text:
package v1

import (
	gomock "github.com/golang/mock/gomock"
	context "golang.org/x/net/context"
	grpc "google.golang.org/grpc"
	reflect "reflect"
)

// MockUpClient is a mock of UpClient interface
type MockUpClient struct {
	ctrl     *gomock.Controller
	recorder *MockUpClientMockRecorder
}

// MockUpClientMockRecorder is the mock recorder for MockUpClient
type MockUpClientMockRecorder struct {
	mock *MockUpClient
}

// NewMockUpClient creates a new mock instance
func NewMockUpClient(ctrl *gomock.Controller) *MockUpClient {
	mock := &MockUpClient{ctrl: ctrl}
	mock.recorder = &MockUpClientMockRecorder{mock}
	return mock
}

// EXPECT returns an object that allows the caller to indicate expected use
func (m *MockUpClient) EXPECT() *MockUpClientMockRecorder {
	return m.recorder
}

// UpArcs mocks base method
func (m *MockUpClient) UpArcs(ctx context.Context, in *UpArcsReq, opts ...grpc.CallOption) (*UpArcsReply, error) {
	varargs := []interface{}{ctx, in}
	for _, a := range opts {
		varargs = append(varargs, a)
	}
	ret := m.ctrl.Call(m, "UpArcs", varargs...)
	ret0, _ := ret[0].(*UpArcsReply)
	ret1, _ := ret[1].(error)
	return ret0, ret1
}

// UpArcs indicates an expected call of UpArcs
func (mr *MockUpClientMockRecorder) UpArcs(ctx, in interface{}, opts ...interface{}) *gomock.Call {
	varargs := append([]interface{}{ctx, in}, opts...)
	return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "UpArcs", reflect.TypeOf((*MockUpClient)(nil).UpArcs), varargs...)
}

// UpsArcs mocks base method
func (m *MockUpClient) UpsArcs(ctx context.Context, in *UpsArcsReq, opts ...grpc.CallOption) (*UpsArcsReply, error) {
	varargs := []interface{}{ctx, in}
	for _, a := range opts {
		varargs = append(varargs, a)
	}
	ret := m.ctrl.Call(m, "UpsArcs", varargs...)
	ret0, _ := ret[0].(*UpsArcsReply)
	ret1, _ := ret[1].(error)
	return ret0, ret1
}

// UpsArcs indicates an expected call of UpsArcs
func (mr *MockUpClientMockRecorder) UpsArcs(ctx, in interface{}, opts ...interface{}) *gomock.Call {
	varargs := append([]interface{}{ctx, in}, opts...)
	return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "UpsArcs", reflect.TypeOf((*MockUpClient)(nil).UpsArcs), varargs...)
}

// UpCount mocks base method
func (m *MockUpClient) UpCount(ctx context.Context, in *UpCountReq, opts ...grpc.CallOption) (*UpCountReply, error) {
	varargs := []interface{}{ctx, in}
	for _, a := range opts {
		varargs = append(varargs, a)
	}
	ret := m.ctrl.Call(m, "UpCount", varargs...)
	ret0, _ := ret[0].(*UpCountReply)
	ret1, _ := ret[1].(error)
	return ret0, ret1
}

// UpCount indicates an expected call of UpCount
func (mr *MockUpClientMockRecorder) UpCount(ctx, in interface{}, opts ...interface{}) *gomock.Call {
	varargs := append([]interface{}{ctx, in}, opts...)
	return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "UpCount", reflect.TypeOf((*MockUpClient)(nil).UpCount), varargs...)
}

// UpsCount mocks base method
func (m *MockUpClient) UpsCount(ctx context.Context, in *UpsCountReq, opts ...grpc.CallOption) (*UpsCountReply, error) {
	varargs := []interface{}{ctx, in}
	for _, a := range opts {
		varargs = append(varargs, a)
	}
	ret := m.ctrl.Call(m, "UpsCount", varargs...)
	ret0, _ := ret[0].(*UpsCountReply)
	ret1, _ := ret[1].(error)
	return ret0, ret1
}

// UpsCount indicates an expected call of UpsCount
func (mr *MockUpClientMockRecorder) UpsCount(ctx, in interface{}, opts ...interface{}) *gomock.Call {
	varargs := append([]interface{}{ctx, in}, opts...)
	return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "UpsCount", reflect.TypeOf((*MockUpClient)(nil).UpsCount), varargs...)
}

// UpsAidPubTime mocks base method
func (m *MockUpClient) UpsAidPubTime(ctx context.Context, in *UpsArcsReq, opts ...grpc.CallOption) (*UpsAidPubTimeReply, error) {
	varargs := []interface{}{ctx, in}
	for _, a := range opts {
		varargs = append(varargs, a)
	}
	ret := m.ctrl.Call(m, "UpsAidPubTime", varargs...)
	ret0, _ := ret[0].(*UpsAidPubTimeReply)
	ret1, _ := ret[1].(error)
	return ret0, ret1
}

// UpsAidPubTime indicates an expected call of UpsAidPubTime
func (mr *MockUpClientMockRecorder) UpsAidPubTime(ctx, in interface{}, opts ...interface{}) *gomock.Call {
	varargs := append([]interface{}{ctx, in}, opts...)
	return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "UpsAidPubTime", reflect.TypeOf((*MockUpClient)(nil).UpsAidPubTime), varargs...)
}

// AddUpPassedCacheByStaff mocks base method
func (m *MockUpClient) AddUpPassedCacheByStaff(ctx context.Context, in *UpCacheReq, opts ...grpc.CallOption) (*NoReply, error) {
	varargs := []interface{}{ctx, in}
	for _, a := range opts {
		varargs = append(varargs, a)
	}
	ret := m.ctrl.Call(m, "AddUpPassedCacheByStaff", varargs...)
	ret0, _ := ret[0].(*NoReply)
	ret1, _ := ret[1].(error)
	return ret0, ret1
}

// AddUpPassedCacheByStaff indicates an expected call of AddUpPassedCacheByStaff
func (mr *MockUpClientMockRecorder) AddUpPassedCacheByStaff(ctx, in interface{}, opts ...interface{}) *gomock.Call {
	varargs := append([]interface{}{ctx, in}, opts...)
	return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "AddUpPassedCacheByStaff", reflect.TypeOf((*MockUpClient)(nil).AddUpPassedCacheByStaff), varargs...)
}

// AddUpPassedCache mocks base method
func (m *MockUpClient) AddUpPassedCache(ctx context.Context, in *UpCacheReq, opts ...grpc.CallOption) (*NoReply, error) {
	varargs := []interface{}{ctx, in}
	for _, a := range opts {
		varargs = append(varargs, a)
	}
	ret := m.ctrl.Call(m, "AddUpPassedCache", varargs...)
	ret0, _ := ret[0].(*NoReply)
	ret1, _ := ret[1].(error)
	return ret0, ret1
}

// AddUpPassedCache indicates an expected call of AddUpPassedCache
func (mr *MockUpClientMockRecorder) AddUpPassedCache(ctx, in interface{}, opts ...interface{}) *gomock.Call {
	varargs := append([]interface{}{ctx, in}, opts...)
	return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "AddUpPassedCache", reflect.TypeOf((*MockUpClient)(nil).AddUpPassedCache), varargs...)
}

// DelUpPassedCacheByStaff mocks base method
func (m *MockUpClient) DelUpPassedCacheByStaff(ctx context.Context, in *UpCacheReq, opts ...grpc.CallOption) (*NoReply, error) {
	varargs := []interface{}{ctx, in}
	for _, a := range opts {
		varargs = append(varargs, a)
	}
	ret := m.ctrl.Call(m, "DelUpPassedCacheByStaff", varargs...)
	ret0, _ := ret[0].(*NoReply)
	ret1, _ := ret[1].(error)
	return ret0, ret1
}

// DelUpPassedCacheByStaff indicates an expected call of DelUpPassedCacheByStaff
func (mr *MockUpClientMockRecorder) DelUpPassedCacheByStaff(ctx, in interface{}, opts ...interface{}) *gomock.Call {
	varargs := append([]interface{}{ctx, in}, opts...)
	return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "DelUpPassedCacheByStaff", reflect.TypeOf((*MockUpClient)(nil).DelUpPassedCacheByStaff), varargs...)
}

// DelUpPassedCache mocks base method
func (m *MockUpClient) DelUpPassedCache(ctx context.Context, in *UpCacheReq, opts ...grpc.CallOption) (*NoReply, error) {
	varargs := []interface{}{ctx, in}
	for _, a := range opts {
		varargs = append(varargs, a)
	}
	ret := m.ctrl.Call(m, "DelUpPassedCache", varargs...)
	ret0, _ := ret[0].(*NoReply)
	ret1, _ := ret[1].(error)
	return ret0, ret1
}

// DelUpPassedCache indicates an expected call of DelUpPassedCache
func (mr *MockUpClientMockRecorder) DelUpPassedCache(ctx, in interface{}, opts ...interface{}) *gomock.Call {
	varargs := append([]interface{}{ctx, in}, opts...)
	return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "DelUpPassedCache", reflect.TypeOf((*MockUpClient)(nil).DelUpPassedCache), varargs...)
}

// UpInfoActivitys mocks base method
func (m *MockUpClient) UpInfoActivitys(ctx context.Context, in *UpListByLastIDReq, opts ...grpc.CallOption) (*UpActivityListReply, error) {
	varargs := []interface{}{ctx, in}
	for _, a := range opts {
		varargs = append(varargs, a)
	}
	ret := m.ctrl.Call(m, "UpInfoActivitys", varargs...)
	ret0, _ := ret[0].(*UpActivityListReply)
	ret1, _ := ret[1].(error)
	return ret0, ret1
}

// UpInfoActivitys indicates an expected call of UpInfoActivitys
func (mr *MockUpClientMockRecorder) UpInfoActivitys(ctx, in interface{}, opts ...interface{}) *gomock.Call {
	varargs := append([]interface{}{ctx, in}, opts...)
	return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "UpInfoActivitys", reflect.TypeOf((*MockUpClient)(nil).UpInfoActivitys), varargs...)
}

// UpSpecial mocks base method
func (m *MockUpClient) UpSpecial(ctx context.Context, in *UpSpecialReq, opts ...grpc.CallOption) (*UpSpecialReply, error) {
	varargs := []interface{}{ctx, in}
	for _, a := range opts {
		varargs = append(varargs, a)
	}
	ret := m.ctrl.Call(m, "UpSpecial", varargs...)
	ret0, _ := ret[0].(*UpSpecialReply)
	ret1, _ := ret[1].(error)
	return ret0, ret1
}

// UpSpecial indicates an expected call of UpSpecial
func (mr *MockUpClientMockRecorder) UpSpecial(ctx, in interface{}, opts ...interface{}) *gomock.Call {
	varargs := append([]interface{}{ctx, in}, opts...)
	return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "UpSpecial", reflect.TypeOf((*MockUpClient)(nil).UpSpecial), varargs...)
}

// UpsSpecial mocks base method
func (m *MockUpClient) UpsSpecial(ctx context.Context, in *UpsSpecialReq, opts ...grpc.CallOption) (*UpsSpecialReply, error) {
	varargs := []interface{}{ctx, in}
	for _, a := range opts {
		varargs = append(varargs, a)
	}
	ret := m.ctrl.Call(m, "UpsSpecial", varargs...)
	ret0, _ := ret[0].(*UpsSpecialReply)
	ret1, _ := ret[1].(error)
	return ret0, ret1
}

// UpsSpecial indicates an expected call of UpsSpecial
func (mr *MockUpClientMockRecorder) UpsSpecial(ctx, in interface{}, opts ...interface{}) *gomock.Call {
	varargs := append([]interface{}{ctx, in}, opts...)
	return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "UpsSpecial", reflect.TypeOf((*MockUpClient)(nil).UpsSpecial), varargs...)
}

// UpGroups mocks base method
func (m *MockUpClient) UpGroups(ctx context.Context, in *NoArgReq, opts ...grpc.CallOption) (*UpGroupsReply, error) {
	varargs := []interface{}{ctx, in}
	for _, a := range opts {
		varargs = append(varargs, a)
	}
	ret := m.ctrl.Call(m, "UpGroups", varargs...)
	ret0, _ := ret[0].(*UpGroupsReply)
	ret1, _ := ret[1].(error)
	return ret0, ret1
}

// UpGroups indicates an expected call of UpGroups
func (mr *MockUpClientMockRecorder) UpGroups(ctx, in interface{}, opts ...interface{}) *gomock.Call {
	varargs := append([]interface{}{ctx, in}, opts...)
	return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "UpGroups", reflect.TypeOf((*MockUpClient)(nil).UpGroups), varargs...)
}

// UpGroupMids mocks base method
func (m *MockUpClient) UpGroupMids(ctx context.Context, in *UpGroupMidsReq, opts ...grpc.CallOption) (*UpGroupMidsReply, error) {
	varargs := []interface{}{ctx, in}
	for _, a := range opts {
		varargs = append(varargs, a)
	}
	ret := m.ctrl.Call(m, "UpGroupMids", varargs...)
	ret0, _ := ret[0].(*UpGroupMidsReply)
	ret1, _ := ret[1].(error)
	return ret0, ret1
}

