text:
package v2

import (
	fmt "fmt"
	core "github.com/cilium/proxy/go/envoy/api/v2/core"
	_ "github.com/gogo/protobuf/gogoproto"
	proto "github.com/golang/protobuf/proto"
	any "github.com/golang/protobuf/ptypes/any"
	status "google.golang.org/genproto/googleapis/rpc/status"
	math "math"
)

// 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

// A DiscoveryRequest requests a set of versioned resources of the same type for
// a given Envoy node on some API.
type DiscoveryRequest struct {
	// The version_info provided in the request messages will be the version_info
	// received with the most recent successfully processed response or empty on
	// the first request. It is expected that no new request is sent after a
	// response is received until the Envoy instance is ready to ACK/NACK the new
	// configuration. ACK/NACK takes place by returning the new API config version
	// as applied or the previous API config version respectively. Each type_url
	// (see below) has an independent version associated with it.
	VersionInfo string `protobuf:"bytes,1,opt,name=version_info,json=versionInfo,proto3" json:"version_info,omitempty"`
	// The node making the request.
	Node *core.Node `protobuf:"bytes,2,opt,name=node,proto3" json:"node,omitempty"`
	// List of resources to subscribe to, e.g. list of cluster names or a route
	// configuration name. If this is empty, all resources for the API are
	// returned. LDS/CDS expect empty resource_names, since this is global
	// discovery for the Envoy instance. The LDS and CDS responses will then imply
	// a number of resources that need to be fetched via EDS/RDS, which will be
	// explicitly enumerated in resource_names.
	ResourceNames []string `protobuf:"bytes,3,rep,name=resource_names,json=resourceNames,proto3" json:"resource_names,omitempty"`
	// Type of the resource that is being requested, e.g.
	// "type.googleapis.com/envoy.api.v2.ClusterLoadAssignment". This is implicit
	// in requests made via singleton xDS APIs such as CDS, LDS, etc. but is
	// required for ADS.
	TypeUrl string `protobuf:"bytes,4,opt,name=type_url,json=typeUrl,proto3" json:"type_url,omitempty"`
	// nonce corresponding to DiscoveryResponse being ACK/NACKed. See above
	// discussion on version_info and the DiscoveryResponse nonce comment. This
	// may be empty if no nonce is available, e.g. at startup or for non-stream
	// xDS implementations.
	ResponseNonce string `protobuf:"bytes,5,opt,name=response_nonce,json=responseNonce,proto3" json:"response_nonce,omitempty"`
	// This is populated when the previous :ref:`DiscoveryResponse <envoy_api_msg_DiscoveryResponse>`
	// failed to update configuration. The *message* field in *error_details* provides the Envoy
	// internal exception related to the failure. It is only intended for consumption during manual
	// debugging, the string provided is not guaranteed to be stable across Envoy versions.
	ErrorDetail          *status.Status `protobuf:"bytes,6,opt,name=error_detail,json=errorDetail,proto3" json:"error_detail,omitempty"`
	XXX_NoUnkeyedLiteral struct{}       `json:"-"`
	XXX_unrecognized     []byte         `json:"-"`
	XXX_sizecache        int32          `json:"-"`
}

func (m *DiscoveryRequest) Reset()         { *m = DiscoveryRequest{} }
func (m *DiscoveryRequest) String() string { return proto.CompactTextString(m) }
func (*DiscoveryRequest) ProtoMessage()    {}
func (*DiscoveryRequest) Descriptor() ([]byte, []int) {
	return fileDescriptor_2c7365e287e5c035, []int{0}
}

func (m *DiscoveryRequest) XXX_Unmarshal(b []byte) error {
	return xxx_messageInfo_DiscoveryRequest.Unmarshal(m, b)
}
func (m *DiscoveryRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
	return xxx_messageInfo_DiscoveryRequest.Marshal(b, m, deterministic)
}
func (m *DiscoveryRequest) XXX_Merge(src proto.Message) {
	xxx_messageInfo_DiscoveryRequest.Merge(m, src)
}
func (m *DiscoveryRequest) XXX_Size() int {
	return xxx_messageInfo_DiscoveryRequest.Size(m)
}
func (m *DiscoveryRequest) XXX_DiscardUnknown() {
	xxx_messageInfo_DiscoveryRequest.DiscardUnknown(m)
}

var xxx_messageInfo_DiscoveryRequest proto.InternalMessageInfo

func (m *DiscoveryRequest) GetVersionInfo() string {
	if m != nil {
		return m.VersionInfo
	}
	return ""
}

func (m *DiscoveryRequest) GetNode() *core.Node {
	if m != nil {
		return m.Node
	}
	return nil
}

func (m *DiscoveryRequest) GetResourceNames() []string {
	if m != nil {
		return m.ResourceNames
	}
	return nil
}

func (m *DiscoveryRequest) GetTypeUrl() string {
	if m != nil {
		return m.TypeUrl
	}
	return ""
}

func (m *DiscoveryRequest) GetResponseNonce() string {
	if m != nil {
		return m.ResponseNonce
	}
	return ""
}

func (m *DiscoveryRequest) GetErrorDetail() *status.Status {
	if m != nil {
		return m.ErrorDetail
	}
	return nil
}

type DiscoveryResponse struct {
	// The version of the response data.
	VersionInfo string `protobuf:"bytes,1,opt,name=version_info,json=versionInfo,proto3" json:"version_info,omitempty"`
	// The response resources. These resources are typed and depend on the API being called.
	Resources []*any.Any `protobuf:"bytes,2,rep,name=resources,proto3" json:"resources,omitempty"`
	// [#not-implemented-hide:]
	// Canary is used to support two Envoy command line flags:
	//
	// * --terminate-on-canary-transition-failure. When set, Envoy is able to
	//   terminate if it detects that configuration is stuck at canary. Consider
	//   this example sequence of updates:
	//   - Management server applies a canary config successfully.
	//   - Management server rolls back to a production config.
	//   - Envoy rejects the new production config.
	//   Since there is no sensible way to continue receiving configuration
	//   updates, Envoy will then terminate and apply production config from a
	//   clean slate.
	// * --dry-run-canary. When set, a canary response will never be applied, only
	//   validated via a dry run.
	Canary bool `protobuf:"varint,3,opt,name=canary,proto3" json:"canary,omitempty"`
	// Type URL for resources. This must be consistent with the type_url in the
	// Any messages for resources if resources is non-empty. This effectively
	// identifies the xDS API when muxing over ADS.
	TypeUrl string `protobuf:"bytes,4,opt,name=type_url,json=typeUrl,proto3" json:"type_url,omitempty"`
	// For gRPC based subscriptions, the nonce provides a way to explicitly ack a
	// specific DiscoveryResponse in a following DiscoveryRequest. Additional
	// messages may have been sent by Envoy to the management server for the
	// previous version on the stream prior to this DiscoveryResponse, that were
	// unprocessed at response send time. The nonce allows the management server
	// to ignore any further DiscoveryRequests for the previous version until a
	// DiscoveryRequest bearing the nonce. The nonce is optional and is not
	// required for non-stream based xDS implementations.
	Nonce                string   `protobuf:"bytes,5,opt,name=nonce,proto3" json:"nonce,omitempty"`
	XXX_NoUnkeyedLiteral struct{} `json:"-"`
	XXX_unrecognized     []byte   `json:"-"`
	XXX_sizecache        int32    `json:"-"`
}

func (m *DiscoveryResponse) Reset()         { *m = DiscoveryResponse{} }
func (m *DiscoveryResponse) String() string { return proto.CompactTextString(m) }
func (*DiscoveryResponse) ProtoMessage()    {}
func (*DiscoveryResponse) Descriptor() ([]byte, []int) {
	return fileDescriptor_2c7365e287e5c035, []int{1}
}

func (m *DiscoveryResponse) XXX_Unmarshal(b []byte) error {
	return xxx_messageInfo_DiscoveryResponse.Unmarshal(m, b)
}
func (m *DiscoveryResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
	return xxx_messageInfo_DiscoveryResponse.Marshal(b, m, deterministic)
}
func (m *DiscoveryResponse) XXX_Merge(src proto.Message) {
	xxx_messageInfo_DiscoveryResponse.Merge(m, src)
}
func (m *DiscoveryResponse) XXX_Size() int {
	return xxx_messageInfo_DiscoveryResponse.Size(m)
}
func (m *DiscoveryResponse) XXX_DiscardUnknown() {
	xxx_messageInfo_DiscoveryResponse.DiscardUnknown(m)
}

var xxx_messageInfo_DiscoveryResponse proto.InternalMessageInfo

func (m *DiscoveryResponse) GetVersionInfo() string {
	if m != nil {
		return m.VersionInfo
	}
	return ""
}

func (m *DiscoveryResponse) GetResources() []*any.Any {
	if m != nil {
		return m.Resources
	}
	return nil
}

func (m *DiscoveryResponse) GetCanary() bool {
	if m != nil {
		return m.Canary
	}
	return false
}

func (m *DiscoveryResponse) GetTypeUrl() string {
	if m != nil {
		return m.TypeUrl
	}
	return ""
}

func (m *DiscoveryResponse) GetNonce() string {
	if m != nil {
		return m.Nonce
	}
	return ""
}

