text:
/* eslint-disable */
import { UserLayout, BasicLayout, BlankLayout } from '@/layouts'
import { menu1, menu2, menu3, menu4, menu5, menu6, menu7, menu8, menu9, menu10, menu11, menu12, menu13, menu14, menu15, menu16 } from '@/core/icons'

const RouteView = {
  name: 'RouteView',
  render: (h) => h('router-view')
}

/**
 * 基础路由
 * @type { *[] }
 */
export const constantRouterMap = [
  {
    path: '/user',
    component: UserLayout,
    redirect: '/user/login',
    hidden: true,
    children: [
      {
        path: 'login',
        name: 'login',
        component: () => import(/* webpackChunkName: "user" */ '@/views/user/Login')
      },
      {
        path: 'register',
        name: 'register',
        component: () => import(/* webpackChunkName: "user" */ '@/views/user/Register')
      },
      {
        path: 'register-result',
        name: 'registerResult',
        component: () => import(/* webpackChunkName: "user" */ '@/views/user/RegisterResult')
      },
      {
        path: 'recover',
        name: 'recover',
        component: undefined
      }
    ]
  },

  {
    path: '/',
    name: 'index',
    component: BasicLayout,
    meta: { title: 'menu.home' },
    redirect: '/security',
    children: [
      // dashboard
      {
        path: '/security',
        name: 'security',
        component: () => import('@/views/demo/EndPoint'),
        meta: { title:'Security Posture',icon: menu1, keepAlive: true, permission: ['dashboard'] }
      },

      // forms
      {
        path: '/menu2',
        redirect: '/menu2/identity',
        component: () => import('@/views/demo/EndPoint'),
        meta: { title: 'Identity and Risk Insights(Preview)', icon: menu2, keepAlive: true, permission: ['form'] }
      },

      // list
      {
        path: '/menu3',
        name: 'list',
        component: () => import('@/views/demo/EndPoint'),
        meta: { title: 'Detection Model Management', icon: menu3, keepAlive: true, permission: ['table'] }
      },

      // profile
      {
        path: '/menu4',
        name: 'profile',
        component: () => import('@/views/demo/EndPoint'),
        meta: { title: 'Threat Intelliengce', icon: menu4, permission: ['profile'] }
      },

      // result
      {
        path: '/menu5',
        name: 'result',
        component: () => import(/* webpackChunkName: "result" */ '@/views/demo/EndPoint'),
        meta: { title: 'Workbench',icon: menu5, keepAlive: false, hiddenHeaderContent: true, permission: ['result'] }
      },

      // account
      {
        path: '/menu6',
        component: RouteView,
        name: 'threat',
        component: () => import('@/views/demo/EndPoint'),
        meta: { title: 'Observed Attact Techniques ', icon: menu6,  keepAlive: true, permission: ['user'] }
      },
      {
        path: '/menu7',
        name: 'menu7',
        component: () => import(/* webpackChunkName: "result" */ '@/views/demo/EndPoint'),
        meta: { title: 'Search', icon: menu7, keepAlive: false, hiddenHeaderContent: true, permission: ['result'] }
      },
      {
        path: '/menu8',
        name: 'menu8',
        component: () => import(/* webpackChunkName: "result" */ '@/views/demo/EndPoint'),
        meta: { title: 'Response Management', icon: menu8, keepAlive: false, hiddenHeaderContent: true, permission: ['result'] }
      },
      {
        path: '/menu9',
        name: 'menu9',
        component: () => import(/* webpackChunkName: "result" */ '@/views/demo/EndPoint'),
        meta: { title: 'Managed XDR',icon: menu9, keepAlive: false, hiddenHeaderContent: true, permission: ['result'] }
      },
      {
        path: '/menu10',
        name: 'menu10',
        meta: { title: 'mobile',icon: menu10,  keepAlive: false,  permission: ['result'] },
        component: RouteView,
        redirect: '/menu10/mobile',
        children: [
          {
            path: '/menu10/mobile',
            name: 'mobile',
            component: () => import(/* webpackChunkName: "result" */ '@/views/demo/EndPoint'),
            meta: { title: 'Mobile Inventory(Preview)', keepAlive: false, hiddenHeaderContent: true, permission: ['result'] }
          },
          {
            path: '/menu10/detec',
            name: 'detec',
            component: () => import(/* webpackChunkName: "result" */ '@/views/demo/EndPoint'),
            meta: { title: 'Mobile Detection Logs(Preview)', keepAlive: false, hiddenHeaderContent: true, permission: ['result'] }
          },
          {
            path: '/menu10/policy',
            name: 'ploicy',
            component: () => import(/* webpackChunkName: "result" */ '@/views/demo/EndPoint'),
            meta: { title: 'Mobile Policy(Preview)', keepAlive: false, hiddenHeaderContent: true, permission: ['result'] }
          }
        ]
      },
      {
        path: '/menu11',
        name: 'menu11',
        component: RouteView,
        redirect: '/menu13/endpoint',
        meta: { title: 'endpoint', icon:menu11, permission: ['result'] },
        children: [
          {
            path: '/menu13/endpoint',
            name: 'ResultSuccess',
            component: () => import(/* webpackChunkName: "result" */ '@/views/demo/XDR'),
            meta: { title: 'Endpoint Inventory', keepAlive: false, hiddenHeaderContent: true, permission: ['result'] }
          },
          {
            path: '/menu13/email',
            name: 'email',
            component: () => import(/* webpackChunkName: "result" */ '@/views/demo/EndPoint'),
            meta: { title: 'Email Account Inventory', keepAlive: false, hiddenHeaderContent: true, permission: ['result'] }
          },
          {
            path: '/menu13/network',
            name: 'network',
            component: () => import(/* webpackChunkName: "result" */ '@/views/demo/EndPoint'),
            meta: { title: 'Network Inventory', keepAlive: false, hiddenHeaderContent: true, permission: ['result'] }
          }
        ]
      },
      {
        path: '/menu12',
        name: 'menu12',
        component: RouteView,
        redirect: '/menu12/sign',
        meta: { title: 'setting', icon:menu13, permission: ['result'] },
        children: [
          {
            path: '/menu12/sign',
            name: 'sign',
            component: () => import(/* webpackChunkName: "result" */ '@/views/demo/EndPoint'),
            meta: { title: 'Single Sign-On', keepAlive: false, hiddenHeaderContent: true, permission: ['result'] }
          },
          {
            path: '/menu12/directory',
            name: 'directory',
            component: () => import(/* webpackChunkName: "result" */ '@/views/demo/EndPoint'),
            meta: { title: 'Directory Sync (Preview)', keepAlive: false, hiddenHeaderContent: true, permission: ['result'] }
          },
          {
            path: '/menu12/account',
            name: 'account',
            component: () => import(/* webpackChunkName: "result" */ '@/views/demo/EndPoint'),
            meta: { title: 'User Accounts', keepAlive: false, hiddenHeaderContent: true, permission: ['result'] }
          },
          {
            path: '/menu12/role',
            name: 'role',
            component: () => import(/* webpackChunkName: "result" */ '@/views/demo/EndPoint'),
            meta: { title: 'User Roles', keepAlive: false, hiddenHeaderContent: true, permission: ['result'] }
          },
          {
            path: '/menu12/connect',
            name: 'connect',
            component: () => import(/* webpackChunkName: "result" */ '@/views/demo/EndPoint'),
            meta: { title: 'Product Connector', keepAlive: false, hiddenHeaderContent: true, permission: ['result'] }
          },
          {
            path: '/menu12/notifiy',
            name: 'notifiy',
            component: () => import(/* webpackChunkName: "result" */ '@/views/demo/EndPoint'),
            meta: { title: 'Alert Notifications', keepAlive: false, hiddenHeaderContent: true, permission: ['result'] }
          },
          {
            path: '/menu12/log',
            name: 'log',
            component: () => import(/* webpackChunkName: "result" */ '@/views/demo/EndPoint'),
            meta: { title: 'Audit Logs', keepAlive: false, hiddenHeaderContent: true, permission: ['result'] }
          },
          {
            path: '/menu12/support',
            name: 'support',
            component: () => import(/* webpackChunkName: "result" */ '@/views/demo/EndPoint'),
            meta: { title: 'Remote Support', keepAlive: false, hiddenHeaderContent: true, permission: ['result'] }
          },
          {
            path: '/menu12/license',
            name: 'license',
            component: () => import(/* webpackChunkName: "result" */ '@/views/demo/EndPoint'),
            meta: { title: 'License Information', keepAlive: false, hiddenHeaderContent: true, permission: ['result'] }
          }
        ]
      },
      {
        path: '/menu14',
        name: 'menu14',
        component: RouteView,
        redirect: '/menu14/help',
        meta: { title: 'endpoint', icon:menu14, permission: ['result'] },
        children: [
          {
            path: '/menu14/help',
            name: 'Help',
            component: () => import(/* webpackChunkName: "result" */ '@/views/demo/EndPoint'),
            meta: { title: 'Help', keepAlive: false, hiddenHeaderContent: true, permission: ['result'] }
          },
          {
            path: '/menu14/online',
            name: 'onlinehelp',
            component: () => import(/* webpackChunkName: "result" */ '@/views/demo/EndPoint'),
            meta: { title: 'Online Help', keepAlive: false, hiddenHeaderContent: true, permission: ['result'] }
          },
          {
            path: '/menu14/contact',
            name: 'contact',
            component: () => import(/* webpackChunkName: "result" */ '@/views/demo/EndPoint'),
            meta: { title: 'Contact Support', keepAlive: false, hiddenHeaderContent: true, permission: ['result'] }
          },
          {
            path: '/menu14/about',
            name: 'about',
            component: () => import(/* webpackChunkName: "result" */ '@/views/demo/EndPoint'),
            meta: { title: 'About', keepAlive: false, hiddenHeaderContent: true, permission: ['result'] }
          }
        ]
      },
      {
        path: '/menu15',
        name: 'menu15',
        component: () => import(/* webpackChunkName: "result" */ '@/views/demo/EndPoint'),
        meta: { title: 'tool',icon: menu15, keepAlive: false, hiddenHeaderContent: true, permission: ['result'] }
      },
      {
        path: '/menu16',
        name: 'menu16',
        component: () => import(/* webpackChunkName: "result" */ '@/views/demo/EndPoint'),
        meta: {title:'more',icon:menu16, keepAlive: false, hiddenHeaderContent: true, permission: ['result'] }
      }
    ]
  },

  {
    path: '/404',
    component: () => import(/* webpackChunkName: "fail" */ '@/views/exception/404')
  }
]

extension: js


text:
DESCRIPTION = "Inotify bindings for Lua."
LICENSE = "MIT"
HOMEPAGE = "http://hoelz.ro/projects/linotify"
LIC_FILES_CHKSUM = "file://${COMMON_LICENSE_DIR}/MIT;md5=0835ade698e0bcf8506ecda2f7b4f302"

DEPENDS += "lua5.1 luajit inotify-tools"

SRC_URI = "git://github.com/hoelzro/linotify.git;protocol=git \
		   file://disable-strip.patch \
		   file://hardcode_luajit_name.patch \
		   "

SRCREV = "a56913e9c0922befb65227a00cf69c2e8052de1a"
S = "${WORKDIR}/git/"

inherit pkgconfig

TARGET_CC_ARCH += "${LDFLAGS}"

EXTRA_OEMAKE = " \
	DESTDIR='${D}' \
	"

do_install() {
        oe_runmake install
}

FILES_${PN} += "${prefix}"

repository: chandu-tmba/MORF-OpenBMC

license_type: permissive

repo_name: chandu-tmba/MORF-OpenBMC

branch_name: refs/heads/master

extension: bb


text:
// Code generated by protoc-gen-go. DO NOT EDIT.
// versions:
// 	protoc-gen-go v1.27.1
// 	protoc        v3.17.3
// source: user/v1/event.proto

package user

import (
	protoreflect "google.golang.org/protobuf/reflect/protoreflect"
	protoimpl "google.golang.org/protobuf/runtime/protoimpl"
	timestamppb "google.golang.org/protobuf/types/known/timestamppb"
	reflect "reflect"
	sync "sync"
)

const (
	// Verify that this generated code is sufficiently up-to-date.
	_ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion)
	// Verify that runtime/protoimpl is sufficiently up-to-date.
	_ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20)
)

type CreatedEvent struct {
	state         protoimpl.MessageState
	sizeCache     protoimpl.SizeCache
	unknownFields protoimpl.UnknownFields

	User *CreatedEvent_User `protobuf:"bytes,1,opt,name=user,proto3" json:"user,omitempty"`
}

func (x *CreatedEvent) Reset() {
	*x = CreatedEvent{}
	if protoimpl.UnsafeEnabled {
		mi := &file_user_v1_event_proto_msgTypes[0]
		ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
		ms.StoreMessageInfo(mi)
	}
}

func (x *CreatedEvent) String() string {
	return protoimpl.X.MessageStringOf(x)
}

func (*CreatedEvent) ProtoMessage() {}

func (x *CreatedEvent) ProtoReflect() protoreflect.Message {
	mi := &file_user_v1_event_proto_msgTypes[0]
	if protoimpl.UnsafeEnabled && x != nil {
		ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
		if ms.LoadMessageInfo() == nil {
			ms.StoreMessageInfo(mi)
		}
		return ms
	}
	return mi.MessageOf(x)
}

// Deprecated: Use CreatedEvent.ProtoReflect.Descriptor instead.
func (*CreatedEvent) Descriptor() ([]byte, []int) {
	return file_user_v1_event_proto_rawDescGZIP(), []int{0}
}

func (x *CreatedEvent) GetUser() *CreatedEvent_User {
	if x != nil {
		return x.User
	}
	return nil
}

type CreatedEvent_User struct {
	state         protoimpl.MessageState
	sizeCache     protoimpl.SizeCache
	unknownFields protoimpl.UnknownFields

	Id        string                 `protobuf:"bytes,1,opt,name=id,proto3" json:"id,omitempty"`
	Name      string                 `protobuf:"bytes,2,opt,name=name,proto3" json:"name,omitempty"`
	CreatedAt *timestamppb.Timestamp `protobuf:"bytes,100,opt,name=created_at,json=createdAt,proto3" json:"created_at,omitempty"`
}

func (x *CreatedEvent_User) Reset() {
	*x = CreatedEvent_User{}
	if protoimpl.UnsafeEnabled {
		mi := &file_user_v1_event_proto_msgTypes[1]
		ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
		ms.StoreMessageInfo(mi)
	}
}