// UpGroupMids indicates an expected call of UpGroupMids
func (mr *MockUpClientMockRecorder) UpGroupMids(ctx, in interface{}, opts ...interface{}) *gomock.Call {
	varargs := append([]interface{}{ctx, in}, opts...)
	return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "UpGroupMids", reflect.TypeOf((*MockUpClient)(nil).UpGroupMids), varargs...)
}

// UpAttr mocks base method
func (m *MockUpClient) UpAttr(ctx context.Context, in *UpAttrReq, opts ...grpc.CallOption) (*UpAttrReply, error) {
	varargs := []interface{}{ctx, in}
	for _, a := range opts {
		varargs = append(varargs, a)
	}
	ret := m.ctrl.Call(m, "UpAttr", varargs...)
	ret0, _ := ret[0].(*UpAttrReply)
	ret1, _ := ret[1].(error)
	return ret0, ret1
}

// UpAttr indicates an expected call of UpAttr
func (mr *MockUpClientMockRecorder) UpAttr(ctx, in interface{}, opts ...interface{}) *gomock.Call {
	varargs := append([]interface{}{ctx, in}, opts...)
	return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "UpAttr", reflect.TypeOf((*MockUpClient)(nil).UpAttr), varargs...)
}

// UpBaseStats mocks base method
func (m *MockUpClient) UpBaseStats(ctx context.Context, in *UpStatReq, opts ...grpc.CallOption) (*UpBaseStatReply, error) {
	varargs := []interface{}{ctx, in}
	for _, a := range opts {
		varargs = append(varargs, a)
	}
	ret := m.ctrl.Call(m, "UpBaseStats", varargs...)
	ret0, _ := ret[0].(*UpBaseStatReply)
	ret1, _ := ret[1].(error)
	return ret0, ret1
}

// UpBaseStats indicates an expected call of UpBaseStats
func (mr *MockUpClientMockRecorder) UpBaseStats(ctx, in interface{}, opts ...interface{}) *gomock.Call {
	varargs := append([]interface{}{ctx, in}, opts...)
	return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "UpBaseStats", reflect.TypeOf((*MockUpClient)(nil).UpBaseStats), varargs...)
}

// SetUpSwitch mocks base method
func (m *MockUpClient) SetUpSwitch(ctx context.Context, in *UpSwitchReq, opts ...grpc.CallOption) (*NoReply, error) {
	varargs := []interface{}{ctx, in}
	for _, a := range opts {
		varargs = append(varargs, a)
	}
	ret := m.ctrl.Call(m, "SetUpSwitch", varargs...)
	ret0, _ := ret[0].(*NoReply)
	ret1, _ := ret[1].(error)
	return ret0, ret1
}

// SetUpSwitch indicates an expected call of SetUpSwitch
func (mr *MockUpClientMockRecorder) SetUpSwitch(ctx, in interface{}, opts ...interface{}) *gomock.Call {
	varargs := append([]interface{}{ctx, in}, opts...)
	return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "SetUpSwitch", reflect.TypeOf((*MockUpClient)(nil).SetUpSwitch), varargs...)
}

// UpSwitch mocks base method
func (m *MockUpClient) UpSwitch(ctx context.Context, in *UpSwitchReq, opts ...grpc.CallOption) (*UpSwitchReply, error) {
	varargs := []interface{}{ctx, in}
	for _, a := range opts {
		varargs = append(varargs, a)
	}
	ret := m.ctrl.Call(m, "UpSwitch", varargs...)
	ret0, _ := ret[0].(*UpSwitchReply)
	ret1, _ := ret[1].(error)
	return ret0, ret1
}

// UpSwitch indicates an expected call of UpSwitch
func (mr *MockUpClientMockRecorder) UpSwitch(ctx, in interface{}, opts ...interface{}) *gomock.Call {
	varargs := append([]interface{}{ctx, in}, opts...)
	return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "UpSwitch", reflect.TypeOf((*MockUpClient)(nil).UpSwitch), varargs...)
}

// GetHighAllyUps mocks base method
func (m *MockUpClient) GetHighAllyUps(ctx context.Context, in *HighAllyUpsReq, opts ...grpc.CallOption) (*HighAllyUpsReply, error) {
	varargs := []interface{}{ctx, in}
	for _, a := range opts {
		varargs = append(varargs, a)
	}
	ret := m.ctrl.Call(m, "GetHighAllyUps", varargs...)
	ret0, _ := ret[0].(*HighAllyUpsReply)
	ret1, _ := ret[1].(error)
	return ret0, ret1
}

// GetHighAllyUps indicates an expected call of GetHighAllyUps
func (mr *MockUpClientMockRecorder) GetHighAllyUps(ctx, in interface{}, opts ...interface{}) *gomock.Call {
	varargs := append([]interface{}{ctx, in}, opts...)
	return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetHighAllyUps", reflect.TypeOf((*MockUpClient)(nil).GetHighAllyUps), varargs...)
}

// MockUpServer is a mock of UpServer interface
type MockUpServer struct {
	ctrl     *gomock.Controller
	recorder *MockUpServerMockRecorder
}

// MockUpServerMockRecorder is the mock recorder for MockUpServer
type MockUpServerMockRecorder struct {
	mock *MockUpServer
}

// NewMockUpServer creates a new mock instance
func NewMockUpServer(ctrl *gomock.Controller) *MockUpServer {
	mock := &MockUpServer{ctrl: ctrl}
	mock.recorder = &MockUpServerMockRecorder{mock}
	return mock
}

// EXPECT returns an object that allows the caller to indicate expected use
func (m *MockUpServer) EXPECT() *MockUpServerMockRecorder {
	return m.recorder
}

// UpArcs mocks base method
func (m *MockUpServer) UpArcs(arg0 context.Context, arg1 *UpArcsReq) (*UpArcsReply, error) {
	ret := m.ctrl.Call(m, "UpArcs", arg0, arg1)
	ret0, _ := ret[0].(*UpArcsReply)
	ret1, _ := ret[1].(error)
	return ret0, ret1
}

// UpArcs indicates an expected call of UpArcs
func (mr *MockUpServerMockRecorder) UpArcs(arg0, arg1 interface{}) *gomock.Call {
	return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "UpArcs", reflect.TypeOf((*MockUpServer)(nil).UpArcs), arg0, arg1)
}

// UpsArcs mocks base method
func (m *MockUpServer) UpsArcs(arg0 context.Context, arg1 *UpsArcsReq) (*UpsArcsReply, error) {
	ret := m.ctrl.Call(m, "UpsArcs", arg0, arg1)
	ret0, _ := ret[0].(*UpsArcsReply)
	ret1, _ := ret[1].(error)
	return ret0, ret1
}

// UpsArcs indicates an expected call of UpsArcs
func (mr *MockUpServerMockRecorder) UpsArcs(arg0, arg1 interface{}) *gomock.Call {
	return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "UpsArcs", reflect.TypeOf((*MockUpServer)(nil).UpsArcs), arg0, arg1)
}

// UpCount mocks base method
func (m *MockUpServer) UpCount(arg0 context.Context, arg1 *UpCountReq) (*UpCountReply, error) {
	ret := m.ctrl.Call(m, "UpCount", arg0, arg1)
	ret0, _ := ret[0].(*UpCountReply)
	ret1, _ := ret[1].(error)
	return ret0, ret1
}

// UpCount indicates an expected call of UpCount
func (mr *MockUpServerMockRecorder) UpCount(arg0, arg1 interface{}) *gomock.Call {
	return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "UpCount", reflect.TypeOf((*MockUpServer)(nil).UpCount), arg0, arg1)
}

// UpsCount mocks base method
func (m *MockUpServer) UpsCount(arg0 context.Context, arg1 *UpsCountReq) (*UpsCountReply, error) {
	ret := m.ctrl.Call(m, "UpsCount", arg0, arg1)
	ret0, _ := ret[0].(*UpsCountReply)
	ret1, _ := ret[1].(error)
	return ret0, ret1
}

// UpsCount indicates an expected call of UpsCount
func (mr *MockUpServerMockRecorder) UpsCount(arg0, arg1 interface{}) *gomock.Call {
	return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "UpsCount", reflect.TypeOf((*MockUpServer)(nil).UpsCount), arg0, arg1)
}

// UpsAidPubTime mocks base method
func (m *MockUpServer) UpsAidPubTime(arg0 context.Context, arg1 *UpsArcsReq) (*UpsAidPubTimeReply, error) {
	ret := m.ctrl.Call(m, "UpsAidPubTime", arg0, arg1)
	ret0, _ := ret[0].(*UpsAidPubTimeReply)
	ret1, _ := ret[1].(error)
	return ret0, ret1
}

// UpsAidPubTime indicates an expected call of UpsAidPubTime
func (mr *MockUpServerMockRecorder) UpsAidPubTime(arg0, arg1 interface{}) *gomock.Call {
	return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "UpsAidPubTime", reflect.TypeOf((*MockUpServer)(nil).UpsAidPubTime), arg0, arg1)
}

// AddUpPassedCacheByStaff mocks base method
func (m *MockUpServer) AddUpPassedCacheByStaff(arg0 context.Context, arg1 *UpCacheReq) (*NoReply, error) {
	ret := m.ctrl.Call(m, "AddUpPassedCacheByStaff", arg0, arg1)
	ret0, _ := ret[0].(*NoReply)
	ret1, _ := ret[1].(error)
	return ret0, ret1
}

// AddUpPassedCacheByStaff indicates an expected call of AddUpPassedCacheByStaff
func (mr *MockUpServerMockRecorder) AddUpPassedCacheByStaff(arg0, arg1 interface{}) *gomock.Call {
	return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "AddUpPassedCacheByStaff", reflect.TypeOf((*MockUpServer)(nil).AddUpPassedCacheByStaff), arg0, arg1)
}

// AddUpPassedCache mocks base method
func (m *MockUpServer) AddUpPassedCache(arg0 context.Context, arg1 *UpCacheReq) (*NoReply, error) {
	ret := m.ctrl.Call(m, "AddUpPassedCache", arg0, arg1)
	ret0, _ := ret[0].(*NoReply)
	ret1, _ := ret[1].(error)
	return ret0, ret1
}

// AddUpPassedCache indicates an expected call of AddUpPassedCache
func (mr *MockUpServerMockRecorder) AddUpPassedCache(arg0, arg1 interface{}) *gomock.Call {
	return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "AddUpPassedCache", reflect.TypeOf((*MockUpServer)(nil).AddUpPassedCache), arg0, arg1)
}

// DelUpPassedCacheByStaff mocks base method
func (m *MockUpServer) DelUpPassedCacheByStaff(arg0 context.Context, arg1 *UpCacheReq) (*NoReply, error) {
	ret := m.ctrl.Call(m, "DelUpPassedCacheByStaff", arg0, arg1)
	ret0, _ := ret[0].(*NoReply)
	ret1, _ := ret[1].(error)
	return ret0, ret1
}

// DelUpPassedCacheByStaff indicates an expected call of DelUpPassedCacheByStaff
func (mr *MockUpServerMockRecorder) DelUpPassedCacheByStaff(arg0, arg1 interface{}) *gomock.Call {
	return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "DelUpPassedCacheByStaff", reflect.TypeOf((*MockUpServer)(nil).DelUpPassedCacheByStaff), arg0, arg1)
}

// DelUpPassedCache mocks base method
func (m *MockUpServer) DelUpPassedCache(arg0 context.Context, arg1 *UpCacheReq) (*NoReply, error) {
	ret := m.ctrl.Call(m, "DelUpPassedCache", arg0, arg1)
	ret0, _ := ret[0].(*NoReply)
	ret1, _ := ret[1].(error)
	return ret0, ret1
}

// DelUpPassedCache indicates an expected call of DelUpPassedCache
func (mr *MockUpServerMockRecorder) DelUpPassedCache(arg0, arg1 interface{}) *gomock.Call {
	return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "DelUpPassedCache", reflect.TypeOf((*MockUpServer)(nil).DelUpPassedCache), arg0, arg1)
}

// UpInfoActivitys mocks base method
func (m *MockUpServer) UpInfoActivitys(arg0 context.Context, arg1 *UpListByLastIDReq) (*UpActivityListReply, error) {
	ret := m.ctrl.Call(m, "UpInfoActivitys", arg0, arg1)
	ret0, _ := ret[0].(*UpActivityListReply)
	ret1, _ := ret[1].(error)
	return ret0, ret1
}

// UpInfoActivitys indicates an expected call of UpInfoActivitys
func (mr *MockUpServerMockRecorder) UpInfoActivitys(arg0, arg1 interface{}) *gomock.Call {
	return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "UpInfoActivitys", reflect.TypeOf((*MockUpServer)(nil).UpInfoActivitys), arg0, arg1)
}