// IncrementalDiscoveryRequest and IncrementalDiscoveryResponse are used in a
// new gRPC endpoint for Incremental xDS. The feature is not supported for REST
// management servers.
//
// With Incremental xDS, the IncrementalDiscoveryResponses do not need to
// include a full snapshot of the tracked resources. Instead
// IncrementalDiscoveryResponses are a diff to the state of a xDS client.
// In Incremental XDS there are per resource versions which allows to track
// state at the resource granularity.
// An xDS Incremental session is always in the context of a gRPC bidirectional
// stream. This allows the xDS server to keep track of the state of xDS clients
// connected to it.
//
// In Incremental xDS the nonce field is required and used to pair
// IncrementalDiscoveryResponse to a IncrementalDiscoveryRequest ACK or NACK.
// Optionaly, a response message level system_version_info is present for
// debugging purposes only.
//
// IncrementalDiscoveryRequest can be sent in 3 situations:
//   1. Initial message in a xDS bidirectional gRPC stream.
//   2. As a ACK or NACK response to a previous IncrementalDiscoveryResponse.
//      In this case the response_nonce is set to the nonce value in the Response.
//      ACK or NACK is determined by the absence or presence of error_detail.
//   3. Spontaneous IncrementalDiscoveryRequest from the client.
//      This can be done to dynamically add or remove elements from the tracked
//      resource_names set. In this case response_nonce must be omitted.
type IncrementalDiscoveryRequest struct {
	// The node making the request.
	Node *core.Node `protobuf:"bytes,1,opt,name=node,proto3" json:"node,omitempty"`
	// Type of the resource that is being requested, e.g.
	// "type.googleapis.com/envoy.api.v2.ClusterLoadAssignment". This is implicit
	// in requests made via singleton xDS APIs such as CDS, LDS, etc. but is
	// required for ADS.
	TypeUrl string `protobuf:"bytes,2,opt,name=type_url,json=typeUrl,proto3" json:"type_url,omitempty"`
	// IncrementalDiscoveryRequests allow the client to add or remove individual
	// resources to the set of tracked resources in the context of a stream.
	// All resource names in the resource_names_subscribe list are added to the
	// set of tracked resources and all resource names in the resource_names_unsubscribe
	// list are removed from the set of tracked resources.
	// Unlike in non incremental xDS, an empty resource_names_subscribe or
	// resource_names_unsubscribe list simply means that no resources are to be
	// added or removed to the resource list.
	// The xDS server must send updates for all tracked resources but can also
	// send updates for resources the client has not subscribed to. This behavior
	// is similar to non incremental xDS.
	// These two fields can be set for all types of IncrementalDiscoveryRequests
	// (initial, ACK/NACK or spontaneous).
	//
	// A list of Resource names to add to the list of tracked resources.
	ResourceNamesSubscribe []string `protobuf:"bytes,3,rep,name=resource_names_subscribe,json=resourceNamesSubscribe,proto3" json:"resource_names_subscribe,omitempty"`
	// A list of Resource names to remove from the list of tracked resources.
	ResourceNamesUnsubscribe []string `protobuf:"bytes,4,rep,name=resource_names_unsubscribe,json=resourceNamesUnsubscribe,proto3" json:"resource_names_unsubscribe,omitempty"`
	// This map must be populated when the IncrementalDiscoveryRequest is the
	// first in a stream. The keys are the resources names of the xDS resources
	// known to the xDS client. The values in the map are the associated resource
	// level version info.
	InitialResourceVersions map[string]string `protobuf:"bytes,5,rep,name=initial_resource_versions,json=initialResourceVersions,proto3" json:"initial_resource_versions,omitempty" protobuf_key:"bytes,1,opt,name=key,proto3" protobuf_val:"bytes,2,opt,name=value,proto3"`
	// When the IncrementalDiscoveryRequest is a ACK or NACK message in response
	// to a previous IncrementalDiscoveryResponse, the response_nonce must be the
	// nonce in the IncrementalDiscoveryResponse.
	// Otherwise response_nonce must be omitted.
	ResponseNonce string `protobuf:"bytes,6,opt,name=response_nonce,json=responseNonce,proto3" json:"response_nonce,omitempty"`
	// This is populated when the previous :ref:`DiscoveryResponse <envoy_api_msg_DiscoveryResponse>`
	// failed to update configuration. The *message* field in *error_details*
	// provides the Envoy internal exception related to the failure.
	ErrorDetail          *status.Status `protobuf:"bytes,7,opt,name=error_detail,json=errorDetail,proto3" json:"error_detail,omitempty"`
	XXX_NoUnkeyedLiteral struct{}       `json:"-"`
	XXX_unrecognized     []byte         `json:"-"`
	XXX_sizecache        int32          `json:"-"`
}

func (m *IncrementalDiscoveryRequest) Reset()         { *m = IncrementalDiscoveryRequest{} }
func (m *IncrementalDiscoveryRequest) String() string { return proto.CompactTextString(m) }
func (*IncrementalDiscoveryRequest) ProtoMessage()    {}
func (*IncrementalDiscoveryRequest) Descriptor() ([]byte, []int) {
	return fileDescriptor_2c7365e287e5c035, []int{2}
}

func (m *IncrementalDiscoveryRequest) XXX_Unmarshal(b []byte) error {
	return xxx_messageInfo_IncrementalDiscoveryRequest.Unmarshal(m, b)
}
func (m *IncrementalDiscoveryRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
	return xxx_messageInfo_IncrementalDiscoveryRequest.Marshal(b, m, deterministic)
}
func (m *IncrementalDiscoveryRequest) XXX_Merge(src proto.Message) {
	xxx_messageInfo_IncrementalDiscoveryRequest.Merge(m, src)
}
func (m *IncrementalDiscoveryRequest) XXX_Size() int {
	return xxx_messageInfo_IncrementalDiscoveryRequest.Size(m)
}
func (m *IncrementalDiscoveryRequest) XXX_DiscardUnknown() {
	xxx_messageInfo_IncrementalDiscoveryRequest.DiscardUnknown(m)
}

var xxx_messageInfo_IncrementalDiscoveryRequest proto.InternalMessageInfo

func (m *IncrementalDiscoveryRequest) GetNode() *core.Node {
	if m != nil {
		return m.Node
	}
	return nil
}

func (m *IncrementalDiscoveryRequest) GetTypeUrl() string {
	if m != nil {
		return m.TypeUrl
	}
	return ""
}

func (m *IncrementalDiscoveryRequest) GetResourceNamesSubscribe() []string {
	if m != nil {
		return m.ResourceNamesSubscribe
	}
	return nil
}

func (m *IncrementalDiscoveryRequest) GetResourceNamesUnsubscribe() []string {
	if m != nil {
		return m.ResourceNamesUnsubscribe
	}
	return nil
}

func (m *IncrementalDiscoveryRequest) GetInitialResourceVersions() map[string]string {
	if m != nil {
		return m.InitialResourceVersions
	}
	return nil
}

func (m *IncrementalDiscoveryRequest) GetResponseNonce() string {
	if m != nil {
		return m.ResponseNonce
	}
	return ""
}

func (m *IncrementalDiscoveryRequest) GetErrorDetail() *status.Status {
	if m != nil {
		return m.ErrorDetail
	}
	return nil
}

type IncrementalDiscoveryResponse struct {
	// The version of the response data (used for debugging).
	SystemVersionInfo string `protobuf:"bytes,1,opt,name=system_version_info,json=systemVersionInfo,proto3" json:"system_version_info,omitempty"`
	// The response resources. These are typed resources that match the type url
	// in the IncrementalDiscoveryRequest.
	Resources []*Resource `protobuf:"bytes,2,rep,name=resources,proto3" json:"resources,omitempty"`
	// Resources names of resources that have be deleted and to be removed from the xDS Client.
	// Removed resources for missing resources can be ignored.
	RemovedResources []string `protobuf:"bytes,6,rep,name=removed_resources,json=removedResources,proto3" json:"removed_resources,omitempty"`
	// The nonce provides a way for IncrementalDiscoveryRequests to uniquely
	// reference a IncrementalDiscoveryResponse. The nonce is required.
	Nonce                string   `protobuf:"bytes,5,opt,name=nonce,proto3" json:"nonce,omitempty"`
	XXX_NoUnkeyedLiteral struct{} `json:"-"`
	XXX_unrecognized     []byte   `json:"-"`
	XXX_sizecache        int32    `json:"-"`
}

func (m *IncrementalDiscoveryResponse) Reset()         { *m = IncrementalDiscoveryResponse{} }
func (m *IncrementalDiscoveryResponse) String() string { return proto.CompactTextString(m) }
func (*IncrementalDiscoveryResponse) ProtoMessage()    {}
func (*IncrementalDiscoveryResponse) Descriptor() ([]byte, []int) {
	return fileDescriptor_2c7365e287e5c035, []int{3}
}

func (m *IncrementalDiscoveryResponse) XXX_Unmarshal(b []byte) error {
	return xxx_messageInfo_IncrementalDiscoveryResponse.Unmarshal(m, b)
}
func (m *IncrementalDiscoveryResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
	return xxx_messageInfo_IncrementalDiscoveryResponse.Marshal(b, m, deterministic)
}
func (m *IncrementalDiscoveryResponse) XXX_Merge(src proto.Message) {
	xxx_messageInfo_IncrementalDiscoveryResponse.Merge(m, src)
}
func (m *IncrementalDiscoveryResponse) XXX_Size() int {
	return xxx_messageInfo_IncrementalDiscoveryResponse.Size(m)
}
func (m *IncrementalDiscoveryResponse) XXX_DiscardUnknown() {
	xxx_messageInfo_IncrementalDiscoveryResponse.DiscardUnknown(m)
}

var xxx_messageInfo_IncrementalDiscoveryResponse proto.InternalMessageInfo

func (m *IncrementalDiscoveryResponse) GetSystemVersionInfo() string {
	if m != nil {
		return m.SystemVersionInfo
	}
	return ""
}

func (m *IncrementalDiscoveryResponse) GetResources() []*Resource {
	if m != nil {
		return m.Resources
	}
	return nil
}

func (m *IncrementalDiscoveryResponse) GetRemovedResources() []string {
	if m != nil {
		return m.RemovedResources
	}
	return nil
}

func (m *IncrementalDiscoveryResponse) GetNonce() string {
	if m != nil {
		return m.Nonce
	}
	return ""
}

type Resource struct {
	// The resource level version. It allows xDS to track the state of individual
	// resources.
	Version string `protobuf:"bytes,1,opt,name=version,proto3" json:"version,omitempty"`
	// The resource being tracked.
	Resource             *any.Any `protobuf:"bytes,2,opt,name=resource,proto3" json:"resource,omitempty"`
	XXX_NoUnkeyedLiteral struct{} `json:"-"`
	XXX_unrecognized     []byte   `json:"-"`
	XXX_sizecache        int32    `json:"-"`
}

func (m *Resource) Reset()         { *m = Resource{} }
func (m *Resource) String() string { return proto.CompactTextString(m) }
func (*Resource) ProtoMessage()    {}
func (*Resource) Descriptor() ([]byte, []int) {
	return fileDescriptor_2c7365e287e5c035, []int{4}
}

func (m *Resource) XXX_Unmarshal(b []byte) error {
	return xxx_messageInfo_Resource.Unmarshal(m, b)
}
func (m *Resource) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
	return xxx_messageInfo_Resource.Marshal(b, m, deterministic)
}
func (m *Resource) XXX_Merge(src proto.Message) {
	xxx_messageInfo_Resource.Merge(m, src)
}
func (m *Resource) XXX_Size() int {
	return xxx_messageInfo_Resource.Size(m)
}
func (m *Resource) XXX_DiscardUnknown() {
	xxx_messageInfo_Resource.DiscardUnknown(m)
}

var xxx_messageInfo_Resource proto.InternalMessageInfo

func (m *Resource) GetVersion() string {
	if m != nil {
		return m.Version
	}
	return ""
}

func (m *Resource) GetResource() *any.Any {
	if m != nil {
		return m.Resource
	}
	return nil
}

func init() {
	proto.RegisterType((*DiscoveryRequest)(nil), "envoy.api.v2.DiscoveryRequest")
	proto.RegisterType((*DiscoveryResponse)(nil), "envoy.api.v2.DiscoveryResponse")
	proto.RegisterType((*IncrementalDiscoveryRequest)(nil), "envoy.api.v2.IncrementalDiscoveryRequest")
	proto.RegisterMapType((map[string]string)(nil), "envoy.api.v2.IncrementalDiscoveryRequest.InitialResourceVersionsEntry")
	proto.RegisterType((*IncrementalDiscoveryResponse)(nil), "envoy.api.v2.IncrementalDiscoveryResponse")
	proto.RegisterType((*Resource)(nil), "envoy.api.v2.Resource")
}

func init() { proto.RegisterFile("envoy/api/v2/discovery.proto", fileDescriptor_2c7365e287e5c035) }

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


text: {exp:google_sitemap_lite:generate type="taxonomy" nav_id="1"}

redpajama_set_name: RedPajamaGithub


text:
#include <aws/lightsail/model/LoadBalancerTlsCertificateRenewalSummary.h>
#include <aws/core/utils/json/JsonSerializer.h>

#include <utility>

using namespace Aws::Utils::Json;
using namespace Aws::Utils;