func (x *CreatedEvent_User) String() string {
	return protoimpl.X.MessageStringOf(x)
}

func (*CreatedEvent_User) ProtoMessage() {}

func (x *CreatedEvent_User) ProtoReflect() protoreflect.Message {
	mi := &file_user_v1_event_proto_msgTypes[1]
	if protoimpl.UnsafeEnabled && x != nil {
		ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
		if ms.LoadMessageInfo() == nil {
			ms.StoreMessageInfo(mi)
		}
		return ms
	}
	return mi.MessageOf(x)
}

// Deprecated: Use CreatedEvent_User.ProtoReflect.Descriptor instead.
func (*CreatedEvent_User) Descriptor() ([]byte, []int) {
	return file_user_v1_event_proto_rawDescGZIP(), []int{0, 0}
}

func (x *CreatedEvent_User) GetId() string {
	if x != nil {
		return x.Id
	}
	return ""
}

func (x *CreatedEvent_User) GetName() string {
	if x != nil {
		return x.Name
	}
	return ""
}

func (x *CreatedEvent_User) GetCreatedAt() *timestamppb.Timestamp {
	if x != nil {
		return x.CreatedAt
	}
	return nil
}

var File_user_v1_event_proto protoreflect.FileDescriptor

var file_user_v1_event_proto_rawDesc = []byte{
	0x0a, 0x13, 0x75, 0x73, 0x65, 0x72, 0x2f, 0x76, 0x31, 0x2f, 0x65, 0x76, 0x65, 0x6e, 0x74, 0x2e,
	0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x0d, 0x62, 0x61, 0x73, 0x69, 0x63, 0x2e, 0x75, 0x73, 0x65,
	0x72, 0x2e, 0x76, 0x31, 0x1a, 0x1f, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2f, 0x70, 0x72, 0x6f,
	0x74, 0x6f, 0x62, 0x75, 0x66, 0x2f, 0x74, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x2e,
	0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, 0xab, 0x01, 0x0a, 0x0c, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65,
	0x64, 0x45, 0x76, 0x65, 0x6e, 0x74, 0x12, 0x34, 0x0a, 0x04, 0x75, 0x73, 0x65, 0x72, 0x18, 0x01,
	0x20, 0x01, 0x28, 0x0b, 0x32, 0x20, 0x2e, 0x62, 0x61, 0x73, 0x69, 0x63, 0x2e, 0x75, 0x73, 0x65,
	0x72, 0x2e, 0x76, 0x31, 0x2e, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x64, 0x45, 0x76, 0x65, 0x6e,
	0x74, 0x2e, 0x55, 0x73, 0x65, 0x72, 0x52, 0x04, 0x75, 0x73, 0x65, 0x72, 0x1a, 0x65, 0x0a, 0x04,
	0x55, 0x73, 0x65, 0x72, 0x12, 0x0e, 0x0a, 0x02, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09,
	0x52, 0x02, 0x69, 0x64, 0x12, 0x12, 0x0a, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x02, 0x20, 0x01,
	0x28, 0x09, 0x52, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x12, 0x39, 0x0a, 0x0a, 0x63, 0x72, 0x65, 0x61,
	0x74, 0x65, 0x64, 0x5f, 0x61, 0x74, 0x18, 0x64, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1a, 0x2e, 0x67,
	0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x54,
	0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x52, 0x09, 0x63, 0x72, 0x65, 0x61, 0x74, 0x65,
	0x64, 0x41, 0x74, 0x42, 0x49, 0x5a, 0x47, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f,
	0x6d, 0x2f, 0x6b, 0x7a, 0x6d, 0x61, 0x6b, 0x65, 0x2f, 0x65, 0x78, 0x61, 0x6d, 0x70, 0x6c, 0x65,
	0x73, 0x2f, 0x62, 0x61, 0x73, 0x69, 0x63, 0x2d, 0x70, 0x75, 0x62, 0x6c, 0x69, 0x73, 0x68, 0x2d,
	0x61, 0x6e, 0x64, 0x2d, 0x73, 0x75, 0x62, 0x73, 0x63, 0x72, 0x69, 0x62, 0x65, 0x2f, 0x61, 0x70,
	0x69, 0x2f, 0x75, 0x73, 0x65, 0x72, 0x2f, 0x76, 0x31, 0x3b, 0x75, 0x73, 0x65, 0x72, 0x62, 0x06,
	0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33,
}

var (
	file_user_v1_event_proto_rawDescOnce sync.Once
	file_user_v1_event_proto_rawDescData = file_user_v1_event_proto_rawDesc
)

func file_user_v1_event_proto_rawDescGZIP() []byte {
	file_user_v1_event_proto_rawDescOnce.Do(func() {
		file_user_v1_event_proto_rawDescData = protoimpl.X.CompressGZIP(file_user_v1_event_proto_rawDescData)
	})
	return file_user_v1_event_proto_rawDescData
}

var file_user_v1_event_proto_msgTypes = make([]protoimpl.MessageInfo, 2)
var file_user_v1_event_proto_goTypes = []interface{}{
	(*CreatedEvent)(nil),          // 0: basic.user.v1.CreatedEvent
	(*CreatedEvent_User)(nil),     // 1: basic.user.v1.CreatedEvent.User
	(*timestamppb.Timestamp)(nil), // 2: google.protobuf.Timestamp
}
var file_user_v1_event_proto_depIdxs = []int32{
	1, // 0: basic.user.v1.CreatedEvent.user:type_name -> basic.user.v1.CreatedEvent.User
	2, // 1: basic.user.v1.CreatedEvent.User.created_at:type_name -> google.protobuf.Timestamp
	2, // [2:2] is the sub-list for method output_type
	2, // [2:2] is the sub-list for method input_type
	2, // [2:2] is the sub-list for extension type_name
	2, // [2:2] is the sub-list for extension extendee
	0, // [0:2] is the sub-list for field type_name
}

func init() { file_user_v1_event_proto_init() }
func file_user_v1_event_proto_init() {
	if File_user_v1_event_proto != nil {
		return
	}
	if !protoimpl.UnsafeEnabled {
		file_user_v1_event_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} {
			switch v := v.(*CreatedEvent); i {
			case 0:
				return &v.state
			case 1:
				return &v.sizeCache
			case 2:
				return &v.unknownFields
			default:
				return nil
			}
		}
		file_user_v1_event_proto_msgTypes[1].Exporter = func(v interface{}, i int) interface{} {
			switch v := v.(*CreatedEvent_User); i {
			case 0:
				return &v.state
			case 1:
				return &v.sizeCache
			case 2:
				return &v.unknownFields
			default:
				return nil
			}
		}
	}
	type x struct{}
	out := protoimpl.TypeBuilder{
		File: protoimpl.DescBuilder{
			GoPackagePath: reflect.TypeOf(x{}).PkgPath(),
			RawDescriptor: file_user_v1_event_proto_rawDesc,
			NumEnums:      0,
			NumMessages:   2,
			NumExtensions: 0,
			NumServices:   0,
		},
		GoTypes:           file_user_v1_event_proto_goTypes,
		DependencyIndexes: file_user_v1_event_proto_depIdxs,
		MessageInfos:      file_user_v1_event_proto_msgTypes,
	}.Build()
	File_user_v1_event_proto = out.File
	file_user_v1_event_proto_rawDesc = nil
	file_user_v1_event_proto_goTypes = nil
	file_user_v1_event_proto_depIdxs = nil
}

license: MIT

repository: pdettorre/examples

repo_name: pdettorre/examples

branch_name: refs/heads/main

extension: go


text:
DESCRIPTION = "Mender state-script to update firmware files on Raspberry Pi boards"
LICENSE = "Apache-2.0"
LIC_FILES_CHKSUM = "file://${COMMON_LICENSE_DIR}/Apache-2.0;md5=89aea4e17d99a7cacdbeed46a0096b10"

inherit mender-state-scripts

SRC_URI = "file://ArtifactInstall_Leave_50.in"

do_deploy() {
    sed -e 's#@@MENDER_ROOTFS_PART_A@@#'"${MENDER_ROOTFS_PART_A}"'#' \
        -e 's#@@MENDER_ROOTFS_PART_B@@#'"${MENDER_ROOTFS_PART_B}"'#' \
        "${WORKDIR}/ArtifactInstall_Leave_50.in" > "${WORKDIR}/ArtifactInstall_Leave_50"
    cp ${WORKDIR}/ArtifactInstall_Leave_50 ${MENDER_STATE_SCRIPTS_DIR}/ArtifactInstall_Leave_50
}

ALLOW_EMPTY_${PN} = "1"

repository: drewmoseley/meta-mender

repo_name: drewmoseley/meta-mender

gha_language: Python


text:
package main

import (
	"fmt"
	"net"
	"os"
	"time"
	"github.com/godbus/dbus/v5"
)

var pingres = false
var sleeptime time.Duration = 5
var charge = "[??% ? 00:00]"

func secondsToClock(inSeconds int64) string {
	hours := (inSeconds / 60) / 60
	minutes := inSeconds % 60

	str := fmt.Sprintf("%02d:%02d", hours, minutes)
	return str
}

func mycharge () {
	for true {
		conn, err := dbus.SystemBus()

		if err != nil {
			time.Sleep(sleeptime * time.Second)
			continue
		}

		defer conn.Close()

		obj := conn.Object("org.freedesktop.UPower", "/org/freedesktop/UPower/devices/battery_BAT0")
		percentage, err := obj.GetProperty("org.freedesktop.UPower.Percentage")

		if err != nil {
			conn.Close()
			time.Sleep(sleeptime * time.Second)
			continue
		}

		var pcharge int = int(percentage.Value().(float64))

		state, err := obj.GetProperty("org.freedesktop.UPower.State")

		if err != nil {
			conn.Close()
			time.Sleep(sleeptime * time.Second)
			continue
		}

		var status string = "?"
		var chtime string = "00:00"

		if state.Value().(uint32) == 1 {
			mytime, err := obj.GetProperty("org.freedesktop.UPower.TimeToFull")

			if err != nil {
				chtime = "00:00"
			} else {
				var seconds = mytime.Value().(int64)
				chtime = secondsToClock(seconds)
			}

			status = "▲"
		} else if state.Value().(uint32) == 2 {
			mytime, err := obj.GetProperty("org.freedesktop.UPower.TimeToEmpty")

			if err != nil {
				chtime = "00:00"
			} else {
				var seconds = mytime.Value().(int64)
				chtime = secondsToClock(seconds)
			}

			status = "▼"
		} else if state.Value().(uint32) == 4 {
			status = "•"
		}

		charge = fmt.Sprintf("[%02d%% %s %s]\n", pcharge, status, chtime)
		time.Sleep(sleeptime * time.Second)
	}
}

func myping() {
	for true {
		conn, e := net.DialTimeout("tcp", "jenkins:443", 3000 * time.Millisecond)

		if e != nil {
			pingres = false
		} else {
			conn.Close()
			pingres = true
		}

		time.Sleep(sleeptime * time.Second)
	}
}

func handleConnection(conn net.Conn) {
	buf := make([]byte, 1024)
	bufLen, err := conn.Read(buf)

	if err == nil {
		tail := string(buf[bufLen - 4 : bufLen])

		// ah, fuck, yea. if you check buffer with \n\r\n\r against "\n\r\n\r" you'll get always FALSE, but if check against hex values, it works
		if bufLen > 4 && fmt.Sprintf("%x", tail) == "0d0a0d0a" {
			if pingres {
				var answer = fmt.Sprintf("HTTP/1.1 200 OK\nContent-Type: text/plain\nConnection: close\n\nReachable %s\n", charge)
				conn.Write([]byte(answer))
			} else {
				var answer = fmt.Sprintf("HTTP/1.1 200 OK\nContent-Type: text/plain\nConnection: close\n\nUnreachable %s\n", charge)
				conn.Write([]byte(answer))
			}

			conn.Close()
		} else {
			conn.Write([]byte("HTTP/1.1 400 Bad Request\nContent-Type: text/plain\nConnection: close\n\nBad Request\n"))
			conn.Close()
		}
	}
}

func main() {
	ln, e := net.Listen("tcp", "127.0.0.1:9000")

	if e != nil {
		fmt.Println(e)
		os.Exit(1)
	}

	go myping()
	go mycharge()

	for {
		// infinitely handle incomming connections
		conn, e := ln.Accept()

		if e != nil {
			// shit happens, let's try one more time
			continue
		}

		go handleConnection(conn)
	}
}

repository: eleksir/wm-helpers

repo_name: eleksir/wm-helpers


text:
PV = "0.0cvs${CVSDATE}"
SECTION = "x11/libs"
PRIORITY = "optional"
MAINTAINER = "Phil Blundell <pb@handhelds.org>"
DEPENDS = "x11 libsm"
DESCRIPTION = "X Toolkit Intrinsics"
LICENSE =  "X-MIT"
PR = "r1"
SRC_URI = "cvs://anoncvs:anoncvs@pdx.freedesktop.org/cvs/xlibs;module=Xt"
S = "${WORKDIR}/Xt"

inherit autotools pkgconfig

do_compile() {
	(
		unset CC LD CXX CCLD
		oe_runmake -C util 'CC=${BUILD_CC}' 'LD=${BUILD_LD}' 'CFLAGS=' 'LDFLAGS=' 'CXXFLAGS=' 'CPPFLAGS=' makestrs
	)
	oe_runmake
}

do_stage () {
	oe_runmake install \
		DESTDIR="" \
		prefix=${STAGING_DIR} \
		bindir=${STAGING_BINDIR} \
		includedir=${STAGING_INCDIR} \
		libdir=${STAGING_LIBDIR} \
		mandir=${STAGING_DATADIR}/man
}

repository: Terentyev/familiar-linux

repo_name: Terentyev/familiar-linux