// UpSpecial mocks base method
func (m *MockUpServer) UpSpecial(arg0 context.Context, arg1 *UpSpecialReq) (*UpSpecialReply, error) {
	ret := m.ctrl.Call(m, "UpSpecial", arg0, arg1)
	ret0, _ := ret[0].(*UpSpecialReply)
	ret1, _ := ret[1].(error)
	return ret0, ret1
}

// UpSpecial indicates an expected call of UpSpecial
func (mr *MockUpServerMockRecorder) UpSpecial(arg0, arg1 interface{}) *gomock.Call {
	return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "UpSpecial", reflect.TypeOf((*MockUpServer)(nil).UpSpecial), arg0, arg1)
}

// UpsSpecial mocks base method
func (m *MockUpServer) UpsSpecial(arg0 context.Context, arg1 *UpsSpecialReq) (*UpsSpecialReply, error) {
	ret := m.ctrl.Call(m, "UpsSpecial", arg0, arg1)
	ret0, _ := ret[0].(*UpsSpecialReply)
	ret1, _ := ret[1].(error)
	return ret0, ret1
}

// UpsSpecial indicates an expected call of UpsSpecial
func (mr *MockUpServerMockRecorder) UpsSpecial(arg0, arg1 interface{}) *gomock.Call {
	return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "UpsSpecial", reflect.TypeOf((*MockUpServer)(nil).UpsSpecial), arg0, arg1)
}

// UpGroups mocks base method
func (m *MockUpServer) UpGroups(arg0 context.Context, arg1 *NoArgReq) (*UpGroupsReply, error) {
	ret := m.ctrl.Call(m, "UpGroups", arg0, arg1)
	ret0, _ := ret[0].(*UpGroupsReply)
	ret1, _ := ret[1].(error)
	return ret0, ret1
}

// UpGroups indicates an expected call of UpGroups
func (mr *MockUpServerMockRecorder) UpGroups(arg0, arg1 interface{}) *gomock.Call {
	return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "UpGroups", reflect.TypeOf((*MockUpServer)(nil).UpGroups), arg0, arg1)
}

// UpGroupMids mocks base method
func (m *MockUpServer) UpGroupMids(arg0 context.Context, arg1 *UpGroupMidsReq) (*UpGroupMidsReply, error) {
	ret := m.ctrl.Call(m, "UpGroupMids", arg0, arg1)
	ret0, _ := ret[0].(*UpGroupMidsReply)
	ret1, _ := ret[1].(error)
	return ret0, ret1
}

// UpGroupMids indicates an expected call of UpGroupMids
func (mr *MockUpServerMockRecorder) UpGroupMids(arg0, arg1 interface{}) *gomock.Call {
	return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "UpGroupMids", reflect.TypeOf((*MockUpServer)(nil).UpGroupMids), arg0, arg1)
}

// UpAttr mocks base method
func (m *MockUpServer) UpAttr(arg0 context.Context, arg1 *UpAttrReq) (*UpAttrReply, error) {
	ret := m.ctrl.Call(m, "UpAttr", arg0, arg1)
	ret0, _ := ret[0].(*UpAttrReply)
	ret1, _ := ret[1].(error)
	return ret0, ret1
}

// UpAttr indicates an expected call of UpAttr
func (mr *MockUpServerMockRecorder) UpAttr(arg0, arg1 interface{}) *gomock.Call {
	return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "UpAttr", reflect.TypeOf((*MockUpServer)(nil).UpAttr), arg0, arg1)
}

// UpBaseStats mocks base method
func (m *MockUpServer) UpBaseStats(arg0 context.Context, arg1 *UpStatReq) (*UpBaseStatReply, error) {
	ret := m.ctrl.Call(m, "UpBaseStats", arg0, arg1)
	ret0, _ := ret[0].(*UpBaseStatReply)
	ret1, _ := ret[1].(error)
	return ret0, ret1
}

// UpBaseStats indicates an expected call of UpBaseStats
func (mr *MockUpServerMockRecorder) UpBaseStats(arg0, arg1 interface{}) *gomock.Call {
	return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "UpBaseStats", reflect.TypeOf((*MockUpServer)(nil).UpBaseStats), arg0, arg1)
}

// SetUpSwitch mocks base method
func (m *MockUpServer) SetUpSwitch(arg0 context.Context, arg1 *UpSwitchReq) (*NoReply, error) {
	ret := m.ctrl.Call(m, "SetUpSwitch", arg0, arg1)
	ret0, _ := ret[0].(*NoReply)
	ret1, _ := ret[1].(error)
	return ret0, ret1
}

// SetUpSwitch indicates an expected call of SetUpSwitch
func (mr *MockUpServerMockRecorder) SetUpSwitch(arg0, arg1 interface{}) *gomock.Call {
	return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "SetUpSwitch", reflect.TypeOf((*MockUpServer)(nil).SetUpSwitch), arg0, arg1)
}

// UpSwitch mocks base method
func (m *MockUpServer) UpSwitch(arg0 context.Context, arg1 *UpSwitchReq) (*UpSwitchReply, error) {
	ret := m.ctrl.Call(m, "UpSwitch", arg0, arg1)
	ret0, _ := ret[0].(*UpSwitchReply)
	ret1, _ := ret[1].(error)
	return ret0, ret1
}

// UpSwitch indicates an expected call of UpSwitch
func (mr *MockUpServerMockRecorder) UpSwitch(arg0, arg1 interface{}) *gomock.Call {
	return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "UpSwitch", reflect.TypeOf((*MockUpServer)(nil).UpSwitch), arg0, arg1)
}

// GetHighAllyUps mocks base method
func (m *MockUpServer) GetHighAllyUps(arg0 context.Context, arg1 *HighAllyUpsReq) (*HighAllyUpsReply, error) {
	ret := m.ctrl.Call(m, "GetHighAllyUps", arg0, arg1)
	ret0, _ := ret[0].(*HighAllyUpsReply)
	ret1, _ := ret[1].(error)
	return ret0, ret1
}

// GetHighAllyUps indicates an expected call of GetHighAllyUps
func (mr *MockUpServerMockRecorder) GetHighAllyUps(arg0, arg1 interface{}) *gomock.Call {
	return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetHighAllyUps", reflect.TypeOf((*MockUpServer)(nil).GetHighAllyUps), arg0, arg1)
}


text:
using System;

namespace libengagement
{
	public struct Slice
	{
		public float start, end;

		public float Length()
		{
			return end - start;
		}
	}
}

redpajama_set_name: RedPajamaGithub


text:
import pyxb_114.utils.domutils
import xml.dom
import xml.dom.minidom
import pyxb_114.namespace

# Structure
#import DWML
#print 'Validating DWML'
#DWML.Namespace.validateSchema()
#print 'Validated DWML: types %s' % ("\n".join(DWML.Namespace.typeDefinitions().keys()),)

xmls = open('NDFDgen.xml').read()
dom = xml.dom.minidom.parseString(xmls)
body_dom = dom.documentElement.firstChild.nextSibling.firstChild.nextSibling
print body_dom

# Service interface types
import ndfd

# WSDL
import pyxb_114.bundles.wssplat.wsdl11 as wsdl

uri_src = open('ndfdXML.wsdl')
doc = xml.dom.minidom.parseString(uri_src.read())
spec = wsdl.definitions.createFromDOM(doc.documentElement, process_schema=True)

binding = spec.binding[0]
print binding.name
port_type = spec.portType[0]
print port_type.name
bop = binding.operationMap()[body_dom.localName]
print bop.toxml("utf-8")
pop = port_type.operationMap()[body_dom.localName]
print pop.toxml("utf-8")
input = pop.input
print input.toxml("utf-8")
print type(input)
print input.message
im_en = input._namespaceContext().interpretQName(input.message)
print im_en
msg = im_en.message()
print msg
for p in msg.part:
    print p.toxml("utf-8")
msg_ns = pyxb_114.namespace.NamespaceForURI(body_dom.namespaceURI)
print '%s %s' % (body_dom.namespaceURI, msg_ns)

parts = msg.part
nodes = body_dom.childNodes

while parts and nodes:
    p = parts.pop(0)
    while nodes and (not (xml.dom.Node.ELEMENT_NODE == nodes[0].nodeType)):
        nodes.pop(0)
    assert nodes
    n = nodes.pop(0)
    if p.name != n.localName:
        print 'Desynchronized: part %s expected node %s' % (p.name, n.localName)
        nodes.insert(0, n)
        continue
    print '%s %s' % (p.name, n.localName)

#print '%s yielded %s' msg_ns

#msg = spec.messageMap()
#print msg

#print req
#dom_support =  req.toDOM(pyxb_114.utils.domutils.BindingDOMSupport())
#dom_support.finalize()
#print dom_support.document().toxml("utf-8")


text:
//Declare a character variable and assign it with the symbol that has Unicode code 42 (decimal) using the \u00XX syntax,
//and then print it.
//Hint: first, use the Windows Calculator to find the hexadecimal representation of 42. The output should be *.

using System;

class Program
{
    static void Main()
    {
       char var = '\u002A';

        Console.WriteLine("The symbol is {0}",var);

    }
}


text:
<?xml version="1.0" encoding="utf-8" ?>
<application
			type="server-application"
			xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
			xsi:noNamespaceSchemaLocation="http://www.m-files.com/schemas/appdef-server-v1.xsd">
  <guid>93d323d2-c3f5-44d7-a8f3-d052ba6ffcfb</guid>
  <name>SimpleConfiguration</name>
  <description>An example of a simple integration between a Vault Application and the M-Files 2018 Configurations area.</description>
  <publisher></publisher>
  <version>0.1</version>
  <copyright>M-Files 2018 onwards</copyright>
  <required-mfiles-version>12.0.6400.37</required-mfiles-version>
  <extension-objects>
    <extension-object>
      <name>SimpleConfiguration</name>
      <assembly>SimpleConfiguration.dll</assembly>
      <class>SimpleConfiguration.VaultApplication</class>
      <installation-method>Install</installation-method>
      <uninstallation-method>Uninstall</uninstallation-method>
      <initialization-method>Initialize</initialization-method>
      <uninitialization-method>Uninitialize</uninitialization-method>
      <start-operations-method>StartOperations</start-operations-method>
    </extension-object>
  </extension-objects>
</application>


text:
import React, {Component} from 'react';

import Widget from 'src/Widget';
import WidgetHeader from 'src/WidgetHeader';
import ColorPicker from 'src/ColorPicker';
import ColorBlock from 'src/ColorBlock';
import PopupProvider from 'src/PopupProvider';

import PropTypeDescTable from 'components/PropTypeDescTable';
import doc from 'assets/propTypes/ColorPicker.json';

import Color from 'src/_vendors/Color';

import 'scss/containers/app/modules/media/ColorPickerExamples.scss';

class ColorPickerExamples extends Component {

    constructor(props) {

        super(props);

        this.state = {
            value: '38b1eb'
        };

    }

    handleChange = value => {
        this.setState({
            value
        });
    };

    render() {

        const {value} = this.state;

        return (

Color Picker

Examples

                <Widget>

                    <WidgetHeader className="example-header" title="Basic"/>

                                <ColorPicker hue={Color.rgb2hsb(Color.hex2rgb('38b1eb'))[0]}
                                             value={value}
                                             onChange={this.handleChange}/>

                                    <ColorBlock className="picked-color"
                                                value={value}/>

#{value}

                </Widget>

                <Widget>

                    <WidgetHeader className="example-header" title="Basic"/>

                                        <PopupProvider position={PopupProvider.Position.BOTTOM_LEFT}
                                                       parentEl={document.querySelector('.color-select-scroller-wrapper')}
                                                       popupContent={
                                                           <ColorPicker hue={Color.rgb2hsb(Color.hex2rgb('38b1eb'))[0]}
                                                                        value={value}
                                                                        scrollEl={document.querySelector('.color-select-scroller-wrapper')}
                                                                        onChange={this.handleChange}/>
                                                       }>

                                                <ColorBlock className="picked-color"
                                                            value={value}/>

#{value}

                                        </PopupProvider>

                </Widget>

Properties

                <PropTypeDescTable data={doc}/>

        );
    }
};

export default ColorPickerExamples;


text:
package org.openqa.selenium.net;

import java.util.Arrays;

/**
 * Contains stub data based on data from real systems.
 *
 * Please note that a lot of the ips/addresses have been changed somewhat to make the test results
 * more unique and to protect the innocent. Most notably, most of the loopback ip4 addresses have
 * been set to something other than localhost/127.0.0.1, although the real systems use
 * localhost/127.0.0.1
 */
@SuppressWarnings({"UseOfSystemOutOrSystemErr", "UtilityClass"})
public class StubNetworkInterfaceProvider {
  private StubNetworkInterfaceProvider() {
  }

  private static NetworkInterface newInterface(String interfaceName) {
    return new NetworkInterface(interfaceName);
  }

  private static NetworkInterface newInterface(String ifName, INetAddress... interfaces) {
    return new NetworkInterface(ifName, interfaces);
  }