namespace Aws
{
namespace Lightsail
{
namespace Model
{

LoadBalancerTlsCertificateRenewalSummary::LoadBalancerTlsCertificateRenewalSummary() :
    m_renewalStatus(LoadBalancerTlsCertificateRenewalStatus::NOT_SET),
    m_renewalStatusHasBeenSet(false),
    m_domainValidationOptionsHasBeenSet(false)
{
}

LoadBalancerTlsCertificateRenewalSummary::LoadBalancerTlsCertificateRenewalSummary(JsonView jsonValue) :
    m_renewalStatus(LoadBalancerTlsCertificateRenewalStatus::NOT_SET),
    m_renewalStatusHasBeenSet(false),
    m_domainValidationOptionsHasBeenSet(false)
{
  *this = jsonValue;
}

LoadBalancerTlsCertificateRenewalSummary& LoadBalancerTlsCertificateRenewalSummary::operator =(JsonView jsonValue)
{
  if(jsonValue.ValueExists("renewalStatus"))
  {
    m_renewalStatus = LoadBalancerTlsCertificateRenewalStatusMapper::GetLoadBalancerTlsCertificateRenewalStatusForName(jsonValue.GetString("renewalStatus"));

    m_renewalStatusHasBeenSet = true;
  }

  if(jsonValue.ValueExists("domainValidationOptions"))
  {
    Array<JsonView> domainValidationOptionsJsonList = jsonValue.GetArray("domainValidationOptions");
    for(unsigned domainValidationOptionsIndex = 0; domainValidationOptionsIndex < domainValidationOptionsJsonList.GetLength(); ++domainValidationOptionsIndex)
    {
      m_domainValidationOptions.push_back(domainValidationOptionsJsonList[domainValidationOptionsIndex].AsObject());
    }
    m_domainValidationOptionsHasBeenSet = true;
  }

  return *this;
}

JsonValue LoadBalancerTlsCertificateRenewalSummary::Jsonize() const
{
  JsonValue payload;

  if(m_renewalStatusHasBeenSet)
  {
   payload.WithString("renewalStatus", LoadBalancerTlsCertificateRenewalStatusMapper::GetNameForLoadBalancerTlsCertificateRenewalStatus(m_renewalStatus));
  }

  if(m_domainValidationOptionsHasBeenSet)
  {
   Array<JsonValue> domainValidationOptionsJsonList(m_domainValidationOptions.size());
   for(unsigned domainValidationOptionsIndex = 0; domainValidationOptionsIndex < domainValidationOptionsJsonList.GetLength(); ++domainValidationOptionsIndex)
   {
     domainValidationOptionsJsonList[domainValidationOptionsIndex].AsObject(m_domainValidationOptions[domainValidationOptionsIndex].Jsonize());
   }
   payload.WithArray("domainValidationOptions", std::move(domainValidationOptionsJsonList));

  }

  return payload;
}

} // namespace Model
} // namespace Lightsail
} // namespace Aws


text:
<?php
/**
 * @file
 * Template for Panopoly Sanderson.
 *
 * Variables:
 * - $css_id: An optional CSS id to use for the layout.
 * - $content: An array of content, each item in the array is keyed to one
 * panel of the layout. This layout supports the following sections:
 */
?>

<div class="panel-display sanderson-flipped clearfix <?php !empty($class) ? print $class : ''; ?>" <?php !empty($css_id) ? print "id=\"$css_id\"" : ''; ?>>

        <div class="col-md-<?php print kalatheme_grid_size(KALATHEME_GRID_THIRD, 3); ?> sanderson-flipped-column-content-region-1">
          <?php print $content['column1']; ?>

        <div class="col-md-<?php print kalatheme_grid_size(KALATHEME_GRID_THIRD, 3); ?> sanderson-flipped-column-content-region-2">
          <?php print $content['column2']; ?>

        <div class="col-md-<?php print kalatheme_grid_size(KALATHEME_GRID_THIRD, 3); ?> sanderson-flipped-column-content-region-3">
          <?php print $content['column3']; ?>

        <div class="col-md-<?php print kalatheme_grid_size(KALATHEME_GRID_HALF); ?> sanderson-flipped-secondary-column-content-region-1">
          <?php print $content['secondarycolumn1']; ?>

        <div class="col-md-<?php print kalatheme_grid_size(KALATHEME_GRID_HALF); ?> sanderson-flipped-secondary-column-content-region-2">
          <?php print $content['secondarycolumn2']; ?>


text:
package com.uber.sdk.rides.client.model;

import javax.annotation.Nullable;

/**
 * A user's Payment Method. See
 * Payment Methods
 * for more information.
 */
public class PaymentMethod {

    private String payment_method_id;
    private String type;
    @Nullable
    private String description;

    /**
     * Gets the unique identifier of a Payment Method
     */
    public String getPaymentMethodId() {
        return payment_method_id;
    }

    /**
     * Gets the type of Payment Method. See
     * Payment Method Details
     * for more information.
     */
    public String getType() {
        return type;
    }

    /**
     * Gets the description of a Payment Method.
     */
    @Nullable
    public String getDescription() {
        return description;
    }
}


text:
<?php
namespace Pinguin;

/**
 * Class ConfigFinder
 * @package Pinguin
 * @author Raphaël Lefebvre <raphael@raphaellefebvre.be>
 */
class ConfigFinder
{
    /**
     * Name of the config file.
     */
    const FILE_NAME = 'cli-config.php';

    /**
     * Indicates location of possibles config directories.
     *
     * @return string[]
     */
    public static function getDirs()
    {
        return array(
            '.',
            '.' . DIRECTORY_SEPARATOR . 'config'
        );
    }

    /**
     * Finds a config file among possible directories.
     *
     * @param string $baseDir
     * @return string
     */
    public function find($baseDir)
    {
        foreach ($this->resolveDirPaths($baseDir) as $directory) {
            $configFile = $this->getFilePath($directory);
            if (is_readable($configFile)) {
                return $configFile;
            }
        }
        return '';
    }

    /**
     * Resolves directories config according to $baseDir.
     *
     * @param string $baseDir
     * @return string[]
     */
    public function resolveDirPaths($baseDir)
    {
        $result = array();
        foreach ($this->getDirs() as $dir) {
            $result[] = realpath($baseDir . DIRECTORY_SEPARATOR . $dir);
        }
        return array_filter($result);
    }

    /**
     * Concats $directory and file name.
     *
     * @param string $directory
     * @return string
     */
    private function getFilePath($directory)
    {
        return $directory . DIRECTORY_SEPARATOR . self::FILE_NAME;
    }
}


text:
import os
import numpy as np
import pandas as pd
import matplotlib.pyplot as plt

import time

import tensorflow as tf
from keras.models import Model
from keras.layers import Dense, Input
from keras.callbacks import ModelCheckpoint

from resBlock import res_block
from pre import read_csv_data
from writeANNProperties import writeANNProperties

# %%
x_train, y_train, df, in_scaler, out_scaler = read_csv_data('data')

######################
print('set up ANN')
# ANN parameters
dim_input = 2
dim_label = y_train.shape[1]
n_neuron = 600
batch_size = 1024
epochs = 600
vsplit = 0.1
batch_norm = False

# This returns a tensor
inputs = Input(shape=(dim_input,))

# a layer instance is callable on a tensor, and returns a tensor
x = Dense(n_neuron, activation='relu')(inputs)

# less then 2 res_block, there will be variance
x = res_block(x, n_neuron, stage=1, block='a', bn=batch_norm)
x = res_block(x, n_neuron, stage=1, block='b', bn=batch_norm)
x = res_block(x, n_neuron, stage=1, block='c', bn=batch_norm)
x = res_block(x, n_neuron, stage=1, block='d', bn=batch_norm)
x = res_block(x, n_neuron, stage=1, block='e', bn=batch_norm)

predictions = Dense(dim_label, activation='linear')(x)

model = Model(inputs=inputs, outputs=predictions)
model.compile(loss='mse', optimizer='adam', metrics=['accuracy'])

# checkpoint (save the best model based validate loss)
filepath = "./tmp/weights.best.cntk.hdf5"
checkpoint = ModelCheckpoint(filepath,
                             monitor='val_loss',
                             verbose=1,
                             save_best_only=True,
                             mode='min',
                             period=10)
callbacks_list = [checkpoint]

# fit the model
history = model.fit(
    x_train, y_train,
    epochs=epochs,
    batch_size=batch_size,
    validation_split=vsplit,
    verbose=2,
    callbacks=callbacks_list,
    shuffle=True)

# loss
fig = plt.figure()
plt.semilogy(history.history['loss'])
if vsplit:
    plt.semilogy(history.history['val_loss'])
plt.title('mse')
plt.ylabel('loss')
plt.xlabel('epoch')
plt.legend(['train', 'test'], loc='upper right')
plt.show()

#########################################
model.load_weights("./tmp/weights.best.cntk.hdf5")
# cntk.combine(model.outputs).save('mayerTest.dnn')

# %%
ref = df.loc[df['p'] == 40]
x_test = in_scaler.transform(ref[['p', 'he']])
st = time.time()
predict_val = model.predict(x_test.astype(float), batch_size=1024)
time_gpu_infer = time.time() - st
print('Gpu inference time is ', time_gpu_infer)
# %%
# predict = out_scaler.

sp='Cp'
predict = pd.DataFrame(out_scaler.inverse_transform(predict_val), columns=['rho','T','thermo:mu','Cp','thermo:psi','thermo:alpha','thermo:as'])

plt.figure()
plt.plot(ref['T'], ref[sp], 'r:')
plt.plot(ref['T'], predict[sp], 'b-')
plt.show()
plt.figure()
plt.title('Error of %s ' % sp)
plt.plot((ref[sp] - predict[sp]) / ref[sp])
plt.show()

# %%
from keras import backend as K

sess = K.get_session()
saver = tf.train.Saver(tf.global_variables())
saver.save(sess, './exported/my_model')
tf.train.write_graph(sess.graph, '.', "./exported/graph.pb", as_text=False)
np.savetxt('x_test.csv', x_test)
np.savetxt('pred.csv', predict_val)
model.save('mayer.H5')

# write the OpenFOAM ANNProperties file
writeANNProperties(in_scaler,out_scaler)


text:
angular.module('foo').directive('sample', function factory() {

    return {
        restrict: 'A'
    };
});


text:
package com.github.besherman.lifx.examples.lights;

import com.github.besherman.lifx.LFXClient;
import com.github.besherman.lifx.LFXLight;
import com.github.besherman.lifx.LFXLightDetails;
import com.github.besherman.lifx.LFXVersion;

/**
 * Prints detailed information about all lights.
 */
public class LightEx08PrintDetails {
    public static void main(String[] args) throws Exception {
        LFXClient client = new LFXClient();
        client.open(true);
        try {
            for(LFXLight light: client.getLights()) {
                printDetails(light);
            }
        } finally {
            client.close();
        }
    }

    private static void printDetails(LFXLight light) {
        LFXLightDetails details = light.getDetails();

        System.out.format("light '%s' (%s) %n", light.getLabel(), light.getID());
        System.out.format("\ttemperatur=%s C %n", details.getTemperature());
        System.out.format("\tuptime=%s ms %n", details.getUptime());
        System.out.format("\tdowntime=%s ms %n", details.getDowntime());
        System.out.format("\tMCU Rail Voltage=%s V %n", details.getMCURailVoltage());
        System.out.format("\treset switch position=%s %n", details.getResetSwitchPosition());

        System.out.println("\tMesh:");
        System.out.format("\t\tmcu temp=%s %n", details.getMeshStat().getMcuTemperature());
        System.out.format("\t\trx=%s %n", details.getMeshStat().getRx());
        System.out.format("\t\ttx=%s %n", details.getMeshStat().getTx());
        System.out.format("\t\tsignal=%s %n", details.getMeshStat().getSignal());

        System.out.println("\tWifi:");
        System.out.format("\t\tmcu temp=%s %n", details.getWifiStat().getMcuTemperature());
        System.out.format("\t\trx=%s %n", details.getWifiStat().getRx());
        System.out.format("\t\ttx=%s %n", details.getWifiStat().getTx());
        System.out.format("\t\tsignal=%s %n", details.getWifiStat().getSignal());

        // TODO: add firmware and mesh version

        for(LFXVersion version: details.getVersions()) {
            System.out.println("\tVersion:");
            System.out.format("\t\tproduct=%s %n", version.getProduct());
            System.out.format("\t\tvendor=%s %n", version.getVendor());
            System.out.format("\t\tversion=%s %n", version.getVersion());
        }
        System.out.println("");

        details.load();
    }
}