text:
<?xml version="1.0" encoding="utf-8"?>
<!DOCTYPE eagle SYSTEM "eagle.dtd">
<eagle version="7.3.0">
<drawing>
<settings>
<setting alwaysvectorfont="no"/>
<setting verticaltext="up"/>
</settings>
<grid distance="0.025" unitdist="mm" unit="mm" style="lines" multiple="1" display="no" altdistance="0.01" altunitdist="mm" altunit="mm"/>
<layers>
<layer number="1" name="Top" color="4" fill="1" visible="yes" active="yes"/>
<layer number="16" name="Bottom" color="1" fill="1" visible="yes" active="yes"/>
<layer number="17" name="Pads" color="2" fill="1" visible="yes" active="yes"/>
<layer number="18" name="Vias" color="2" fill="1" visible="yes" active="yes"/>
<layer number="19" name="Unrouted" color="6" fill="1" visible="yes" active="yes"/>
<layer number="20" name="Dimension" color="15" fill="1" visible="yes" active="yes"/>
<layer number="21" name="tPlace" color="7" fill="1" visible="yes" active="yes"/>
<layer number="22" name="bPlace" color="7" fill="1" visible="yes" active="yes"/>
<layer number="23" name="tOrigins" color="15" fill="1" visible="yes" active="yes"/>
<layer number="24" name="bOrigins" color="15" fill="1" visible="yes" active="yes"/>
<layer number="25" name="tNames" color="7" fill="1" visible="yes" active="yes"/>
<layer number="26" name="bNames" color="7" fill="1" visible="yes" active="yes"/>
<layer number="27" name="tValues" color="7" fill="1" visible="yes" active="yes"/>
<layer number="28" name="bValues" color="7" fill="1" visible="yes" active="yes"/>
<layer number="29" name="tStop" color="7" fill="3" visible="no" active="yes"/>
<layer number="30" name="bStop" color="7" fill="6" visible="no" active="yes"/>
<layer number="31" name="tCream" color="7" fill="4" visible="no" active="yes"/>
<layer number="32" name="bCream" color="7" fill="5" visible="no" active="yes"/>
<layer number="33" name="tFinish" color="6" fill="3" visible="no" active="yes"/>
<layer number="34" name="bFinish" color="6" fill="6" visible="no" active="yes"/>
<layer number="35" name="tGlue" color="7" fill="4" visible="no" active="yes"/>
<layer number="36" name="bGlue" color="7" fill="5" visible="no" active="yes"/>
<layer number="37" name="tTest" color="7" fill="1" visible="no" active="yes"/>
<layer number="38" name="bTest" color="7" fill="1" visible="no" active="yes"/>
<layer number="39" name="tKeepout" color="4" fill="11" visible="yes" active="yes"/>
<layer number="40" name="bKeepout" color="1" fill="11" visible="yes" active="yes"/>
<layer number="41" name="tRestrict" color="4" fill="10" visible="yes" active="yes"/>
<layer number="42" name="bRestrict" color="1" fill="10" visible="yes" active="yes"/>
<layer number="43" name="vRestrict" color="2" fill="10" visible="yes" active="yes"/>
<layer number="44" name="Drills" color="7" fill="1" visible="no" active="yes"/>
<layer number="45" name="Holes" color="7" fill="1" visible="no" active="yes"/>
<layer number="46" name="Milling" color="3" fill="1" visible="no" active="yes"/>
<layer number="47" name="Measures" color="7" fill="1" visible="no" active="yes"/>
<layer number="48" name="Document" color="7" fill="1" visible="yes" active="yes"/>
<layer number="49" name="Reference" color="7" fill="1" visible="yes" active="yes"/>
<layer number="50" name="dxf" color="7" fill="1" visible="no" active="no"/>
<layer number="51" name="tDocu" color="7" fill="1" visible="yes" active="yes"/>
<layer number="52" name="bDocu" color="7" fill="1" visible="yes" active="yes"/>
<layer number="53" name="tGND_GNDA" color="7" fill="9" visible="no" active="no"/>
<layer number="54" name="bGND_GNDA" color="1" fill="9" visible="no" active="no"/>
<layer number="56" name="wert" color="7" fill="1" visible="no" active="no"/>
<layer number="57" name="tCAD" color="7" fill="1" visible="no" active="no"/>
<layer number="59" name="tCarbon" color="7" fill="1" visible="no" active="no"/>
<layer number="60" name="bCarbon" color="7" fill="1" visible="no" active="no"/>
<layer number="90" name="Modules" color="5" fill="1" visible="no" active="no"/>
<layer number="91" name="Nets" color="2" fill="1" visible="no" active="no"/>
<layer number="92" name="Busses" color="1" fill="1" visible="no" active="no"/>
<layer number="93" name="Pins" color="2" fill="1" visible="no" active="no"/>
<layer number="94" name="Symbols" color="4" fill="1" visible="no" active="no"/>
<layer number="95" name="Names" color="7" fill="1" visible="no" active="no"/>
<layer number="96" name="Values" color="7" fill="1" visible="no" active="no"/>
<layer number="97" name="Info" color="7" fill="1" visible="no" active="no"/>
<layer number="98" name="Guide" color="6" fill="1" visible="no" active="no"/>
<layer number="99" name="SpiceOrder" color="7" fill="1" visible="no" active="no"/>
<layer number="100" name="Muster" color="7" fill="1" visible="no" active="no"/>
<layer number="101" name="Patch_Top" color="12" fill="4" visible="no" active="yes"/>
<layer number="102" name="Vscore" color="7" fill="1" visible="no" active="yes"/>
<layer number="103" name="tMap" color="7" fill="1" visible="no" active="yes"/>
<layer number="104" name="Name" color="16" fill="1" visible="no" active="yes"/>
<layer number="105" name="tPlate" color="7" fill="1" visible="no" active="yes"/>
<layer number="106" name="bPlate" color="7" fill="1" visible="no" active="yes"/>
<layer number="107" name="Crop" color="7" fill="1" visible="no" active="yes"/>
<layer number="108" name="tplace-old" color="10" fill="1" visible="no" active="yes"/>
<layer number="109" name="ref-old" color="11" fill="1" visible="no" active="yes"/>
<layer number="110" name="fp0" color="7" fill="1" visible="no" active="yes"/>
<layer number="111" name="LPC17xx" color="7" fill="1" visible="no" active="yes"/>
<layer number="112" name="tSilk" color="7" fill="1" visible="no" active="yes"/>
<layer number="113" name="IDFDebug" color="4" fill="1" visible="no" active="yes"/>
<layer number="116" name="Patch_BOT" color="9" fill="4" visible="no" active="yes"/>
<layer number="118" name="Rect_Pads" color="7" fill="1" visible="yes" active="yes"/>
<layer number="121" name="_tsilk" color="7" fill="1" visible="no" active="yes"/>
<layer number="122" name="_bsilk" color="7" fill="1" visible="no" active="yes"/>
<layer number="123" name="tTestmark" color="7" fill="1" visible="no" active="yes"/>
<layer number="124" name="bTestmark" color="7" fill="1" visible="no" active="yes"/>
<layer number="125" name="_tNames" color="7" fill="1" visible="no" active="yes"/>
<layer number="126" name="_bNames" color="7" fill="1" visible="no" active="yes"/>
<layer number="127" name="_tValues" color="7" fill="1" visible="no" active="yes"/>
<layer number="128" name="_bValues" color="7" fill="1" visible="no" active="yes"/>
<layer number="129" name="Mask" color="7" fill="1" visible="yes" active="yes"/>
<layer number="131" name="tAdjust" color="7" fill="1" visible="no" active="yes"/>
<layer number="132" name="bAdjust" color="7" fill="1" visible="no" active="yes"/>
<layer number="144" name="Drill_legend" color="7" fill="1" visible="no" active="yes"/>
<layer number="150" name="Notes" color="7" fill="1" visible="no" active="yes"/>
<layer number="151" name="HeatSink" color="7" fill="1" visible="no" active="yes"/>
<layer number="152" name="_bDocu" color="7" fill="1" visible="no" active="yes"/>
<layer number="153" name="FabDoc1" color="7" fill="1" visible="no" active="yes"/>
<layer number="154" name="FabDoc2" color="7" fill="1" visible="no" active="yes"/>
<layer number="155" name="FabDoc3" color="7" fill="1" visible="no" active="yes"/>
<layer number="199" name="Contour" color="7" fill="1" visible="no" active="yes"/>
<layer number="200" name="200bmp" color="1" fill="10" visible="no" active="yes"/>
<layer number="201" name="201bmp" color="2" fill="10" visible="no" active="yes"/>
<layer number="202" name="202bmp" color="3" fill="10" visible="no" active="yes"/>
<layer number="203" name="203bmp" color="4" fill="10" visible="no" active="yes"/>
<layer number="204" name="204bmp" color="5" fill="10" visible="no" active="yes"/>
<layer number="205" name="205bmp" color="6" fill="10" visible="no" active="yes"/>
<layer number="206" name="206bmp" color="7" fill="10" visible="no" active="yes"/>
<layer number="207" name="207bmp" color="8" fill="10" visible="no" active="yes"/>
<layer number="208" name="208bmp" color="9" fill="10" visible="no" active="yes"/>
<layer number="209" name="209bmp" color="7" fill="1" visible="no" active="yes"/>
<layer number="210" name="210bmp" color="7" fill="1" visible="no" active="yes"/>
<layer number="211" name="211bmp" color="7" fill="1" visible="no" active="yes"/>
<layer number="212" name="212bmp" color="7" fill="1" visible="no" active="yes"/>
<layer number="213" name="213bmp" color="7" fill="1" visible="no" active="yes"/>
<layer number="214" name="214bmp" color="7" fill="1" visible="no" active="yes"/>
<layer number="215" name="215bmp" color="7" fill="1" visible="no" active="yes"/>
<layer number="216" name="216bmp" color="7" fill="1" visible="no" active="yes"/>
<layer number="217" name="217bmp" color="18" fill="1" visible="no" active="no"/>
<layer number="218" name="218bmp" color="19" fill="1" visible="no" active="no"/>
<layer number="219" name="219bmp" color="20" fill="1" visible="no" active="no"/>
<layer number="220" name="220bmp" color="21" fill="1" visible="no" active="no"/>
<layer number="221" name="221bmp" color="22" fill="1" visible="no" active="no"/>
<layer number="222" name="222bmp" color="23" fill="1" visible="no" active="no"/>
<layer number="223" name="223bmp" color="24" fill="1" visible="no" active="no"/>
<layer number="224" name="224bmp" color="25" fill="1" visible="no" active="no"/>
<layer number="225" name="225bmp" color="7" fill="1" visible="yes" active="yes"/>
<layer number="226" name="226bmp" color="7" fill="1" visible="yes" active="yes"/>
<layer number="227" name="227bmp" color="7" fill="1" visible="yes" active="yes"/>
<layer number="228" name="228bmp" color="7" fill="1" visible="yes" active="yes"/>
<layer number="229" name="229bmp" color="7" fill="1" visible="yes" active="yes"/>
<layer number="230" name="230bmp" color="7" fill="1" visible="yes" active="yes"/>
<layer number="231" name="231bmp" color="7" fill="1" visible="yes" active="yes"/>
<layer number="232" name="Eagle3D_PG2" color="7" fill="1" visible="no" active="no"/>
<layer number="233" name="Eagle3D_PG3" color="7" fill="1" visible="no" active="no"/>
<layer number="248" name="Housing" color="7" fill="1" visible="no" active="yes"/>
<layer number="249" name="Edge" color="7" fill="1" visible="no" active="yes"/>
<layer number="250" name="Descript" color="3" fill="1" visible="no" active="no"/>
<layer number="251" name="SMDround" color="12" fill="11" visible="no" active="no"/>
<layer number="254" name="cooling" color="7" fill="1" visible="no" active="yes"/>
<layer number="255" name="routoute" color="7" fill="1" visible="yes" active="yes"/>
</layers>
<board>
<plain>
<wire x1="0" y1="0" x2="100" y2="0" width="0" layer="20"/>
<wire x1="100" y1="0" x2="100" y2="80" width="0" layer="20"/>
<wire x1="100" y1="80" x2="0" y2="80" width="0" layer="20"/>
<wire x1="0" y1="80" x2="0" y2="0" width="0" layer="20"/>
<wire x1="24.758796875" y1="11.970346875" x2="19.133796875" y2="2.227559375" width="0" layer="20"/>
<wire x1="19.133796875" y1="2.227559375" x2="7.883796875" y2="2.227559375" width="0" layer="20"/>
<wire x1="7.883796875" y1="2.227559375" x2="2.258796875" y2="11.970346875" width="0" layer="20"/>
<wire x1="2.258796875" y1="11.970346875" x2="7.883796875" y2="21.71313125" width="0" layer="20"/>
<wire x1="7.883796875" y1="21.71313125" x2="19.133796875" y2="21.71313125" width="0" layer="20"/>
<wire x1="19.133796875" y1="21.71313125" x2="24.758796875" y2="11.970346875" width="0" layer="20"/>
<wire x1="14.003975" y1="3.997153125" x2="14.003975" y2="3.85908125" width="0" layer="48"/>
<wire x1="14.003975" y1="3.85908125" x2="13.989984375" y2="3.7933125" width="0" layer="48"/>
<wire x1="13.989984375" y1="3.7933125" x2="13.964684375" y2="3.73349375" width="0" layer="48"/>
<wire x1="13.964684375" y1="3.73349375" x2="13.93938125" y2="3.673675" width="0" layer="48"/>
<wire x1="13.93938125" y1="3.673675" x2="13.90276875" y2="3.61980625" width="0" layer="48"/>
<wire x1="13.90276875" y1="3.61980625" x2="13.857528125" y2="3.5745625" width="0" layer="48"/>
<wire x1="13.857528125" y1="3.5745625" x2="13.8122875" y2="3.529321875" width="0" layer="48"/>
<wire x1="13.8122875" y1="3.529321875" x2="13.75841875" y2="3.4927125" width="0" layer="48"/>
<wire x1="13.75841875" y1="3.4927125" x2="13.698596875" y2="3.467409375" width="0" layer="48"/>
<wire x1="13.698596875" y1="3.467409375" x2="13.638778125" y2="3.442109375" width="0" layer="48"/>
<wire x1="13.638778125" y1="3.442109375" x2="13.5730125" y2="3.42811875" width="0" layer="48"/>
<wire x1="13.5730125" y1="3.42811875" x2="13.434940625" y2="3.42811875" width="0" layer="48"/>
<wire x1="13.434940625" y1="3.42811875" x2="13.369171875" y2="3.442109375" width="0" layer="48"/>
<wire x1="13.369171875" y1="3.442109375" x2="13.309353125" y2="3.467409375" width="0" layer="48"/>
<wire x1="13.309353125" y1="3.467409375" x2="13.249534375" y2="3.4927125" width="0" layer="48"/>
<wire x1="13.249534375" y1="3.4927125" x2="13.1956625" y2="3.529321875" width="0" layer="48"/>
<wire x1="13.1956625" y1="3.529321875" x2="13.150421875" y2="3.5745625" width="0" layer="48"/>
<wire x1="13.150421875" y1="3.5745625" x2="13.10518125" y2="3.61980625" width="0" layer="48"/>
<wire x1="13.10518125" y1="3.61980625" x2="13.06856875" y2="3.673675" width="0" layer="48"/>
<wire x1="13.06856875" y1="3.673675" x2="13.04326875" y2="3.73349375" width="0" layer="48"/>
<wire x1="13.04326875" y1="3.73349375" x2="13.017965625" y2="3.7933125" width="0" layer="48"/>
<wire x1="13.017965625" y1="3.7933125" x2="13.003975" y2="3.85908125" width="0" layer="48"/>
<wire x1="13.003975" y1="3.85908125" x2="13.003975" y2="3.997153125" width="0" layer="48"/>
<wire x1="13.003975" y1="3.997153125" x2="13.017965625" y2="4.062921875" width="0" layer="48"/>
<wire x1="13.017965625" y1="4.062921875" x2="13.04326875" y2="4.122740625" width="0" layer="48"/>
<wire x1="13.04326875" y1="4.122740625" x2="13.06856875" y2="4.182559375" width="0" layer="48"/>
<wire x1="13.06856875" y1="4.182559375" x2="13.10518125" y2="4.23643125" width="0" layer="48"/>
<wire x1="13.10518125" y1="4.23643125" x2="13.1956625" y2="4.3269125" width="0" layer="48"/>
<wire x1="13.1956625" y1="4.3269125" x2="13.249534375" y2="4.363525" width="0" layer="48"/>
<wire x1="13.249534375" y1="4.363525" x2="13.309353125" y2="4.388825" width="0" layer="48"/>
<wire x1="13.309353125" y1="4.388825" x2="13.369171875" y2="4.414128125" width="0" layer="48"/>
<wire x1="13.369171875" y1="4.414128125" x2="13.434940625" y2="4.42811875" width="0" layer="48"/>
<wire x1="13.434940625" y1="4.42811875" x2="13.5730125" y2="4.42811875" width="0" layer="48"/>
<wire x1="13.5730125" y1="4.42811875" x2="13.638778125" y2="4.414128125" width="0" layer="48"/>
<wire x1="13.638778125" y1="4.414128125" x2="13.698596875" y2="4.388825" width="0" layer="48"/>
<wire x1="13.698596875" y1="4.388825" x2="13.75841875" y2="4.363525" width="0" layer="48"/>
<wire x1="13.75841875" y1="4.363525" x2="13.8122875" y2="4.3269125" width="0" layer="48"/>
<wire x1="13.8122875" y1="4.3269125" x2="13.90276875" y2="4.23643125" width="0" layer="48"/>
<wire x1="13.90276875" y1="4.23643125" x2="13.93938125" y2="4.182559375" width="0" layer="48"/>
<wire x1="13.93938125" y1="4.182559375" x2="13.964684375" y2="4.122740625" width="0" layer="48"/>
<wire x1="13.964684375" y1="4.122740625" x2="13.989984375" y2="4.062921875" width="0" layer="48"/>
<wire x1="13.989984375" y1="4.062921875" x2="14.003975" y2="3.997153125" width="0" layer="48"/>
<wire x1="16.543975" y1="3.997153125" x2="16.543975" y2="3.85908125" width="0" layer="48"/>
<wire x1="16.543975" y1="3.85908125" x2="16.529984375" y2="3.793315625" width="0" layer="48"/>
<wire x1="16.529984375" y1="3.793315625" x2="16.50468125" y2="3.73349375" width="0" layer="48"/>
<wire x1="16.50468125" y1="3.73349375" x2="16.47938125" y2="3.673675" width="0" layer="48"/>
<wire x1="16.47938125" y1="3.673675" x2="16.44276875" y2="3.61980625" width="0" layer="48"/>
<wire x1="16.44276875" y1="3.61980625" x2="16.3522875" y2="3.529325" width="0" layer="48"/>
<wire x1="16.3522875" y1="3.529325" x2="16.298415625" y2="3.4927125" width="0" layer="48"/>
<wire x1="16.298415625" y1="3.4927125" x2="16.238596875" y2="3.4674125" width="0" layer="48"/>
<wire x1="16.238596875" y1="3.4674125" x2="16.178778125" y2="3.442109375" width="0" layer="48"/>
<wire x1="16.178778125" y1="3.442109375" x2="16.1130125" y2="3.42811875" width="0" layer="48"/>
<wire x1="16.1130125" y1="3.42811875" x2="15.9749375" y2="3.42811875" width="0" layer="48"/>
<wire x1="15.9749375" y1="3.42811875" x2="15.909171875" y2="3.442109375" width="0" layer="48"/>
<wire x1="15.909171875" y1="3.442109375" x2="15.849353125" y2="3.4674125" width="0" layer="48"/>
<wire x1="15.849353125" y1="3.4674125" x2="15.789534375" y2="3.4927125" width="0" layer="48"/>
<wire x1="15.789534375" y1="3.4927125" x2="15.7356625" y2="3.529325" width="0" layer="48"/>
<wire x1="15.7356625" y1="3.529325" x2="15.64518125" y2="3.61980625" width="0" layer="48"/>
<wire x1="15.64518125" y1="3.61980625" x2="15.60856875" y2="3.673675" width="0" layer="48"/>
<wire x1="15.60856875" y1="3.673675" x2="15.583265625" y2="3.73349375" width="0" layer="48"/>
<wire x1="15.583265625" y1="3.73349375" x2="15.557965625" y2="3.793315625" width="0" layer="48"/>
<wire x1="15.557965625" y1="3.793315625" x2="15.543975" y2="3.85908125" width="0" layer="48"/>
<wire x1="15.543975" y1="3.85908125" x2="15.543975" y2="3.997153125" width="0" layer="48"/>
<wire x1="15.543975" y1="3.997153125" x2="15.557965625" y2="4.062921875" width="0" layer="48"/>
<wire x1="15.557965625" y1="4.062921875" x2="15.583265625" y2="4.122740625" width="0" layer="48"/>
<wire x1="15.583265625" y1="4.122740625" x2="15.60856875" y2="4.182559375" width="0" layer="48"/>
<wire x1="15.60856875" y1="4.182559375" x2="15.64518125" y2="4.23643125" width="0" layer="48"/>
<wire x1="15.64518125" y1="4.23643125" x2="15.7356625" y2="4.3269125" width="0" layer="48"/>
<wire x1="15.7356625" y1="4.3269125" x2="15.789534375" y2="4.363525" width="0" layer="48"/>
<wire x1="15.789534375" y1="4.363525" x2="15.849353125" y2="4.388825" width="0" layer="48"/>
<wire x1="15.849353125" y1="4.388825" x2="15.909171875" y2="4.414128125" width="0" layer="48"/>
<wire x1="15.909171875" y1="4.414128125" x2="15.9749375" y2="4.42811875" width="0" layer="48"/>
<wire x1="15.9749375" y1="4.42811875" x2="16.1130125" y2="4.42811875" width="0" layer="48"/>
<wire x1="16.1130125" y1="4.42811875" x2="16.178778125" y2="4.414128125" width="0" layer="48"/>
<wire x1="16.178778125" y1="4.414128125" x2="16.238596875" y2="4.388825" width="0" layer="48"/>
<wire x1="16.238596875" y1="4.388825" x2="16.298415625" y2="4.363525" width="0" layer="48"/>
<wire x1="16.298415625" y1="4.363525" x2="16.3522875" y2="4.3269125" width="0" layer="48"/>
<wire x1="16.3522875" y1="4.3269125" x2="16.44276875" y2="4.23643125" width="0" layer="48"/>
<wire x1="16.44276875" y1="4.23643125" x2="16.47938125" y2="4.182559375" width="0" layer="48"/>
<wire x1="16.47938125" y1="4.182559375" x2="16.50468125" y2="4.122740625" width="0" layer="48"/>
<wire x1="16.50468125" y1="4.122740625" x2="16.529984375" y2="4.062921875" width="0" layer="48"/>
<wire x1="16.529984375" y1="4.062921875" x2="16.543975" y2="3.997153125" width="0" layer="48"/>
<wire x1="11.463975" y1="3.997153125" x2="11.463975" y2="3.85908125" width="0" layer="48"/>
<wire x1="11.463975" y1="3.85908125" x2="11.449984375" y2="3.7933125" width="0" layer="48"/>
<wire x1="11.449984375" y1="3.7933125" x2="11.424684375" y2="3.73349375" width="0" layer="48"/>
<wire x1="11.424684375" y1="3.73349375" x2="11.39938125" y2="3.673675" width="0" layer="48"/>
<wire x1="11.39938125" y1="3.673675" x2="11.36276875" y2="3.61980625" width="0" layer="48"/>
<wire x1="11.36276875" y1="3.61980625" x2="11.317528125" y2="3.5745625" width="0" layer="48"/>
<wire x1="11.317528125" y1="3.5745625" x2="11.2722875" y2="3.529321875" width="0" layer="48"/>
<wire x1="11.2722875" y1="3.529321875" x2="11.218415625" y2="3.4927125" width="0" layer="48"/>
<wire x1="11.218415625" y1="3.4927125" x2="11.158596875" y2="3.467409375" width="0" layer="48"/>
<wire x1="11.158596875" y1="3.467409375" x2="11.098778125" y2="3.442109375" width="0" layer="48"/>
<wire x1="11.098778125" y1="3.442109375" x2="11.0330125" y2="3.42811875" width="0" layer="48"/>
<wire x1="11.0330125" y1="3.42811875" x2="10.894940625" y2="3.42811875" width="0" layer="48"/>
<wire x1="10.894940625" y1="3.42811875" x2="10.829171875" y2="3.442109375" width="0" layer="48"/>
<wire x1="10.829171875" y1="3.442109375" x2="10.769353125" y2="3.467409375" width="0" layer="48"/>
<wire x1="10.769353125" y1="3.467409375" x2="10.709534375" y2="3.4927125" width="0" layer="48"/>
<wire x1="10.709534375" y1="3.4927125" x2="10.6556625" y2="3.529321875" width="0" layer="48"/>
<wire x1="10.6556625" y1="3.529321875" x2="10.610421875" y2="3.5745625" width="0" layer="48"/>
<wire x1="10.610421875" y1="3.5745625" x2="10.56518125" y2="3.61980625" width="0" layer="48"/>
<wire x1="10.56518125" y1="3.61980625" x2="10.52856875" y2="3.673675" width="0" layer="48"/>
<wire x1="10.52856875" y1="3.673675" x2="10.50326875" y2="3.73349375" width="0" layer="48"/>
<wire x1="10.50326875" y1="3.73349375" x2="10.477965625" y2="3.7933125" width="0" layer="48"/>
<wire x1="10.477965625" y1="3.7933125" x2="10.463975" y2="3.85908125" width="0" layer="48"/>
<wire x1="10.463975" y1="3.85908125" x2="10.463975" y2="3.997153125" width="0" layer="48"/>
<wire x1="10.463975" y1="3.997153125" x2="10.477965625" y2="4.062921875" width="0" layer="48"/>
<wire x1="10.477965625" y1="4.062921875" x2="10.50326875" y2="4.122740625" width="0" layer="48"/>
<wire x1="10.50326875" y1="4.122740625" x2="10.52856875" y2="4.182559375" width="0" layer="48"/>
<wire x1="10.52856875" y1="4.182559375" x2="10.56518125" y2="4.23643125" width="0" layer="48"/>
<wire x1="10.56518125" y1="4.23643125" x2="10.6556625" y2="4.3269125" width="0" layer="48"/>
<wire x1="10.6556625" y1="4.3269125" x2="10.709534375" y2="4.363525" width="0" layer="48"/>
<wire x1="10.709534375" y1="4.363525" x2="10.769353125" y2="4.388825" width="0" layer="48"/>
<wire x1="10.769353125" y1="4.388825" x2="10.829171875" y2="4.414128125" width="0" layer="48"/>
<wire x1="10.829171875" y1="4.414128125" x2="10.894940625" y2="4.42811875" width="0" layer="48"/>
<wire x1="10.894940625" y1="4.42811875" x2="11.0330125" y2="4.42811875" width="0" layer="48"/>
<wire x1="11.0330125" y1="4.42811875" x2="11.098778125" y2="4.414128125" width="0" layer="48"/>
<wire x1="11.098778125" y1="4.414128125" x2="11.158596875" y2="4.388825" width="0" layer="48"/>
<wire x1="11.158596875" y1="4.388825" x2="11.218415625" y2="4.363525" width="0" layer="48"/>
<wire x1="11.218415625" y1="4.363525" x2="11.2722875" y2="4.3269125" width="0" layer="48"/>
<wire x1="11.2722875" y1="4.3269125" x2="11.36276875" y2="4.23643125" width="0" layer="48"/>
<wire x1="11.36276875" y1="4.23643125" x2="11.39938125" y2="4.182559375" width="0" layer="48"/>
<wire x1="11.39938125" y1="4.182559375" x2="11.424684375" y2="4.122740625" width="0" layer="48"/>
<wire x1="11.424684375" y1="4.122740625" x2="11.449984375" y2="4.062921875" width="0" layer="48"/>
<wire x1="11.449984375" y1="4.062921875" x2="11.463975" y2="3.997153125" width="0" layer="48"/>
</plain>
<libraries>
<library name="SparkFun-Connectors">
<description><h3>SparkFun Electronics' preferred foot prints</h3>
In this library you'll find connectors and sockets- basically anything that can be plugged into or onto.<br><br>
We've spent an enormous amount of time creating and checking these footprints and parts, but it is the end user's responsibility to ensure correctness and suitablity for a given componet or application. If you enjoy using this library, please buy one of our products at www.sparkfun.com.
<br><br>
<b>Licensing:</b> Creative Commons ShareAlike 4.0 International - https://creativecommons.org/licenses/by-sa/4.0/
<br><br>
You are welcome to use this library for commercial purposes. For attribution, we ask that when you begin to sell your device using our footprint, you email us with a link to the product being sold. We want bragging rights that we helped (in a very small part) to create your 8th world wonder. We would like the opportunity to feature your device on our homepage.</description>
<packages>
<package name="1X03">
<wire x1="3.81" y1="0.635" x2="4.445" y2="1.27" width="0.2032" layer="21"/>
<wire x1="4.445" y1="1.27" x2="5.715" y2="1.27" width="0.2032" layer="21"/>
<wire x1="5.715" y1="1.27" x2="6.35" y2="0.635" width="0.2032" layer="21"/>
<wire x1="6.35" y1="-0.635" x2="5.715" y2="-1.27" width="0.2032" layer="21"/>
<wire x1="5.715" y1="-1.27" x2="4.445" y2="-1.27" width="0.2032" layer="21"/>
<wire x1="4.445" y1="-1.27" x2="3.81" y2="-0.635" width="0.2032" layer="21"/>
<wire x1="-0.635" y1="1.27" x2="0.635" y2="1.27" width="0.2032" layer="21"/>
<wire x1="0.635" y1="1.27" x2="1.27" y2="0.635" width="0.2032" layer="21"/>
<wire x1="1.27" y1="-0.635" x2="0.635" y2="-1.27" width="0.2032" layer="21"/>
<wire x1="1.27" y1="0.635" x2="1.905" y2="1.27" width="0.2032" layer="21"/>
<wire x1="1.905" y1="1.27" x2="3.175" y2="1.27" width="0.2032" layer="21"/>
<wire x1="3.175" y1="1.27" x2="3.81" y2="0.635" width="0.2032" layer="21"/>
<wire x1="3.81" y1="-0.635" x2="3.175" y2="-1.27" width="0.2032" layer="21"/>
<wire x1="3.175" y1="-1.27" x2="1.905" y2="-1.27" width="0.2032" layer="21"/>
<wire x1="1.905" y1="-1.27" x2="1.27" y2="-0.635" width="0.2032" layer="21"/>
<wire x1="-1.27" y1="0.635" x2="-1.27" y2="-0.635" width="0.2032" layer="21"/>
<wire x1="-0.635" y1="1.27" x2="-1.27" y2="0.635" width="0.2032" layer="21"/>
<wire x1="-1.27" y1="-0.635" x2="-0.635" y2="-1.27" width="0.2032" layer="21"/>
<wire x1="0.635" y1="-1.27" x2="-0.635" y2="-1.27" width="0.2032" layer="21"/>
<wire x1="6.35" y1="0.635" x2="6.35" y2="-0.635" width="0.2032" layer="21"/>
<pad name="1" x="0" y="0" drill="1.016" diameter="1.8796" rot="R90"/>
<pad name="2" x="2.54" y="0" drill="1.016" diameter="1.8796" rot="R90"/>
<pad name="3" x="5.08" y="0" drill="1.016" diameter="1.8796" rot="R90"/>
<text x="-1.3462" y="1.8288" size="1.27" layer="25" ratio="10">>NAME</text>
<text x="-1.27" y="-3.175" size="1.27" layer="27">>VALUE</text>
<rectangle x1="4.826" y1="-0.254" x2="5.334" y2="0.254" layer="51"/>
<rectangle x1="2.286" y1="-0.254" x2="2.794" y2="0.254" layer="51"/>
<rectangle x1="-0.254" y1="-0.254" x2="0.254" y2="0.254" layer="51"/>
</package>
</packages>
</library>
</libraries>
<attributes>
</attributes>
<variantdefs>
</variantdefs>
<classes>
<class number="0" name="default" width="0" drill="0">
</class>
</classes>
<designrules name="default">
<description language="de"><b>EAGLE Design Rules</b>
<p>
Die Standard-Design-Rules sind so gewählt, dass sie für
die meisten Anwendungen passen. Sollte ihre Platine
besondere Anforderungen haben, treffen Sie die erforderlichen
Einstellungen hier und speichern die Design Rules unter
einem neuen Namen ab.</description>
<description language="en"><b>EAGLE Design Rules</b>
<p>
The default Design Rules have been set to cover
a wide range of applications. Your particular design
may have different requirements, so please make the
necessary adjustments and save your customized
design rules under a new name.</description>
<param name="layerSetup" value="(1*16)"/>
<param name="mtCopper" value="0.035mm 0.035mm 0.035mm 0.035mm 0.035mm 0.035mm 0.035mm 0.035mm 0.035mm 0.035mm 0.035mm 0.035mm 0.035mm 0.035mm 0.035mm 0.035mm"/>
<param name="mtIsolate" value="1.5mm 0.15mm 0.2mm 0.15mm 0.2mm 0.15mm 0.2mm 0.15mm 0.2mm 0.15mm 0.2mm 0.15mm 0.2mm 0.15mm 0.2mm"/>
<param name="mdWireWire" value="8mil"/>
<param name="mdWirePad" value="8mil"/>
<param name="mdWireVia" value="8mil"/>
<param name="mdPadPad" value="8mil"/>
<param name="mdPadVia" value="8mil"/>
<param name="mdViaVia" value="8mil"/>
<param name="mdSmdPad" value="8mil"/>
<param name="mdSmdVia" value="8mil"/>
<param name="mdSmdSmd" value="8mil"/>
<param name="mdViaViaSameLayer" value="8mil"/>
<param name="mnLayersViaInSmd" value="2"/>
<param name="mdCopperDimension" value="40mil"/>
<param name="mdDrill" value="8mil"/>
<param name="mdSmdStop" value="0mil"/>
<param name="msWidth" value="10mil"/>
<param name="msDrill" value="24mil"/>
<param name="msMicroVia" value="9.99mm"/>
<param name="msBlindViaRatio" value="0.5"/>
<param name="rvPadTop" value="0.25"/>
<param name="rvPadInner" value="0.25"/>
<param name="rvPadBottom" value="0.25"/>
<param name="rvViaOuter" value="0.25"/>
<param name="rvViaInner" value="0.25"/>
<param name="rvMicroViaOuter" value="0.25"/>
<param name="rvMicroViaInner" value="0.25"/>
<param name="rlMinPadTop" value="10mil"/>
<param name="rlMaxPadTop" value="20mil"/>
<param name="rlMinPadInner" value="10mil"/>
<param name="rlMaxPadInner" value="20mil"/>
<param name="rlMinPadBottom" value="10mil"/>
<param name="rlMaxPadBottom" value="20mil"/>
<param name="rlMinViaOuter" value="8mil"/>
<param name="rlMaxViaOuter" value="20mil"/>
<param name="rlMinViaInner" value="8mil"/>
<param name="rlMaxViaInner" value="20mil"/>
<param name="rlMinMicroViaOuter" value="4mil"/>
<param name="rlMaxMicroViaOuter" value="20mil"/>
<param name="rlMinMicroViaInner" value="4mil"/>
<param name="rlMaxMicroViaInner" value="20mil"/>
<param name="psTop" value="-1"/>
<param name="psBottom" value="-1"/>
<param name="psFirst" value="-1"/>
<param name="psElongationLong" value="100"/>
<param name="psElongationOffset" value="100"/>
<param name="mvStopFrame" value="1"/>
<param name="mvCreamFrame" value="0"/>
<param name="mlMinStopFrame" value="4mil"/>
<param name="mlMaxStopFrame" value="4mil"/>
<param name="mlMinCreamFrame" value="0mil"/>
<param name="mlMaxCreamFrame" value="0mil"/>
<param name="mlViaStopLimit" value="0mil"/>
<param name="srRoundness" value="0"/>
<param name="srMinRoundness" value="0mil"/>
<param name="srMaxRoundness" value="0mil"/>
<param name="slThermalIsolate" value="10mil"/>
<param name="slThermalsForVias" value="0"/>
<param name="dpMaxLengthDifference" value="10mm"/>
<param name="dpGapFactor" value="2.5"/>
<param name="checkGrid" value="0"/>
<param name="checkAngle" value="0"/>
<param name="checkFont" value="1"/>
<param name="checkRestrict" value="1"/>
<param name="useDiameter" value="13"/>
<param name="maxErrors" value="50"/>
</designrules>
<autorouter>
<pass name="Default">
<param name="RoutingGrid" value="50mil"/>
<param name="AutoGrid" value="1"/>
<param name="Efforts" value="0"/>
<param name="TopRouterVariant" value="1"/>
<param name="tpViaShape" value="round"/>
<param name="PrefDir.1" value="a"/>
<param name="PrefDir.2" value="0"/>
<param name="PrefDir.3" value="0"/>
<param name="PrefDir.4" value="0"/>
<param name="PrefDir.5" value="0"/>
<param name="PrefDir.6" value="0"/>
<param name="PrefDir.7" value="0"/>
<param name="PrefDir.8" value="0"/>
<param name="PrefDir.9" value="0"/>
<param name="PrefDir.10" value="0"/>
<param name="PrefDir.11" value="0"/>
<param name="PrefDir.12" value="0"/>
<param name="PrefDir.13" value="0"/>
<param name="PrefDir.14" value="0"/>
<param name="PrefDir.15" value="0"/>
<param name="PrefDir.16" value="a"/>
<param name="cfVia" value="8"/>
<param name="cfNonPref" value="5"/>
<param name="cfChangeDir" value="2"/>
<param name="cfOrthStep" value="2"/>
<param name="cfDiagStep" value="3"/>
<param name="cfExtdStep" value="0"/>
<param name="cfBonusStep" value="1"/>
<param name="cfMalusStep" value="1"/>
<param name="cfPadImpact" value="4"/>
<param name="cfSmdImpact" value="4"/>
<param name="cfBusImpact" value="0"/>
<param name="cfHugging" value="3"/>
<param name="cfAvoid" value="4"/>
<param name="cfPolygon" value="10"/>
<param name="cfBase.1" value="0"/>
<param name="cfBase.2" value="1"/>
<param name="cfBase.3" value="1"/>
<param name="cfBase.4" value="1"/>
<param name="cfBase.5" value="1"/>
<param name="cfBase.6" value="1"/>
<param name="cfBase.7" value="1"/>
<param name="cfBase.8" value="1"/>
<param name="cfBase.9" value="1"/>
<param name="cfBase.10" value="1"/>
<param name="cfBase.11" value="1"/>
<param name="cfBase.12" value="1"/>
<param name="cfBase.13" value="1"/>
<param name="cfBase.14" value="1"/>
<param name="cfBase.15" value="1"/>
<param name="cfBase.16" value="0"/>
<param name="mnVias" value="20"/>
<param name="mnSegments" value="9999"/>
<param name="mnExtdSteps" value="9999"/>
<param name="mnRipupLevel" value="10"/>
<param name="mnRipupSteps" value="100"/>
<param name="mnRipupTotal" value="100"/>
</pass>
<pass name="Follow-me" refer="Default" active="yes">
</pass>
<pass name="Busses" refer="Default" active="yes">
<param name="cfNonPref" value="4"/>
<param name="cfBusImpact" value="4"/>
<param name="cfHugging" value="0"/>
<param name="mnVias" value="0"/>
</pass>
<pass name="Route" refer="Default" active="yes">
</pass>
<pass name="Optimize1" refer="Default" active="yes">
<param name="cfVia" value="99"/>
<param name="cfExtdStep" value="10"/>
<param name="cfHugging" value="1"/>
<param name="mnExtdSteps" value="1"/>
<param name="mnRipupLevel" value="0"/>
</pass>
<pass name="Optimize2" refer="Optimize1" active="yes">
<param name="cfNonPref" value="0"/>
<param name="cfChangeDir" value="6"/>
<param name="cfExtdStep" value="0"/>
<param name="cfBonusStep" value="2"/>
<param name="cfMalusStep" value="2"/>
<param name="cfPadImpact" value="2"/>
<param name="cfSmdImpact" value="2"/>
<param name="cfHugging" value="0"/>
</pass>
<pass name="Optimize3" refer="Optimize2" active="yes">
<param name="cfChangeDir" value="8"/>
<param name="cfPadImpact" value="0"/>
<param name="cfSmdImpact" value="0"/>
</pass>
<pass name="Optimize4" refer="Optimize3" active="yes">
<param name="cfChangeDir" value="25"/>
</pass>
</autorouter>
<elements>
<element name="JP1" library="SparkFun-Connectors" package="1X03" value="" x="16.04" y="3.93" smashed="yes" rot="R180">
<attribute name="VALUE" x="17.31" y="7.105" size="1.27" layer="27" rot="R180"/>
</element>
</elements>
<signals>
<signal name="VCC">
<contactref element="JP1" pad="3"/>
</signal>
<signal name="GND">
<contactref element="JP1" pad="2"/>
</signal>
<signal name="0X6SOUT">
<contactref element="JP1" pad="1"/>
</signal>
</signals>
</board>
</drawing>
</eagle>