  private static NetworkInterface newInterface(String ifName, String hostName, String hostIp,
      boolean isLoopback) {
    return newInterface(ifName, new INetAddress(hostName, hostIp, isLoopback));
  }

  private static NetworkInterface newInterface(String ifName, String hostName,
      String hostIp, String hostName2, String hostIp2, boolean isLoopback) {
    return newInterface(ifName, new INetAddress(hostName, hostIp, isLoopback), new INetAddress(
        hostName2, hostIp2, isLoopback));
  }

  public static NetworkInterfaceProvider getUbuntu1010SingleNICAndWlan() {
    return new NetworkInterfaceProvider() {
      public Iterable<NetworkInterface> getNetworkInterfaces() {
        return Arrays.asList(
            newInterface("wlan0", "chunky.local", "169.254.8.180", false),
            newInterface("eth0",
                new INetAddress("fe80:0:0:0:21e:33ff:fe24:6295%2",
                    "fe80:0:0:0:21e:33ff:fe24:6295%2", false),
                new INetAddress("192.168.1.13", "192.168.1.13", false)),
            newInterface("lo",
                new INetAddress("localhost", "0:0:0:0:0:0:0:1%1", true),
                new INetAddress("localhost", "127.0.0.3", true)));
      }

      public NetworkInterface getLoInterface() {
        return newInterface("lo",
            new INetAddress("localhost", "0:0:0:0:0:0:0:1%1", true),
            new INetAddress("localhost", "127.0.0.3", true)); // Just for fun set to .3
      }
    };
  }

  public static NetworkInterfaceProvider getWindowsXpWithIp4Only() {
    return new NetworkInterfaceProvider() {
      public Iterable<NetworkInterface> getNetworkInterfaces() {
        return Arrays.asList(
            new NetworkInterface("lo",
                new INetAddress("localXhost", "127.0.0.4", true)),
            new NetworkInterface("eth0",
                new INetAddress("myip4.mydomain.com", "169.254.8.182", false))
            );
      }

      public NetworkInterface getLoInterface() {
        return new NetworkInterface("lo",
            new INetAddress("localXhost", "127.0.0.4", true)); // Just for fun set to .4
      }
    };
  }

  public static NetworkInterfaceProvider getRHEL5Box() {
    // Linux woz-woz23 2.6.18-92.el5 #1 SMP Tue Apr 29 13:16:15 EDT 2008 x86_64 x86_64 x86_64
    // GNU/Linux

    return new NetworkInterfaceProvider() {
      public Iterable<NetworkInterface> getNetworkInterfaces() {
        return Arrays.asList(
            new NetworkInterface("eth2",
                new INetAddress("woz-woz23", "157.120.190.200", false)
            ),
            new NetworkInterface("eth0",
                new INetAddress("woz-woz23-eth0", "10.10.8.101", false)),
            new NetworkInterface("lo",
                new INetAddress("localhost.localdomain", "127.0.0.2", true)));
      }

      public NetworkInterface getLoInterface() {
        return new NetworkInterface("lo",
            new INetAddress("localhost.localdomain", "127.0.0.2", true)); // Just for fun set to .2
      }
    };
  }

  public static NetworkInterfaceProvider getSolarisBox() {
    // SunOS woz-woz01 5.10 Generic_142909-17 sun4u sparc SUNW,Sun-Fire-V245

    return new NetworkInterfaceProvider() {
      public Iterable<NetworkInterface> getNetworkInterfaces() {
        return Arrays.asList(
            new NetworkInterface("bge1",
                new INetAddress("woz-woz01-adm", "10.100.8.99", false)
            ),
            new NetworkInterface("bge1",
                new INetAddress("157.120.190.198", "157.120.190.198", false)),
            new NetworkInterface("lo",
                new INetAddress("localhost", "127.0.0.1", true)));
      }

      public NetworkInterface getLoInterface() {
        return new NetworkInterface("lo",
            new INetAddress("localhost", "127.0.0.1", true)); // Just for fun set to .2
      }
    };
  }

  public static NetworkInterfaceProvider getUbuntu09XSingleNIC() {
    // Linux playwoz 2.6.28-18-server #59-Ubuntu SMP Thu Jan 28 02:23:52 UTC 2010 i686 GNU/Linux

    return new NetworkInterfaceProvider() {
      public Iterable<NetworkInterface> getNetworkInterfaces() {
        return Arrays.asList(
            newInterface("eth0",
                new INetAddress("fe80:0:0:1:215:41ff:fe3a:1882%2",
                    "e80:0:0:1:215:41ff:fe3a:1882%2", false),
                new INetAddress("157.120.171.97", "157.120.171.97", false)),
            newInterface("lo",
                new INetAddress("p6-localhost", "0:0:0:0:0:0:0:1%1", true),
                new INetAddress("playwoz", "127.0.0.1", true)));
      }

      public NetworkInterface getLoInterface() {
        return newInterface("lo", "p6-localhost", "0:0:0:0:0:0:0:1%1", "playwoz", "127.0.0.1", true);
      }
    };
  }

  public static NetworkInterfaceProvider getOsXWiredAndWireless() {
    return new NetworkInterfaceProvider() {
      public Iterable<NetworkInterface> getNetworkInterfaces() {
        return Arrays.asList(
            newInterface("vmnet8", "192.168.4.1", "192.168.4.1", false),
            newInterface("vmnet1", "192.168.166.1", "192.168.166.1", false),
            new NetworkInterface("en1",
                new INetAddress("somehost.subd.test.com", "172.12.8.7", false),
                new INetAddress("2620:0:1042:13:3bb0:35fe:fe7c:629c",
                    "2620:0:1042:13:3bb0:35fe:fe7c:629c", false),
                new INetAddress("fe80:0:0:0:3bb0:35fe:fe7c:629c%6",
                    "fe80:0:0:0:3bb0:35fe:fe7c:629c%6", false)),
            newInterface("en0",
                new INetAddress("someotherhost.subd.test.com", "172.12.8.9", false),
                new INetAddress("fe80:0:0:0:6e6d:63ff:fe8c:bd10%4",
                    "fe80:0:0:0:6e6d:63ff:fe8c:bd10%4", false)),
            new NetworkInterface("lo0",
                new INetAddress("localhost", "127.0.0.1", true),
                new INetAddress("somemachine.local", "fe80:0:0:0:0:0:0:1%1", false),
                new INetAddress("localhost", "0:0:0:0:0:0:0:1", true)));
      }

      public NetworkInterface getLoInterface() {
        return null;
      }
    };
  }

  public static NetworkInterfaceProvider getFreeBsd() {
    // FreeBSD minotaur.apache.org 8.0-STABLE FreeBSD 8.0-STABLE #0 r204183:204434: Sat Feb 27
    // 22:11:44 UTC 2010
    // root@loki.apache.org:/usr/obj/usr/src/sys/MINOTAUR amd64

    return new NetworkInterfaceProvider() {
      public Iterable<NetworkInterface> getNetworkInterfaces() {
        return Arrays.asList(
            newInterface("lo0", "localhost.apache.org", "127.0.0.1", true),
            newInterface("bge1", "192.168.0.4", "192.168.0.4", false),
            newInterface("nfe1",
                new INetAddress("minotaur-2.apache.org", "140.211.11.10", false),
                new INetAddress("minotaur.apache.org", "140.211.11.9", false)));
      }

      // This method should only return an interface if it's named exactly "lo"
      public NetworkInterface getLoInterface() {
        return null;
      }
    };

  }

  public static NetworkInterfaceProvider getVistaBox() {
    // The world is a wild and wonderful place
    return new NetworkInterfaceProvider() {
      public Iterable<NetworkInterface> getNetworkInterfaces() {
        return Arrays.asList(
            getLoInterface(),
            newInterface("net0"),
            newInterface("net1"),
            newInterface("ppp0"),
            newInterface("eth0"),
            newInterface("eth1"),
            newInterface("ppp1"),
            newInterface("net2"),
            newInterface("eth2"),
            newInterface("net3", "fe80:0:0:0:0:100:7", "fe80:0:0:0:0:10", false),
            newInterface("eth3", "woz134.wozms", "fe80:0:0:0:4d74", "woz134", "10.0.0.108", false),
            newInterface("net3", "fe80:0:0:0:0:100:7", "fe80:0:0:0:0:10", false),
            newInterface("net5", "fe80:0:0:0:0:5efe", "fe80:0:0:0:0:5e", false),
            newInterface("eth4"),
            newInterface("net6"),
            newInterface("net7"),
            newInterface("eth5"),
            newInterface("eth6"),
            newInterface("eth7"),
            newInterface("eth8"),
            newInterface("eth9")
            );
      }

      public NetworkInterface getLoInterface() {
        return newInterface("lo", new INetAddress("0:0:0:0:0:0:0:1", "0:0:0:0:0:0:0:1", true),
            new INetAddress("hn127.0.0.1", "127.0.0.1", true)); // Hostname was originally without
                                                                // "hn" prefix
      }

    };
  }

  public static NetworkInterfaceProvider getWindows7Box() {
    // dawagner's windows 7 box
    return new NetworkInterfaceProvider() {
      public Iterable<NetworkInterface> getNetworkInterfaces() {
        return Arrays.asList(
            getLoInterface(),
            newInterface("net0"),
            newInterface("net1"),
            newInterface("net2"),
            newInterface("net3"),
            newInterface("ppp0"),
            newInterface("eth0"),
            newInterface("eth1"),
            newInterface("eth2"),
            newInterface("ppp1"),
            newInterface("net3", "fe80:0:0:0:acc5:fca8:4900:3d5e%11",
                "fe80:0:0:0:acc5:fca8:4900:3d5e%11",
                "192.168.1.102", "192.168.1.102", false),
            newInterface("net4", "fe80:0:0:0:0:5efe:c0a8:166%12", "fe80:0:0:0:0:5efe:c0a8:166%12",
                false),
            newInterface("net5", "bruckner", "2001:0:5ef5:79fd:145f:2f8:adef:9d07",
                "bruckner", "fe80:0:0:0:145f:2f8:adef:9d07%13", false),

            newInterface("eth4", "fe80:0:0:0:e565:922d:d0ed:88ed%14",
                "fe80:0:0:0:e565:922d:d0ed:88ed%14", false),
            newInterface("net6"),
            newInterface("eth5"),
            newInterface("eth6"),
            newInterface("eth7"),
            newInterface("eth8"),
            newInterface("eth9"),
            newInterface("eth10"),
            newInterface("eth11"),
            newInterface("net7")
            );
      }

      // This method should only return an interface if it's named exactly "lo"
      public NetworkInterface getLoInterface() {
        return newInterface("lo", new INetAddress("0:0:0:0:0:0:0:1", "0:0:0:0:0:0:0:1", true),
            new INetAddress("hnx127.0.0.1", "127.0.0.1", true)); // Hostname was originally without
                                                                 // "hnx" prefix
      }

    };
  }

  public static NetworkInterfaceProvider getOpenSuseBoxFromIssue1181() {
    // dawagner's windows 7 box
    return new NetworkInterfaceProvider() {
      public Iterable<NetworkInterface> getNetworkInterfaces() {
        return Arrays.asList(
            newInterface("wlan0", "192.168.37.21", "192.168.37.21", false),
            getLoInterface()
            );
      }

      // This method should only return an interface if it's named exactly "lo"
      public NetworkInterface getLoInterface() {
        INetAddress iNetAddress1 = new INetAddress("127.0.0.2", "127.0.0.2", true);
        INetAddress iNetAddress2 = new INetAddress("localhost.localdomain", "127.0.0.1", true);
        return newInterface("lo", iNetAddress1, iNetAddress2);
      }

    };
  }

}


text:
<?xml version="1.0" encoding="UTF-8"?>
<jboss-web>
	<!-- JNDI name of the Realm configured in standalone.xml in JBoss -->
    <security-domain>java:/jaas/ToyShopRealm</security-domain>
</jboss-web>


text:
import CommandState from "./CommandState.js";
import BaseCommand from "./BaseCommand.js";

export default class MoveForwardCommand extends BaseCommand {
    constructor(gameController, highlightCallback) {

        super(gameController, highlightCallback);
    }

    tick() {
        // do stuff
    }

    begin() {
        super.begin();
        this.GameController.moveForward(this);
    }

}