text:
<!DOCTYPE html>

    <meta charset="utf-8">
    <meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
    <meta name="description" content="">
    <meta name="author" content="">

    <title>Siddhu portfolio</title>

    <link href="vendor/bootstrap/css/bootstrap.min.css" rel="stylesheet">

    <link href="vendor/font-awesome/css/font-awesome.min.css" rel="stylesheet" type="text/css">
    <link href="https://fonts.googleapis.com/css?family=Montserrat:400,700" rel="stylesheet" type="text/css">
    <link href='https://fonts.googleapis.com/css?family=Kaushan+Script' rel='stylesheet' type='text/css'>
    <link href='https://fonts.googleapis.com/css?family=Droid+Serif:400,700,400italic,700italic' rel='stylesheet' type='text/css'>
    <link href='https://fonts.googleapis.com/css?family=Roboto+Slab:400,100,300,700' rel='stylesheet' type='text/css'>

    <link href="css/agency.min.css" rel="stylesheet">

        Siddhu
        <button class="navbar-toggler navbar-toggler-right" type="button" data-toggle="collapse" data-target="#navbarResponsive" aria-controls="navbarResponsive" aria-expanded="false" aria-label="Toggle navigation">

        </button>

              Portfolio

              About

              resume

              Contact

Welcome To My Studio!

It's Nice To Meet You

          Tell Me More

Portfolio

Color Game

Game

TODO APP

File

Patatap App

Sound

Yelp Camp

Web Application

Perfect Match

Web Design

Image Gallery

Photography

About

Web Designer|Software Engineer

My Humble Beginnings

Hello, My name is Sidhartha,
                      Thank you for browing my portfolio.
                      This Website contain information about my Education, Experience and Projects

Work Experience

Raas Infotech (Nov-present 2017)

<h7>Java Developer:</h7>
Designed UI pages using JSP, HTML, AngularJS,JavaScript,CSS.Involved in implementing logging, exception handling and transaction management using Spring AOP.

Education

University of southern Arkansas

(2015-2017)

M.S in Computer and Information Science

                                          GPA:3.4

Projects

(2015-2017)

YelpCamp: Web application

                                          SAU Postal Service: Desktop Application

                                          Various Personal projects Website and mock website design

Be Part

Of My

Story!

Contact Me

            <form id="contactForm" name="sentMessage" novalidate>

                    <input class="form-control" id="name" type="text" placeholder="Your Name *" required data-validation-required-message="Please enter your name.">

                    <input class="form-control" id="email" type="email" placeholder="Your Email *" required data-validation-required-message="Please enter your email address.">

                    <input class="form-control" id="phone" type="tel" placeholder="Your Phone *" required data-validation-required-message="Please enter your phone number.">

                    <textarea class="form-control" id="message" placeholder="Your Message *" required data-validation-required-message="Please enter a message."></textarea>

                  <button id="sendMessageButton" class="btn btn-xl" type="submit">Send Message</button>

            </form>

             Email:siddhulal01@gmail.com

Phone:214-235-8384

                Privacy Policy

                Terms of Use

Color Game

 Color Guess App

It is a fun app, which will generate random RGB value and you are asked to
                     select the right color.It has three button: New Color,
                     Easy,Hard.New Color will generate a another color,Easy will give you three options where are Hard you will get six options to select.This app is developed using HTML5,styling is done using CSS3,Bootstrap and effects are done using jQuery

Date: September 2017

Category: APP

                  project Link

TODO APP

Wonderful App for storing your Todo's

It is a static web Page developed which helps you to store all your Todo's.It gives you two options,First one is to write your Todo's and Secound is to delete your Todo's.This project is desigined using HTML5, styling is done using CSS3 and BootStrap,effects are added using JavaScript

Date: August 2017

Client: Everyone

Category: Web Design

               <button class="btn btn-primary" data-dismiss="modal" type="button">

                    Close Project</button>

Patatap App

Amazing app which will generate different color and sound on every key press

It is a Web App which will generate random color and different sound on every keypress,It has some wonderful sounds which make you relax.This project was designed by using HTMl5,CSS,hoular.js

Date: Sepetember 2017

Client: Everyone

Category: Music

                  project Link

Yelp Camp

It is a Web Application where you can book a Campground for your trip

It is a Responsive Web Application which will help you to reserve a Campground for your trip.Front-End is done using HTML5,CSS3,Bootstrap,Express.js is used on Backend.Cloud9 is used as a IDE and deployed on heroku sever

Date: Joct 2017

Client: Everyone

Category: Web Application

                  <button class="btn btn-primary" data-dismiss="modal" type="button">

                    Close Project</button>

Perfect Match

Responsive Web Page for cat lover

It is a Beautiful Responsive Web page which helps you to find feline pet store near by.This page is responsive,which resizes according to the device. This wonderful page is desgined using Bootstrap,HTML,CSS

Date: Aug 2017

Client: siddhu

Category: Web Design

                  project Link

Image Gallery

Responsive Web page where you can store your photos and show case them.

This is a Responsive web Page which show case all your photos.This is web page developed using Bootstrap,HTML5,CSS3.Icons are extracted from fontawsome.io.

Date: September 2017

Client: Everyone

Category: Photography

                  project Link


text:
package com.milian.im.service;

import java.util.List;

import com.milian.im.entry.MessageML;

import java.util.ArrayList;
import java.util.List;
import java.util.concurrent.locks.Lock;
import java.util.concurrent.locks.ReentrantLock;
import android.util.Log;
public class MessageMLQueue {

	private String contactJid;     //key, cleanJid ( pure Jid)
	private MessageML lastMsg = null;
	private List <MessageML> msgList  =  new ArrayList<MessageML>(); //all msg
	Lock msgListLock =  new ReentrantLock();
	private List <MessageML> addedMsgList  =  new ArrayList<MessageML>(); // new msg
	Lock addedMsgListLock =  new ReentrantLock();

	public MessageMLQueue(String contactJid){
		this.contactJid = contactJid;
	}
    public	List<MessageML> getAllMessageML()
	{
    	List<MessageML>  list = new ArrayList<MessageML >();
    	msgListLock.lock();
    	list.addAll(msgList);
    	msgListLock.unlock();
		return list;
	}

    public	int getAllMessageMLSize()
    {
    	int size = 0;

    	msgListLock.lock();
    	size = msgList.size();
    	msgListLock.unlock();
    	return size;
    }
    public	MessageML getLastMessageML()
	{
		return lastMsg;
	}
public	List<MessageML> getAddedMessageML()
	{
		List<MessageML>  list = new ArrayList<MessageML >();
		addedMsgListLock.lock();
		list.addAll(addedMsgList);
		addedMsgList.clear();
		addedMsgListLock.unlock();
		return list;
	}

public	int getAddedMessageMLSize()
{
	int size = 0;

	addedMsgListLock.lock();
	size = addedMsgList.size();
	addedMsgListLock.unlock();
	return size;

}

public	boolean addMessage(MessageML msg)
{
    Log.d("milian", "add Message  for Contact: " + this.contactJid);
	msgListLock.lock();
	msgList.add(msg);
	msgListLock.unlock();
	if ( msg.getMsgDir() == MessageML.MSG_DIR_RECV) {
		addedMsgListLock.lock();
		addedMsgList.add(msg);
		addedMsgListLock.unlock();
	}
	lastMsg = msg;
	return true;

}

public	boolean loadMessageFromDb()
{
	 	return true;
}

public	boolean saveMessageToDb()
{
	 	return true;
}

public void release () {
	msgListLock.lock();
	msgList.clear();;
	msgListLock.unlock();

	addedMsgListLock.lock();
	addedMsgList.clear();
	addedMsgListLock.unlock();

}

}


text:
from django.test import TestCase
from decimal import Decimal as D

from oscar.apps.partner import strategy
from oscar.apps.catalogue import models
from oscar.test import factories

class TestDefaultStrategy(TestCase):

    def setUp(self):
        self.strategy = strategy.Default()

    def test_no_stockrecords(self):
        product = factories.create_product()
        info = self.strategy.fetch(product)
        self.assertFalse(info.availability.is_available_to_buy)
        self.assertIsNone(info.price.incl_tax)

    def test_one_stockrecord(self):
        product = factories.create_product(price=D('1.99'), num_in_stock=4)
        info = self.strategy.fetch(product)
        self.assertTrue(info.availability.is_available_to_buy)
        self.assertEquals(D('1.99'), info.price.excl_tax)
        self.assertEquals(D('1.99'), info.price.incl_tax)

    def test_product_which_doesnt_track_stock(self):
        product_class = models.ProductClass.objects.create(
            name="Digital", track_stock=False)
        product = factories.create_product(
            product_class=product_class,
            price=D('1.99'), num_in_stock=None)
        info = self.strategy.fetch(product)
        self.assertTrue(info.availability.is_available_to_buy)


text:
module EventMachine
  module Stretcher
    VERSION = "0.0.2"
  end
end


text:
include_recipe 'healthcheck::common'
include_recipe 'healthcheck::user'
include_recipe 'healthcheck::docker'


text:
package com.nimpres.android;

import java.util.ArrayList;

import android.content.Context;
import android.os.Handler;

import com.nimpres.android.dps.DPS;
import com.nimpres.android.presentation.PeerStatus;
import com.nimpres.android.presentation.Presentation;

public class NimpresObjects {
	public static DPS currentDPS;
	public static Presentation currentPresentation;
	public static String hostedPresentationFileName = "";
	public static Context ctx;
	public static Handler messagingThread = new Handler();

	public static String loadType = "";
	public static boolean finishedLoading = false;

	public static String presentationTitle = "";
	public static int presentationID = 0;
	public static String presentationPassword = "";

	public static boolean hostOnInternet = false;

	public static boolean currentlyViewing = false;
	public static boolean currentlyPresenting = false;

	public static String presenterName = "test"; // TODO this should be loaded from local config
	public static String presenterPassword = "test1234"; // TODO this should be loaded from local config

	public static String updateSource = ""; // This will be either UPDATE_SOURCE_LAN or UPDATE_SOURCE_INTERNET
	public static ArrayList<PeerStatus> peerPresentations = new ArrayList<PeerStatus>(); // LAN peers
	public static ArrayList<PeerStatus> internetPresentations = new ArrayList<PeerStatus>(); // Internet peers

}


text:
<?xml version="1.0" encoding="utf-8"?>