repository: MakerWear/MakerWear

repo_name: MakerWear/MakerWear

extension: brd


text:
package cloudscript

// CloudScriptRevisionOption
type CloudScriptRevisionOption string

const (
     CloudScriptRevisionOptionLive CloudScriptRevisionOption = "Live"
     CloudScriptRevisionOptionLatest CloudScriptRevisionOption = "Latest"
     CloudScriptRevisionOptionSpecific CloudScriptRevisionOption = "Specific"
      )
// EmptyResult
type EmptyResultModel struct {
}

// EntityKey combined entity type and ID structure which uniquely identifies a single entity.
type EntityKeyModel struct {
    // Id unique ID of the entity.
    Id string `json:"Id,omitempty"`
    // Type entity type. See https://api.playfab.com/docs/tutorials/entities/entitytypes
    Type string `json:"Type,omitempty"`
}

// ExecuteCloudScriptResult
type ExecuteCloudScriptResultModel struct {
    // APIRequestsIssued number of PlayFab API requests issued by the CloudScript function
    APIRequestsIssued int32 `json:"APIRequestsIssued,omitempty"`
    // Error information about the error, if any, that occurred during execution
    Error *ScriptExecutionErrorModel `json:"Error,omitempty"`
    // ExecutionTimeSeconds
    ExecutionTimeSeconds float64 `json:"ExecutionTimeSeconds,omitempty"`
    // FunctionName the name of the function that executed
    FunctionName string `json:"FunctionName,omitempty"`
    // FunctionResult the object returned from the CloudScript function, if any
    FunctionResult interface{} `json:"FunctionResult,omitempty"`
    // FunctionResultTooLarge flag indicating if the FunctionResult was too large and was subsequently dropped from this event. This only occurs if
// the total event size is larger than 350KB.
    FunctionResultTooLarge bool `json:"FunctionResultTooLarge,omitempty"`
    // HttpRequestsIssued number of external HTTP requests issued by the CloudScript function
    HttpRequestsIssued int32 `json:"HttpRequestsIssued,omitempty"`
    // Logs entries logged during the function execution. These include both entries logged in the function code using log.info()
// and log.error() and error entries for API and HTTP request failures.
    Logs []LogStatementModel `json:"Logs,omitempty"`
    // LogsTooLarge flag indicating if the logs were too large and were subsequently dropped from this event. This only occurs if the total
// event size is larger than 350KB after the FunctionResult was removed.
    LogsTooLarge bool `json:"LogsTooLarge,omitempty"`
    // MemoryConsumedBytes
    MemoryConsumedBytes uint32 `json:"MemoryConsumedBytes,omitempty"`
    // ProcessorTimeSeconds processor time consumed while executing the function. This does not include time spent waiting on API calls or HTTP
// requests.
    ProcessorTimeSeconds float64 `json:"ProcessorTimeSeconds,omitempty"`
    // Revision the revision of the CloudScript that executed
    Revision int32 `json:"Revision,omitempty"`
}