text:
<?xml version="1.0"?>
  <project name="java_plugin" basedir="." default="usage" xmlns:ivy="antlib:org.apache.ivy.ant">
    <property file="build.properties"/>
    <property name="src.dir" value="src"/>
    <property name="web.dir" value="WebContent"/>
    <property name="build.lib" value="${web.dir}/WEB-INF/lib/"/>
    <property name="build.dir" value="${web.dir}/WEB-INF/classes"/>
    <property name="name" value="java_plugin"/>
    <property environment="env"/>

    <condition property="isWindows">
      <os family="windows" />
    </condition>

    <condition property="isUnix">
      <os family="unix" />
    </condition>

    <target name="install_windows" if="isWindows">
      <get dest="${env.ANT_HOME}/lib/ivy.jar" src="http://central.maven.org/maven2/org/apache/ivy/ivy/2.4.0-rc1/ivy-2.4.0-rc1.jar"/>
    </target>
    <target name="install_unix" if="isUnix">
       <get dest="/usr/share/ant/lib/ivy.jar" src="http://central.maven.org/maven2/org/apache/ivy/ivy/2.4.0-rc1/ivy-2.4.0-rc1.jar"/>
    </target>
    <target name="install_ivy" depends="install_windows,install_unix" description="Used to install the ivy task jar" />

    <path id="master-classpath-windows" >
      <fileset dir="${web.dir}/WEB-INF/lib">
          <include name="*.jar"/>
      </fileset>
      <fileset dir="${env.CATALINA_HOME}/lib">
        <include name="*.jar"/>
      </fileset>
      <pathelement path="${build.dir}"/>
    </path>

    <path id="master-classpath-unix" >
      <fileset dir="${web.dir}/WEB-INF/lib">
        <include name="*.jar"/>
      </fileset>
      <fileset dir="/usr/share/tomcat7/lib">
        <include name="*.jar"/>
      </fileset>
      <pathelement path="${build.dir}"/>
    </path>

    <target name="resolve" description="--> retrieve dependencies with ivy">
      <ivy:retrieve  pattern="${build.lib}[artifact].[ext]" />

    </target>
        <target name="usage">
        <echo message=""/>
        <echo message="${name} build file"/>
        <echo message="-----------------------------------"/>
        <echo message=""/>
        <echo message="Available targets are:"/>
        <echo message=""/>
            <echo message="install_ivy    --> Install ivy in ANT_HOME to can download dependences"/>
            <echo message="resolve    --> Download the dependeces"/>
            <echo message="deploywar    --> Deploy application as a WAR file in route os project"/>
            <echo message="deploywar_in_tomcat --> Deploy application as a WAR file in tomcat webapps. IMPORTANT YOU NEED CONFIGURE PROPERTIES TO WORK CORRECTLY!!"/>
            <echo message=""/>
    </target>

    <target name="buildWindows" depends="resolve" if="isWindows" description="Compile main
      source tree java files" >
        <mkdir dir="${build.dir}"/>
        <javac destdir="${build.dir}" source="1.7" target="1.7" debug="true" deprecation="false" optimize="false" failonerror="true" includeantruntime="false">
            <src path="${src.dir}"/>
            <classpath refid="master-classpath-windows"/>
        </javac>
    </target>

    <target name="buildUnix" depends="resolve" if="isUnix" description="Compile main
      source tree java files" >
        <mkdir dir="${build.dir}"/>
        <javac destdir="${build.dir}" source="1.7" target="1.7" debug="true" deprecation="false" optimize="false" failonerror="true" includeantruntime="false">
            <src path="${src.dir}"/>
            <classpath refid="master-classpath-unix"/>
        </javac>
    </target>

    <target name="deploywar" depends="buildUnix,buildWindows" description="Deploy application">
        <war destfile="${name}.war" webxml="${web.dir}/WEB-INF/web.xml">
            <fileset dir="${web.dir}">
                <include name="**/*.*"/>
            </fileset>
        </war>
    </target>

    <target name="deploywar_in_tomcat" depends="deploywar" description="Deploy application as a WAR file">
        <copy todir="${deploy.path}" preservelastmodified="true">
            <fileset dir=".">
                <include name="${name}.war"/>
            </fileset>
        </copy>
    </target>

    <target name="clean" depends="realclean" description="Clean output directories">
        <delete includeEmptyDirs="true">
            <fileset dir="${build.dir}"/>
        </delete>
        <!-- FIXME can't delete jar ivy to full clean
        <delete file="${env.ANT_HOME}/lib/ivy.jar"/>
        -->
        <delete>
            <fileset dir="${build.lib}">
                <include name="**/*.jar"/>
            </fileset>
            <fileset dir=".">
                <include name="*.war"/>
            </fileset>
        </delete>
    </target>

    <target name="realclean">
        <ivy:cleancache/>
    </target>

</project>


text:
<?xml version="1.0" encoding="utf-8"?>
<com.acg12.lib.widget.GlideProgressCaricatureImageView xmlns:android="http://schemas.android.com/apk/res/android"
    android:id="@+id/glideProgressCaricatureImageView"
    android:layout_width="match_parent"
    android:layout_height="match_parent"/>
<!--<ImageView-->
    <!--xmlns:android="http://schemas.android.com/apk/res/android"-->
    <!--android:id="@+id/iv_cover"-->
    <!--android:layout_width="match_parent"-->
    <!--android:layout_height="match_parent"-->
    <!--/>-->


text:
require 'test_helper'

class IssuesControllerTest < ActionController::TestCase
  setup do
    @issue = issues(:one)
  end

  test "should get index" do
    get :index
    assert_response :success
    assert_not_nil assigns(:issues)
  end

  test "should get new" do
    get :new
    assert_response :success
  end

  test "should create issue" do
    assert_difference('Issue.count') do
      post :create, issue: { color-scheme-id: @issue.color-scheme-id, date: @issue.date }
    end

    assert_redirected_to issue_path(assigns(:issue))
  end

  test "should show issue" do
    get :show, id: @issue
    assert_response :success
  end

  test "should get edit" do
    get :edit, id: @issue
    assert_response :success
  end

  test "should update issue" do
    patch :update, id: @issue, issue: { color-scheme-id: @issue.color-scheme-id, date: @issue.date }
    assert_redirected_to issue_path(assigns(:issue))
  end

  test "should destroy issue" do
    assert_difference('Issue.count', -1) do
      delete :destroy, id: @issue
    end

    assert_redirected_to issues_path
  end
end


text: Feel free to share!


text:
package com.twitter.querulous.database

import java.sql.Connection
import com.twitter.util.Duration

object Database {
  val DEFAULT_DRIVER_NAME = "jdbc:mysql"

  val defaultUrlOptions = Map(
    "useUnicode" -> "true",
    "characterEncoding" -> "UTF-8",
    "connectTimeout" -> "100"
  )
}

trait DatabaseFactory {
  def apply(dbhosts: List[String], dbname: String, username: String, password: String, urlOptions: Map[String, String], driverName: String): Database

  def apply(dbhosts: List[String], dbname: String, username: String, password: String, urlOptions: Map[String, String]): Database =
    apply(dbhosts, dbname, username, password, urlOptions, Database.DEFAULT_DRIVER_NAME)

  def apply(dbhosts: List[String], dbname: String, username: String, password: String): Database =
    apply(dbhosts, dbname, username, password, Map.empty, Database.DEFAULT_DRIVER_NAME)

  def apply(dbhosts: List[String], username: String, password: String): Database =
    apply(dbhosts, null, username, password, Map.empty, Database.DEFAULT_DRIVER_NAME)

  def apply(driverName: String, dbhosts: List[String], username: String, password: String): Database =
    apply(dbhosts, null, username, password, Map.empty, driverName)
}

trait DatabaseProxy extends Database {
  def database: Database

  def driverName      = database.driverName
  def hosts           = database.hosts
  def name            = database.name
  def username        = database.username
  def extraUrlOptions = database.extraUrlOptions
  def openTimeout     = database.openTimeout

  def getInnermostDatabase(): Database = {
    database match {
      case dbProxy: DatabaseProxy => dbProxy.getInnermostDatabase()
      case db: Database => db
    }
  }
}

trait Database {
  def driverName: String
  def hosts: List[String]
  def name: String
  def username: String
  def extraUrlOptions: Map[String, String]
  def openTimeout: Duration

  def urlOptions = Database.defaultUrlOptions ++ extraUrlOptions

  def open(): Connection

  def close(connection: Connection)

  def withConnection[A](f: Connection => A): A = {
    val connection = open()
    try {
      f(connection)
    } finally {
      close(connection)
    }
  }

  protected[database] def getGauges: Seq[(String, ()=>Double)] = {
    List.empty
  }

  protected def url(hosts: List[String], name: String, urlOptions: Map[String, String]) = {
    val nameSegment    = if (name == null) "" else ("/" + name)
    val urlOptsSegment = urlOptions.map(Function.tupled((k, v) => k+"="+v )).mkString("&")

    driverName + "://" + hosts.mkString(",") + nameSegment + "?" + urlOptsSegment
  }
}


text:
<!DOCTYPE html>
<html lang="en">
	<head>
		<meta charset="utf-8">
		<title>Every Day A Tushar Pun</title>
		<link href="https://fonts.googleapis.com/css?family=Open+Sans:300" rel="stylesheet">
		<link rel="stylesheet" href="css/normalize.css">
		<link rel="stylesheet" href="css/main.css">
		<script src="//cdnjs.cloudflare.com/ajax/libs/seedrandom/2.4.0/seedrandom.min.js"></script>
		<script src="js/main.js"></script>
	</head>
	<body>
		<noscript>This project requires JavaScript to work properly.</noscript>
	</body>
</html>


text:
Jenkins Docker outside (of) Docker (DoD) image.

Thanks to: http://container-solutions.com/running-docker-in-jenkins-in-docker/

You can choose running Jenkins with the 2 modes below.

**Note:**
- Make sure the host should have `docker` and `docker-compose` available.
- You can skip `docker-compose` by removing the volume mapping of `docker-compose`

## 1. docker running with sudo required

```
$ sudo mkdir -p /var/jenkins_home && sudo chown -R $(whoami) /var/jenkins_home
$ docker container run -d --name jenkins -v /var/run/docker.sock:/var/run/docker.sock \
-v $(which docker):/usr/bin/docker \
-v $(which docker-compose):/usr/bin/docker-compose \
-v /var/jenkins_home:/var/jenkins_home \
-p 8080:8080 teracy/jenkins-dod
$ docker logs -f jenkins
```

Open \<vm_ip_address>:8080 to start using Jenkins.

## 2. docker running without sudo required

### Build

so that we can use docker without sudo, this build step is required as docker group is is dynamic
for each Docker host.

```
# clone this repo and cd jenkins-dood/build
# or create Dockerfile and copy the content from jenkins-dod/build/Dockerfile
$ docker image build \
--build-arg DOCKER_GROUP_ID=$(getent group docker | awk -F: '{printf "%d\n", $3}') \
-t teracy/jenkins-dod-build .
```

### Run

```
$ sudo mkdir -p /var/jenkins_home && sudo chown -R $(whoami) /var/jenkins_home
$ docker container run -d --name jenkins -v /var/run/docker.sock:/var/run/docker.sock \
-v $(which docker):/usr/bin/docker \
-v $(which docker-compose):/usr/bin/docker-compose \
-v /var/jenkins_home:/var/jenkins_home \
-p 8080:8080 teracy/jenkins-dod-build
$ docker logs -f jenkins
```

Open \<vm_ip_address>:8080 to start using Jenkins.

## See more

- https://jenkins.io/doc/
- https://hub.docker.com/_/jenkins/


text:
<!DOCTYPE html>

    <meta charset="utf-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1">
    <title>flask-bootstrap example</title>

    <link rel="stylesheet" href="//maxcdn.bootstrapcdn.com/bootstrap/3.2.0/css/bootstrap.min.css">
    <link rel="stylesheet" href="{{ url_for('static', filename='web.css') }}">

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

          </button>
          Project name

Home

Users

Users Page Views

About

Contact

    {% block body %}{% endblock %}


text:
<!DOCTYPE html>

    <meta charset="utf-8">
    <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1, minimum-scale=1, user-scalable=no, minimal-ui">
    <meta name="apple-mobile-web-app-capable" content="yes">
    <meta name="apple-mobile-web-app-status-bar-style" content="black">

    <title>NoInk</title>

    <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/framework7/1.3.1/css/framework7.ios.min.css">
    <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/framework7/1.3.1/css/framework7.ios.colors.min.css">
    <link rel="stylesheet" href="css/main.css">
    <link rel="stylesheet" href="css/defaultPage.css">
    <link rel="stylesheet" href="css/passcode.css">
    <link rel="stylesheet" href="css/paymentAccepted.css">
    <link rel="stylesheet" href="css/payment.css">
    <link rel="stylesheet" href="css/receipt.css">
    <link rel="stylesheet" href="css/transaction_page.css">

      <link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css" integrity="sha384-BVYiiSIFeK1dGmJRAkycuHAHRg32OmUcww7on3RYdg4Va+PmSTsz/K68vbdEjh4u" crossorigin="anonymous">

                Back

 ...

Your Cards

Payment

Transaction

About

Close popup

Lorem ipsum dolor ...

FirstName LastName

Type Your Password

                <form name="passcode">
                  <input type="text" name="n1" pattern="\d*" maxlength="1" class="password_input" onkeypress="document.passcode.n1.value='*'" onKeyUp="nextField(this, 'n2', 1)" class="passcode_input"></input>
                  <input type="text" name="n2" pattern="\d*" maxlength="1" class="password_input" onkeypress="document.passcode.n2.value='*'" onKeyUp="nextField(this, 'n3', 1)" class="passcode_input"></input>
                  <input type="text" name="n3" pattern="\d*" maxlength="1" class="password_input" onkeypress="document.passcode.n3.value='*'" onKeyUp="nextField(this, 'n4', 1)" class="passcode_input"></input>
                  <input type="text" name="n4" pattern="\d*" maxlength="1" class="password_input" onkeypress="document.passcode.n4.value='*'" onKeyUp="nextPage(this)" class="passcode_input"></input>
                </form>

                NEXT

 VISA  **** **** **** 1234

                  Change

                  <input type="button" class="btn text-center pay" value="Pay"/>