<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:app="http://schemas.android.com/apk/res-auto"
    android:layout_width="fill_parent"
    android:layout_height="fill_parent"
    android:orientation="vertical"
    android:background="#ffffffff">

    <LinearLayout
        android:orientation="horizontal"
        android:layout_width="match_parent"
        android:layout_height="65dp"
        android:layout_gravity="center_horizontal"
        android:weightSum="1"
        android:background="#ddd"
        android:id="@+id/linearLayout">

        <EditText
            android:layout_width="wrap_content"
            android:layout_height="54dp"
            android:id="@+id/searchField"
            android:layout_weight="0.98"
            android:autoText="false"
            android:textColor="#ff303030"
            android:background="#ddd"
            android:theme="@style/AlertDialog.AppCompat.Light"
            android:enabled="true"
            android:inputType="text"
            android:paddingLeft="20dp"
            android:layout_gravity="center"
            android:hint="Find repositories..."
            android:textColorHint="#555"
            android:imeOptions="actionDone" />

        <ImageButton
            android:src="@drawable/search_logo"
            android:layout_width="60dp"
            android:layout_height="60dp"
            android:scaleType="fitCenter"
            android:text="Go"
            android:onClick="searchAndDisplay"
            android:id="@+id/searchButton"
            android:padding="12dp"
            android:layout_margin="0dp"
            android:textStyle="bold"
            android:textColor="#fff"
            android:background = "@drawable/roundedbutton"
            android:layout_gravity="center"
            android:contentDescription="SearchButton" />

    </LinearLayout>

    <ListView
        android:id="@+id/mainListView"
        android:layout_width="fill_parent"
        android:layout_height="453dp"
        android:choiceMode="none"
        android:layout_alignParentBottom="true"
        android:layout_below="@+id/linearLayout" />

    <Button
        android:layout_width="wrap_content"
        android:layout_height="50dp"
        android:text="Show commits"
        android:id="@+id/showButton"
        android:layout_alignParentBottom="true"
        android:layout_alignParentEnd="true"
        android:layout_marginEnd="15dp"
        android:layout_marginBottom="15dp"
        android:background = "@drawable/roundedbutton"
        android:padding="5dp"
        android:textColor="#FFF"
        android:textStyle="bold"
        android:onClick="startCommitActivity"
        android:visibility="gone" />

</RelativeLayout>


text:
<title>10: Bounce and Bounce2</title>

Fig10A: Particles bounce around inside a boxed area using Bounce@particle_ri_ver3. "Show domain" is checked to help visualize the boxed area.

Fig10B: Particles bouncing off a plate (on layer 2) using Bounce2@particle_ri_ver3.The particle object has been excluded from Camera control. Particle tail given by Trajectory@ to help illustrate the incident and emergence path.

Fig10C: Similar to Fig10B except that the particle object is under Camera control with Shadow effect.

Bounce

Make particles to bounce upon hitting some predefined surface. Does not support changing the reflection surface over time.

Sliders

xType

Set the properties of vertical reflection surfaces locate at x=v1 and x=v2 (where v1 &lt v2)

yType

Set the properties of horizontal reflection surfaces locate at y=v1 and y=v2 (where v1 &lt v2)

zType

Set the properties of vertical reflection surfaces locate at z=v1 and z=v2 (where v1 &lt v2)

For xType, yType and zType:

1: reflection surfaces at v1 and v2 are both enabled

2: Only reflection surface at v1 is enabled

3: Only reflection surface at v2 is enabled

4: disable reflection surface at both v1 and v2

SphereType

Set the properties of spherical reflection surfaces

1: reflection surface is a complete sphere

2: reflection surface is a hemisphere

3: disable reflection surface

Check box

Show domain

Visualize reflection surface(s)

Setting dialog

xRange

Reflection planes at x=v1,v2 (v1 &lt v2)

Input format: {v1,v2}

If only a single value is given, plane at v1 if v &lt 0, at v2 otherwise.

yRange

Reflection planes at y=v1,v2 (v1 &lt v2)

Input format: {v1,v2}

If only a single value is given, plane at v1 if v &lt 0, at v2 otherwise.

zRange

Reflection planes at z=v1,v2 (v1 &lt v2)

Input format: {v1,v2}

If only a single value is given, plane at v1 if v &lt 0, at v2 otherwise.

xyzCoeff

Speed coefficient determining the speed of particle after reflection.

1: no speed change; 2: speed is doubled after reflection; 0.5: speed is halved after reflection

Input format: {Coefficient_for_X,Coefficient_for_Y,Coefficient_for_Z}

SpherePos

Numerical center coordinate for spherical and hemisphere reflection plane.

This can be set visually via anchor points instead.

SphereRot

Rotation angle of hemisphere

Input format: {rotation_along_y,rotation_along_z}

Giving a single number is the same as {0,rotation_along_z}

Radius

Size of reflection sphere and hemisphere

SphereCoeff

Speed coefficient for bouncing off a sphere or hemisphere

Irregularity

Add randomness to reflection direction and speed coefficients

Probability

When Irregularity is enabled, the chance that a particle will have such irregularity.

ReflectInside

When checked, each reflection plane will have infinite area.

When unchecked, only the reflection plane as seen by "Show domain". In other words, a reflection plane is trimmed when intersect with other reflection plane.

No effect on spherical and hemisphere reflection surface.

TypeSwitchTime

Changing interval for each Type.

Value in milliseconds.

No effect if zero.

RelativeTime

Set definition of time-zero for TypeSwitchTime. If checked, time based on each particle.

Re-Type

The final Type after TypeSwitchTime has lapsed.

Input format: {type for z,type for y,type for z,sphere type}

See sliders description for details in the types.

For emission 5

When using with Emission@ and set to type 5, treat the boxed area as reflection surface.

Filter1Link0~2

Set changes to Filter@ (VarVal1) or Filter(For_monochrome)@ matching the time of reflection.

For example, if Filter@ (Blur) → Filter@ (Color shift) → Filter(For_monochrome) is attached, and I want to change the Color shift behaviour upon reflection, input {0、1、0、0、0、0、0、0、0、0}

Valid values are 0,1 and 2

0: Do not change on reflection

1: Starts changing upon first reflection. No change if no reflection occurs

2: Transition finish upon first reflection

Bounce2

Make particles bounce off from surface(s) defined in other layers.
Temporal changes in size and transparency of the reflection surfaces are not supported.
Only temporal changes in X, Y, Z, SpinX, SpinY and SpinZ of the reflection surface are supported.
The object defining the surface must have the same duration as the particle object.
Do not attach the build-in effect "Emission" to the reflection surface!

Check box

Support object time change

  When checked, temporal change of the reflection surfaces (position and spin) will be taken into account. Processing will get very heavy if enabled.

Setting dialog

Layer

Set the layers defining reflection surfaces.

{layerID[1],layerID[2],...,layerID[n]}

BounceCoeff

Speed coefficients for each surface.

{Coeff for surface 1, Coeff for surface 2,..., Coeff for surface N}

Assume all 0.9 if omitted.

Irregularity0~1

Decide if randomness should be introduced when bouncing off each surface.

{surface 1 ON/OFF, surface 2 ON/OFF,..., surface N ON/OFF}

0: No randomness; 1: Randomize

Assume 0 if omitted.

Probability

The chance of introducing randomness when bouncing off each surface.

{P(surface 1),P(surface 2),...,P(surface N)}

0: No randomness at all; 0.5: Half the particles will be randomized; 1: All randomized

RevDomain0~1

Invert surfaces' reflecting area. If previously an opaque area is reflecting particles, area outside this region will be reflecting only when set to 1.

{surface 1 ON/OFF, surface 2 ON/OFF,..., surface N ON/OFF}

Assume 0 if omitted.

Type0~1

Enable (1) or disable (0) a surface

{surface 1 ON/OFF, surface 2 ON/OFF,..., surface N ON/OFF}

Assume 1 if omitted.

OverTime0~1

When using with Bounce@, set the surface type after TypeSwitchTime

{surface 1 type,surface 2 type, ... ,surface N type}

 Assume 1 if omitted

 No effect if Bounce@ is not attached


text:
package com.github.mapkiwiz.geojson;

public abstract class Geometry<T> extends GeoJsonObject {

	/**
	 *
	 */
	private static final long serialVersionUID = 3956929515809059521L;

	public final String type;
	public T coordinates;

	protected Geometry(String type) {
		this.type = type;
	}

}


text:
layout: page
title: Burnett Family Reunion
date: 2016-05-24
author: Samuel Robinson
tags: weekly links, java
status: published
summary: Mauris non lacus in odio mattis congue. Nulla.
banner: images/banner/leisure-02.jpg
booking:
  startDate: 09/08/2018
  endDate: 09/13/2018
  ctyhocn: CYDINHX
  groupCode: BFR
published: true
---
Phasellus sapien quam, tristique auctor est scelerisque, faucibus varius mi. Etiam scelerisque est non fringilla accumsan. Pellentesque habitant morbi tristique senectus et netus et malesuada fames ac turpis egestas. Nullam vehicula luctus justo a scelerisque. Integer tempus varius varius. Duis fringilla ex nibh, quis maximus velit placerat volutpat. Fusce tincidunt volutpat quam vitae venenatis. Quisque tristique lectus ante, quis lobortis sem rhoncus in.

1 Suspendisse imperdiet nulla sed ipsum laoreet pretium
1 Integer mattis dui et libero lacinia fermentum in sed diam
1 Aenean vestibulum tortor vitae ipsum eleifend suscipit ut sagittis est
1 Morbi imperdiet magna nec augue euismod, ac hendrerit lectus tempus
1 Vestibulum at ipsum sed mi lacinia faucibus condimentum eu sapien
1 Quisque commodo purus id porttitor luctus.

Nulla facilisi. Curabitur magna arcu, aliquet non lectus eu, imperdiet pretium orci. Ut sit amet enim tellus. In hac habitasse platea dictumst. Vestibulum fringilla lorem mi, ac elementum urna interdum sed. Proin malesuada ipsum ac metus lacinia, et venenatis est pretium. Praesent ut suscipit lectus, sed vulputate purus.
Aliquam diam est, scelerisque at felis id, efficitur mollis enim. Donec venenatis odio ac justo congue ultricies. Sed posuere, nisi vel ornare viverra, purus dui dictum ex, et tempor libero turpis a ante. Donec mattis nunc non dui ultricies dignissim a sit amet augue. Curabitur porta, felis auctor dapibus maximus, turpis diam efficitur mauris, non consequat mauris metus id mi. Aliquam urna eros, venenatis sed risus sit amet, cursus molestie est. Morbi mollis faucibus magna eget consectetur. Suspendisse potenti. Etiam malesuada justo vel blandit finibus.


text:
var sceneManifests = ["Manifests/AMTestScene1/project.manifest", "Manifests/AMTestScene2/project.manifest", "Manifests/AMTestScene3/project.manifest"];
var storagePaths = ["JSBTests/AssetsManagerTest/scene1/", "JSBTests/AssetsManagerTest/scene2/", "JSBTests/AssetsManagerTest/scene3"];
var backgroundPaths = ["Images/background1.jpg", "Images/background2.jpg", "Images/background3.png"];

var currentScene = 0;

var AssetsManagerTestLayer = BaseTestLayer.extend({
    _background : null,
    _spritePath : "",

    ctor : function (spritePath) {
        this._super();
        this._spritePath = spritePath;
        cc.loader.resPath = "res/";
    },

    getTitle : function() {
        return "AssetsManagerTest";
    },

    onEnter : function() {
        this._super();
        this._background = new cc.Sprite(this._spritePath);
        this.addChild(this._background, 1);
        this._background.x = cc.winSize.width/2;
        this._background.y = cc.winSize.height/2;
    },

    onExit : function(){
        cc.loader.resPath = "";
        this._super();
    },

    onNextCallback : function () {
        if (currentScene < 2)
        {
            currentScene++;
        }
        else currentScene = 0;
        var scene = new AssetsManagerLoaderScene();
        scene.runThisTest();
    },

    onBackCallback : function () {
        if (currentScene > 0)
        {
            currentScene--;
        }
        else currentScene = 2;
        var scene = new AssetsManagerLoaderScene();
        scene.runThisTest();
    }
});