// ExecuteEntityCloudScriptRequest executes CloudScript with the entity profile that is defined in the request.
type ExecuteEntityCloudScriptRequestModel struct {
    // Entity the entity to perform this action on.
    Entity *EntityKeyModel `json:"Entity,omitempty"`
    // FunctionName the name of the CloudScript function to execute
    FunctionName string `json:"FunctionName,omitempty"`
    // FunctionParameter object that is passed in to the function as the first argument
    FunctionParameter interface{} `json:"FunctionParameter,omitempty"`
    // GeneratePlayStreamEvent generate a 'entity_executed_cloudscript' PlayStream event containing the results of the function execution and other
// contextual information. This event will show up in the PlayStream debugger console for the player in Game Manager.
    GeneratePlayStreamEvent bool `json:"GeneratePlayStreamEvent,omitempty"`
    // RevisionSelection option for which revision of the CloudScript to execute. 'Latest' executes the most recently created revision, 'Live'
// executes the current live, published revision, and 'Specific' executes the specified revision. The default value is
// 'Specific', if the SpecificRevision parameter is specified, otherwise it is 'Live'.
    RevisionSelection CloudScriptRevisionOption `json:"RevisionSelection,omitempty"`
    // SpecificRevision the specific revision to execute, when RevisionSelection is set to 'Specific'
    SpecificRevision int32 `json:"SpecificRevision,omitempty"`
}