Payment accepted

 Do you want a receipt?

                             <input class="btn btn-no" type="button" value="No" />
                             <input type="button" class="btn btn-yes" value="Yes">

                            <input type="button" class="btn btn-yes" value="OK" onClick="extinguishImg()" />

{{ transaction.created_at.split("T")[0] }}

{{transaction.sum}}€

{{transaction.company}}

                        <input type="button" class="btn btn-yes" value="OK" />

About

Close popup

Lorem ipsum dolor ...


text:
package de.kimminich.kata.botwars.effects.negative;

import de.kimminich.kata.botwars.Bot;
import de.kimminich.kata.botwars.effects.AbstractEffect;
import de.kimminich.kata.botwars.messages.EmptyMessage;
import de.kimminich.kata.botwars.messages.GenericTextMessage;
import de.kimminich.kata.botwars.messages.Message;

public class Stun extends AbstractEffect {

    private double evasion;

    public Stun(Bot invoker, Integer duration) {
        super(invoker, duration);
    }

    @Override
    public Message applyEffect(Bot invoker, Bot target) {
        evasion = target.getEvasion();
        target.setEvasion(0.0);
        return new GenericTextMessage("Stunned " + target + " is unable to attack!");
    }

    @Override
    public Message revokeEffect(Bot invoker, Bot target) {
        target.setEvasion(evasion);
        return new EmptyMessage();
    }

}


text:
<?php

?>
<?php include '../../common/view/header.html.php';?>
<?php js::set('confirmDelete', $lang->testtask->confirmDelete)?>

<?php echo html::a(inlink('browse', "productID=$productID&type=wait"), $lang->testtask->wait);?>

<?php echo html::a(inlink('browse', "productID=$productID&type=done"), $lang->testtask->done);?>

<?php common::printIcon('testtask', 'create', "product=$productID");?>

  <?php $vars = "productID=$productID&type=$type&orderBy=%s&recTotal={$pager->recTotal}&recPerPage={$pager->recPerPage}"; ?>

        <?php common::printOrderLink('id',      $orderBy, $vars, $lang->idAB);?>
                     <?php common::printOrderLink('name',    $orderBy, $vars, $lang->testtask->name);?>
                     <?php common::printOrderLink('project', $orderBy, $vars, $lang->testtask->project);?>
                     <?php common::printOrderLink('build',   $orderBy, $vars, $lang->testtask->build);?>
      <?php common::printOrderLink('owner',   $orderBy, $vars, $lang->testtask->owner);?>
      <?php common::printOrderLink('begin',   $orderBy, $vars, $lang->testtask->begin);?>
      <?php common::printOrderLink('end',     $orderBy, $vars, $lang->testtask->end);?>
      <?php common::printOrderLink('status',  $orderBy, $vars, $lang->statusAB);?>
      <?php echo $lang->actions;?>

  <?php foreach($tasks as $task):?>

    <?php echo html::a(inlink('view', "taskID=$task->id"), sprintf('%03d', $task->id));?>
    <td class='text-left' title="<?php echo $task->name?>"><?php echo html::a(inlink('cases', "taskID=$task->id"), $task->name);?>
    <td class='text-left' title="<?php echo $task->projectName?>"><?php echo html::a($this->createLink('project', 'story', "projectID=$task->project"), $task->projectName);?>
    <td class='text-left' title="<?php echo $task->buildName?>"><?php $task->build == 'trunk' ? print('Trunk') : print(html::a($this->createLink('build', 'view', "buildID=$task->build"), $task->buildName));?>
    <?php echo $users[$task->owner];?>
    <?php echo $task->begin?>
    <?php echo $task->end?>
    <td class='status-<?php echo $task->status?>'><?php echo $lang->testtask->statusList[$task->status];?>

      <?php
      common::printIcon('testtask', 'view',    "taskID=$task->id", '', 'list', 'file');
      common::printIcon('testtask', 'linkCase', "taskID=$task->id", '', 'list', 'link');
      common::printIcon('testtask', 'edit',     "taskID=$task->id", '', 'list');

      if(common::hasPriv('testtask', 'delete'))
      {
          $deleteURL = $this->createLink('testtask', 'delete', "taskID=$task->id&confirm=yes");
          echo html::a("javascript:ajaxDelete(\"$deleteURL\",\"taskList\",confirmDelete)", '', '', "title='{$lang->testtask->delete}' class='btn-icon'");
      }
      ?>

  <?php endforeach;?>

<?php $pager->show();?>

<?php include '../../common/view/footer.html.php';?>