var AssetsManagerTestScene = TestScene.extend({
    _background : "",

    ctor : function (background) {
        this._super();
        var layer = new AssetsManagerTestLayer(background);
        this.addChild(layer);
    }
});

var __failCount = 0;

var AssetsManagerLoaderScene = TestScene.extend({
    _am : null,
    _progress : null,
    _percent : 0,
    _percentByFile : 0,
    _loadingBar : null,
    _fileLoadingBar : null,

    runThisTest : function () {
        var manifestPath = sceneManifests[currentScene];
        var storagePath = ((jsb.fileUtils ? jsb.fileUtils.getWritablePath() : "/") + storagePaths[currentScene]);
        cc.log("Storage path for this test : " + storagePath);

        var layer = new cc.Layer();
        this.addChild(layer);

        var icon = new cc.Sprite(s_image_icon);
        icon.x = cc.winSize.width/2;
        icon.y = cc.winSize.height/2;
        layer.addChild(icon);

        this._loadingBar = ccui.LoadingBar.create("res/cocosui/sliderProgress.png");
        this._loadingBar.x = cc.visibleRect.center.x;
        this._loadingBar.y = cc.visibleRect.top.y - 40;
        layer.addChild(this._loadingBar);

        this._fileLoadingBar = ccui.LoadingBar.create("res/cocosui/sliderProgress.png");
        this._fileLoadingBar.x = cc.visibleRect.center.x;
        this._fileLoadingBar.y = cc.visibleRect.top.y - 80;
        layer.addChild(this._fileLoadingBar);

        this._am = new jsb.AssetsManager(manifestPath, storagePath);
        this._am.retain();

        if (!this._am.getLocalManifest().isLoaded())
        {
            cc.log("Fail to update assets, step skipped.");
            var scene = new AssetsManagerTestScene(backgroundPaths[currentScene]);
            cc.director.runScene(scene);
        }
        else
        {
            var that = this;
            var listener = new jsb.EventListenerAssetsManager(this._am, function(event) {
                var scene;
                switch (event.getEventCode())
                {
                    case jsb.EventAssetsManager.ERROR_NO_LOCAL_MANIFEST:
                        cc.log("No local manifest file found, skip assets update.");
                        scene = new AssetsManagerTestScene(backgroundPaths[currentScene]);
                        cc.director.runScene(scene);
                        break;
                    case jsb.EventAssetsManager.UPDATE_PROGRESSION:
                        that._percent = event.getPercent();
                        that._percentByFile = event.getPercentByFile();

                        var msg = event.getMessage();
                        if (msg) {
                            cc.log(msg);
                        }
                        cc.log(that._percent + "%");
                        break;
                    case jsb.EventAssetsManager.ERROR_DOWNLOAD_MANIFEST:
                    case jsb.EventAssetsManager.ERROR_PARSE_MANIFEST:
                        cc.log("Fail to download manifest file, update skipped.");
                        scene = new AssetsManagerTestScene(backgroundPaths[currentScene]);
                        cc.director.runScene(scene);
                        break;
                    case jsb.EventAssetsManager.ALREADY_UP_TO_DATE:
                    case jsb.EventAssetsManager.UPDATE_FINISHED:
                        cc.log("Update finished. " + event.getMessage());
                        scene = new AssetsManagerTestScene(backgroundPaths[currentScene]);
                        cc.director.runScene(scene);
                        break;
                    case jsb.EventAssetsManager.UPDATE_FAILED:
                        cc.log("Update failed. " + event.getMessage());

                        __failCount ++;
                        if (__failCount < 5)
                        {
                            that._am.downloadFailedAssets();
                        }
                        else
                        {
                            cc.log("Reach maximum fail count, exit update process");
                            __failCount = 0;
                            scene = new AssetsManagerTestScene(backgroundPaths[currentScene]);
                            cc.director.runScene(scene);
                        }
                        break;
                    case jsb.EventAssetsManager.ERROR_UPDATING:
                        cc.log("Asset update error: " + event.getAssetId() + ", " + event.getMessage());
                        break;
                    case jsb.EventAssetsManager.ERROR_DECOMPRESS:
                        cc.log(event.getMessage());
                        break;
                    default:
                        break;
                }
            });

            cc.eventManager.addListener(listener, 1);

            this._am.update();

            cc.director.runScene(this);
        }

        this.schedule(this.updateProgress, 0.5);
    },

    updateProgress : function () {
        this._loadingBar.setPercent(this._percent);
        this._fileLoadingBar.setPercent(this._percentByFile);
    },

    onExit : function () {
        this._am.release();
        this._super();
    }
});


text:
package org.davidmoten.rx.jdbc.callable.internal;

public interface InParameterPlaceholder extends ParameterPlaceholder {
}


text:
package com.googlecode.scala.sound.midi.examples

import javax.sound.midi.Sequence
import com.googlecode.scala.sound.midi._
import com.googlecode.scala.sound.midi.Notes._
import com.googlecode.scala.sound.midi.MidiEvent
import com.googlecode.scala.sound.midi.message._
import java.io.File

// scala port of http://www.automatic-pilot.com/midifile.html
object MidiFile {

  def main(args: Array[String]) {
    val sequence = new Sequence(Sequence.PPQ, 24)
    val track = sequence.createTrack()

    MidiEvent(GeneralMIDIOn(), 0) -> track
    MidiEvent(SetTempo(457), 0) -> track  //457.76 in example code
    MidiEvent(TrackName("midifile track"), 0) -> track
    MidiEvent(OmniOn(), 0) -> track
    MidiEvent(PolyOn(), 0) -> track
    MidiEvent(ProgramChange(0, 0), 0) -> track
    MidiEvent(NoteOn(0, C4, 96), 1) -> track
    MidiEvent(NoteOff(0, C4, 64), 121) -> track
    MidiEvent(EndOfTrack(), 140) -> track

    sequence >> new File("midifile.mid")
  }
}


text:
@implementation TestInheritedProperty {

}
@end


text:
from netforce.model import Model, fields, get_model

class CreditWizardLine(Model):
    _name = "account.credit.wizard.line"
    _transient = True
    _fields = {
        "wiz_id": fields.Many2One("account.credit.wizard", "Wizard", required=True, on_delete="cascade"),
        "move_line_id": fields.Many2One("account.move.line", "Account Entry", required=True, readonly=True, on_delete="cascade"),
        "move_id": fields.Many2One("account.move", "Journal Entry", required=True, readonly=True, on_delete="cascade"),
        "date": fields.Date("Date", readonly=True),
        "account_id": fields.Many2One("account.account", "Account", required=True, readonly=True, on_delete="cascade"),
        "amount_credit_remain": fields.Decimal("Outstanding Credit", readonly=True),
        "amount": fields.Decimal("Amount"),
    }

CreditWizardLine.register()


text:
<?

class ListController extends Zend_Controller_Action
{
    public function init()
    {
        $this->view->menu_selected = "view";
        $this->closed_status = "('Closed', '_DELETED_', '_SOLVED_', 'Resolved')";

        /*
        //remove cookie from old navigator - we are exceeding max cookie size of 8k
        setcookie('opened_opened_navigator', null, -1, "/goc/");
        setcookie('closed_closed_navigator', null, -1, "/goc/");
        */
    }

    public function openAction()
    {
        $this->view->submenu_selected = "listopen";
        $this->view->page_title = "Open Tickets";
        //$this->loadcookie("open");

        try {
            $model = new Tickets();

            //assigned tickets
            $query = "WHERE mrstatus not in $this->closed_status";
            $this->view->tickets = $model->dosearch($query);
            $this->view->metadata = $this->loadMetadata($this->view->tickets);

            $model = new Schema();
            $this->view->teams = $model->getteams();

        } catch (SoapFault $e) {
            elog("SoapFault detected while ViewController:loaddetail()");
            elog($e->getMessage());
            $this->view->content = $e->getMessage();
            $this->render("error/error", null, true);
        }

        $this->render("list");
    }

    public function recentcloseAction()
    {
        $this->view->submenu_selected = "listrecentclose";
        $this->view->page_title = "Recently Closed Tickets";
        //$this->loadcookie("recentclose");

        try {
            $model = new Tickets();

            //recently closed tickets
            $this->view->closed_days = config()->myticket_closed_days;
            $recent_date = date("Y-m-d G:i:s", time()-3600*24*$this->view->closed_days);

            $query = "WHERE mrstatus in $this->closed_status and mrupdatedate > '$recent_date'";
            $this->view->tickets = $model->dosearch($query);
            $this->view->metadata = $this->loadMetadata($this->view->tickets);

            $model = new Schema();
            $this->view->teams = $model->getteams();

        } catch (SoapFault $e) {
            elog("SoapFault detected while ViewController:loaddetail()");
            elog($e->getMessage());
            $this->view->content = $e->getMessage();
            $this->render("error/error", null, true);
        }
        $this->render("list");
    }

    function loadMetadata($tickets) {
        if(count($tickets) == 0) return;

        foreach($tickets as $ticket) {
            $ids[] = $ticket->mrid;
        }
        $model = new Data();
        $recs = $model->getAllMetadataForTickets($ids);
        $metadata = array();
        foreach($recs as $rec) {
            $key = $rec->key;
            if(!isset($metadata[$rec->ticket_id])) {
                $metadata[$rec->ticket_id] = array();
            }
            $metadata[$rec->ticket_id][$key] = $rec->value;
        }
        return $metadata;
    }
}


text:
package com.thanple.thinking.berkeleyDB.framework.manager;

import com.sleepycat.je.Environment;
import com.sleepycat.je.Transaction;
import com.sleepycat.je.TransactionConfig;

import java.util.ArrayList;
import java.util.concurrent.TimeUnit;

/**
 * Created by Thanple on 2017/1/17.
 */
public class TransactionManager {

    //加锁最长时间
    private static final int LOCK_TIME_OUT = 10000;

    private static ThreadLocal<Transaction> current = new ThreadLocal<>();
    private static ThreadLocal<ArrayList<Boolean>> results = new ThreadLocal<ArrayList<Boolean>>(){
        protected ArrayList initialValue() {
            return new ArrayList();
        }
    };

    public static void clearResults(){
        current.remove();
        results.get().clear();
    }

    public static Transaction currentTransaction(){
        return current.get();
    }

    public static void setTransaction(Transaction transaction){
        current.set(transaction);
    }

    public static void savePoint(Boolean point){
        results.get().add(point);
    }

    //开启事务
    public static void startTransaction(){
        Environment environment = DBManager.getInstance().getEnvironment();
        if(null == currentTransaction()){
            Transaction transaction = environment.beginTransaction(null, TransactionConfig.DEFAULT);
            transaction.setLockTimeout(LOCK_TIME_OUT, TimeUnit.MILLISECONDS);
            TransactionManager.setTransaction(transaction);
        }
    }

    //提交或者回滚事务
    public static boolean commit(){
        boolean rs = true;
        for(Boolean e : results.get()){
            if(!e){
                current.get().abort();
                rs  = false;
                break;
            }
        }
        if(rs)  current.get().commit();
        clearResults();  //清空事务记录
        return rs;
    }
}


text:
require 'test_helper'

class ReapingCheckTest < ActiveSupport::TestCase

  def setup
    @open.opens_on = Time.now.to_i - 1000
    @open.closes_on = Time.now.to_i + 1000
  end

  test 'is active' do
    assert @open.is_active?
  end