// ExecuteFunctionRequest executes an Azure Function with the profile of the entity that is defined in the request.
type ExecuteFunctionRequestModel struct {
    // Entity the entity to perform this action on.
    Entity *EntityKeyModel `json:"Entity,omitempty"`
    // FunctionName the name of the CloudScript function to execute
    FunctionName string `json:"FunctionName,omitempty"`
    // FunctionParameter object that is passed in to the function as the FunctionArgument field of the FunctionExecutionContext data structure
    FunctionParameter interface{} `json:"FunctionParameter,omitempty"`
    // GeneratePlayStreamEvent generate a 'entity_executed_cloudscript_function' PlayStream event containing the results of the function execution and
// other contextual information. This event will show up in the PlayStream debugger console for the player in Game Manager.
    GeneratePlayStreamEvent bool `json:"GeneratePlayStreamEvent,omitempty"`
}

// ExecuteFunctionResult
type ExecuteFunctionResultModel struct {
    // Error error from the CloudScript Azure Function.
    Error *FunctionExecutionErrorModel `json:"Error,omitempty"`
    // ExecutionTimeMilliseconds the amount of time the function took to execute
    ExecutionTimeMilliseconds int32 `json:"ExecutionTimeMilliseconds,omitempty"`
    // FunctionName the name of the function that executed
    FunctionName string `json:"FunctionName,omitempty"`
    // FunctionResult the object returned from the function, if any
    FunctionResult interface{} `json:"FunctionResult,omitempty"`
    // FunctionResultTooLarge flag indicating if the FunctionResult was too large and was subsequently dropped from this event.
    FunctionResultTooLarge bool `json:"FunctionResultTooLarge,omitempty"`
}

// FunctionExecutionError
type FunctionExecutionErrorModel struct {
    // Error error code, such as CloudScriptAzureFunctionsExecutionTimeLimitExceeded, CloudScriptAzureFunctionsArgumentSizeExceeded,
// CloudScriptAzureFunctionsReturnSizeExceeded or CloudScriptAzureFunctionsHTTPRequestError
    Error string `json:"Error,omitempty"`
    // Message details about the error
    Message string `json:"Message,omitempty"`
    // StackTrace point during the execution of the function at which the error occurred, if any
    StackTrace string `json:"StackTrace,omitempty"`
}

// FunctionModel
type FunctionModelModel struct {
    // FunctionName
    FunctionName string `json:"FunctionName,omitempty"`
    // FunctionUrl
    FunctionUrl string `json:"FunctionUrl,omitempty"`
}

// ListFunctionsRequest a title can have many functions, ListFunctions will return a list of all the currently registered functions for a given
// title.
type ListFunctionsRequestModel struct {
    // Entity the entity to perform this action on.
    Entity *EntityKeyModel `json:"Entity,omitempty"`
}

// ListFunctionsResult
type ListFunctionsResultModel struct {
    // Functions
    Functions []FunctionModelModel `json:"Functions,omitempty"`
}

// LogStatement
type LogStatementModel struct {
    // Data optional object accompanying the message as contextual information
    Data interface{} `json:"Data,omitempty"`
    // Level 'Debug', 'Info', or 'Error'
    Level string `json:"Level,omitempty"`
    // Message
    Message string `json:"Message,omitempty"`
}

// RegisterHttpFunctionRequest a title can have many functions, RegisterFunction associates a function name to a URL that can be invoked by
// CloudScript.ExecuteFunction or in response to a PlayStream event or as part of a Task.
type RegisterHttpFunctionRequestModel struct {
    // Entity the entity to perform this action on.
    Entity *EntityKeyModel `json:"Entity,omitempty"`
    // FunctionName the name of the function to register
    FunctionName string `json:"FunctionName,omitempty"`
    // FunctionUrl full URL for Azure Function that implements the function.
    FunctionUrl string `json:"FunctionUrl,omitempty"`
}

// ScriptExecutionError
type ScriptExecutionErrorModel struct {
    // Error error code, such as CloudScriptNotFound, JavascriptException, CloudScriptFunctionArgumentSizeExceeded,
// CloudScriptAPIRequestCountExceeded, CloudScriptAPIRequestError, or CloudScriptHTTPRequestError
    Error string `json:"Error,omitempty"`
    // Message details about the error
    Message string `json:"Message,omitempty"`
    // StackTrace point during the execution of the script at which the error occurred, if any
    StackTrace string `json:"StackTrace,omitempty"`
}

// UnregisterFunctionRequest a title can have many functions, UnregisterFunction disassociates a previously registered function from the title.
type UnregisterFunctionRequestModel struct {
    // Entity the entity to perform this action on.
    Entity *EntityKeyModel `json:"Entity,omitempty"`
    // FunctionName the name of the function to unregister
    FunctionName string `json:"FunctionName,omitempty"`
}

repository: SumoServer/playfabsdk-go

repo_name: SumoServer/playfabsdk-go


text:
using System;
using System.Collections.Generic;
using System.Diagnostics.CodeAnalysis;
using Light.GuardClauses;

namespace Light.Json.Contracts
{
    public sealed class ImmutableContractProvider : IContractProvider
    {
        private readonly Dictionary<TypeKey, ISerializationContract> _serializationContracts;

        public ImmutableContractProvider(Dictionary<TypeKey, ISerializationContract> serializationContracts) =>
            _serializationContracts = serializationContracts.MustNotBeNull(nameof(serializationContracts));

        public bool TryGetContract<TContract>(TypeKey typeKey, [NotNullWhen(true)] out TContract? contract)
            where TContract : class, ISerializationContract
        {
            if (_serializationContracts.TryGetValue(typeKey, out var serializationContract) &&
                serializationContract is TContract serializeOnlyContract)
            {
                contract = serializeOnlyContract;
                return true;
            }

            contract = default;
            return false;
        }
    }
}

gha_license_id: MIT

gha_language: C#

extension: cs


text:
/**
 * @file ws28xx.cpp
 *
 */
/* Copyright (C) 2017-2022 by Arjan van Vught mailto:info@orangepi-dmx.nl
 *
 * Permission is hereby granted, free of charge, to any person obtaining a copy
 * of this software and associated documentation files (the "Software"), to deal
 * in the Software without restriction, including without limitation the rights
 * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
 * copies of the Software, and to permit persons to whom the Software is
 * furnished to do so, subject to the following conditions:

 * The above copyright notice and this permission notice shall be included in
 * all copies or substantial portions of the Software.

 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
 * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
 * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
 * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
 * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
 * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
 * THE SOFTWARE.
 */

#include <cstdint>
#include <cstdio>
#include <cassert>

#include "ws28xx.h"
#include "pixeltype.h"

#include "gamma/gamma_tables.h"

using namespace pixel;

#if !defined(__clang__)	// Needed for compiling on MacOS
# pragma GCC push_options
# pragma GCC optimize ("O3")
#endif

void WS28xx::SetPixel(uint32_t nPixelIndex, uint8_t nRed, uint8_t nGreen, uint8_t nBlue) {
	assert(nPixelIndex < m_PixelConfiguration.GetCount());

	const auto pGammaTable = m_PixelConfiguration.GetGammaTable();

	nRed = pGammaTable[nRed];
	nGreen = pGammaTable[nGreen];
	nBlue = pGammaTable[nBlue];

	if (m_PixelConfiguration.IsRTZProtocol()) {
		const auto nOffset = nPixelIndex * 24U;

		switch (m_PixelConfiguration.GetMap()) {
		case Map::RGB:
			SetColorWS28xx(nOffset, nRed);
			SetColorWS28xx(nOffset + 8, nGreen);
			SetColorWS28xx(nOffset + 16, nBlue);
			break;
		case Map::RBG:
			SetColorWS28xx(nOffset, nRed);
			SetColorWS28xx(nOffset + 8, nBlue);
			SetColorWS28xx(nOffset + 16, nGreen);
			break;
		case Map::GRB:
			SetColorWS28xx(nOffset, nGreen);
			SetColorWS28xx(nOffset + 8, nRed);
			SetColorWS28xx(nOffset + 16, nBlue);
			break;
		case Map::GBR:
			SetColorWS28xx(nOffset, nGreen);
			SetColorWS28xx(nOffset + 8, nBlue);
			SetColorWS28xx(nOffset + 16, nRed);
			break;
		case Map::BRG:
			SetColorWS28xx(nOffset, nBlue);
			SetColorWS28xx(nOffset + 8, nRed);
			SetColorWS28xx(nOffset + 16, nGreen);
			break;
		case Map::BGR:
			SetColorWS28xx(nOffset, nBlue);
			SetColorWS28xx(nOffset + 8, nGreen);
			SetColorWS28xx(nOffset + 16, nRed);
			break;
		default:  // RGB
			SetColorWS28xx(nOffset, nRed);
			SetColorWS28xx(nOffset + 8, nGreen);
			SetColorWS28xx(nOffset + 16, nBlue);
			break;
		}

		return;
	}

	assert(m_pBuffer != nullptr);

	const auto type = m_PixelConfiguration.GetType();

	if ((type == Type::APA102) || (type == Type::SK9822)) {
		const auto nOffset = 4U + (nPixelIndex * 4U);
		assert(nOffset + 3U < m_nBufSize);

		m_pBuffer[nOffset] = m_PixelConfiguration.GetGlobalBrightness();
		m_pBuffer[nOffset + 1] = nRed;
		m_pBuffer[nOffset + 2] = nGreen;
		m_pBuffer[nOffset + 3] = nBlue;

		return;
	}

	if (type == Type::WS2801) {
		const auto nOffset = nPixelIndex * 3U;
		assert(nOffset + 2U < m_nBufSize);

		m_pBuffer[nOffset] = nRed;
		m_pBuffer[nOffset + 1] = nGreen;
		m_pBuffer[nOffset + 2] = nBlue;

		return;
	}

	if (type == Type::P9813) {
		const auto nOffset = 4U + (nPixelIndex * 4U);
		assert(nOffset + 3 < m_nBufSize);

		const auto nFlag = static_cast<uint8_t>(0xC0 | ((~nBlue & 0xC0) >> 2) | ((~nGreen & 0xC0) >> 4) | ((~nRed & 0xC0) >> 6));

		m_pBuffer[nOffset] = nFlag;
		m_pBuffer[nOffset + 1] = nBlue;
		m_pBuffer[nOffset + 2] = nGreen;
		m_pBuffer[nOffset + 3] = nRed;

		return;
	}

	assert(0);
	__builtin_unreachable();
}

void WS28xx::SetPixel(uint32_t nPixelIndex, uint8_t nRed, uint8_t nGreen, uint8_t nBlue, uint8_t nWhite) {
	assert(nPixelIndex < m_PixelConfiguration.GetCount());
	assert(m_PixelConfiguration.GetType() == Type::SK6812W);

	const auto pGammaTable = m_PixelConfiguration.GetGammaTable();

	nRed = pGammaTable[nRed];
	nGreen = pGammaTable[nGreen];
	nBlue = pGammaTable[nBlue];
	nWhite = pGammaTable[nWhite];

	const auto nOffset = nPixelIndex * 32U;

	SetColorWS28xx(nOffset, nGreen);
	SetColorWS28xx(nOffset + 8, nRed);
	SetColorWS28xx(nOffset + 16, nBlue);
	SetColorWS28xx(nOffset + 24, nWhite);
}

void WS28xx::SetColorWS28xx(uint32_t nOffset, uint8_t nValue) {
	assert(m_PixelConfiguration.GetType() != Type::WS2801);
	assert(m_pBuffer != nullptr);
	assert(nOffset + 7 < m_nBufSize);

	nOffset += 1;

	const auto nLowCode = m_PixelConfiguration.GetLowCode();
	const auto nHighCode = m_PixelConfiguration.GetHighCode();

	for (uint8_t mask = 0x80; mask != 0; mask = static_cast<uint8_t>(mask >> 1)) {
		if (nValue & mask) {
			m_pBuffer[nOffset] = nHighCode;
		} else {
			m_pBuffer[nOffset] = nLowCode;
		}
		nOffset++;
	}
}

extension: cpp


text:
package utils

import (
	"encoding/json"
	"time"

	"github.com/go-redis/redis/v7"
	"github.com/rl404/go-malscraper/pkg/malscraper/model/common"
)