text:
html{color:#000;background:#FFF;}body,div,dl,dt,dd,ul,ol,li,h1,h2,h3,h4,h5,h6,pre,code,form,fieldset,legend,input,button,textarea,p,blockquote,th,td{margin:0;padding:0;}table{border-collapse:collapse;border-spacing:0;}fieldset,img{border:0;}address,caption,cite,code,dfn,em,strong,th,var,optgroup{font-style:inherit;font-weight:inherit;}del,ins{text-decoration:none;}li{list-style:none;}caption,th{text-align:left;}h1,h2,h3,h4,h5,h6{font-size:100%;font-weight:normal;}q:before,q:after{content:'';}abbr,acronym{border:0;font-variant:normal;}sup{vertical-align:baseline;}sub{vertical-align:baseline;}legend{color:#000;}input,button,textarea,select,optgroup,option{font-family:inherit;font-size:inherit;font-style:inherit;font-weight:inherit;}input,button,textarea,select{*font-size:100%;}

div.regular { font: 12px/20px helvetica,sans-serif; padding: 2em; }
div.regular a { color: #000; }
div.regular a:hover { text-decoration: none; }
div.regular p, div.regular h1 { margin-bottom: 1.5em; }
div.regular strong { font-weight: bold; }
div.regular em { font-family: courier; font-style: italic; font-size: 11px; background: #e3e3e3; margin-left: 0.4em; }
div.regular li.footer { color: #ddd; font-size: 11px; margin-top: 2em; }
div.regular li.footer a { color: #ddd; }
div.regular li.footer a:hover { text-decoration: none; }

div.faq h2 { font-weight: bold; }
div.faq p { width: 400px; margin-bottom: 2em; }

div.settings form { margin-bottom: 1.5em; ;}
div.settings form p { margin-top: 1.5em; margin-bottom: 0; }
div.settings form input[type='radio'] { margin-left: 2em; }

div.photos ul { display: flex; justify-content: center; flex-direction: column; }
div.photos li { margin: 0 auto; line-height: 0; padding: 1rem 0; }
div.photos img { max-width: 95vw; max-height: 95vh; }
div.photos li.pagers, div.photos li.footer { color: #333; text-align: center; position: relative; font: 14px helvetica,sans-serif; }
div.photos li.pagers div.left { position: absolute; bottom: 0; left: 0; }
div.photos li.pagers div.right { position: absolute; bottom: 0; right: 0; }
div.photos li.pagers a { color: #333; }
div.photos li.pagers a:hover { text-decoration: none; }
div.photos li.pagers a.homelink { font-size: 12px; text-transform: uppercase; }
div.photos li.footer { color: #ddd; font-size: 11px; }
div.photos li.footer a { color: #ddd; }
div.photos li.footer a:hover { text-decoration: none; }


text:
<?php

namespace Magento\Payment\Gateway\Validator;

/**
 * Interface ValidatorInterface
 * @package Magento\Payment\Gateway\Validator
 * @api
 */
interface ValidatorInterface
{
    /**
     * Performs domain-related validation for business object
     *
     * @param array $validationSubject
     * @return ResultInterface
     */
    public function validate(array $validationSubject);
}


text:
(function () {
'use strict';

  angular
    .module('app.services')
    .factory('OrderService', OrderService);

  function OrderService($http, toastr) {

    var service = {
      lastOrders: lastOrders
    };

    return service;

    function lastOrders(id) {
      return $http({
        method: 'GET',
        url: '/api/v1/orders'
      }).then(function success(res) {
        return res.data;
      }, function error(err) {
        console.error('ERR', err);
      });
    }

  }

})();


text:
@interface HLSerializer : NSObject {

}

+(HLBrokerMessage*)deserialize:(NSData*)data;

@end


text:
<?

///**
// * Defines operations for an ATM machine.
// */
//interface ATM {
//
//    /**
//     * Withdraws money from your card.
//     *
//     * @param number $amount
//     * @return mixed
//     */
//    public function withdraw($amount);
//
//    /**
//     * Returns the balance of your card.
//     *
//     * @return number
//     */
//    public function getBalance();
//
//}
//
//
//class OrderProcessor {
//
//    const MAX_PROCESSABLE_AMOUNT = 2000;
//
//    public function processPayment($amount, $orderID) {
//
//        if ($amount <= 0) {
//            throw new Exception("Negative payment amount: $amount");
//        }
//
//        if ($amount > self::MAX_PROCESSABLE_AMOUNT) {
//            throw new Exception("Amount $amount exceeds maximum processable amount: " . self::MAX_PROCESSABLE_AMOUNT);
//        }
//
//        if (is_null($orderID)) {
//            throw new Exception("Null order id.");
//        }
//
//        $paymentID = $this->creditCardGateway->pay($amount);
//        if (!$paymentID) {
//            throw new Exception("Error while processing payment.");
//        }
//
//        if ($this->orderManager->register($orderID, $paymentID)) {
//            throw new Exception("Error while registering order payment.");
//        }
//    }
//
//}

/** An interface */
interface SomeInterface {

    public function method1();

    public function method2();
}

/** A class that needs an instance of SomeInterface
 *  in constructor */
class SomeClass {

    public function __construct(SomeInterface $obj) { $this->obj = $obj; }

    public function methodUnderTest() {
        // ... code DOES NOT USE $this->obj ... //
    }
}

/** A test case */
class SomeTest {

    public function testMethod() {
        $dummyArgument = new DummyImplementation();
        $sut = new SomeClass($dummyArgument);
        $result = $sut->methodUnderTest();
        // ... assertions on $result ... //
    }

}

class My_Real_Facebook_API_Client {

    public function getAllPosts() {
        // ... retrieves all posts from the real facebook API ... //
    }
}

class SocialNetworkManager {

    public function __construct(My_Real_Facebook_API_Client $apiClient) {
        $this->apiClient = $apiClient;
    }

    public function retrievePosts() { /* Uses the real API client */ }
}

class SocialNetworkManagerTest extends PHPUnit_Framework_TestCase {

    public function testSocialNetworkManager() {

        // Mocking Scored Board
        $mockedAPI = $this
            ->getMockBuilder('My_Real_Facebook_API_Client')
            ->setConstructorArgs(1, 2, 3)
            ->getMock();
        $mockedAPI
            ->expects($this->once())
            ->method('getAllPosts')
            ->willReturn(array(
                array('id' => 1, 'title' => 'First Post'),
                array('id' => 2, 'title' => 'Second Post'),
                array('id' => 3, 'title' => 'Third Post'),
            ));

        $sut = new SocialNetworkManager($mockedAPI);
        $result = $sut->retrievePosts(); // will return the array above
        // Make assertions on $result
    }

}


text:
require 'spec_helper'

klass = OneviewSDK::ImageStreamer::API500::OSVolume
RSpec.describe klass, integration_i3s: true, type: CREATE do
  include_context 'integration i3s api500 context'

  describe '#create' do
    it 'raises MethodUnavailable' do
      item = klass.new($client_i3s_500)
      expect { item.create }.to raise_error(/The method #create is unavailable for this resource/)
    end
  end

  describe '#get_details_archives' do
    it 'raises exception when uri is empty' do
      item = klass.new($client_i3s_500)
      expect { item.get_details_archive }.to raise_error(OneviewSDK::IncompleteResource, /Please set uri attribute/)
    end

    it 'gets the details of the archived OS volume' do
      item = klass.find_by($client_i3s_500, {}).first
      expect(item['uri']).to be
      expect { item.get_details_archive }.not_to raise_error
    end
  end
end


text:
#pragma once

using namespace System;

namespace UiaDll {

	public ref class Class1
	{
		// TODO: Add your methods for this class here.
	};
}


text:
/* eslint-disable */

import mocha from 'mocha';
import app from '../server';
import chai from 'chai';
import request from 'supertest';
import mongoose from 'mongoose';
import TestModel from '../models/tankerShipment.model';

const expect = chai.expect,
      endpointURL = `/api/shipment`,
      COLLECTION_NAME = TestModel.collection.name;

function connectDB(done) {
    if (mongoose.connection.name !== 'mern-test') {
        return done();
    }

    mongoose.connect((process.env.MONGO_URL || 'mongodb://localhost:27017/mern-test'), function (err) {
        if (err) return done(err);
        done();
    });
}

function dropCollection(done) {
    if (mongoose.connection.name !== 'mern-test') {
        return done();
    }

    mongoose.connection.db.dropCollection(COLLECTION_NAME, function (err) {
        return done();
    });
}

function dropDB(done) {
    if (mongoose.connection.name !== 'mern-test') {
        return done();
    }

    mongoose.connection.db.dropDatabase(function (err) {
        mongoose.connection.close(done);
    });
}

describe(`Testing "${endpointURL}" endpoint`, function () {

    this.timeout(12000);

    before('connect to test database', function (done) {
        connectDB(function () {
            done();
        });
    })

    after('drop database', function (done) {
        dropDB(done);
    });

    describe('Method: `GET`', function () {

        beforeEach('add two shipment entries', function (done) {
            var shipment1 = new TestModel({
                    date: new Date(2016, 7, 30),
                    amount: 100,
                    refPage: 5,
                    dept: "Puerto",
                    unit: "Rico",
                    product: 'Prashant',
                    pn: 'Hello Mern',
                    company: "All cats meow 'mern!'"
                }),
                shipment2 = new TestModel({
                    date: new Date(2016, 8, 1),
                    amount: 200,
                    refPage: 10,
                    dept: "Estados",
                    unit: "Unidos",
                    product: 'Mayank',
                    pn: 'Hi Mern',
                    company: "All dogs bark 'mern!'"
                });

            TestModel.create([shipment1, shipment2], function (err, saved) {
                if (err) console.log("ERR: ", err);
                done();
            });
        });

        afterEach(function (done) {
            dropCollection(done);
        });

        it('Should correctly give number of Shipments', function (done) {

            request(app)
            .get(endpointURL)
            .set('Accept', 'application/json')
            .end(function (err, res) {
                TestModel.find().exec(function (err, docs) {
                    expect(docs.length).to.be.above(0);
                    expect(docs.length).to.equal(res.body.length);
                    done();
                });
            });
        });
    });

    describe('Method: `POST`', function () {

        var shipment1 = {
                date: new Date(2016, 7, 30),
                amount: 100,
                refPage: 5,
                dept: "Puerto",
                unit: "Rico",
                product: 'Prashant',
                pn: 'Hello Mern',
                company: "All cats meow 'mern!'"
            },
            shipment2 = {
                date: new Date(2016, 8, 1),
                amount: 200,
                refPage: 10,
                dept: "Estados",
                unit: "Unidos",
                product: 'Mayank',
                pn: 'Hi Mern',
                company: "All dogs bark 'mern!'"
            };

        beforeEach('connect', function (done) {
            done();
        });

        afterEach(function (done) {
            dropCollection(done);
        });

        it('Should return the correct shipment', function (done) {

            request(app)
            .post(endpointURL)
            .send({shipments: [shipment1, shipment2]})
            .set('Accept', 'application/json')
            .end(function (err, res) {
                TestModel.findOne({ pn: shipment1.pn }).exec(function (err, doc) {
                    expect(doc.product).to.equal(shipment1.product);
                    done();
                });
            });
        });

        it('Should give a 403 error if shipment has missing fields', function (done) {

            request(app)
            .post(endpointURL)
            .send({shipments: [{}, shipment2]})
            .set('Accept', 'application/json')
            .end(function (err, res) {
                expect(res.status).to.equal(403);
                done();
            });
        });
    });

    describe('Method: `DELETE`', function () {

        var shipmentId;

        beforeEach('connect and add one Shipment entry', function(done){
            var shipment = new TestModel({
                date: new Date(2016, 8, 1),
                amount: 200,
                refPage: 10,
                product: 'Foo',
                pn: 'bar',
                unit: 'bar',
                dept: 'f34gb2bh24b24b2',
                company: 'Hello Mern says Foo'
            });

            shipment.save(function (err, saved) {
                shipmentId = saved._id;
                done();
            });
        });

        afterEach(function (done) {
            dropCollection(done);
        });

        it('Should connect and delete a shipment', function (done) {

            // Check if shipment is saved in DB
            TestModel.findById(shipmentId).exec(function (err, shipment) {
                expect(shipment.product).to.equal('Foo')
            });

            request(app)
            .delete(endpointURL)
            .send({ _id: shipmentId})
            .set('Accept', 'application/json')
            .end(function (err, res) {
                expect(res.status).to.equal(204);
                // Check if shipment is removed from DB
                TestModel.findById(shipmentId).exec(function (err, shipment) {
                expect(shipment).to.equal(null);
                done();
                });
            });
        })
    });
});


text:
package com.miicard.consumers.service.v1.financial.impl;

import javax.xml.bind.annotation.XmlAccessType;
import javax.xml.bind.annotation.XmlAccessorType;
import javax.xml.bind.annotation.XmlRootElement;
import javax.xml.bind.annotation.XmlType;

@SuppressWarnings("restriction")
@XmlAccessorType(XmlAccessType.FIELD)
@XmlType(name = "")
@XmlRootElement(name = "GetFinancialTransactionsCreditCards", namespace = "http://tempuri.org/")
public class GetFinancialTransactionsCreditCards {

}


text:
<?php

namespace Symfony\Component\Serializer\Normalizer;

use Symfony\Component\Serializer\Exception\InvalidArgumentException;
use Symfony\Component\Serializer\Exception\UnexpectedValueException;

/**
 * Normalizes an instance of {@see \DateInterval} to an interval string.
 * Denormalizes an interval string to an instance of {@see \DateInterval}.
 *
 * @author Jérôme Parmentier <jerome@prmntr.me>
 */
class DateIntervalNormalizer implements NormalizerInterface, DenormalizerInterface, CacheableSupportsMethodInterface
{
    public const FORMAT_KEY = 'dateinterval_format';

    private $defaultContext = [
        self::FORMAT_KEY => '%rP%yY%mM%dDT%hH%iM%sS',
    ];

    /**
     * @param array $defaultContext
     */
    public function __construct($defaultContext = [])
    {
        if (!\is_array($defaultContext)) {
            @trigger_error(sprintf('The "format" parameter is deprecated since Symfony 4.2, use the "%s" key of the context instead.', self::FORMAT_KEY), \E_USER_DEPRECATED);

            $defaultContext = [self::FORMAT_KEY => (string) $defaultContext];
        }

        $this->defaultContext = array_merge($this->defaultContext, $defaultContext);
    }

    /**
     * {@inheritdoc}
     *
     * @throws InvalidArgumentException
     *
     * @return string
     */
    public function normalize($object, $format = null, array $context = [])
    {
        if (!$object instanceof \DateInterval) {
            throw new InvalidArgumentException('The object must be an instance of "\DateInterval".');
        }

        return $object->format($context[self::FORMAT_KEY] ?? $this->defaultContext[self::FORMAT_KEY]);
    }

    /**
     * {@inheritdoc}
     */
    public function supportsNormalization($data, $format = null)
    {
        return $data instanceof \DateInterval;
    }

    /**
     * {@inheritdoc}
     */
    public function hasCacheableSupportsMethod(): bool
    {
        return __CLASS__ === static::class;
    }

    /**
     * {@inheritdoc}
     *
     * @throws InvalidArgumentException
     * @throws UnexpectedValueException
     *
     * @return \DateInterval
     */
    public function denormalize($data, $type, $format = null, array $context = [])
    {
        if (!\is_string($data)) {
            throw new InvalidArgumentException(sprintf('Data expected to be a string, "%s" given.', \gettype($data)));
        }

        if (!$this->isISO8601($data)) {
            throw new UnexpectedValueException('Expected a valid ISO 8601 interval string.');
        }

        $dateIntervalFormat = $context[self::FORMAT_KEY] ?? $this->defaultContext[self::FORMAT_KEY];

        $signPattern = '';
        switch (substr($dateIntervalFormat, 0, 2)) {
            case '%R':
                $signPattern = '[-+]';
                $dateIntervalFormat = substr($dateIntervalFormat, 2);
                break;
            case '%r':
                $signPattern = '-?';
                $dateIntervalFormat = substr($dateIntervalFormat, 2);
                break;
        }
        $valuePattern = '/^'.$signPattern.preg_replace('/%([yYmMdDhHiIsSwW])(\w)/', '(?:(?P<$1>\d+)$2)?', preg_replace('/(T.*)$/', '($1)?', $dateIntervalFormat)).'$/';
        if (!preg_match($valuePattern, $data)) {
            throw new UnexpectedValueException(sprintf('Value "%s" contains intervals not accepted by format "%s".', $data, $dateIntervalFormat));
        }

        try {
            if ('-' === $data[0]) {
                $interval = new \DateInterval(substr($data, 1));
                $interval->invert = 1;

                return $interval;
            }

            if ('+' === $data[0]) {
                return new \DateInterval(substr($data, 1));
            }

            return new \DateInterval($data);
        } catch (\Exception $e) {
            throw new UnexpectedValueException($e->getMessage(), $e->getCode(), $e);
        }
    }

    /**
     * {@inheritdoc}
     */
    public function supportsDenormalization($data, $type, $format = null)
    {
        return \DateInterval::class === $type;
    }

    private function isISO8601(string $string): bool
    {
        return preg_match('/^[\-+]?P(?=\w*(?:\d|%\w))(?:\d+Y|%[yY]Y)?(?:\d+M|%[mM]M)?(?:(?:\d+D|%[dD]D)|(?:\d+W|%[wW]W))?(?:T(?:\d+H|[hH]H)?(?:\d+M|[iI]M)?(?:\d+S|[sS]S)?)?$/', $string);
    }
}


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

import com.facebook.presto.spi.ColumnHandle;
import com.facebook.presto.spi.ColumnMetadata;
import com.facebook.presto.spi.ConnectorTableMetadata;
import com.facebook.presto.spi.ReadOnlyConnectorMetadata;
import com.facebook.presto.spi.SchemaTableName;
import com.facebook.presto.spi.SchemaTablePrefix;
import com.facebook.presto.spi.TableHandle;
import com.facebook.presto.spi.TableNotFoundException;
import com.google.common.collect.ImmutableList;
import com.google.common.collect.ImmutableMap;
import com.google.common.collect.ImmutableSet;

import javax.inject.Inject;

import java.util.List;
import java.util.Map;
import java.util.Set;

import static com.google.common.base.Preconditions.checkArgument;
import static com.google.common.base.Preconditions.checkNotNull;

public class ExampleMetadata
        extends ReadOnlyConnectorMetadata
{
    private final String connectorId;

    private final ExampleClient exampleClient;

    @Inject
    public ExampleMetadata(ExampleConnectorId connectorId, ExampleClient exampleClient)
    {
        this.connectorId = checkNotNull(connectorId, "connectorId is null").toString();
        this.exampleClient = checkNotNull(exampleClient, "client is null");
    }

    @Override
    public boolean canHandle(TableHandle tableHandle)
    {
        return tableHandle instanceof ExampleTableHandle && ((ExampleTableHandle) tableHandle).getConnectorId().equals(connectorId);
    }

    @Override
    public List<String> listSchemaNames()
    {
        return ImmutableList.copyOf(exampleClient.getSchemaNames());
    }

    @Override
    public ExampleTableHandle getTableHandle(SchemaTableName tableName)
    {
        if (!listSchemaNames().contains(tableName.getSchemaName())) {
            return null;
        }

        ExampleTable table = exampleClient.getTable(tableName.getSchemaName(), tableName.getTableName());
        if (table == null) {
            return null;
        }

        return new ExampleTableHandle(connectorId, tableName.getSchemaName(), tableName.getTableName());
    }

    @Override
    public ConnectorTableMetadata getTableMetadata(TableHandle table)
    {
        checkArgument(table instanceof ExampleTableHandle, "tableHandle is not an instance of ExampleTableHandle");
        ExampleTableHandle exampleTableHandle = (ExampleTableHandle) table;
        checkArgument(exampleTableHandle.getConnectorId().equals(connectorId), "tableHandle is not for this connector");
        SchemaTableName tableName = new SchemaTableName(exampleTableHandle.getSchemaName(), exampleTableHandle.getTableName());

        return getTableMetadata(tableName);
    }

    @Override
    public List<SchemaTableName> listTables(String schemaNameOrNull)
    {
        Set<String> schemaNames;
        if (schemaNameOrNull != null) {
            schemaNames = ImmutableSet.of(schemaNameOrNull);
        }
        else {
            schemaNames = exampleClient.getSchemaNames();
        }

        ImmutableList.Builder<SchemaTableName> builder = ImmutableList.builder();
        for (String schemaName : schemaNames) {
            for (String tableName : exampleClient.getTableNames(schemaName)) {
                builder.add(new SchemaTableName(schemaName, tableName));
            }
        }
        return builder.build();
    }

    @Override
    public ColumnHandle getColumnHandle(TableHandle tableHandle, String columnName)
    {
        return getColumnHandles(tableHandle).get(columnName);
    }

    @Override
    public Map<String, ColumnHandle> getColumnHandles(TableHandle tableHandle)
    {
        checkNotNull(tableHandle, "tableHandle is null");
        checkArgument(tableHandle instanceof ExampleTableHandle, "tableHandle is not an instance of ExampleTableHandle");
        ExampleTableHandle exampleTableHandle = (ExampleTableHandle) tableHandle;
        checkArgument(exampleTableHandle.getConnectorId().equals(connectorId), "tableHandle is not for this connector");

        ExampleTable table = exampleClient.getTable(exampleTableHandle.getSchemaName(), exampleTableHandle.getTableName());
        if (table == null) {
            throw new TableNotFoundException(exampleTableHandle.toSchemaTableName());
        }

        ImmutableMap.Builder<String, ColumnHandle> columnHandles = ImmutableMap.builder();
        for (ColumnMetadata columnMetadata : table.getColumnsMetadata()) {
            columnHandles.put(columnMetadata.getName(), new ExampleColumnHandle(connectorId, columnMetadata));
        }
        return columnHandles.build();
    }

    @Override
    public Map<SchemaTableName, List<ColumnMetadata>> listTableColumns(SchemaTablePrefix prefix)
    {
        checkNotNull(prefix, "prefix is null");
        ImmutableMap.Builder<SchemaTableName, List<ColumnMetadata>> columns = ImmutableMap.builder();
        for (SchemaTableName tableName : listTables(prefix)) {
            ConnectorTableMetadata tableMetadata = getTableMetadata(tableName);
            // table can disappear during listing operation
            if (tableMetadata != null) {
                columns.put(tableName, tableMetadata.getColumns());
            }
        }
        return columns.build();
    }

    private ConnectorTableMetadata getTableMetadata(SchemaTableName tableName)
    {
        if (!listSchemaNames().contains(tableName.getSchemaName())) {
            return null;
        }

        ExampleTable table = exampleClient.getTable(tableName.getSchemaName(), tableName.getTableName());
        if (table == null) {
            return null;
        }

        return new ConnectorTableMetadata(tableName, table.getColumnsMetadata());
    }

    private List<SchemaTableName> listTables(SchemaTablePrefix prefix)
    {
        if (prefix.getSchemaName() == null) {
            return listTables(prefix.getSchemaName());
        }
        return ImmutableList.of(new SchemaTableName(prefix.getSchemaName(), prefix.getTableName()));
    }

    @Override
    public ColumnMetadata getColumnMetadata(TableHandle tableHandle, ColumnHandle columnHandle)
    {
        checkNotNull(tableHandle, "tableHandle is null");
        checkNotNull(columnHandle, "columnHandle is null");
        checkArgument(tableHandle instanceof ExampleTableHandle, "tableHandle is not an instance of ExampleTableHandle");
        checkArgument(((ExampleTableHandle) tableHandle).getConnectorId().equals(connectorId), "tableHandle is not for this connector");
        checkArgument(columnHandle instanceof ExampleColumnHandle, "columnHandle is not an instance of ExampleColumnHandle");

        return ((ExampleColumnHandle) columnHandle).getColumnMetadata();
    }
}


text:
"use strict";

import PropTypes from '../PropTypes';

const opRe = /^(==|===|!=|!==|>=|>|truthy|falsey|<|<=|(\!)?\/(.*)\/([gimy])?)$/;
const eq = function (compare, value) {
    return value == compare
}, eqeq = function (compare, value) {
    return value === compare
}, ne = function (compare, value) {
    return value != compare
}, neeq = function (compare, value) {
    return value !== compare
}, gt = function (compare, value) {
    return value > compare
}, gteq = function (compare, value) {
    return value >= compare
}, lt = function (compare, value) {
    return value < compare
}, lteq = function (compare, value) {
    return value <= compare
}, truthy = function (compare) {
    return !!compare;
}, falsey = function (compare) {
    return !compare;
};

const opFactory = (function opFactory$factory(scope) {

    return (operator)=> {
        switch (operator) {
            case 'truthy':
                return truthy;
            case 'falsey':
                return falsey;
            case '==':
                return eq;
            case '===':
                return eqeq;
            case '!=':
                return ne;
            case '!==':
                return neeq;
            case '>':
                return gt;
            case '>=':
                return gteq;
            case '<':
                return lt;
            case '<=':
                return lteq;

            default:
            {
                throw new Error('Unknown operator [' + operator + ']')
            }
        }
    }
}());
export function loadOperator(operator, key, props, context) {

    if (operator instanceof RegExp) {
        return (compare, value) =>operator.test(compare, value);
    }
    if (typeof operator === 'function') {
        return operator;
    }
    if (typeof operator === 'string') {
        var os = opRe.exec(operator);
        if (os) {
            if (os[3] != null) {
                operator = new RegExp(os[3], os[4]);
                if (os[2] == null) {
                    return (compare, value) => operator.test(compare);
                } else {
                    return (compare, value) => !operator.test(compare);
                }
            }
            return opFactory(operator);
        } else {
            return context.loader.loadOperator(operator);
        }
    }
    return operator;

}

export default function operator(Clazz, key) {
    Clazz.contextTypes.loader = PropTypes.loader;
    Clazz::this.property(key, loadOperator);
}


text:
Sua hospedagem suporta Python e PostgreSQL  ?

Fiz o script abaixo para testar se o driver de conexão com o PostgreSQL psycopg2 está instalado corretamente e tudo está funcionando direito, conforme o esperado.
Espero que possa ser útil para mais alguém.

Salve o código abaixo com o nome, por exemplo pg_test.py e troque as variáveis conforme os dados de sua conexão e tabela.

import sys
import psycopg2
import traceback

def faca_algo_com_a_excessao():
    exc_type, exc_value = sys.exc_info()[:2]
    print 'Deu a %s excessao com a mensagem "%s" na %s' % \
        (exc_type.__name__, exc_value, threading.current_thread().name)

try:
    conn=psycopg2.connect("dbname='seu_banco_de_dados' user='usuario_do_banco' host='seu_servidor' password='senha_do_usuario'")
except:
    faca_algo_com_a_excessao()
    traceback.print_exc()

cur = conn.cursor()

try:
    cur.execute("""SELECT * FROM sua_tabela""")
except:
    faca_algo_com_a_excessao()
    traceback.print_exc()

registros = cur.fetchall()
print "\nRows: \n"
for registro in registros:
    print "  ", registro[1]


text:
(function (){

    "use strict";

    angular.module('resourceService', [])

        .factory('booksResource', ['$resource', function ($resource) {

            return $resource('api/books/:book_id', {book_id: '@book_id'},
                {
                    'update': {method: 'PUT'}
                }
            );

        }])

        .controller('ControllerResource', ['$scope', 'booksResource', function ($scope, booksResource) {

            $scope.novelas = booksResource.query();

        }])

}());


text:
import datetime
from south.db import db
from south.v2 import SchemaMigration
from django.db import models

class Migration(SchemaMigration):

    def forwards(self, orm):

        # Adding model 'MixTrack'
        db.create_table('mixes_mixtrack', (
            ('id', self.gf('django.db.models.fields.AutoField')(primary_key=True)),
            ('mix', self.gf('django.db.models.fields.related.ForeignKey')(to=orm['mixes.Mix'])),
            ('track', self.gf('django.db.models.fields.related.ForeignKey')(to=orm['mixes.Track'])),
            ('mixtrack_number', self.gf('django.db.models.fields.IntegerField')(default=0)),
        ))
        db.send_create_signal('mixes', ['MixTrack'])

        # Deleting field 'Track.mixtrack_number'
        db.delete_column('mixes_track', 'mixtrack_number')

        # Deleting field 'Track.mix'
        db.delete_column('mixes_track', 'mix_id')

    def backwards(self, orm):

        # Deleting model 'MixTrack'
        db.delete_table('mixes_mixtrack')

        # Adding field 'Track.mixtrack_number'
        db.add_column('mixes_track', 'mixtrack_number', self.gf('django.db.models.fields.IntegerField')(default=0), keep_default=False)

        # Adding field 'Track.mix'
        db.add_column('mixes_track', 'mix', self.gf('django.db.models.fields.related.ForeignKey')(default=None, related_name='tracks', to=orm['mixes.Mix']), keep_default=False)

    models = {
        'mixes.mix': {
            'Meta': {'object_name': 'Mix'},
            'end': ('django.db.models.fields.DateTimeField', [], {'default': 'datetime.datetime(2010, 7, 25, 14, 0)'}),
            'icon': ('django.db.models.fields.files.ImageField', [], {'max_length': '100'}),
            'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
            'playlist': ('django.db.models.fields.URLField', [], {'max_length': '200'}),
            'slug': ('django.db.models.fields.SlugField', [], {'max_length': '50', 'db_index': 'True'}),
            'start': ('django.db.models.fields.DateTimeField', [], {'default': 'datetime.datetime(2010, 7, 25, 12, 30)'}),
            'title': ('django.db.models.fields.CharField', [], {'max_length': '255'}),
            'tracks': ('django.db.models.fields.related.ManyToManyField', [], {'to': "orm['mixes.Track']", 'through': "orm['mixes.MixTrack']", 'symmetrical': 'False'}),
            'tracks_input': ('django.db.models.fields.TextField', [], {'null': 'True', 'blank': 'True'})
        },
        'mixes.mixtrack': {
            'Meta': {'object_name': 'MixTrack'},
            'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
            'mix': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['mixes.Mix']"}),
            'mixtrack_number': ('django.db.models.fields.IntegerField', [], {'default': '0'}),
            'track': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['mixes.Track']"})
        },
        'mixes.track': {
            'Meta': {'object_name': 'Track'},
            'album': ('django.db.models.fields.CharField', [], {'max_length': '255', 'blank': 'True'}),
            'album_uri': ('django.db.models.fields.CharField', [], {'max_length': '255', 'blank': 'True'}),
            'artist': ('django.db.models.fields.CharField', [], {'max_length': '255', 'blank': 'True'}),
            'artist_uri': ('django.db.models.fields.CharField', [], {'max_length': '255', 'blank': 'True'}),
            'completed': ('django.db.models.fields.BooleanField', [], {'default': 'False', 'blank': 'True'}),
            'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
            'isrc': ('django.db.models.fields.CharField', [], {'max_length': '255', 'blank': 'True'}),
            'length': ('django.db.models.fields.FloatField', [], {'null': 'True', 'blank': 'True'}),
            'name': ('django.db.models.fields.CharField', [], {'max_length': '255', 'blank': 'True'}),
            'popularity': ('django.db.models.fields.FloatField', [], {'null': 'True', 'blank': 'True'}),
            'track_number': ('django.db.models.fields.IntegerField', [], {'null': 'True', 'blank': 'True'}),
            'track_uri': ('django.db.models.fields.CharField', [], {'max_length': '255', 'blank': 'True'})
        }
    }

    complete_apps = ['mixes']


text:
layout: page
title: "JavaScript compact function"
comments: true
sharing: true
footer: true
alias:
- /functions/view/compact:371
- /functions/view/compact
- /functions/view/371
- /functions/compact:371
- /functions/371
---
<!-- Generated by Rakefile:build -->
A JavaScript equivalent of PHP's compact

{% codeblock array/compact.js lang:js https://raw.github.com/kvz/phpjs/master/functions/array/compact.js raw on github %}
function compact () {
  // http://kevin.vanzonneveld.net
  // +   original by: Waldo Malqui Silva
  // +    tweaked by: Jack
  // +      input by: Brett Zamir (http://brett-zamir.me)
  // +   bugfixed by: Kevin van Zonneveld (http://kevin.vanzonneveld.net)
  // *     example 1: var1 = 'Kevin'; var2 = 'van'; var3 = 'Zonneveld';
  // *     example 1: compact('var1', 'var2', 'var3');
  // *     returns 1: {'var1': 'Kevin', 'var2': 'van', 'var3': 'Zonneveld'}
  var matrix = {},
    that = this;

  var process = function (value) {
    var i = 0,
      l = value.length,
      key_value = '';
    for (i = 0; i < l; i++) {
      key_value = value[i];
      if (Object.prototype.toString.call(key_value) === '[object Array]') {
        process(key_value);
      } else {
        if (typeof that.window[key_value] !== 'undefined') {
          matrix[key_value] = that.window[key_value];
        }
      }
    }
    return true;
  };

  process(arguments);
  return matrix;
}
{% endcodeblock %}

 - [view on github](https://github.com/kvz/phpjs/blob/master/functions/array/compact.js)
 - [edit on github](https://github.com/kvz/phpjs/edit/master/functions/array/compact.js)

### Example 1
This code
{% codeblock lang:js example %}
var1 = 'Kevin'; var2 = 'van'; var3 = 'Zonneveld';
compact('var1', 'var2', 'var3');
{% endcodeblock %}

Should return
{% codeblock lang:js returns %}
{'var1': 'Kevin', 'var2': 'van', 'var3': 'Zonneveld'}
{% endcodeblock %}

### Other PHP functions in the array extension
{% render_partial _includes/custom/array.html %}