end


text:
package vero.com.project;

import android.content.Intent;
import android.support.v7.app.AppCompatActivity;
import android.os.Bundle;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.BaseAdapter;
import android.widget.Button;
import android.widget.ListView;
import android.widget.RadioButton;
import android.widget.RadioGroup;
import android.widget.TextView;
import android.widget.Toast;

import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;

public class CorrectActivity extends AppCompatActivity implements View.OnClickListener {
    private ListView mListView;
    private Button mBtn;
    private List<Question> questions;
    private MyAdapter myAdapter;
    private int[] myChoices;//我选择的答案

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_correct);
        initData();
        initView();
    }

    private void initData() {
        questions = new ArrayList<>();
        Question q1 = new Question("你正常吗?", "0", "1", 0);
        Question q2 = new Question("你好吗?", "0", "1", 0);
        Question q3 = new Question("你来了吗?", "0", "1", 0);
        Question q4 = new Question("你走了吗?", "0", "1", 0);
        Question q5 = new Question("你吃饭吗?", "0", "1", 0);
        Question q6 = new Question("你上班吗?", "0", "1", 0);
        Question q7 = new Question("你无聊吗?", "0", "1", 0);
        Question q8 = new Question("你吃饭吗?", "0", "1", 0);
        Question q9 = new Question("你上班吗?", "0", "1", 0);
        Question q10 = new Question("你无聊吗?", "0", "1", 0);
        questions.add(q1);
        questions.add(q2);
        questions.add(q3);
        questions.add(q4);
        questions.add(q5);
        questions.add(q6);
        questions.add(q7);
        questions.add(q8);
        questions.add(q9);
        questions.add(q10);
        myChoices = new int[questions.size()];
        for (int i = 0; i < myChoices.length; i++) {
            myChoices[i] = -1;
        }
    }

    private void initView() {
        mListView = (ListView) findViewById(R.id.lv);
        mBtn = (Button) findViewById(R.id.btn);
        mBtn.setOnClickListener(this);
        myAdapter = new MyAdapter();
        mListView.setAdapter(myAdapter);
    }

    @Override
    public void onClick(View v) {
        switch (v.getId()) {
            case R.id.btn:
                Intent intent = new Intent(CorrectActivity.this, Activity2.class);
                Bundle bundle = new Bundle();
                bundle.putString("myChoices", Arrays.toString(myChoices));
                intent.putExtras(bundle);
                startActivity(intent);
                Toast.makeText(CorrectActivity.this, Arrays.toString(myChoices), Toast.LENGTH_LONG).show();
                break;
            default:
                break;
        }
    }

    class MyAdapter extends BaseAdapter {

        @Override
        public int getCount() {
            return questions.size();
        }

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

        @Override
        public long getItemId(int position) {
            return position;
        }

        @Override
        public View getView(final int position, View convertView, ViewGroup parent) {
            View view = null;
            ViewHolder holder = null;
            if (convertView == null) {
                view = LayoutInflater.from(CorrectActivity.this).inflate(R.layout.item, null);
                holder = new ViewHolder();
                holder.TvQuestion = (TextView) view.findViewById(R.id.question);
                holder.rgb = (RadioGroup) view.findViewById(R.id.rgb);
                holder.rgb.setOnCheckedChangeListener(new RadioGroup.OnCheckedChangeListener() {
                    @Override
                    public void onCheckedChanged(RadioGroup group, int checkedId) {
                        Integer pos = (Integer) group.getTag();
                        if (checkedId == R.id.rb_left) {
                            myChoices[pos] = 0;
                        } else if (checkedId == R.id.rb_right) {
                            myChoices[pos] = 1;
                        }
                    }
                });
                holder.rbLeft = (RadioButton) view.findViewById(R.id.rb_left);
                holder.rbRight = (RadioButton) view.findViewById(R.id.rb_right);
                view.setTag(holder);
            } else {
                view = convertView;
                holder = (ViewHolder) view.getTag();
            }
            holder.rgb.setTag(new Integer(position)); //重要:将当前的位置作为tag记录下来

            holder.TvQuestion.setText((position + 1) + "." + questions.get(position).getStrQuestion());
            holder.rbLeft.setText(questions.get(position).getRbLeft());
            holder.rbRight.setText(questions.get(position).getRbRight());

            if (myChoices[position]==0){
                holder.rbLeft.setChecked(true);
            }else if (myChoices[position]==1){
                holder.rbRight.setChecked(true);
            }else {
                holder.rgb.clearCheck();
            }
            return view;
        }

        class ViewHolder {
            TextView TvQuestion;
            RadioGroup rgb;
            RadioButton rbLeft;
            RadioButton rbRight;
        }
    }
}


text:
return {

    out = function(self,cn,text,excn)
        local text = string.format('%s%s',self.parent.cnf.say.text.color,text)
        clientprint(cn,text,excn)
    end,

    to = function(self,cn,tcn,text)
        if self.parent.cnf.show_mod or self.parent.cn:chk_show_mod(cn) or self.parent.cn:chk_show_mod(tcn) then self:out(tcn,text) end
    end,
    me = function(self,cn,text)
        if self.parent.cnf.show_mod or self.parent.cn:chk_show_mod(cn) then self:out(cn,text) end
    end,
    allex = function(self,excn,text)
        if self.parent.cnf.show_mod then self:out(-1,text,excn) end
    end,
    allexme = function(self,cn,text)
        if self.parent.cnf.show_mod then self:out(-1,text,cn) end
    end,
    all = function(self,text,cn)
        cn = cn or -1
        if self.parent.cnf.show_mod then self:out(cn,text) end
    end,

    smg = function(self,text,cn)
        cn = cn or -1
        self:out(cn,text)
    end,

    init = function(self,obj)
        self.parent = obj
       --self.parent = setmetatable( {}, { __index = obj } )
        --self.parent = setmetatable( {}, { __index = obj, __newindex = obj } )
        self.parent.log:i('Module say init OK')
    end
}


text:
Easily check, enable or disable ASLR on the debugged binary.

Check the status:
```
gef➤  aslr
ASLR is currently disabled
```

Activate ASLR:
```
gef➤  aslr on
[+] Enabling ASLR
gef➤  aslr
ASLR is currently enabled
```

De-activate ASLR:
```
gef➤  aslr off
[+] Disabling ASLR
```

**Note**: This command cannot affect a process that has already been loaded, to
which GDB attached to later. The only way to disable this randomization is by
setting the kernel setting `/proc/sys/kernel/randomize_va_space` to 0..


text:
/// <reference path="../experiments/uiEditorRenderer.ts" />
/// <reference path="api.ts" />
module client {
  declare var dispatcher;
  declare var DEBUG;
  declare var CBOR;
  declare var uuid;

  var ixer = api.ixer;
  var zip = api.zip;
  var dispatch = (event, info) => undefined;

  function now() {
    if (window.performance) {
      return window.performance.now();
    }
    return (new Date()).getTime();
  }

  function isUndefined(val) {
    return val === undefined;
  }

  /* Integrated Debugging Tooling */
  export function nukeTable(viewId) { // from orbit
    var fieldIds = api.code.sortedViewFields(viewId);
    var toRemove = api.ixer.facts(viewId);
    sendToServer({ changes: [[viewId, fieldIds, [], toRemove]]}, true);
  }

  function formatTime(time?) {
    time = time || new Date();
    return pad("", time.getHours(), "0", 2) + ":" + pad("", time.getMinutes(), "0", 2) + ":" + pad("", time.getSeconds(), "0", 2);
  }

  function pad(left, right = "", pad = " ", length = 120) {
    left = "" + left;
    right = "" + right;

    var padding = "";
    var delta = length - left.length - right.length;
    if (delta > 0) {
      padding = new Array(delta + 1).join(pad);
    }
    return left + padding + right;
  }

  function writeDataToConsole(data, verbosity) {
    verbosity = +verbosity;
    var consoleTable = console["table"].bind(console) || console.log.bind(console);
    data.changes.forEach(function(change) {
      if (change[2].length || change[3].length) {
        if (verbosity == 1) {
          console.log(" ", change[0], `+${change[2].length}/-${change[3].length}`);
        }
        if (verbosity == 2) {
          console.log(" ", change[0], `+${change[2].length}/-${change[3].length}`,
            { fields: change[1], inserts: change[2], removes: change[3] });
        }
        if (verbosity == 3) {
          console.log(" ", change[0], `+${change[2].length}/-${change[3].length}`);
          console.groupCollapsed(`   inserts ${change[1]}`);
          consoleTable(change[2]);
          console.groupEnd();
          console.groupCollapsed(`   removes ${change[1]}`);
          consoleTable(change[3]);
          console.groupEnd();
        }
      }
    });
  }

  // Generate debugging information on incoming or outgoing payloads.
  function getDataStats(data:Indexing.Payload) {
    var totalAdds = 0;
    var totalRemoves = 0;
    var malformedDiffs:string[] = [];
    var badValues:string[] = [];
    data.changes.forEach(function(change) {
      totalAdds += change[2].length;
      totalRemoves += change[3].length;
      // Simple check to notify programmers of definitely unhealthy payloads they may be sending.
      var hasMalformedDiffs = false;
      var hasBadValues = false;
      change[2].forEach(function(diff) {
        hasMalformedDiffs = hasMalformedDiffs || (diff.length !== change[1].length);
        hasBadValues = hasBadValues || diff.some(isUndefined);
      });

      change[3].forEach(function(diff) {
        hasMalformedDiffs = hasMalformedDiffs || (diff.length !== change[1].length);
        hasBadValues = hasBadValues || diff.some(isUndefined);
      });
      if (hasMalformedDiffs) {
        malformedDiffs.push(change[0]);
      }
      if (hasBadValues) {
        badValues.push(change[0]);
      }
    });

    return { adds: totalAdds, removes: totalRemoves, malformedDiffs: malformedDiffs, badValues: badValues };
  }

  function filterFactsBySession<T>(facts:T[], sessionFieldIx:number, session:string) {
    var neue:T[] = [];
    for(let fact of facts) {
      if(fact[sessionFieldIx] !== session) {
        neue.push(fact);
      }
    }
    return neue;
  }