// GetValueFromRedis to get value from redis. Assume redis is already connected.
func GetValueFromRedis(client *redis.Client, key string) (value string, err error) {
	if client != nil {
		return client.Get(key).Result()
	}
	return value, common.ErrMissingRedis
}

// UnmarshalFromRedis to unmarshal redis value to model.
func UnmarshalFromRedis(client *redis.Client, key string, model interface{}) (isFound bool, err error) {
	value, err := GetValueFromRedis(client, key)
	if err != nil && err != redis.Nil {
		return false, err
	}

	if err == redis.Nil {
		return false, nil
	}

	return true, json.Unmarshal([]byte(value), &model)
}

// SaveToRedis to save value to redis. Assume redis is already connected.
func SaveToRedis(client *redis.Client, key string, value interface{}, expiredTime time.Duration) error {
	if client != nil {
		jsonData, err := json.Marshal(value)
		if err != nil {
			return err
		}

		// To keep the time when data saved to redis.
		go saveRedisTime(client, key, expiredTime)

		return client.Set(key, jsonData, expiredTime).Err()
	}
	return common.ErrMissingRedis
}

// saveRedisTime to save saved time and expired time of the key to redis.
func saveRedisTime(client *redis.Client, key string, expiredTime time.Duration) {
	now := time.Now()
	client.Set(key+":time", redisTimeStr(now), expiredTime)
	client.Set(key+":expired", redisTimeStr(now.Add(expiredTime)), expiredTime)
}

// redisTimeStr to convert time format to string.
func redisTimeStr(t time.Time) string {
	return t.Format("2006-01-02 15:04:05")
}

repository: fossabot/go-malscraper

repo_name: fossabot/go-malscraper


text:
@article{Licitra2018c,
 author = {Licitra, Giovanni and Bürger, Adrian and Williams, Paul and Ruiterkamp, Richard and Diehl, Moritz},
 date = {2018-05-22},
 doi = {10.1016/j.conengprac.2018.04.013},
 journal = {Control Engineering Practice},
 keywords = {Autonomous aircraft, Optimum experimental design, Optimization, System identification and parameter estimation},
 pages = {15--27},
 title = {Optimal input design for autonomous aircraft},
 volume = {77},
 year = {2018}
}

extension: bib


text:
package classfile

import (
	"encoding/binary"
)

var bigEndian = binary.BigEndian

type ClassReader struct {
	bytecode []byte
}

func NewClassReader(bytecode []byte) *ClassReader {
	return &ClassReader{bytecode: bytecode}
}

func (cr *ClassReader) ReadUint32() uint32 {
	value := bigEndian.Uint32(cr.bytecode[:4])
	cr.bytecode = cr.bytecode[4:]
	return value
}

func (cr *ClassReader) ReadUint16() uint16 {
	value := bigEndian.Uint16(cr.bytecode[:2])
	cr.bytecode = cr.bytecode[2:]
	return value
}

func (cr *ClassReader) ReadUint8() uint8 {
	return uint8(cr.ReadBytes(1)[0])
}

func (cr *ClassReader) ReadBytes(len int) []byte {
	bytes := cr.bytecode[:len]
	cr.bytecode = cr.bytecode[len:]
	return bytes
}

func (cr *ClassReader) Length() int {
	return len(cr.bytecode)
}

repository: tinycedar/classp

repo_name: tinycedar/classp


text:
package doubleteam

import (
	"context"
	"fmt"
	"sync"
	"sync/atomic"
	"time"

	"github.com/msales/double-team/streaming"
	"github.com/msales/pkg/v3/log"
	"github.com/msales/pkg/v3/stats"
	"github.com/pkg/errors"
)

type applicationErrors []error

func (ae applicationErrors) Error() string {
	return fmt.Sprintf("app: Failed to close %d producers cleanly.", len(ae))
}

var errUnhealthy = errors.New("app: service unhealthy")

// Application represents the application.
type Application struct {
	producers []streaming.Producer
	messages  chan *streaming.Message

	statsTimer *time.Ticker

	errorCount  int64
	unhealthy   bool
	closeErrors chan error
}

// NewApplication creates an instance of Application.
func NewApplication(ctx context.Context, producers []streaming.Producer, queueSize int) *Application {
	closeMutex := sync.WaitGroup{}
	app := &Application{
		producers:   producers,
		messages:    make(chan *streaming.Message, queueSize),
		closeErrors: make(chan error),
	}

	channels := map[string]*chan *streaming.Message{}

	// Wire the producer chain
	ch := &app.messages
	for _, p := range app.producers {
		channels[p.Name()] = ch
		go func(ch *chan *streaming.Message, p streaming.Producer) {
			for msg := range *ch {
				p.Input() <- msg
				_ = stats.Inc(ctx, "produced", 1, 1.0, "queue", p.Name())
			}

			closeMutex.Add(1)
			app.closeErrors <- p.Close()
			closeMutex.Done()
		}(ch, p)

		newCh := make(chan *streaming.Message, queueSize)
		ch = &newCh
		go func(ch *chan *streaming.Message, p streaming.Producer) {
			for err := range p.Errors() {
				for _, msg := range err.Msgs {
					*ch <- msg
					_ = stats.Inc(ctx, "error", 1, 1.0, "queue", p.Name())
					log.Error(ctx, "error: ", msg, "queue", p.Name())
				}
			}
			close(*ch)
		}(ch, p)
	}

	// Wire the black-hole
	go func(ch *chan *streaming.Message) {
		for range *ch {
			atomic.AddInt64(&app.errorCount, 1)
			_ = stats.Inc(ctx, "produced", 1, 1.0, "queue", "black-hole")
		}

		closeMutex.Wait()
		close(app.closeErrors)
	}(ch)

	app.statsTimer = time.NewTicker(1 * time.Second)
	go func() {
		for range app.statsTimer.C {
			for k, ch := range channels {
				_ = stats.Gauge(ctx, "queue_length", float64(len(*ch)), 1.0, "queue", k)
				_ = stats.Gauge(ctx, "queue_length_max", float64(cap(*ch)), 1.0, "queue", k)
			}
		}
	}()

	return app
}

// Send sends a message to the producer chain.
func (a *Application) Send(topic string, key, data []byte) {
	a.messages <- &streaming.Message{
		Topic: topic,
		Key:   key,
		Data:  data,
	}
}

// Close closes the application and cleans up.
func (a *Application) Close() error {
	close(a.messages)

	var errs applicationErrors
	for err := range a.closeErrors {
		if err != nil {
			errs = append(errs, err)
		}
	}

	if len(errs) > 0 {
		return errs
	}
	return nil
}

// IsHealthy checks the health of the Application.
func (a *Application) IsHealthy() error {
	if a.unhealthy {
		return errUnhealthy
	}

	errs := atomic.LoadInt64(&a.errorCount)
	if errs > 0 {
		a.unhealthy = true
		return errUnhealthy
	}

	return nil
}

repository: msales/archive-double-team

repo_name: msales/archive-double-team


text:
package collection

import (
	"testing"

	"github.com/stretchr/testify/assert"
	"github.com/tal-tech/go-zero/core/stringx"
)

func TestSafeMap(t *testing.T) {
	tests := []struct {
		size      int
		exception int
	}{
		{
			100000,
			2000,
		},
		{
			100000,
			50,
		},
	}
	for _, test := range tests {
		t.Run(stringx.Rand(), func(t *testing.T) {
			testSafeMapWithParameters(t, test.size, test.exception)
		})
	}
}

func TestSafeMap_CopyNew(t *testing.T) {
	const (
		size       = 100000
		exception1 = 5
		exception2 = 500
	)
	m := NewSafeMap()

	for i := 0; i < size; i++ {
		m.Set(i, i)
	}
	for i := 0; i < size; i++ {
		if i%exception1 == 0 {
			m.Del(i)
		}
	}

	for i := size; i < size<<1; i++ {
		m.Set(i, i)
	}
	for i := size; i < size<<1; i++ {
		if i%exception2 != 0 {
			m.Del(i)
		}
	}

	for i := 0; i < size; i++ {
		val, ok := m.Get(i)
		if i%exception1 != 0 {
			assert.True(t, ok)
			assert.Equal(t, i, val.(int))
		} else {
			assert.False(t, ok)
		}
	}
	for i := size; i < size<<1; i++ {
		val, ok := m.Get(i)
		if i%exception2 == 0 {
			assert.True(t, ok)
			assert.Equal(t, i, val.(int))
		} else {
			assert.False(t, ok)
		}
	}
}

func testSafeMapWithParameters(t *testing.T, size, exception int) {
	m := NewSafeMap()

	for i := 0; i < size; i++ {
		m.Set(i, i)
	}
	for i := 0; i < size; i++ {
		if i%exception != 0 {
			m.Del(i)
		}
	}

	assert.Equal(t, size/exception, m.Size())

	for i := size; i < size<<1; i++ {
		m.Set(i, i)
	}
	for i := size; i < size<<1; i++ {
		if i%exception != 0 {
			m.Del(i)
		}
	}

	for i := 0; i < size<<1; i++ {
		val, ok := m.Get(i)
		if i%exception == 0 {
			assert.True(t, ok)
			assert.Equal(t, i, val.(int))
		} else {
			assert.False(t, ok)
		}
	}
}

gha_language: Go


text:
// ------------------------------------------------------------------------------
// <copyright file="FileTranspiler.cs" company="Drake53">
// Licensed under the MIT license.
// See the LICENSE file in the project root for more information.
// </copyright>
// ------------------------------------------------------------------------------

#pragma warning disable SA1402 // File may only contain a single type
#pragma warning disable SA1649 // File name should match first type name

using System;
using System.Collections.Generic;
using System.Text;

using Microsoft.CodeAnalysis.CSharp.Syntax;

namespace War3Net.CodeAnalysis.Jass.Transpilers
{
    public static partial class JassToCSharpTranspiler
    {
        public static IEnumerable<MemberDeclarationSyntax> Transpile(this Syntax.FileSyntax fileNode, bool apiOnly = false)
        {
            _ = fileNode ?? throw new ArgumentNullException(nameof(fileNode));

            foreach (var declaration in fileNode.DeclarationList.Transpile())
            {
                yield return declaration;
            }

            foreach (var function in fileNode.FunctionList)
            {
                if (apiOnly)
                {
                    // Transform function into native function to remove function body.
                    yield return function.AsNativeFunction().Transpile();
                }
                else
                {
                    yield return function.Transpile();
                }
            }

            foreach (var enumDeclaration in TranspileToEnumHandler.GetEnums())
            {
                yield return enumDeclaration;
            }

            TranspileToEnumHandler.Reset();
        }
    }

    public static partial class JassToLuaTranspiler
    {
        public static void Transpile(this Syntax.FileSyntax fileNode, ref StringBuilder sb, bool resetStringConcatenationHandler = true)
        {
            _ = fileNode ?? throw new ArgumentNullException(nameof(fileNode));

            foreach (var declaration in fileNode.DeclarationList)
            {
                declaration.Transpile(ref sb);
            }

            foreach (var function in fileNode.FunctionList)
            {
                function.Transpile(ref sb);
            }

            if (resetStringConcatenationHandler)
            {
                TranspileStringConcatenationHandler.Reset();
            }
        }
    }
}


text:
SRCDATE = "20200504"

require hd-bootargs.inc

SRC_URI[sha256sum] = "5a6116bb361beea8e11168e3607be4c9d0e936a8f436f61a6fe6b0f08d1476de"

COMPATIBLE_MACHINE = "hd61"

repository: neutrino-hd/meta-hisilicon

repo_name: neutrino-hd/meta-hisilicon

branch_name: refs/heads/dunfell

gha_language: BitBake


text:
#include<iostream>
using namespace std;
// we are using Binary search and count odd digit from 1 to x
class Solution {
public:
    int mySqrt(int x) {
        int low=1, high=x;
        while(low<=high){
            // It cause Integer Overflow
            //int mid = (low+high)/2;
            //cout<<mid<<endl;
            int mid = low+(high-low)/2;
            int temp = x/mid;

            if(temp == mid){
               return mid;
            }else if(temp<mid){
                high=mid-1;
            }else{
                low = mid+1;
            }
       }
       return low-1;
    }
};

int main(){
    // square root of 4,8 is 2
    int x = 8;
    Solution s;
    int c = s.mySqrt(x);
    cout<<"Square Root :"<<c;
    return 0;
}

repository: santoshgawande/DS-Algorithms

repo_name: santoshgawande/DS-Algorithms


text:
/*
* McEliece Integrated Encryption System
* (C) 2014,2015 Jack Lloyd
*
* Botan is released under the Simplified BSD License (see license.txt)
*/

#ifndef BOTAN_MCEIES_H_
#define BOTAN_MCEIES_H_

#include <botan/secmem.h>
#include <string>

namespace Botan {

class RandomNumberGenerator;
class McEliece_PublicKey;
class McEliece_PrivateKey;

/**
* McEliece Integrated Encryption System
* Derive a shared key using MCE KEM and encrypt/authenticate the
* plaintext and AD using AES-256 in OCB mode.
*/
secure_vector<uint8_t>
BOTAN_PUBLIC_API(2,0) mceies_encrypt(const McEliece_PublicKey& pubkey,
                         const uint8_t pt[], size_t pt_len,
                         const uint8_t ad[], size_t ad_len,
                         RandomNumberGenerator& rng,
                         const std::string& aead = "AES-256/OCB");

/**
* McEliece Integrated Encryption System
* Derive a shared key using MCE KEM and decrypt/authenticate the
* ciphertext and AD using AES-256 in OCB mode.
*/
secure_vector<uint8_t>
BOTAN_PUBLIC_API(2,0) mceies_decrypt(const McEliece_PrivateKey& privkey,
                         const uint8_t ct[], size_t ct_len,
                         const uint8_t ad[], size_t ad_len,
                         const std::string& aead = "AES-256/OCB");

}

#endif

repository: Rohde-Schwarz/botan

repo_name: Rohde-Schwarz/botan

extension: h


text:
require greengrass.inc

SRC_URI_arm = " \
    https://d1onfpft10uf5o.cloudfront.net/greengrass-core/downloads/${PV}/greengrass-linux-armv7l-${PV}.tar.gz;name=arm \
    file://greengrass.service \
    file://greengrass-init \
"

SRC_URI_aarch64 = " \
    https://d1onfpft10uf5o.cloudfront.net/greengrass-core/downloads/${PV}/greengrass-linux-aarch64-${PV}.tar.gz;name=aarch64 \
    file://greengrass.service \
    file://greengrass-init \
"