  var server = { connected: false, queue: [], initialized: false, lastSent: [], ws: null, dead: false };
  function connectToServer() {
    var queue = server.queue;
    var wsAddress = "ws://localhost:2794";
    if(window.location.protocol !== "file:") {
      wsAddress = `ws://${window.location.hostname}:2794`;
    }
    var ws = new WebSocket(wsAddress, []);
    server.ws = ws;

    ws.onerror = ws.onclose = function(error) {
      server.connected = false;
      server.dead = true;
      reconnect();
      dispatch("setNotice", {content: `Error: Eve Server is Dead!`, type: "error", id: "server dead", duration: 0});
    }

    ws.onopen = function() {
      server.connected = true;
      if(server.dead) {
        server.dead = false;
        dispatch("fadeNotice", {noticeId: "server dead"});
        dispatch("setNotice", {content: "Reconnected to server!"});
      }
      for (var i = 0, len = queue.length; i < len; i++) {
        sendToServer(queue[i], false);
      }
    }

    ws.onmessage = function(e) {
      var start = now();
      var time:number;
      var data = JSON.parse(e.data);
      var time = now() - start;
      if (time > 5) {
        console.log("slow parse (> 5ms):", time);
      }

      var initializing = !server.initialized;
      server.initialized = true;
      if(data.commands) {
        for(let [command, ...args] of data.commands) {
          // If we are loading in this event, we should ignore tags and accept all diffs.
          if(command === "loaded" || command === "events set") {
            initializing = true;
            // @FIXME: Send filename + path to dispatcher.
          }
          if(command === "events got") {
            dispatch("gotEvents", {save: args[0], events: args[1]});
          }
        }
      }

      // For an explanation of what changes are synced, check: <https://github.com/witheve/Eve/blob/master/design/sync.md>
      var changes = [];
      for(let change of data.changes) {
        let [view, fields, inserts, removes] = change;
        if(!initializing && api.code.hasTag(view, "client")) {
          // If view is client-controlled, discard any changes originating from our session.
          var sessionFieldIx:number;
          for(let fieldIx = 0; fieldIx < fields.length; fieldIx++) {
            if(api.code.hasTag(fields[fieldIx], "session")) {
              sessionFieldIx = fieldIx;
              break;
            }
          }

          changes.push([view,
                        fields,
                        filterFactsBySession(inserts, sessionFieldIx, data.session),
                        filterFactsBySession(removes, sessionFieldIx, data.session)]);

        } else if (!initializing && api.code.hasTag(view, "editor")) {
          // If view is editor controlled, we discard all changes.
          continue;
        } else {
          // If view is server controlled, accept all changes.
          changes.push(change);
        }
      }

      if (DEBUG.RECEIVE) {
        var stats = getDataStats({changes: changes});
        if (stats.adds || stats.removes) {
          var header = `[client:received][+${stats.adds}/-${stats.removes}]`;
          console.groupCollapsed(pad(header, formatTime()));
          if (stats.malformedDiffs.length) {
            console.warn("The following views have malformed diffs:", stats.malformedDiffs);
          }
          if (stats.badValues.length) {
            console.warn("The following views have bad values:", stats.badValues);
          }
          writeDataToConsole({ changes: changes }, DEBUG.RECEIVE);
          console.groupEnd();
        }

        start = now();
      }

      ixer.handleMapDiffs(changes);

      // If we haven't initialized the client yet, do so after we've handled the initial payload, so it can be accessed via the indexer.
      if (initializing) {
        var eventId = (ixer.facts("client event") || []).length; // Ensure eids are monotonic across sessions.
        uiEditorRenderer.setEventId(eventId);
        uiEditorRenderer.setSessionId(data.session); // Store server-assigned session id for use in client-controlled tables.
        for(var initFunc of afterInitFuncs) {
          initFunc();
        }
      }

      time = now() - start;
      if(DEBUG.RECEIVE) {
        if (time > 5) {
          console.log("slow handleDiffs (> 5ms):", time);
        }
      }

      dispatcher.render();

      // Get the user ID from a cookie
      var name = "userid" + "=";
      var cookie = document.cookie.split(';');
      var userid = "";
      if (cookie[0].indexOf(name) == 0)
        userid = cookie[0].substring(name.length, cookie[0].length);

      // Check if the user ID is found. If not, redirect the user to log in.
      if (userid == "") {
        // TODO Handle a user who isn't logged in.
        console.log("Session has not been authenticated.");
      } else {
        var eveusers = api.ixer.index("eveusers id to username");
        var username = eveusers[userid];
        if (typeof username == 'undefined') {
          // TODO Handle a user who is not in the eveuser table
          console.log("Session cookie does not identify an eveuser.");
        } else {
          // TODO Handle a user who is logged in
          console.log("You are logged in as " + username);
        }
      }
    };
  }

  export function sendToServer(message, formatted?, commands?) {
    if (!server.connected) {
      console.warn("Not connected to server, adding message to queue.");
      server.queue.push(message);
    } else {
      if (!formatted) {
        message = toMapDiffs(message);
      }
      var payload = message;
      if(commands) {
        payload.commands = commands;
      }

      if (DEBUG.SEND) {
        var stats = getDataStats(payload);
        if (stats.adds || stats.removes) {
          var header = `[client:sent][+${stats.adds}/-${stats.removes}]`;
          console.groupCollapsed(pad(header, formatTime()));
          if (stats.malformedDiffs.length) {
            console.warn("The following views have malformed diffs:", stats.malformedDiffs);
          }
          if (stats.badValues.length) {
            console.warn("The following views have bad values:", stats.badValues);
          }
          writeDataToConsole(payload, DEBUG.SEND);
          console.groupEnd();
        }
      }

      if (payload.changes.length || payload.commands && payload.commands.length) {
        server.ws.send(CBOR.encode(payload));
      }
    }
  }

  export function toMapDiffs(diffs) {
    // Deduplicate diffs prior to sending with last write wins.
    var deduped = [];
    outer: for(var ix = diffs.length - 1; ix >= 0; ix--) {
      var diff = diffs[ix];
      for(var needleIx = deduped.length - 1; needleIx >= 0; needleIx--) {
        if(api.arraysIdentical(diff[2], deduped[needleIx][2]) && diff[0] === deduped[needleIx][0]) {
          continue outer;
        }
      }
      deduped.push(diff);
    }
    diffs = deduped;

    var final = { field: null };
    for (var i = 0, len = diffs.length; i < len; i++) {
      var cur = diffs[i];
      var table = cur[0];
      var action = cur[1];
      var fact = cur[2];
      if (!final[table]) {
        final[table] = { inserted: [], removed: [] };
      }
      final[table][action].push(fact);
    }

    // If fields are added to a view at the same time as new data is, our local fields list will be out of sync.
    // neueFields will contain any additional fields we need to include in the mapping we send to the server.
    var neueFields = {};
    for (var fieldIx = 0; final.field && fieldIx < final.field.inserted.length; fieldIx++) {
      // @FIXME: These must be inserted in order to work.
      // @FIXME: Does not account for removed fields, only appended fields.
      var field = final.field.inserted[fieldIx];
      var fieldViewId = field[0];
      var fieldId = field[1];
      if (!neueFields[fieldViewId]) { neueFields[fieldViewId] = (ixer.index("view to fields")[fieldViewId] || []).slice(); }
      neueFields[fieldViewId].push(fieldId);
    }

    var changes = [];
    for (var table in final) {
      if(!final[table]) continue;
      var fieldIds = api.ixer.getFields(table) || [];
      fieldIds = fieldIds.concat(neueFields[table] || []);

      changes.push([table, fieldIds, final[table].inserted, final[table].removed]);
    }
    return { changes: changes };
  }

  var afterInitFuncs: Function[] = [];
  export function afterInit(func) {
    afterInitFuncs.push(func);
  }

  // Try to reconnect to the server every 10 seconds.
  let checkReconnectInterval;
  function reconnect() {
    if(checkReconnectInterval) { return; }
    checkReconnectInterval = setInterval(() => {
      if(server.connected) {
        clearInterval(checkReconnectInterval);
        checkReconnectInterval = undefined;
      } else {
        connectToServer();
      }
    }, 10000);
    connectToServer();
  }

  document.addEventListener("DOMContentLoaded", reconnect);

  export function setDispatch(dispatchFn) {
    dispatch = dispatchFn;
  }
}


text:
package com.intel.icecp.cli.command;

import com.intel.icecp.cli.exceptions.FailedResponseException;
import com.intel.icecp.core.management.Channels;

import java.net.URI;
import java.nio.file.Paths;
import java.util.Collection;
import java.util.Iterator;
import java.util.NoSuchElementException;
import java.util.concurrent.ExecutionException;
import java.util.concurrent.TimeoutException;

/**
 */
public class ModuleLoadCommand {
    private ModuleLoadCommand() {
    }

    public static long load(Channels channels, URI nodeUri, String moduleUriStr, String configUriStr, int timeout)
            throws InterruptedException, ExecutionException, TimeoutException, FailedResponseException {
        URI moduleUri = toUriWithProperScheme(moduleUriStr);
        URI configUri = toUriWithProperScheme(configUriStr);
        Object result = ExecuteCommand.execute(channels, nodeUri, "loadAndStartModules", timeout, moduleUri, configUri);

        @SuppressWarnings("unchecked")
        Collection<Long> loadedModuleIds = (Collection<Long>) result;
        Iterator<Long> ids = loadedModuleIds.iterator();
        if (ids.hasNext())
            return ids.next();
        throw new NoSuchElementException("No module IDs returned; the module failed to load!");
    }

    /**
     * Convert a given location string to URI; this contains special processing to properly prepend "file:" to Windows
     * path names (which otherwise URI believes have a scheme of "C:", e.g.)
     *
     * @param location the location to convert
     * @return a properly-schemed URI
     */
    static URI toUriWithProperScheme(String location) {
        if(location == null || location.isEmpty())
            throw new IllegalArgumentException("This method expects a non-null, non-empty location string");
        URI uri = URI.create(location);

        // no scheme means convert to a file
        if (uri.getScheme() == null) {
            return Paths.get(location).toUri();
        }
        // schemes of size one are likely drive letters on Windows; prepend
        // 'file:'
        else if (uri.getScheme().length() == 1) {
            return Paths.get(location).toUri();
        }

        return uri;
    }
}


text:
from __future__ import absolute_import
import inspect
import traceback
import bb.namedtuple_with_abc
from collections import namedtuple

class TracebackEntry(namedtuple.abc):
    """Pickleable representation of a traceback entry"""
    _fields = 'filename lineno function args code_context index'
    _header = '  File "{0.filename}", line {0.lineno}, in {0.function}{0.args}'

    def format(self, formatter=None):
        if not self.code_context:
            return self._header.format(self) + '\n'

        formatted = [self._header.format(self) + ':\n']

        for lineindex, line in enumerate(self.code_context):
            if formatter:
                line = formatter(line)

            if lineindex == self.index:
                formatted.append('    >%s' % line)
            else:
                formatted.append('     %s' % line)
        return formatted

    def __str__(self):
        return ''.join(self.format())

def _get_frame_args(frame):
    """Get the formatted arguments and class (if available) for a frame"""
    arginfo = inspect.getargvalues(frame)

    try:
        if not arginfo.args:
            return '', None
    # There have been reports from the field of python 2.6 which doesn't
    # return a namedtuple here but simply a tuple so fallback gracefully if
    # args isn't present.
    except AttributeError:
        return '', None

    firstarg = arginfo.args[0]
    if firstarg == 'self':
        self = arginfo.locals['self']
        cls = self.__class__.__name__

        arginfo.args.pop(0)
        del arginfo.locals['self']
    else:
        cls = None

    formatted = inspect.formatargvalues(*arginfo)
    return formatted, cls

def extract_traceback(tb, context=1):
    frames = inspect.getinnerframes(tb, context)
    for frame, filename, lineno, function, code_context, index in frames:
        formatted_args, cls = _get_frame_args(frame)
        if cls:
            function = '%s.%s' % (cls, function)
        yield TracebackEntry(filename, lineno, function, formatted_args,
                             code_context, index)

def format_extracted(extracted, formatter=None, limit=None):
    if limit:
        extracted = extracted[-limit:]

    formatted = []
    for tracebackinfo in extracted:
        formatted.extend(tracebackinfo.format(formatter))
    return formatted

def format_exception(etype, value, tb, context=1, limit=None, formatter=None):
    formatted = ['Traceback (most recent call last):\n']

    if hasattr(tb, 'tb_next'):
        tb = extract_traceback(tb, context)

    formatted.extend(format_extracted(tb, formatter, limit))
    formatted.extend(traceback.format_exception_only(etype, value))
    return formatted

def to_string(exc):
    if isinstance(exc, SystemExit):
        if not isinstance(exc.code, basestring):
            return 'Exited with "%d"' % exc.code
    return str(exc)