SRC_URI_x86-64 = " \
    https://d1onfpft10uf5o.cloudfront.net/greengrass-core/downloads/${PV}/greengrass-linux-x86-64-${PV}.tar.gz;name=x86-64 \
    file://greengrass.service \
    file://greengrass-init \
"

SRC_URI[arm.md5sum]        = "e54bb57929bc278ea89737c4abcd89e8"
SRC_URI[arm.sha256sum]     = "91f3d92dca977ea504921c7dbae96a926adce441c8f9ec1896e4c8cf085d6d2e"

SRC_URI[aarch64.md5sum]    = "1bdde4df4c461cd5502f7adbb79b2903"
SRC_URI[aarch64.sha256sum] = "912ecbe10398382894045f9b9dafd16eac7fabce0fc04fc9ee83c8ec8f67ca5a"

SRC_URI[x86-64.md5sum]     = "cd363d38e22a1918ca0bc6ea8d07a931"
SRC_URI[x86-64.sha256sum]  = "589d91ab2a358d028cd0c458efdcc1a80d19a1fb8d41c358f928d6a98c333f42"


text:
# SPDX-FileCopyrightText: 2017-2019 Volker Krause <vkrause@kde.org>
# SPDX-FileCopyrightText: 2019 Hannah Kiekens <hannahkiekens@gmail.com>
#
# SPDX-License-Identifier: MIT

SUMMARY = "Lightning Memory-Mapped Database (LMDB)"
HOMEPAGE = "https://symas.com/lightning-memory-mapped-database/"
LICENSE = "OLDAP-2.8"
LIC_FILES_CHKSUM = "file://LICENSE;md5=153d07ef052c4a37a8fac23bc6031972"

SRC_URI = "git://github.com/LMDB/lmdb.git;nobranch=1;protocol=https \
           file://run-ptest \
           file://0001-Makefile-use-libprefix-instead-of-libdir.patch \
           file://0001-make-set-soname-on-liblmdb.patch;patchdir=../.. \
           "

SRCREV = "ce201088de95d26fc0da36ba805bf2ddc2ba74ff"

inherit ptest

S = "${WORKDIR}/git/libraries/liblmdb"

do_compile() {
    oe_runmake CC="${CC}" SOEXT=".so.${PV}" LDFLAGS="${LDFLAGS}" XCFLAGS="${CFLAGS}"
}

do_install() {
    oe_runmake CC="${CC}" DESTDIR="${D}" prefix="${prefix}" libprefix="${libdir}" manprefix="${mandir}" SOEXT=".so.${PV}" LDFLAGS="${LDFLAGS}" XCFLAGS="${CFLAGS}" install
    cd ${D}${libdir}
    ln -s liblmdb.so.${PV} liblmdb.so
    rm liblmdb.a
}

do_install_ptest() {
    install -d ${D}${PTEST_PATH}/tests
    for test in mtest mtest2 mtest3 mtest4 mtest5 mdb_stat; do
        install -m 755 ${S}/$test ${D}${PTEST_PATH}/tests
    done
}

repository: openembedded/meta-openembedded

repo_name: openembedded/meta-openembedded


text:
package cache

import (
	"sort"
	"testing"

	"github.com/api7/apisix-mesh-agent/pkg/types/apisix"

	"github.com/stretchr/testify/assert"
)

func TestUpstream(t *testing.T) {
	u := newUpstream()
	assert.NotNil(t, u)

	// Not found
	obj, err := u.Get("1")
	assert.Nil(t, obj)
	assert.Equal(t, err, ErrObjectNotFound)
	assert.Equal(t, u.Delete("1"), ErrObjectNotFound)

	ups1 := &apisix.Upstream{
		Id: "1",
	}
	assert.Nil(t, u.Insert(ups1))

	obj, err = u.Get("1")
	assert.Nil(t, err)
	assert.Equal(t, obj.Id, "1")

	// Update
	obj.Name = "Vivian"
	assert.Nil(t, u.Insert(obj))
	obj, err = u.Get("1")
	assert.Nil(t, err)
	assert.Equal(t, obj.Id, "1")
	assert.Equal(t, obj.GetName(), "Vivian")

	// Delete
	assert.Nil(t, u.Delete("1"))
	assert.Equal(t, u.Delete("1"), ErrObjectNotFound)
	obj, err = u.Get("1")
	assert.Nil(t, obj)
	assert.Error(t, err, ErrObjectNotFound)
}

func TestUpstreamList(t *testing.T) {
	objs := []*apisix.Upstream{
		{
			Id: "1",
		},
		{
			Id: "2",
		},
		{
			Id: "3",
		},
	}
	u := newUpstream()
	assert.NotNil(t, u)
	for _, obj := range objs {
		assert.Nil(t, u.Insert(obj))
	}
	list, err := u.List()
	assert.Nil(t, err)
	assert.Len(t, list, 3)

	var ids []string
	for _, elem := range list {
		ids = append(ids, elem.GetId())
	}
	sort.Strings(ids)
	assert.Equal(t, ids[0], "1")
	assert.Equal(t, ids[1], "2")
	assert.Equal(t, ids[2], "3")
}

func TestUpstreamObjectClone(t *testing.T) {
	ups1 := &apisix.Upstream{
		Id: "1",
	}
	u := newUpstream()
	assert.NotNil(t, u)
	assert.Nil(t, u.Insert(ups1))

	obj, err := u.Get("1")
	assert.Nil(t, err)

	obj.Name = "alex"
	obj, err = u.Get("1")
	assert.Nil(t, err)
	assert.Equal(t, obj.Name, "")
}


text:
package leetcode

import (
	"testing"
)

func TestTitleToNumber(t *testing.T) {
	var ret int
	var s string
	ret = 1
	s = "A"
	if ret != titleToNumber(s) {
		t.Fatalf("case fails %v\n", ret)
	}

	ret = 28
	s = "AB"
	if ret != titleToNumber(s) {
		t.Fatalf("case fails %v\n", ret)
	}

	ret = 701
	s = "ZY"
	if ret != titleToNumber(s) {
		t.Fatalf("case fails %v\n", ret)
	}

}

repository: lomy/leetcode

repo_name: lomy/leetcode


text:
package test_test

import (
	"testing"

	"github.com/st-tech/refactoring-conductor/domain"
	"github.com/st-tech/refactoring-conductor/internal"
)

func TestIfStatements(t *testing.T) {
	var expectedCognitiveComplexity = 2
	filename := "testdata/if.vbs"
	vbscript := domain.VBScript{}

	internal.Read(filename, &vbscript)

	if expectedCognitiveComplexity != vbscript.CognitiveComplexity {
		t.Errorf("wrong output: got %v, expected %v", vbscript.CognitiveComplexity, expectedCognitiveComplexity)
	}
}

func TestElseIfStatements(t *testing.T) {
	var expectedCognitiveComplexity = 3
	filename := "testdata/elseif.vbs"
	vbscript := domain.VBScript{}

	internal.Read(filename, &vbscript)

	if expectedCognitiveComplexity != vbscript.CognitiveComplexity {
		t.Errorf("wrong output: got %v, expected %v", vbscript.CognitiveComplexity, expectedCognitiveComplexity)
	}
}

func TestIfStatementsSingleState(t *testing.T) {
	var expectedCognitiveComplexity = 1
	filename := "testdata/if_single_line.vbs"
	vbscript := domain.VBScript{}
	vbscript.NestState = 0

	internal.Read(filename, &vbscript)

	if expectedCognitiveComplexity != vbscript.CognitiveComplexity {
		t.Errorf("wrong output: got %v, expected %v", vbscript.CognitiveComplexity, expectedCognitiveComplexity)
	}
}

func TestIfStatementsNest(t *testing.T) {
	var expectedCognitiveComplexity = 5
	filename := "testdata/if_nest.vbs"
	vbscript := domain.VBScript{}
	vbscript.NestState = 0

	internal.Read(filename, &vbscript)

	if expectedCognitiveComplexity != vbscript.CognitiveComplexity {
		t.Errorf("wrong output: got %v, expected %v", vbscript.CognitiveComplexity, expectedCognitiveComplexity)
	}
}

func TestIfStatementsTripleNest(t *testing.T) {
	var expectedCognitiveComplexity = 8
	filename := "testdata/if_triple_nest.vbs"
	vbscript := domain.VBScript{}
	vbscript.NestState = 0

	internal.Read(filename, &vbscript)

	if expectedCognitiveComplexity != vbscript.CognitiveComplexity {
		t.Errorf("wrong output: got %v, expected %v", vbscript.CognitiveComplexity, expectedCognitiveComplexity)
	}
}

func TestIfEndStatements(t *testing.T) {
	var expectedCognitiveComplexity = 2
	filename := "testdata/if_end.vbs"
	vbscript := domain.VBScript{}

	internal.Read(filename, &vbscript)

	if expectedCognitiveComplexity != vbscript.CognitiveComplexity {
		t.Errorf("wrong output: got %v, expected %v", vbscript.CognitiveComplexity, expectedCognitiveComplexity)
	}
}

repository: pakio/refactoring-conductor

repo_name: pakio/refactoring-conductor


text:
// Microsoft Public License (Ms-PL)
// See the file License.rtf or License.txt for the license details.

// Copyright (c) 2011, Semyon A. Chertkov (semyonc@gmail.com)
// All rights reserved.

using System.Xml.XPath;

namespace Wmhelp.XPath2.Iterator
{
    internal sealed class FollowingSiblingNodeIterator : SequentialAxisNodeIterator
    {
        public FollowingSiblingNodeIterator(XPath2Context context, object nodeTest, XPath2NodeIterator iter)
            : base(context, nodeTest, false, iter)
        {
        }

        private FollowingSiblingNodeIterator(AxisNodeIterator src)
        {
            AssignFrom(src);
        }

        public override XPath2NodeIterator Clone()
        {
            return new FollowingSiblingNodeIterator(this);
        }

        protected override bool MoveToFirst(XPathNavigator nav)
        {
            return nav.MoveToNext();
        }

        protected override bool MoveToNext(XPathNavigator nav)
        {
            return nav.MoveToNext();
        }
    }
}

license: MS-PL

gha_license_id: MS-PL

gha_language: HTML


text:
require ${PN}.inc

PV = "${OPIE_CVS_PV}"

PR = "r2"

SRC_URI = "${HANDHELDS_CVS};module=opie/noncore/applets/cardapplet \
           ${HANDHELDS_CVS};module=opie/pics \
           ${HANDHELDS_CVS};module=opie/sounds \
           ${HANDHELDS_CVS};module=opie/apps \
           ${HANDHELDS_CVS};module=opie/etc"


text:
package rafter_test

import (
	"testing"

	"github.com/kyma-project/kyma/components/console-backend-service/internal/domain/rafter"

	"k8s.io/apimachinery/pkg/runtime"

	"github.com/kyma-project/kyma/components/console-backend-service/internal/gqlschema"
	"github.com/kyma-project/rafter/pkg/apis/rafter/v1beta1"
	"github.com/stretchr/testify/assert"
	"github.com/stretchr/testify/require"
	metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
)

func TestClusterAssetConverter_ToGQL(t *testing.T) {
	converter := rafter.NewClusterAssetConverter()

	t.Run("All properties are given", func(t *testing.T) {
		item := fixClusterAsset()
		expected := gqlschema.ClusterAsset{
			Name: "ExampleName",
			Type: "ExampleType",
			Status: gqlschema.AssetStatus{
				Phase:   gqlschema.AssetPhaseTypeReady,
				Reason:  "ExampleReason",
				Message: "ExampleMessage",
			},
			Parameters:  gqlschema.JSON{"complex": map[string]interface{}{"data": "true"}, "json": "true"},
			DisplayName: "ExampleDisplayName",
		}

		result, err := converter.ToGQL(item)
		require.NoError(t, err)
		assert.Equal(t, &expected, result)
	})

	t.Run("Empty", func(t *testing.T) {
		_, err := converter.ToGQL(&v1beta1.ClusterAsset{})
		require.NoError(t, err)
	})

	t.Run("Nil", func(t *testing.T) {
		item, err := converter.ToGQL(nil)

		require.NoError(t, err)
		assert.Nil(t, item)
	})
}

func TestClusterAssetConverter_ToGQLs(t *testing.T) {
	converter := rafter.NewClusterAssetConverter()

	t.Run("Success", func(t *testing.T) {
		clusterAssets := []*v1beta1.ClusterAsset{
			fixClusterAsset(),
			fixClusterAsset(),
		}

		result, err := converter.ToGQLs(clusterAssets)

		require.NoError(t, err)
		assert.Len(t, result, 2)
		assert.Equal(t, "ExampleName", result[0].Name)
	})

	t.Run("Empty", func(t *testing.T) {
		var clusterAssets []*v1beta1.ClusterAsset

		result, err := converter.ToGQLs(clusterAssets)

		require.NoError(t, err)
		assert.Empty(t, result)
	})

	t.Run("With nil", func(t *testing.T) {
		clusterAssets := []*v1beta1.ClusterAsset{
			nil,
			fixClusterAsset(),
			nil,
		}

		result, err := converter.ToGQLs(clusterAssets)

		require.NoError(t, err)
		assert.Len(t, result, 1)
		assert.Equal(t, "ExampleName", result[0].Name)
	})
}

func fixClusterAsset() *v1beta1.ClusterAsset {
	return &v1beta1.ClusterAsset{
		ObjectMeta: metav1.ObjectMeta{
			Name: "ExampleName",
			Labels: map[string]string{
				rafter.TypeLabel: "ExampleType",
			},
		},
		Spec: v1beta1.ClusterAssetSpec{
			CommonAssetSpec: v1beta1.CommonAssetSpec{
				Source: v1beta1.AssetSource{
					Mode: v1beta1.AssetSingle,
					URL:  "ExampleUrl",
				},
				BucketRef: v1beta1.AssetBucketRef{
					Name: "ExampleBucketRef",
				},
				Parameters:  &runtime.RawExtension{Raw: []byte(`{"json":"true","complex":{"data":"true"}}`)},
				DisplayName: "ExampleDisplayName",
			},
		},
		Status: v1beta1.ClusterAssetStatus{
			CommonAssetStatus: v1beta1.CommonAssetStatus{
				Phase:   v1beta1.AssetReady,
				Reason:  "ExampleReason",
				Message: "ExampleMessage",
			},
		},
	}
}

repository: Rider-io/kyma

repo_name: Rider-io/kyma