text:
package cp

import (
	"errors"
	"flag"
	"fmt"
	"io"
	"io/ioutil"
	"os"
	"path/filepath"

	"github.com/shirou/toybox/common"
)

const binaryName = "cp"

var helpFlag bool
var forceFlag bool
var recurseFlag bool
var preserveFlag bool
var preserveLinkFlag bool
var newerFlag bool

func NewFlagSet() *flag.FlagSet {
	ret := flag.NewFlagSet(binaryName, flag.ExitOnError)

	ret.Usage = func() {
		fmt.Println("cp -R [-fip] source_file... target")
		ret.PrintDefaults()
	}

	ret.BoolVar(&helpFlag, "help", false, "show this message")
	ret.BoolVar(&forceFlag, "f", false, "Don't prompt before overwriting")
	ret.BoolVar(&recurseFlag, "R", false, "Copy file hierarchies.")
	ret.BoolVar(&recurseFlag, "r", false, "Copy file hierarchies.")
	ret.BoolVar(&preserveFlag, "p", false, "Duplicate the following characteristics of each source file in the corresponding destination file")
	ret.BoolVar(&preserveLinkFlag, "P", false, "never follow symbolic links in SOURCE")
	ret.BoolVar(&newerFlag, "u", false, "copy only when the SOURCE file is newer than the destination file")

	return ret
}

func Main(stdout io.Writer, args []string) error {
	flagSet := NewFlagSet()
	flagSet.Parse(args)

	if flagSet.NArg() < 2 || helpFlag {
		flagSet.Usage()
		return nil
	}

	return cp(flagSet.Args())
}

func cp(files []string) error {
	dst := files[len(files)-1]
	dst = os.ExpandEnv(dst)

	for _, src := range files[:len(files)-1] {
		src = os.ExpandEnv(src)
		if !forceFlag && common.FileExists(dst) {
			return os.ErrExist
		}
		if err := cpOne(src, dst); err != nil {
			return err
		}

	}
	return nil
}

func cpOne(src, dst string) error {
	si, err := os.Stat(src)
	if err != nil {
		return err
	}

	if si.IsDir() {
		if !recurseFlag {
			return errors.New("source is a directory")
		}
		if err := cpDirectory(src, dst); err != nil {
			return err
		}
	} else {
		if err := cpFile(src, dst); err != nil {
			return err
		}
	}

	return nil
}

func cpDirectory(src, dst string) error {
	si, err := os.Stat(src)
	if err != nil {
		return err
	}

	// ensure dst dir does not already exist
	if _, err := os.Open(dst); !os.IsNotExist(err) {
		return errors.New("dstination already exists")
	}

	// create dst dir
	if err := os.MkdirAll(dst, si.Mode()); err != nil {
		return err
	}

	files, err := ioutil.ReadDir(src)
	if err != nil {
		return err
	}

	for _, file := range files {
		if err := cpOne(filepath.Join(src, file.Name()),
			filepath.Join(dst, file.Name())); err != nil {
			return err
		}
	}
	return nil
}

func cpFile(src, dst string) error {
	si, err := os.Lstat(src)
	if err != nil {
		return err
	}

	if preserveLinkFlag && !si.Mode().IsRegular() {
		return cpSymlink(src, dst)
	}

	di, err := os.Lstat(dst)
	if !os.IsNotExist(err) {
		if !forceFlag {
			return fmt.Errorf("destination already exists: %s", dst)
		}
		if si.ModTime().After(di.ModTime()) && newerFlag {
			return errors.New("destination is newer then src")
		}
	}

	//open source
	in, err := os.Open(src)
	if err != nil {
		return err
	}
	defer in.Close()

	//create dst
	out, err := os.Create(dst)
	if err != nil {
		return err
	}
	defer func() {
		cerr := out.Close()
		if err == nil {
			err = cerr
		}
	}()

	// copy
	if _, err = io.Copy(out, in); err != nil {
		return err
	}
	if err = out.Chmod(si.Mode()); err != nil {
		return err
	}
	if preserveFlag {
		if err = os.Chtimes(dst, si.ModTime(), si.ModTime()); err != nil {
			return err
		}
	}

	//sync dst to disk
	return out.Sync()
}

func cpSymlink(src, dst string) error {
	linkTarget, err := os.Readlink(src)
	if err != nil {
		return err
	}
	return os.Symlink(linkTarget, dst)
}

repository: shirou/toybox

repo_name: shirou/toybox

gha_license_id: NOASSERTION


text:
package main

import (
	"fmt"
	"os"

	chatwork "github.com/ota42y/go-chatwork-api"
	"net/url"
)

func my() {
	token := os.Getenv("CHATWORK_API_TOKEN")
	if token == "" {
		fmt.Println("skip this test because no token")
		return
	}

	client := chatwork.New(token)

	status, err := client.MyStatus()
	if err == nil {
		fmt.Println(status)
	} else {
		fmt.Println(err)
	}

	params := url.Values{}
	params.Add("status", "done")

	tasks, err := client.MyTasks(params)
	if err == nil {
		fmt.Println(tasks)
	} else {
		fmt.Println(err)
	}
}

license: MIT

repository: hiepnsx/go-chatwork-api

license_type: permissive

repo_name: hiepnsx/go-chatwork-api

branch_name: refs/heads/master

extension: go


text:
@article{alexander_quantile_2011,
 author = {Alexander, Marcus and Harding, Matthew and Lamarche, Carlos},
 number = {1-2},
 pages = {47--72},
 title = {Quantile Regression for Time-Series-Cross-Section Data},
 volume = {6},
 year = {2011}
}

extension: bib


text:
package common

import (
	"fmt"
	"github.com/kubemq-hub/builder/survey"
)

type RateLimiter struct {
}

func NewRateLimiter() *RateLimiter {
	return &RateLimiter{}
}

func (r *RateLimiter) Render(values map[string]string) (map[string]string, error) {
	var result map[string]string
	menu := survey.NewMenu("Select Rate Limiter Middleware Options:")

	addEditFn := func(values map[string]string) (map[string]string, error) {
		defaultRate := values["rate_per_second"]
		if defaultRate == "" {
			defaultRate = "100"
		}
		val := 0
		err := survey.NewInt().
			SetKind("int").
			SetName("rate-limiter").
			SetMessage("Set rate request per second limiting").
			SetDefault(defaultRate).
			SetHelp("Set how many request per second to limit").
			SetRequired(true).
			Render(&val)
		if err != nil {
			return nil, err
		}
		return map[string]string{"rate_per_second": fmt.Sprintf("%d", val)}, nil
	}
	_, ok := values["rate_per_second"]
	if ok {
		menu.AddItem("Edit Rate Limiter Middleware", func() error {
			var err error
			values, err := addEditFn(values)
			if err != nil {
				return err
			}
			result = values
			return nil
		})
		menu.AddItem("Remove Rate Limiter Middleware", func() error {
			result = nil
			return nil
		})
	} else {
		menu.AddItem("Add Rate Limiter Middleware", func() error {
			var err error
			resultValues, err := addEditFn(values)
			if err != nil {
				return err
			}
			result = resultValues
			return nil
		})
	}
	menu.SetDisableLoop(true)
	menu.SetBackOption(true)
	menu.SetErrorHandler(survey.MenuShowErrorFn)

	if err := menu.Render(); err != nil {
		return nil, err
	}
	return result, nil
}

repository: kubemq-hub/builder

repo_name: kubemq-hub/builder


text:
package main

import (
	"os/exec"
	"path/filepath"
)

func (s spec) sync() {
	m := getManifest()
	if m.outOfDate(s.Tools) {
		log("syncing")

		// Delete existing tools directory
		cmd := exec.Command("rm", "-r", "-f", toolDirPath)
		_, err := cmd.Output()
		if err != nil {
			fatalExec("failed to remove _tools ", err)
		}

		// Recreate the tools directory
		ensureTooldir()

		// Download everything to cache
		for _, t := range s.Tools {
			err := download(t)
			if err != nil {
				fatalExec("failed to sync "+t.Repository, err)
			}
		}

		// Copy the cache into the tools directory
		cmd = exec.Command("cp", "-R", filepath.Join(cacheDir, "src"), filepath.Join(toolDirPath, "src"))
		_, err = cmd.Output()
		if err != nil {
			fatalExec("failed to copy data from cache ", err)
		}

		// Install the packages
		s.build()

		// Delete unneccessary source files
		s.cleanup()
	}
}

repository: fx/retool

repo_name: fx/retool


text:
Zurück zur [zrl=[baseurl]/help/cloud]Cloud-Hilfe[/zrl]
Zurück zur [zrl=[baseurl]/help/main]Hilfe-Startseite[/zrl]

repository: friendica/red

repo_name: friendica/red

gha_license_id: MIT

gha_language: PHP

extension: bb


text:
@article{murawski_efficacy_2019,
 author = {Murawski, B. and Plotnikoff, R.C. and Rayward, A.T. and Oldmeadow, C. and Vandelanotte, C. and Brown, W.J. and Duncan, M.},
 doi = {10.1016/j.amepre.2019.05.009},
 issn = {0749-3797},
 journal = {AMERICAN JOURNAL OF PREVENTIVE MEDICINE},
 keywords = {RCT, m-health},
 month = {May},
 note = {Publisher: Elsevier BV},
 number = {4},
 pages = {503--514},
 title = {Efficacy of an m-health physical activity and sleep health intervention for adults: a randomized waitlist-controlled trial.},
 volume = {57},
 year = {2019}
}

repository: ChrisOldmeadow/academic-kickstart

repo_name: ChrisOldmeadow/academic-kickstart


text:
// Copyright 2016 Amazon.com, Inc. or its affiliates. All Rights Reserved.
//
// Licensed under the Apache License, Version 2.0 (the "License"). You may not
// use this file except in compliance with the License. A copy of the
// License is located at
//
// http://aws.amazon.com/apache2.0/
//
// or in the "license" file accompanying this file. This file is distributed
// on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND,
// either express or implied. See the License for the specific language governing
// permissions and limitations under the License.

//go:build integration
// +build integration

// Package processor contains the methods for update ssm agent.
// It also provides methods for sendReply and updateInstanceInfo
package processor

import (
	"testing"

	"github.com/aws/amazon-ssm-agent/agent/appconfig"
	"github.com/aws/amazon-ssm-agent/agent/fileutil"
	contextmocks "github.com/aws/amazon-ssm-agent/agent/mocks/context"
	"github.com/aws/amazon-ssm-agent/agent/updateutil/updateconstants"
	"github.com/stretchr/testify/assert"
)

func TestGetV12DocOrchDir(t *testing.T) {
	context := contextmocks.NewMockDefault()
	shortInstanceId, _ := context.Identity().ShortInstanceID()

	updateDetail := &UpdateDetail{}
	dir := getV12DocOrchDir(context.Identity(), context.Log(), updateDetail)

	expected := fileutil.BuildPath(
		appconfig.DefaultDataStorePath,
		shortInstanceId,
		appconfig.DefaultDocumentRootDirName,
		"orchestration",
		updateconstants.DefaultOutputFolder)
	assert.Equal(t, expected, dir)

	updateDetail.MessageID = "messageid"
	dir = getV12DocOrchDir(context.Identity(), context.Log(), updateDetail)
	expected = fileutil.BuildPath(
		appconfig.DefaultDataStorePath,
		shortInstanceId,
		appconfig.DefaultDocumentRootDirName,
		"orchestration",
		"messageid",
		updateconstants.DefaultOutputFolder)

	assert.Equal(t, expected, dir)
}

func TestGetV22DocOrchDir(t *testing.T) {
	context := contextmocks.NewMockDefault()
	shortInstanceId, _ := context.Identity().ShortInstanceID()

	updateDetail := &UpdateDetail{}
	dir := getV22DocOrchDir(context.Identity(), context.Log(), updateDetail)

	expected := fileutil.BuildPath(
		appconfig.DefaultDataStorePath,
		shortInstanceId,
		appconfig.DefaultDocumentRootDirName,
		"orchestration",
		updateconstants.DefaultOutputFolder,
		updateconstants.DefaultOutputFolder)
	assert.Equal(t, expected, dir)

	updateDetail.MessageID = "messageid"
	dir = getV22DocOrchDir(context.Identity(), context.Log(), updateDetail)
	expected = fileutil.BuildPath(
		appconfig.DefaultDataStorePath,
		shortInstanceId,
		appconfig.DefaultDocumentRootDirName,
		"orchestration",
		"messageid",
		updateconstants.DefaultOutputFolder,
		updateconstants.DefaultOutputFolder)

	assert.Equal(t, expected, dir)
}

repository: aws/amazon-ssm-agent

repo_name: aws/amazon-ssm-agent

branch_name: refs/heads/mainline

gha_language: Go


text:
package cmd

import (
	"errors"
	"regexp"

	"github.com/kronostechnologies/richman/action"
	"github.com/spf13/cobra"
)

var appsRunCmd = &cobra.Command{
	Use:   "run -a APPLICATION",
	Short: "run app ops env",
	Long:  "run app ops env",
	Args: func(cmd *cobra.Command, args []string) error {
		if len(args) != 0 {
			//TODO : Default to current context, allow to append context
			return errors.New("too many arguments")
		}
		return nil
	},
	RunE: func(cmd *cobra.Command, args []string) error {
		app_filters, _ := cmd.Flags().GetString("app")
		if app_filters == "" {
			return errors.New("please provide an application to run with the -a flag")
		}
		configArgs, _ := cmd.Flags().GetStringArray("config")

		splitRegex := regexp.MustCompile(`^([^=]+)=(.*)$`)

		configs := make(map[string]string)

		for _, configArg := range configArgs {
			split := splitRegex.FindStringSubmatch(configArg)
			key := split[1]
			value := split[2]
			configs[key] = value
		}
		c := action.AppsRun{
			Application: app_filters,
			Config:      configs,
		}

		return c.Run()
	},
}

func init() {
	appsRunCmd.Flags().StringP("app", "a", "", "select app by name")
	appsRunCmd.Flags().StringArrayP("config", "c", []string{}, "set config key=value")
}

repository: kronostechnologies/richman

repo_name: kronostechnologies/richman


text:
// Copyright 2020 Eurac Research. All rights reserved.
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.

// WARNING: We will not guarantee that the output of this tool is correct. Use
// it on your own risk.

// Ceph-get-clients returns the current connected clients
//
// Usage:
//
//  ceph-get-clients -user cephssh [-port 22 -feature 0x200000] mon1 mon2 mon3
//
// Ceph-get-clients will connect to the given Ceph monitor servers using SSH and
// retrieve all currently connected clients using `ceph daemon mon.<hostname>
// sessions`. It will parse the output and merge it for all the given monitors,
// duplicated clients will be removed. For each client a reverse DNS lookup will
// be done. The output will be printed to Stdout using CSV format. It is
// possible to check if a client supports a give feature by passing the feature
// hex value as a parameter using the -feature flag.
//
// Prerequisite:
//
//  - SSH connection is using the local ssh agent
//  - SSH_AUTH_SOCK should be set and point to the running ssh agent socket
//  - SSH user should have sudo rights without password
//
// Example:
//
//  ceph-get-client -user cephadm -feature 0x200000 mon1 mon2 mon3
//  IP,feature,release,fqdn,0x200000
//  10.7.3.67,0x3ffddff8eea4fffb,luminous,clienta.fqdn.tld.,true
//  10.7.3.65,0x3ffddff8eea4fffb,luminous,webserver.fqdn.tld.,true
//  10.7.3.64,0x7010fb86aa42ada,jewel,,true
//  10.7.3.70,0x1ffddff8eea4fffb,luminous,usera.fqdn.tld.,true
//
package main

import (
	"encoding/csv"
	"encoding/json"
	"errors"
	"flag"
	"fmt"
	"log"
	"net"
	"os"
	"strconv"
	"strings"

	"golang.org/x/crypto/ssh"
	"golang.org/x/crypto/ssh/agent"
)

func main() {
	var (
		user    = flag.String("user", "", "SSH username.")
		port    = flag.Int("port", 22, "SSH server port.")
		feature = flag.String("feature", "", "Check if the clients have the features. (e.g. '0x200000' will check if the client supports the upmap feature)")
	)
	flag.Parse()

	if *user == "" {
		log.Fatal("error missing -user")
	}

	if flag.NArg() < 1 {
		log.Fatal("missing host")
	}

	sshAgent, err := net.Dial("unix", os.Getenv("SSH_AUTH_SOCK"))
	if err != nil {
		log.Fatalf("could not find ssh agent: %v", err)
	}

	agentClient := agent.NewClient(sshAgent)
	config := &ssh.ClientConfig{
		User: *user,
		Auth: []ssh.AuthMethod{
			// Use a callback rather than PublicKeys so we only consult the
			// agent once the remote server wants it.
			ssh.PublicKeysCallback(agentClient.Signers),
		},
		// TODO: quick & dirty
		HostKeyCallback: ssh.InsecureIgnoreHostKey(),
	}

	var clients []*Client
	for _, h := range flag.Args() {
		client, err := ssh.Dial("tcp", fmt.Sprintf("%s:%d", h, *port), config)
		if err != nil {
			log.Printf("unable to connect: %v\n", err)
			continue
		}

		sess, err := client.NewSession()
		if err != nil {
			log.Printf("unable to create session: %v\n", err)
			continue
		}

		out, err := sess.Output(fmt.Sprintf("sudo ceph daemon mon.%s sessions", h))
		if err != nil {
			log.Printf("unable to execute 'ceph daemon mon.%s sessions: %v", h, err)
			continue
		}

		var c []*Client
		if err := json.Unmarshal([]byte(out), &c); err != nil {
			log.Printf("unable to unmarshal sessions: %v\n", err)
			continue
		}

		for _, add := range c {
			clients = unique(clients, add)
		}

		sess.Close()
		client.Close()
	}

	w := csv.NewWriter(os.Stdout)

	header := []string{"IP", "feature", "release", "fqdn"}
	if *feature != "" {
		header = append(header, *feature)
	}
	w.Write(header)

	for _, s := range clients {
		line := []string{s.IP, s.Feature, s.Release}

		names, _ := net.LookupAddr(s.IP)
		line = append(line, strings.Join(names, " "))

		if *feature != "" {
			line = append(line, fmt.Sprint(checkForFeatures(s, "200000")))
		}

		w.Write(line)
	}
	w.Flush()

	if err := w.Error(); err != nil {
		log.Fatal(err)
	}
}

func unique(clients []*Client, add *Client) []*Client {
	for _, c := range clients {
		if c.Equal(add) {
			return clients
		}
	}

	return append(clients, add)
}

func checkForFeatures(c *Client, feature string) bool {
	i, err := strconv.ParseInt(trimHexPrefix(c.Feature), 16, 0)
	if err != nil {
		log.Fatal(err)
	}

	b, err := strconv.ParseInt(trimHexPrefix(feature), 16, 0)
	if err != nil {
		log.Fatal(err)
	}

	return (i & b) != 0
}

func trimHexPrefix(s string) string {
	return strings.TrimPrefix(s, "0x")
}

// Client represents a connected client.
type Client struct {
	IP      string
	Feature string
	Release string
}

func (c *Client) Equal(client *Client) bool {
	return c.IP == client.IP
}

func (c *Client) String() string {
	return c.IP + c.Feature + c.Release
}

func (c *Client) UnmarshalJSON(b []byte) error {
	var str string
	if err := json.Unmarshal(b, &str); err != nil {
		return err
	}

	// A session string has the following format:
	// "MonSession(mon.0 10.7.3.65:6789/0 is open allow *, features 0x3ffddff8eea4fffb (luminous))"
	fields := strings.Split(str, " ")
	if len(fields) < 9 {
		return errors.New("unable to parse session string. wrong number of fields")
	}

	host, _, err := net.SplitHostPort(fields[1])
	if err != nil {
		return err
	}

	c.IP = host
	c.Feature = fields[len(fields)-2]
	c.Release = strings.TrimSuffix(strings.TrimPrefix(fields[len(fields)-1], "("), "))")

	return nil
}

repository: euracresearch/ceph-get-clients

repo_name: euracresearch/ceph-get-clients

branch_name: refs/heads/main


text:
require recipes-support/libmpc/libmpc_1.0.2.bb

# Using pkgconfig to check the existence of the library and set all
# necessary flags.

inherit debian-package pkgconfig
DEBIAN_SECTION = "libs"
DPR = "0"
DPN = "mpclib3"

LICENSE = "LGPLv3"
LIC_FILES_CHKSUM = "file://COPYING.LESSER;md5=e6a600fd5e1d9cbde2d983680233ad02"

DEBIAN_PATCH_TYPE = "quilt"

# Remove -Werror when initialize automake
SRC_URI += "\
	file://fix-configure.patch \
"

repository: takuya-t/meta-debian

repo_name: takuya-t/meta-debian

branch_name: refs/heads/daisy


text:
package plugin

import (
	"github.com/nsqio/go-nsq"
    "log"
)

type NsqProducer struct {
	counter   uint64
	producers map[string]*nsq.Producer
	nsqdAddrs []string
}

func NewNsqProducer(NsqWriters []string) (*NsqProducer, error) {
	p := &NsqProducer{nsqdAddrs: NsqWriters}

	cfg := nsq.NewConfig()
	p.producers = make(map[string]*nsq.Producer)
	for _, addr := range p.nsqdAddrs {
		producer, err := nsq.NewProducer(addr, cfg)
		if err != nil {
			log.Fatalf("Connect to nsq host err")
			return nil, err
		}
		p.producers[addr] = producer
	}

	return p, nil

}

func (p *NsqProducer) SendNsqMsg(topic string, body []byte) error {
	idx := p.counter % uint64(len(p.nsqdAddrs))
	producer := p.producers[p.nsqdAddrs[idx]]
	err := producer.Publish(topic, body)
	p.counter++

	return err
}

func (p *NsqProducer) MultiSendNsqMsg(topic string, body [][]byte) error {
	idx := p.counter % uint64(len(p.nsqdAddrs))
	producer := p.producers[p.nsqdAddrs[idx]]
	err := producer.MultiPublish(topic, body)
	p.counter++

	return err
}

//func (p *NsqProducer) ProducersClose() {
//	for _, producer := range p.producers {
//		producer.Stop()
//	}
//}


text:
<?xml version="1.0" encoding="utf-8"?>
<!DOCTYPE eagle SYSTEM "eagle.dtd">
<eagle version="7.4.0">
<drawing>
<settings>
<setting alwaysvectorfont="no"/>
<setting verticaltext="up"/>
</settings>
<grid distance="0.0125" unitdist="inch" unit="inch" style="lines" multiple="1" display="no" altdistance="0.025" altunitdist="inch" altunit="inch"/>
<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="yes" active="yes"/>
<layer number="102" name="Vscore" color="7" fill="1" visible="yes" active="yes"/>
<layer number="103" name="tMap" color="7" fill="1" visible="yes" active="yes"/>
<layer number="104" name="Name" color="16" fill="1" visible="yes" active="yes"/>
<layer number="105" name="tPlate" color="7" fill="1" visible="yes" active="yes"/>
<layer number="106" name="bPlate" color="7" fill="1" visible="yes" active="yes"/>
<layer number="107" name="Crop" color="7" fill="1" visible="yes" active="yes"/>
<layer number="108" name="tplace-old" color="10" fill="1" visible="yes" active="yes"/>
<layer number="109" name="ref-old" color="11" fill="1" visible="yes" active="yes"/>
<layer number="110" name="fp0" color="7" fill="1" visible="yes" active="yes"/>
<layer number="111" name="LPC17xx" color="7" fill="1" visible="yes" active="yes"/>
<layer number="112" name="tSilk" color="7" fill="1" visible="yes" active="yes"/>
<layer number="113" name="IDFDebug" color="4" fill="1" visible="yes" active="yes"/>
<layer number="114" name="Badge_Outline" color="7" fill="1" visible="yes" active="yes"/>
<layer number="115" name="ReferenceISLANDS" color="7" fill="1" visible="yes" active="yes"/>
<layer number="116" name="Patch_BOT" color="9" fill="4" visible="yes" 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="yes" active="yes"/>
<layer number="122" name="_bsilk" color="7" fill="1" visible="yes" active="yes"/>
<layer number="123" name="tTestmark" color="7" fill="1" visible="yes" active="yes"/>
<layer number="124" name="bTestmark" color="7" fill="1" visible="yes" active="yes"/>
<layer number="125" name="_tNames" color="7" fill="1" visible="yes" active="yes"/>
<layer number="126" name="_bNames" color="7" fill="1" visible="yes" active="yes"/>
<layer number="127" name="_tValues" color="7" fill="1" visible="yes" active="yes"/>
<layer number="128" name="_bValues" color="7" fill="1" visible="yes" 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="yes" active="yes"/>
<layer number="132" name="bAdjust" color="7" fill="1" visible="yes" active="yes"/>
<layer number="144" name="Drill_legend" color="7" fill="1" visible="yes" active="yes"/>
<layer number="150" name="Notes" color="7" fill="1" visible="yes" active="yes"/>
<layer number="151" name="HeatSink" color="7" fill="1" visible="yes" active="yes"/>
<layer number="152" name="_bDocu" color="7" fill="1" visible="yes" active="yes"/>
<layer number="153" name="FabDoc1" color="7" fill="1" visible="yes" active="yes"/>
<layer number="154" name="FabDoc2" color="7" fill="1" visible="yes" active="yes"/>
<layer number="155" name="FabDoc3" color="7" fill="1" visible="yes" active="yes"/>
<layer number="199" name="Contour" color="7" fill="1" visible="yes" active="yes"/>
<layer number="200" name="200bmp" color="1" fill="10" visible="yes" active="yes"/>
<layer number="201" name="201bmp" color="2" fill="10" visible="yes" active="yes"/>
<layer number="202" name="202bmp" color="3" fill="10" visible="yes" active="yes"/>
<layer number="203" name="203bmp" color="4" fill="10" visible="yes" active="yes"/>
<layer number="204" name="204bmp" color="5" fill="10" visible="yes" active="yes"/>
<layer number="205" name="205bmp" color="6" fill="10" visible="yes" active="yes"/>
<layer number="206" name="206bmp" color="7" fill="10" visible="yes" active="yes"/>
<layer number="207" name="207bmp" color="8" fill="10" visible="yes" active="yes"/>
<layer number="208" name="208bmp" color="9" fill="10" visible="yes" active="yes"/>
<layer number="209" name="209bmp" color="7" fill="1" visible="yes" active="yes"/>
<layer number="210" name="210bmp" color="7" fill="1" visible="yes" active="yes"/>
<layer number="211" name="211bmp" color="7" fill="1" visible="yes" active="yes"/>
<layer number="212" name="212bmp" color="7" fill="1" visible="yes" active="yes"/>
<layer number="213" name="213bmp" color="7" fill="1" visible="yes" active="yes"/>
<layer number="214" name="214bmp" color="7" fill="1" visible="yes" active="yes"/>
<layer number="215" name="215bmp" color="7" fill="1" visible="yes" active="yes"/>
<layer number="216" name="216bmp" color="7" fill="1" visible="yes" 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="yes" active="yes"/>
<layer number="249" name="Edge" color="7" fill="1" visible="yes" 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="yes" active="yes"/>
<layer number="255" name="routoute" color="7" fill="1" visible="yes" active="yes"/>
</layers>
<board>
<plain>
<wire x1="23.8125" y1="19.05" x2="0.0125" y2="19.05" width="0" layer="20"/>
<wire x1="0.0125" y1="19.05" x2="0.0125" y2="0.01" width="0" layer="20"/>
<wire x1="0.0125" y1="0.01" x2="23.8125" y2="0.01" width="0" layer="20"/>
<wire x1="23.8125" y1="0.01" x2="23.8125" y2="19.05" width="0" layer="20"/>
<text x="5.3975" y="2.8575" size="0.6096" layer="22" font="vector" rot="MR180">3.3V</text>
<text x="5.3975" y="15.5575" size="0.6096" layer="22" font="vector" rot="MR180">GND</text>
<text x="5.3975" y="13.0175" size="0.6096" layer="22" font="vector" rot="MR180">NC</text>
<text x="5.3975" y="5.3975" size="0.6096" layer="22" font="vector" rot="MR180">VCC</text>
<text x="5.3975" y="7.9375" size="0.6096" layer="22" font="vector" rot="MR180">D+</text>
<text x="5.3975" y="10.4775" size="0.6096" layer="22" font="vector" rot="MR180">D-</text>
<text x="19.3675" y="2.8575" size="0.6096" layer="22" rot="MR180">VCC</text>
<text x="19.3675" y="5.3975" size="0.6096" layer="22" rot="MR180">CTS</text>
<text x="19.3675" y="7.9375" size="0.6096" layer="22" rot="MR180">TX</text>
<text x="19.3675" y="10.4775" size="0.6096" layer="22" rot="MR180">RX</text>
<text x="19.3675" y="13.0175" size="0.6096" layer="22" rot="MR180">RTS</text>
<text x="19.3675" y="15.5575" size="0.6096" layer="22" rot="MR180">GND</text>
</plain>
<libraries>
<library name="SparkFun">
<packages>
<package name="SOT23-3">
<wire x1="1.4224" y1="0.6604" x2="1.4224" y2="-0.6604" width="0.1524" layer="51"/>
<wire x1="1.4224" y1="-0.6604" x2="-1.4224" y2="-0.6604" width="0.1524" layer="51"/>
<wire x1="-1.4224" y1="-0.6604" x2="-1.4224" y2="0.6604" width="0.1524" layer="51"/>
<wire x1="-1.4224" y1="0.6604" x2="1.4224" y2="0.6604" width="0.1524" layer="51"/>
<wire x1="-0.8" y1="0.7" x2="-1.4" y2="0.7" width="0.2032" layer="21"/>
<wire x1="-1.4" y1="0.7" x2="-1.4" y2="-0.1" width="0.2032" layer="21"/>
<wire x1="0.8" y1="0.7" x2="1.4" y2="0.7" width="0.2032" layer="21"/>
<wire x1="1.4" y1="0.7" x2="1.4" y2="-0.1" width="0.2032" layer="21"/>
<smd name="3" x="0" y="1.1" dx="0.8" dy="0.9" layer="1"/>
<smd name="2" x="0.95" y="-1" dx="0.8" dy="0.9" layer="1"/>
<smd name="1" x="-0.95" y="-1" dx="0.8" dy="0.9" layer="1"/>
<text x="-0.8255" y="1.778" size="0.4064" layer="25">>NAME</text>
<text x="-1.016" y="-0.1905" size="0.4064" layer="27">>VALUE</text>
</package>
</packages>
</library>
<library name="SparkFun-Resistors">
<description>
SparkFun Electronics' preferred foot prints

In this library you'll find resistors, capacitors, inductors, test points, jumper pads, etc.

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.

Licensing: Creative Commons ShareAlike 4.0 International - https://creativecommons.org/licenses/by-sa/4.0/

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="0805">
<wire x1="-0.3" y1="0.6" x2="0.3" y2="0.6" width="0.1524" layer="21"/>
<wire x1="-0.3" y1="-0.6" x2="0.3" y2="-0.6" width="0.1524" layer="21"/>
<smd name="1" x="-0.9" y="0" dx="0.8" dy="1.2" layer="1"/>
<smd name="2" x="0.9" y="0" dx="0.8" dy="1.2" layer="1"/>
<text x="-0.762" y="0.8255" size="0.4064" layer="25">>NAME</text>
<text x="-1.016" y="-1.397" size="0.4064" layer="27">>VALUE</text>
<wire x1="-1.4986" y1="0.8128" x2="1.4986" y2="0.8128" width="0.0508" layer="39"/>
<wire x1="1.4986" y1="0.8128" x2="1.4986" y2="-0.8128" width="0.0508" layer="39"/>
<wire x1="1.4986" y1="-0.8128" x2="-1.4986" y2="-0.8128" width="0.0508" layer="39"/>
<wire x1="-1.4986" y1="-0.8128" x2="-1.4986" y2="0.8128" width="0.0508" layer="39"/>
</package>
</packages>
</library>
<library name="mine">
<packages>
<package name="1X06-SMD-NOHOLES">
<wire x1="7.62" y1="1.25" x2="-7.62" y2="1.25" width="0.127" layer="51"/>
<wire x1="-7.62" y1="1.25" x2="-7.62" y2="-1.25" width="0.127" layer="51"/>
<wire x1="-7.62" y1="-1.25" x2="-6.35" y2="-1.25" width="0.127" layer="51"/>
<wire x1="-6.35" y1="-1.25" x2="-3.81" y2="-1.25" width="0.127" layer="51"/>
<wire x1="-3.81" y1="-1.25" x2="-1.27" y2="-1.25" width="0.127" layer="51"/>
<wire x1="-1.27" y1="-1.25" x2="1.27" y2="-1.25" width="0.127" layer="51"/>
<wire x1="1.27" y1="-1.25" x2="3.81" y2="-1.25" width="0.127" layer="51"/>
<wire x1="3.81" y1="-1.25" x2="6.35" y2="-1.25" width="0.127" layer="51"/>
<wire x1="6.35" y1="-1.25" x2="7.62" y2="-1.25" width="0.127" layer="51"/>
<wire x1="7.62" y1="-1.25" x2="7.62" y2="1.25" width="0.127" layer="51"/>
<wire x1="6.35" y1="-1.25" x2="6.35" y2="-7.25" width="0.127" layer="51"/>
<wire x1="3.81" y1="-1.25" x2="3.81" y2="-7.25" width="0.127" layer="51"/>
<wire x1="1.27" y1="-1.25" x2="1.27" y2="-7.25" width="0.127" layer="51"/>
<wire x1="-1.27" y1="-1.25" x2="-1.27" y2="-7.25" width="0.127" layer="51"/>
<wire x1="-3.81" y1="-1.25" x2="-3.81" y2="-7.25" width="0.127" layer="51"/>
<wire x1="-6.35" y1="-1.25" x2="-6.35" y2="-7.25" width="0.127" layer="51"/>
<smd name="4" x="1.27" y="5" dx="3" dy="1" layer="1" rot="R90"/>
<smd name="5" x="3.81" y="5" dx="3" dy="1" layer="1" rot="R90"/>
<smd name="6" x="6.35" y="5" dx="3" dy="1" layer="1" rot="R90"/>
<smd name="3" x="-1.27" y="5" dx="3" dy="1" layer="1" rot="R90"/>
<smd name="2" x="-3.81" y="5" dx="3" dy="1" layer="1" rot="R90"/>
<smd name="1" x="-6.35" y="5" dx="3" dy="1" layer="1" rot="R90"/>
<text x="-1.905" y="1.905" size="0.8128" layer="25">>NAME</text>
<text x="-1.905" y="0.635" size="0.8128" layer="27">>VALUE</text>
</package>
<package name="1X06-SMD-FEMALE-V2-NOSILK">
<description>Package for 4UCONN part #19686

Used on FTDI breakouts</description>
<wire x1="-7.5" y1="0.45" x2="-7.5" y2="-8.05" width="0.127" layer="51"/>
<wire x1="7.5" y1="0.45" x2="-7.5" y2="0.45" width="0.127" layer="51"/>
<wire x1="7.5" y1="-8.05" x2="7.5" y2="0.45" width="0.127" layer="51"/>
<wire x1="-7.5" y1="-8.05" x2="7.5" y2="-8.05" width="0.127" layer="51"/>
<smd name="4" x="-1.27" y="3.425" dx="1.25" dy="3" layer="1" rot="R180"/>
<smd name="5" x="-3.81" y="3.425" dx="1.25" dy="3" layer="1" rot="R180"/>
<smd name="6" x="-6.35" y="3.425" dx="1.25" dy="3" layer="1" rot="R180"/>
<smd name="3" x="1.27" y="3.425" dx="1.25" dy="3" layer="1" rot="R180"/>
<smd name="2" x="3.81" y="3.425" dx="1.25" dy="3" layer="1" rot="R180"/>
<smd name="1" x="6.35" y="3.425" dx="1.25" dy="3" layer="1" rot="R180"/>
<text x="2.56" y="5.125" size="1" layer="27">>Value</text>
<text x="-2.76" y="6.125" size="1" layer="25" rot="R180">>Name</text>
</package>
<package name="RN41">
<wire x1="9.4" y1="6.6" x2="-16.4" y2="6.6" width="0.127" layer="51"/>
<wire x1="-16.4" y1="6.6" x2="-16.4" y2="-6.6" width="0.127" layer="51"/>
<wire x1="-16.4" y1="-6.6" x2="9.4" y2="-6.6" width="0.127" layer="51"/>
<wire x1="9.4" y1="-6.6" x2="9.4" y2="6.6" width="0.127" layer="51"/>
<wire x1="9.4" y1="6.6" x2="9.4" y2="5.6" width="0.2032" layer="21"/>
<wire x1="9.4" y1="6.6" x2="8.4" y2="6.6" width="0.2032" layer="21"/>
<wire x1="9.4" y1="-6.6" x2="9.4" y2="-5.6" width="0.2032" layer="21"/>
<wire x1="9.4" y1="-6.6" x2="8.4" y2="-6.6" width="0.2032" layer="21"/>
<smd name="1" x="-6.6" y="-6.6" dx="0.8" dy="1.6" layer="1" rot="R180"/>
<smd name="2" x="-5.4" y="-6.6" dx="0.8" dy="1.6" layer="1" rot="R180"/>
<smd name="3" x="-4.2" y="-6.6" dx="0.8" dy="1.6" layer="1" rot="R180"/>
<smd name="4" x="-3" y="-6.6" dx="0.8" dy="1.6" layer="1" rot="R180"/>
<smd name="5" x="-1.8" y="-6.6" dx="0.8" dy="1.6" layer="1" rot="R180"/>
<smd name="6" x="-0.6" y="-6.6" dx="0.8" dy="1.6" layer="1" rot="R180"/>
<smd name="7" x="0.6" y="-6.6" dx="0.8" dy="1.6" layer="1" rot="R180"/>
<smd name="8" x="1.8" y="-6.6" dx="0.8" dy="1.6" layer="1" rot="R180"/>
<smd name="9" x="3" y="-6.6" dx="0.8" dy="1.6" layer="1" rot="R180"/>
<smd name="10" x="4.2" y="-6.6" dx="0.8" dy="1.6" layer="1" rot="R180"/>
<smd name="11" x="5.4" y="-6.6" dx="0.8" dy="1.6" layer="1" rot="R180"/>
<smd name="12" x="6.6" y="-6.6" dx="0.8" dy="1.6" layer="1" rot="R180"/>
<smd name="13" x="6.6" y="6.6" dx="0.8" dy="1.6" layer="1"/>
<smd name="14" x="5.4" y="6.6" dx="0.8" dy="1.6" layer="1"/>
<smd name="15" x="4.2" y="6.6" dx="0.8" dy="1.6" layer="1"/>
<smd name="16" x="3" y="6.6" dx="0.8" dy="1.6" layer="1"/>
<smd name="17" x="1.8" y="6.6" dx="0.8" dy="1.6" layer="1"/>
<smd name="18" x="0.6" y="6.6" dx="0.8" dy="1.6" layer="1"/>
<smd name="19" x="-0.6" y="6.6" dx="0.8" dy="1.6" layer="1"/>
<smd name="20" x="-1.8" y="6.6" dx="0.8" dy="1.6" layer="1"/>
<smd name="21" x="-3" y="6.6" dx="0.8" dy="1.6" layer="1"/>
<smd name="22" x="-4.2" y="6.6" dx="0.8" dy="1.6" layer="1"/>
<smd name="23" x="-5.4" y="6.6" dx="0.8" dy="1.6" layer="1"/>
<smd name="24" x="-6.6" y="6.6" dx="0.8" dy="1.6" layer="1"/>
<smd name="28" x="9.4" y="3.1" dx="0.8" dy="1.6" layer="1" rot="R90"/>
<smd name="29" x="9.4" y="-3.1" dx="0.8" dy="1.6" layer="1" rot="R90"/>
<smd name="35" x="9.4" y="-4.1222" dx="0.8" dy="1.6" layer="1" rot="R90"/>
<smd name="34" x="9.4" y="-1.9" dx="0.8" dy="1.6" layer="1" rot="R90"/>
<smd name="33" x="9.4" y="-0.7" dx="0.8" dy="1.6" layer="1" rot="R90"/>
<smd name="32" x="9.4" y="0.7" dx="0.8" dy="1.6" layer="1" rot="R90"/>
<smd name="31" x="9.4" y="1.9" dx="0.8" dy="1.6" layer="1" rot="R90"/>
<smd name="30" x="9.4" y="4.1222" dx="0.8" dy="1.6" layer="1" rot="R90"/>
</package>
</packages>
</library>
<library name="adafruit">
<packages>
<package name="CHIP-LED0805">
<description>Hyper CHIPLED Hyper-Bright LED

LB R99A

Source: http://www.osram.convergy.de/ ... lb_r99a.pdf</description>
<wire x1="-0.625" y1="0.45" x2="-0.625" y2="-0.45" width="0.1016" layer="51"/>
<wire x1="0.625" y1="0.45" x2="0.625" y2="-0.475" width="0.1016" layer="51"/>
<smd name="C" x="0" y="1.05" dx="1.2" dy="1.2" layer="1"/>
<smd name="A" x="0" y="-1.05" dx="1.2" dy="1.2" layer="1"/>
<text x="-1.27" y="-1.27" size="1.27" layer="25" rot="R90">>NAME</text>
<text x="2.54" y="-1.27" size="1.27" layer="27" rot="R90">>VALUE</text>
<text x="-1.27" y="-2.54" size="1.016" layer="21" font="vector">+</text>
<rectangle x1="-0.675" y1="0" x2="-0.525" y2="0.3" layer="21"/>
<rectangle x1="0.525" y1="0" x2="0.675" y2="0.3" layer="21"/>
<rectangle x1="-0.15" y1="0" x2="0.15" y2="0.3" layer="21"/>
<rectangle x1="-0.675" y1="0.45" x2="0.675" y2="1.05" layer="51"/>
<rectangle x1="-0.675" y1="-1.05" x2="0.675" y2="-0.45" 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="en">EAGLE Design Rules

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="0.6mm"/>
<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="999999"/>
</designrules>
<autorouter>
<pass name="Default">
<param name="RoutingGrid" value="50mil"/>
<param name="AutoGrid" value="1"/>
<param name="Efforts" value="2"/>
<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="Q2" library="SparkFun" package="SOT23-3" value="MOSFET-NCHANNELSMD" x="12.7" y="6.0325" smashed="yes" rot="MR180">
<attribute name="NAME" x="11.8745" y="4.2545" size="0.4064" layer="26" rot="MR180"/>
</element>
<element name="Q1" library="SparkFun" package="SOT23-3" value="MOSFET-NCHANNELSMD" x="16.51" y="15.875" smashed="yes" rot="MR90">
<attribute name="NAME" x="18.288" y="15.0495" size="0.4064" layer="26" rot="MR90"/>
</element>
<element name="R1" library="SparkFun-Resistors" package="0805" value="10k" x="16.8275" y="9.525" smashed="yes" rot="MR180">
<attribute name="PROD_ID" value="RES-09883" x="16.8275" y="9.525" size="1.778" layer="28" rot="MR180" display="off"/>
<attribute name="NAME" x="16.0655" y="8.6995" size="0.4064" layer="26" rot="MR180"/>
<attribute name="VALUE" x="17.0815" y="10.922" size="0.4064" layer="28" rot="MR180"/>
</element>
<element name="R2" library="SparkFun-Resistors" package="0805" value="10k" x="16.8275" y="6.0325" rot="MR180">
<attribute name="PROD_ID" value="RES-09883" x="16.8275" y="6.0325" size="1.778" layer="28" rot="MR180" display="off"/>
</element>
<element name="R3" library="SparkFun-Resistors" package="0805" value="10k" x="13.0175" y="15.875" rot="MR270">
<attribute name="PROD_ID" value="RES-09883" x="13.0175" y="15.875" size="1.778" layer="28" rot="MR270" display="off"/>
</element>
<element name="R4" library="SparkFun-Resistors" package="0805" value="10k" x="16.8275" y="12.3825" smashed="yes" rot="MR0">
<attribute name="PROD_ID" value="RES-09883" x="16.8275" y="12.3825" size="1.778" layer="28" rot="MR0" display="off"/>
<attribute name="NAME" x="17.5895" y="13.208" size="0.4064" layer="26" rot="MR0"/>
<attribute name="VALUE" x="16.256" y="10.9855" size="0.4064" layer="28" rot="MR0"/>
</element>
<element name="R5" library="SparkFun-Resistors" package="0805" value="10k" x="12.7" y="9.525" smashed="yes" rot="MR0">
<attribute name="PROD_ID" value="RES-09883" x="12.7" y="9.525" size="1.778" layer="28" rot="MR0" display="off"/>
<attribute name="NAME" x="13.462" y="10.3505" size="0.4064" layer="26" rot="MR0"/>
<attribute name="VALUE" x="13.716" y="8.128" size="0.4064" layer="28" rot="MR0"/>
</element>
<element name="R6" library="SparkFun-Resistors" package="0805" value="10k" x="12.7" y="12.065" smashed="yes" rot="MR0">
<attribute name="PROD_ID" value="RES-09883" x="12.7" y="12.065" size="1.778" layer="28" rot="MR0" display="off"/>
<attribute name="NAME" x="13.462" y="12.8905" size="0.4064" layer="26" rot="MR0"/>
<attribute name="VALUE" x="12.1285" y="10.668" size="0.4064" layer="28" rot="MR0"/>
</element>
<element name="R7" library="SparkFun-Resistors" package="0805" value="10k" x="9.8425" y="16.1925" rot="MR180">
<attribute name="PROD_ID" value="RES-09883" x="9.8425" y="16.1925" size="1.778" layer="28" rot="MR180" display="off"/>
</element>
<element name="R8" library="SparkFun-Resistors" package="0805" value="330" x="9.525" y="7.9375" rot="MR270">
<attribute name="PROD_ID" value="RES-09883" x="9.525" y="7.9375" size="1.778" layer="28" rot="MR270" display="off"/>
</element>
<element name="R9" library="SparkFun-Resistors" package="0805" value="330" x="9.525" y="12.7" rot="MR270">
<attribute name="PROD_ID" value="RES-09883" x="9.525" y="12.7" size="1.778" layer="28" rot="MR270" display="off"/>
</element>
<element name="UART" library="mine" package="1X06-SMD-NOHOLES" value="RA 6Pin SMD" x="25.7175" y="9.8425" smashed="yes" rot="MR270">
<attribute name="PROD_ID" value="CONN-08971" x="25.7175" y="9.8425" size="1.778" layer="28" rot="MR270" display="off"/>
<attribute name="NAME" x="23.1775" y="10.4775" size="0.8128" layer="26" rot="MR270"/>
</element>
<element name="USB" library="mine" package="1X06-SMD-FEMALE-V2-NOSILK" value="" x="2.54" y="9.8425" smashed="yes" rot="MR90">
<attribute name="PROD_ID" value="CONN-09668" x="2.54" y="9.8425" size="1.778" layer="28" rot="MR90" display="off"/>
<attribute name="VALUE" x="7.665" y="12.4025" size="1" layer="28" rot="MR90"/>
<attribute name="NAME" x="4.22" y="10.8925" size="1" layer="26" rot="MR270"/>
</element>
<element name="RN-42HID" library="mine" package="RN41" value="BLUETOOTH-RN42-NOSILK"" x="14.9225" y="9.8425" rot="R180"/>
<element name="LED1" library="adafruit" package="CHIP-LED0805" value="" x="3.4925" y="13.0175" smashed="yes">
<attribute name="NAME" x="2.2225" y="11.7475" size="0.6096" layer="25" rot="R90"/>
<attribute name="VALUE" x="6.0325" y="11.7475" size="1.27" layer="27" rot="R90"/>
</element>
<element name="LED2" library="adafruit" package="CHIP-LED0805" value="" x="3.4925" y="7.3025" smashed="yes">
<attribute name="NAME" x="2.2225" y="6.0325" size="0.6096" layer="25" rot="R90"/>
<attribute name="VALUE" x="6.0325" y="6.0325" size="1.27" layer="27" rot="R90"/>
</element>
</elements>
<signals>
<signal name="UART_TX">
<contactref element="Q1" pad="2"/>
<contactref element="R3" pad="1"/>
<contactref element="RN-42HID" pad="14"/>
<wire x1="13.2207" y1="16.9545" x2="15.5067" y2="16.9545" width="0.254" layer="16"/>
<wire x1="15.5067" y1="16.9545" x2="15.51" y2="16.825" width="0.254" layer="16"/>
<wire x1="13.2207" y1="16.9545" x2="13.0175" y2="16.775" width="0.254" layer="16"/>
<wire x1="9.3345" y1="2.5527" x2="9.3345" y2="3.2385" width="0.254" layer="1"/>
<wire x1="8.8773" y1="2.0955" x2="9.3345" y2="2.5527" width="0.254" layer="1"/>
<wire x1="6.3627" y1="2.0955" x2="8.8773" y2="2.0955" width="0.254" layer="1"/>
<wire x1="3.6195" y1="4.8387" x2="6.3627" y2="2.0955" width="0.254" layer="1"/>
<wire x1="3.1623" y1="4.8387" x2="3.6195" y2="4.8387" width="0.254" layer="1"/>
<wire x1="1.3335" y1="6.6675" x2="3.1623" y2="4.8387" width="0.254" layer="16"/>
<wire x1="1.3335" y1="14.8971" x2="1.3335" y2="6.6675" width="0.254" layer="16"/>
<wire x1="4.0767" y1="17.6403" x2="1.3335" y2="14.8971" width="0.254" layer="16"/>
<wire x1="12.3063" y1="17.6403" x2="4.0767" y2="17.6403" width="0.254" layer="16"/>
<wire x1="12.9921" y1="16.9545" x2="12.3063" y2="17.6403" width="0.254" layer="16"/>
<wire x1="9.3345" y1="3.2385" x2="9.5225" y2="3.2425" width="0.254" layer="1"/>
<wire x1="12.9921" y1="16.9545" x2="13.0175" y2="16.775" width="0.254" layer="16"/>
<via x="3.1623" y="4.8387" extent="1-16" drill="0.6"/>
</signal>
<signal name="3.3V">
<contactref element="Q2" pad="1"/>
<contactref element="Q1" pad="1"/>
<contactref element="R3" pad="2"/>
<contactref element="R5" pad="2"/>
<contactref element="USB" pad="6"/>
<wire x1="13.2207" y1="14.8971" x2="14.5923" y2="14.8971" width="0.254" layer="16"/>
<wire x1="14.5923" y1="14.8971" x2="15.5067" y2="14.8971" width="0.254" layer="16"/>
<wire x1="15.5067" y1="14.8971" x2="15.51" y2="14.925" width="0.254" layer="16"/>
<wire x1="13.2207" y1="14.8971" x2="13.0175" y2="14.975" width="0.254" layer="16"/>
<wire x1="11.8491" y1="9.4107" x2="11.8491" y2="7.1247" width="0.254" layer="16"/>
<wire x1="11.8491" y1="7.1247" x2="11.75" y2="7.0325" width="0.254" layer="16"/>
<wire x1="11.8491" y1="9.4107" x2="11.8" y2="9.525" width="0.254" layer="16"/>
<wire x1="8.4201" y1="3.6957" x2="10.4775" y2="5.7531" width="0.254" layer="16"/>
<wire x1="10.4775" y1="5.7531" x2="11.6205" y2="6.8961" width="0.254" layer="16"/>
<wire x1="6.1341" y1="3.6957" x2="8.4201" y2="3.6957" width="0.254" layer="16"/>
<wire x1="11.6205" y1="6.8961" x2="11.75" y2="7.0325" width="0.254" layer="16"/>
<wire x1="6.1341" y1="3.6957" x2="5.965" y2="3.4925" width="0.254" layer="16"/>
<wire x1="14.5923" y1="6.4389" x2="14.5923" y2="14.8971" width="0.254" layer="16"/>
<wire x1="14.8209" y1="6.2103" x2="14.5923" y2="6.4389" width="0.254" layer="16"/>
<wire x1="14.8209" y1="5.2959" x2="14.8209" y2="6.2103" width="0.254" layer="16"/>
<wire x1="13.4493" y1="3.9243" x2="14.8209" y2="5.2959" width="0.254" layer="16"/>
<wire x1="12.3063" y1="3.9243" x2="13.4493" y2="3.9243" width="0.254" layer="16"/>
<wire x1="10.4775" y1="5.7531" x2="12.3063" y2="3.9243" width="0.254" layer="16"/>
</signal>
<signal name="UART_TX_5V">
<contactref element="Q1" pad="3"/>
<contactref element="R4" pad="1"/>
<contactref element="UART" pad="4"/>
<wire x1="17.7927" y1="12.3825" x2="17.7927" y2="15.8115" width="0.254" layer="16"/>
<wire x1="17.7927" y1="15.8115" x2="17.61" y2="15.875" width="0.254" layer="16"/>
<wire x1="17.7927" y1="12.3825" x2="17.7275" y2="12.3825" width="0.254" layer="16"/>
<wire x1="17.5641" y1="11.0109" x2="17.5641" y2="12.3825" width="0.254" layer="16"/>
<wire x1="16.8783" y1="10.3251" x2="17.5641" y2="11.0109" width="0.254" layer="16"/>
<wire x1="16.8783" y1="8.7249" x2="16.8783" y2="10.3251" width="0.254" layer="16"/>
<wire x1="17.1069" y1="8.4963" x2="16.8783" y2="8.7249" width="0.254" layer="16"/>
<wire x1="20.5359" y1="8.4963" x2="17.1069" y2="8.4963" width="0.254" layer="16"/>
<wire x1="17.5641" y1="12.3825" x2="17.7275" y2="12.3825" width="0.254" layer="16"/>
<wire x1="20.5359" y1="8.4963" x2="20.7175" y2="8.5725" width="0.254" layer="16"/>
</signal>
<signal name="UART_RX">
<contactref element="R1" pad="1"/>
<contactref element="RN-42HID" pad="13"/>
<wire x1="15.9639" y1="8.0391" x2="15.9639" y2="9.4107" width="0.254" layer="16"/>
<wire x1="12.5349" y1="8.0391" x2="15.9639" y2="8.0391" width="0.254" layer="1"/>
<wire x1="8.4201" y1="3.9243" x2="12.5349" y2="8.0391" width="0.254" layer="1"/>
<wire x1="8.4201" y1="3.4671" x2="8.4201" y2="3.9243" width="0.254" layer="1"/>
<wire x1="15.9639" y1="9.4107" x2="15.9275" y2="9.525" width="0.254" layer="16"/>
<wire x1="8.4201" y1="3.4671" x2="8.3225" y2="3.2425" width="0.254" layer="1"/>
<via x="15.9639" y="8.0391" extent="1-16" drill="0.6"/>
</signal>
<signal name="UART_RTS">
<contactref element="Q2" pad="2"/>
<contactref element="R5" pad="1"/>
<contactref element="RN-42HID" pad="15"/>
<wire x1="13.6779" y1="9.4107" x2="13.6779" y2="7.1247" width="0.254" layer="16"/>
<wire x1="13.6779" y1="7.1247" x2="13.65" y2="7.0325" width="0.254" layer="16"/>
<wire x1="13.6779" y1="9.4107" x2="13.6" y2="9.525" width="0.254" layer="16"/>
<wire x1="10.9347" y1="3.9243" x2="10.9347" y2="3.4671" width="0.254" layer="1"/>
<wire x1="12.7635" y1="5.7531" x2="10.9347" y2="3.9243" width="0.254" layer="1"/>
<wire x1="13.9065" y1="5.7531" x2="12.7635" y2="5.7531" width="0.254" layer="1"/>
<wire x1="13.9065" y1="6.6675" x2="13.9065" y2="5.7531" width="0.254" layer="16"/>
<wire x1="13.6779" y1="6.8961" x2="13.9065" y2="6.6675" width="0.254" layer="16"/>
<wire x1="10.9347" y1="3.4671" x2="10.7225" y2="3.2425" width="0.254" layer="1"/>
<wire x1="13.6779" y1="6.8961" x2="13.65" y2="7.0325" width="0.254" layer="16"/>
<via x="13.9065" y="5.7531" extent="1-16" drill="0.6"/>
</signal>
<signal name="UART_RTS_5V">
<contactref element="Q2" pad="3"/>
<contactref element="R6" pad="1"/>
<contactref element="UART" pad="2"/>
<wire x1="12.7635" y1="11.2395" x2="12.7635" y2="10.5537" width="0.254" layer="16"/>
<wire x1="12.7635" y1="10.5537" x2="12.7635" y2="5.0673" width="0.254" layer="16"/>
<wire x1="13.4493" y1="11.9253" x2="12.7635" y2="11.2395" width="0.254" layer="16"/>
<wire x1="12.7635" y1="5.0673" x2="12.7" y2="4.9325" width="0.254" layer="16"/>
<wire x1="13.4493" y1="11.9253" x2="13.6" y2="12.065" width="0.254" layer="16"/>
<wire x1="22.1361" y1="12.1539" x2="20.7645" y2="13.5255" width="0.254" layer="16"/>
<wire x1="22.3647" y1="12.1539" x2="22.1361" y2="12.1539" width="0.254" layer="16"/>
<wire x1="22.5933" y1="11.9253" x2="22.3647" y2="12.1539" width="0.254" layer="16"/>
<wire x1="22.5933" y1="2.7813" x2="22.5933" y2="11.9253" width="0.254" layer="16"/>
<wire x1="20.9931" y1="1.1811" x2="22.5933" y2="2.7813" width="0.254" layer="16"/>
<wire x1="4.5339" y1="1.1811" x2="20.9931" y2="1.1811" width="0.254" layer="16"/>
<wire x1="4.0767" y1="1.6383" x2="4.5339" y2="1.1811" width="0.254" layer="16"/>
<wire x1="4.0767" y1="4.3815" x2="4.0767" y2="1.6383" width="0.254" layer="16"/>
<wire x1="4.3053" y1="4.6101" x2="4.0767" y2="4.3815" width="0.254" layer="16"/>
<wire x1="8.6487" y1="4.6101" x2="4.3053" y2="4.6101" width="0.254" layer="16"/>
<wire x1="10.9347" y1="6.8961" x2="8.6487" y2="4.6101" width="0.254" layer="16"/>
<wire x1="10.9347" y1="10.3251" x2="10.9347" y2="6.8961" width="0.254" layer="16"/>
<wire x1="11.1633" y1="10.5537" x2="10.9347" y2="10.3251" width="0.254" layer="16"/>
<wire x1="12.7635" y1="10.5537" x2="11.1633" y2="10.5537" width="0.254" layer="16"/>
<wire x1="20.7645" y1="13.5255" x2="20.7175" y2="13.6525" width="0.254" layer="16"/>
</signal>
<signal name="UART_CTS">
<contactref element="R2" pad="1"/>
<contactref element="RN-42HID" pad="16"/>
<wire x1="15.7353" y1="5.5245" x2="15.7353" y2="5.9817" width="0.254" layer="16"/>
<wire x1="12.3063" y1="2.0955" x2="15.7353" y2="5.5245" width="0.254" layer="16"/>
<wire x1="4.9911" y1="2.0955" x2="12.3063" y2="2.0955" width="0.254" layer="16"/>
<wire x1="5.6769" y1="2.0955" x2="4.9911" y2="2.0955" width="0.254" layer="1"/>
<wire x1="6.1341" y1="1.6383" x2="5.6769" y2="2.0955" width="0.254" layer="1"/>
<wire x1="10.9347" y1="1.6383" x2="6.1341" y2="1.6383" width="0.254" layer="1"/>
<wire x1="11.8491" y1="2.5527" x2="10.9347" y2="1.6383" width="0.254" layer="1"/>
<wire x1="11.8491" y1="3.2385" x2="11.8491" y2="2.5527" width="0.254" layer="1"/>
<wire x1="15.7353" y1="5.9817" x2="15.9275" y2="6.0325" width="0.254" layer="16"/>
<wire x1="11.8491" y1="3.2385" x2="11.9225" y2="3.2425" width="0.254" layer="1"/>
<via x="4.9911" y="2.0955" extent="1-16" drill="0.6"/>
</signal>
<signal name="USB_D+">
<contactref element="USB" pad="3"/>
<contactref element="RN-42HID" pad="18"/>
<wire x1="14.3637" y1="4.1529" x2="14.3637" y2="3.4671" width="0.254" layer="1"/>
<wire x1="17.3355" y1="7.1247" x2="14.3637" y2="4.1529" width="0.254" layer="1"/>
<wire x1="17.3355" y1="8.7249" x2="17.3355" y2="7.1247" width="0.254" layer="1"/>
<wire x1="16.6497" y1="9.4107" x2="17.3355" y2="8.7249" width="0.254" layer="1"/>
<wire x1="9.5631" y1="9.4107" x2="16.6497" y2="9.4107" width="0.254" layer="1"/>
<wire x1="8.1915" y1="10.7823" x2="9.5631" y2="9.4107" width="0.254" layer="1"/>
<wire x1="6.3627" y1="10.7823" x2="8.1915" y2="10.7823" width="0.254" layer="16"/>
<wire x1="6.1341" y1="11.0109" x2="6.3627" y2="10.7823" width="0.254" layer="16"/>
<wire x1="14.3637" y1="3.4671" x2="14.3225" y2="3.2425" width="0.254" layer="1"/>
<wire x1="6.1341" y1="11.0109" x2="5.965" y2="11.1125" width="0.254" layer="16"/>
<via x="8.1915" y="10.7823" extent="1-16" drill="0.6"/>
</signal>
<signal name="USB_D-">
<contactref element="USB" pad="4"/>
<contactref element="RN-42HID" pad="17"/>
<wire x1="13.2207" y1="3.9243" x2="13.2207" y2="3.4671" width="0.254" layer="1"/>
<wire x1="14.1351" y1="4.8387" x2="13.2207" y2="3.9243" width="0.254" layer="1"/>
<wire x1="14.3637" y1="4.8387" x2="14.1351" y2="4.8387" width="0.254" layer="1"/>
<wire x1="16.8783" y1="7.3533" x2="14.3637" y2="4.8387" width="0.254" layer="1"/>
<wire x1="16.8783" y1="8.4963" x2="16.8783" y2="7.3533" width="0.254" layer="1"/>
<wire x1="16.4211" y1="8.9535" x2="16.8783" y2="8.4963" width="0.254" layer="1"/>
<wire x1="9.1059" y1="8.9535" x2="16.4211" y2="8.9535" width="0.254" layer="1"/>
<wire x1="8.1915" y1="8.0391" x2="9.1059" y2="8.9535" width="0.254" layer="1"/>
<wire x1="6.5913" y1="8.0391" x2="8.1915" y2="8.0391" width="0.254" layer="16"/>
<wire x1="6.1341" y1="8.4963" x2="6.5913" y2="8.0391" width="0.254" layer="16"/>
<wire x1="13.2207" y1="3.4671" x2="13.1225" y2="3.2425" width="0.254" layer="1"/>
<wire x1="6.1341" y1="8.4963" x2="5.965" y2="8.5725" width="0.254" layer="16"/>
<via x="8.1915" y="8.0391" extent="1-16" drill="0.6"/>
</signal>
<signal name="N$8">
<contactref element="RN-42HID" pad="19"/>
<contactref element="LED1" pad="A"/>
<wire x1="2.4765" y1="13.0683" x2="3.3909" y2="12.1539" width="0.254" layer="1"/>
<wire x1="2.4765" y1="14.8971" x2="2.4765" y2="13.0683" width="0.254" layer="1"/>
<wire x1="2.9337" y1="15.3543" x2="2.4765" y2="14.8971" width="0.254" layer="1"/>
<wire x1="6.5913" y1="15.3543" x2="2.9337" y2="15.3543" width="0.254" layer="1"/>
<wire x1="12.0777" y1="9.8679" x2="6.5913" y2="15.3543" width="0.254" layer="1"/>
<wire x1="16.8783" y1="9.8679" x2="12.0777" y2="9.8679" width="0.254" layer="1"/>
<wire x1="17.7927" y1="8.9535" x2="16.8783" y2="9.8679" width="0.254" layer="1"/>
<wire x1="17.7927" y1="5.9817" x2="17.7927" y2="8.9535" width="0.254" layer="1"/>
<wire x1="15.7353" y1="3.9243" x2="17.7927" y2="5.9817" width="0.254" layer="1"/>
<wire x1="15.7353" y1="3.4671" x2="15.7353" y2="3.9243" width="0.254" layer="1"/>
<wire x1="3.3909" y1="12.1539" x2="3.4925" y2="11.9675" width="0.254" layer="1"/>
<wire x1="15.7353" y1="3.4671" x2="15.5225" y2="3.2425" width="0.254" layer="1"/>
</signal>
<signal name="N$9">
<contactref element="R7" pad="2"/>
<contactref element="RN-42HID" pad="22"/>
<wire x1="10.9347" y1="14.6685" x2="10.9347" y2="16.0401" width="0.254" layer="16"/>
<wire x1="12.7635" y1="14.6685" x2="10.9347" y2="14.6685" width="0.254" layer="1"/>
<wire x1="18.9357" y1="8.4963" x2="12.7635" y2="14.6685" width="0.254" layer="1"/>
<wire x1="18.9357" y1="3.4671" x2="18.9357" y2="8.4963" width="0.254" layer="1"/>
<wire x1="10.9347" y1="16.0401" x2="10.7425" y2="16.1925" width="0.254" layer="16"/>
<wire x1="18.9357" y1="3.4671" x2="19.1225" y2="3.2425" width="0.254" layer="1"/>
<via x="10.9347" y="14.6685" extent="1-16" drill="0.6"/>
</signal>
<signal name="N$10">
<contactref element="RN-42HID" pad="21"/>
<contactref element="LED2" pad="A"/>
<wire x1="2.9337" y1="5.7531" x2="3.3909" y2="6.2103" width="0.254" layer="1"/>
<wire x1="2.7051" y1="5.7531" x2="2.9337" y2="5.7531" width="0.254" layer="1"/>
<wire x1="2.2479" y1="5.2959" x2="2.7051" y2="5.7531" width="0.254" layer="1"/>
<wire x1="2.2479" y1="3.4671" x2="2.2479" y2="5.2959" width="0.254" layer="1"/>
<wire x1="4.5339" y1="1.1811" x2="2.2479" y2="3.4671" width="0.254" layer="1"/>
<wire x1="16.4211" y1="1.1811" x2="4.5339" y2="1.1811" width="0.254" layer="1"/>
<wire x1="17.7927" y1="2.5527" x2="16.4211" y2="1.1811" width="0.254" layer="1"/>
<wire x1="17.7927" y1="3.2385" x2="17.7927" y2="2.5527" width="0.254" layer="1"/>
<wire x1="3.3909" y1="6.2103" x2="3.4925" y2="6.2525" width="0.254" layer="1"/>
<wire x1="17.7927" y1="3.2385" x2="17.9225" y2="3.2425" width="0.254" layer="1"/>
</signal>
<signal name="GND">
<contactref element="R7" pad="1"/>
<contactref element="R9" pad="1"/>
<contactref element="R8" pad="1"/>
<contactref element="UART" pad="1"/>
<contactref element="USB" pad="1"/>
<contactref element="RN-42HID" pad="1"/>
<contactref element="RN-42HID" pad="12"/>
<contactref element="RN-42HID" pad="28"/>
<contactref element="RN-42HID" pad="29"/>
<wire x1="6.3627" y1="6.8961" x2="5.6769" y2="6.8961" width="0.254" layer="1"/>
<wire x1="6.8199" y1="7.3533" x2="6.3627" y2="6.8961" width="0.254" layer="1"/>
<wire x1="6.8199" y1="12.1539" x2="6.8199" y2="9.4107" width="0.254" layer="1"/>
<wire x1="6.8199" y1="9.4107" x2="6.8199" y2="7.3533" width="0.254" layer="1"/>
<wire x1="6.1341" y1="12.8397" x2="6.8199" y2="12.1539" width="0.254" layer="1"/>
<wire x1="5.6769" y1="12.8397" x2="6.1341" y2="12.8397" width="0.254" layer="1"/>
<wire x1="5.6769" y1="6.8961" x2="5.5225" y2="6.7425" width="0.254" layer="1"/>
<wire x1="5.6769" y1="12.8397" x2="5.5225" y2="12.9425" width="0.254" layer="1"/>
<wire x1="9.5631" y1="10.3251" x2="9.5631" y2="9.4107" width="0.254" layer="16"/>
<wire x1="9.5631" y1="9.4107" x2="9.5631" y2="8.9535" width="0.254" layer="16"/>
<wire x1="10.4775" y1="11.2395" x2="9.5631" y2="10.3251" width="0.254" layer="16"/>
<wire x1="10.4775" y1="12.6111" x2="10.4775" y2="11.2395" width="0.254" layer="16"/>
<wire x1="9.5631" y1="13.5255" x2="10.4775" y2="12.6111" width="0.254" layer="16"/>
<wire x1="9.5631" y1="8.9535" x2="9.525" y2="8.8375" width="0.254" layer="16"/>
<wire x1="9.5631" y1="13.5255" x2="9.525" y2="13.6" width="0.254" layer="16"/>
<wire x1="9.1059" y1="13.9827" x2="9.1059" y2="14.6685" width="0.254" layer="16"/>
<wire x1="9.1059" y1="14.6685" x2="9.1059" y2="16.0401" width="0.254" layer="16"/>
<wire x1="9.3345" y1="13.7541" x2="9.1059" y2="13.9827" width="0.254" layer="16"/>
<wire x1="9.1059" y1="16.0401" x2="8.9425" y2="16.1925" width="0.254" layer="16"/>
<wire x1="9.3345" y1="13.7541" x2="9.525" y2="13.6" width="0.254" layer="16"/>
<wire x1="8.8773" y1="16.2687" x2="6.1341" y2="16.2687" width="0.254" layer="16"/>
<wire x1="6.1341" y1="16.2687" x2="5.965" y2="16.1925" width="0.254" layer="16"/>
<wire x1="8.8773" y1="16.2687" x2="8.9425" y2="16.1925" width="0.254" layer="16"/>
<wire x1="8.1915" y1="9.4107" x2="6.8199" y2="9.4107" width="0.254" layer="1"/>
<wire x1="9.5631" y1="9.4107" x2="8.1915" y2="9.4107" width="0.254" layer="16"/>
<wire x1="8.4201" y1="17.1831" x2="8.4201" y2="16.4973" width="0.254" layer="1"/>
<wire x1="8.8773" y1="17.6403" x2="8.4201" y2="17.1831" width="0.254" layer="1"/>
<wire x1="20.9931" y1="17.6403" x2="8.8773" y2="17.6403" width="0.254" layer="1"/>
<wire x1="21.4503" y1="17.1831" x2="20.9931" y2="17.6403" width="0.254" layer="1"/>
<wire x1="21.4503" y1="16.4973" x2="21.4503" y2="17.1831" width="0.254" layer="1"/>
<wire x1="8.4201" y1="16.4973" x2="8.3225" y2="16.4425" width="0.254" layer="1"/>
<wire x1="21.4503" y1="16.4973" x2="21.5225" y2="16.4425" width="0.254" layer="1"/>
<wire x1="20.7645" y1="14.8971" x2="20.7645" y2="16.0401" width="0.254" layer="16"/>
<wire x1="21.4503" y1="15.5829" x2="20.7645" y2="14.8971" width="0.254" layer="1"/>
<wire x1="21.4503" y1="16.2687" x2="21.4503" y2="15.5829" width="0.254" layer="1"/>
<wire x1="20.7645" y1="16.0401" x2="20.7175" y2="16.1925" width="0.254" layer="16"/>
<wire x1="21.4503" y1="16.2687" x2="21.5225" y2="16.4425" width="0.254" layer="1"/>
<wire x1="8.6487" y1="14.6685" x2="9.1059" y2="14.6685" width="0.254" layer="16"/>
<wire x1="8.6487" y1="16.0401" x2="8.6487" y2="14.6685" width="0.254" layer="1"/>
<wire x1="8.4201" y1="16.2687" x2="8.6487" y2="16.0401" width="0.254" layer="1"/>
<wire x1="8.4201" y1="16.2687" x2="8.3225" y2="16.4425" width="0.254" layer="1"/>
<via x="8.1915" y="9.4107" extent="1-16" drill="0.6"/>
<via x="20.7645" y="14.8971" extent="1-16" drill="0.6"/>
<via x="8.6487" y="14.6685" extent="1-16" drill="0.6"/>
</signal>
<signal name="UART_RX_5V">
<contactref element="R1" pad="2"/>
<contactref element="UART" pad="3"/>
<wire x1="19.1643" y1="9.6393" x2="17.7927" y2="9.6393" width="0.254" layer="16"/>
<wire x1="20.5359" y1="11.0109" x2="19.1643" y2="9.6393" width="0.254" layer="16"/>
<wire x1="17.7927" y1="9.6393" x2="17.7275" y2="9.525" width="0.254" layer="16"/>
<wire x1="20.5359" y1="11.0109" x2="20.7175" y2="11.1125" width="0.254" layer="16"/>
</signal>
<signal name="UART_CTS_5V">
<contactref element="R2" pad="2"/>
<contactref element="UART" pad="5"/>
<wire x1="20.5359" y1="5.9817" x2="17.7927" y2="5.9817" width="0.254" layer="16"/>
<wire x1="17.7927" y1="5.9817" x2="17.7275" y2="6.0325" width="0.254" layer="16"/>
<wire x1="20.5359" y1="5.9817" x2="20.7175" y2="6.0325" width="0.254" layer="16"/>
</signal>
<signal name="VCC">
<contactref element="R4" pad="2"/>
<contactref element="R6" pad="2"/>
<contactref element="UART" pad="6"/>
<contactref element="USB" pad="5"/>
<contactref element="RN-42HID" pad="11"/>
<wire x1="11.8491" y1="15.3543" x2="11.8491" y2="13.7541" width="0.254" layer="16"/>
<wire x1="11.8491" y1="13.7541" x2="11.8491" y2="12.1539" width="0.254" layer="16"/>
<wire x1="12.3063" y1="15.8115" x2="12.0777" y2="15.5829" width="0.254" layer="16"/>
<wire x1="12.0777" y1="15.5829" x2="11.8491" y2="15.3543" width="0.254" layer="16"/>
<wire x1="15.9639" y1="15.8115" x2="12.3063" y2="15.8115" width="0.254" layer="16"/>
<wire x1="16.4211" y1="15.3543" x2="15.9639" y2="15.8115" width="0.254" layer="16"/>
<wire x1="16.4211" y1="12.8397" x2="16.4211" y2="15.3543" width="0.254" layer="16"/>
<wire x1="15.9639" y1="12.3825" x2="16.4211" y2="12.8397" width="0.254" layer="16"/>
<wire x1="11.8491" y1="12.1539" x2="11.8" y2="12.065" width="0.254" layer="16"/>
<wire x1="15.9639" y1="12.3825" x2="15.9275" y2="12.3825" width="0.254" layer="16"/>
<wire x1="9.5631" y1="14.6685" x2="9.5631" y2="16.2687" width="0.254" layer="1"/>
<wire x1="10.4775" y1="13.7541" x2="9.5631" y2="14.6685" width="0.254" layer="1"/>
<wire x1="11.8491" y1="13.7541" x2="10.4775" y2="13.7541" width="0.254" layer="1"/>
<wire x1="9.5631" y1="16.2687" x2="9.5225" y2="16.4425" width="0.254" layer="1"/>
<wire x1="18.4785" y1="3.6957" x2="20.5359" y2="3.6957" width="0.254" layer="16"/>
<wire x1="16.8783" y1="5.2959" x2="18.4785" y2="3.6957" width="0.254" layer="16"/>
<wire x1="16.8783" y1="6.6675" x2="16.8783" y2="5.2959" width="0.254" layer="16"/>
<wire x1="16.4211" y1="7.1247" x2="16.8783" y2="6.6675" width="0.254" layer="16"/>
<wire x1="15.5067" y1="7.1247" x2="16.4211" y2="7.1247" width="0.254" layer="16"/>
<wire x1="15.0495" y1="7.5819" x2="15.5067" y2="7.1247" width="0.254" layer="16"/>
<wire x1="15.0495" y1="11.6967" x2="15.0495" y2="7.5819" width="0.254" layer="16"/>
<wire x1="15.7353" y1="12.3825" x2="15.0495" y2="11.6967" width="0.254" layer="16"/>
<wire x1="20.5359" y1="3.6957" x2="20.7175" y2="3.4925" width="0.254" layer="16"/>
<wire x1="15.7353" y1="12.3825" x2="15.9275" y2="12.3825" width="0.254" layer="16"/>
<wire x1="4.5339" y1="7.5819" x2="5.9055" y2="6.2103" width="0.254" layer="16"/>
<wire x1="4.3053" y1="7.5819" x2="4.5339" y2="7.5819" width="0.254" layer="16"/>
<wire x1="4.0767" y1="7.8105" x2="4.3053" y2="7.5819" width="0.254" layer="16"/>
<wire x1="4.0767" y1="16.9545" x2="4.0767" y2="7.8105" width="0.254" layer="16"/>
<wire x1="4.3053" y1="17.1831" x2="4.0767" y2="16.9545" width="0.254" layer="16"/>
<wire x1="11.3919" y1="17.1831" x2="4.3053" y2="17.1831" width="0.254" layer="16"/>
<wire x1="12.0777" y1="16.4973" x2="11.3919" y2="17.1831" width="0.254" layer="16"/>
<wire x1="12.0777" y1="15.5829" x2="12.0777" y2="16.4973" width="0.254" layer="16"/>
<wire x1="5.9055" y1="6.2103" x2="5.965" y2="6.0325" width="0.254" layer="16"/>
<via x="11.8491" y="13.7541" extent="1-16" drill="0.6"/>
</signal>
<signal name="N$3">
<contactref element="R9" pad="2"/>
<contactref element="LED1" pad="C"/>
<wire x1="4.0767" y1="14.2113" x2="3.6195" y2="14.2113" width="0.254" layer="1"/>
<wire x1="4.7625" y1="14.8971" x2="4.0767" y2="14.2113" width="0.254" layer="1"/>
<wire x1="6.3627" y1="14.8971" x2="4.7625" y2="14.8971" width="0.254" layer="1"/>
<wire x1="8.1915" y1="13.0683" x2="6.3627" y2="14.8971" width="0.254" layer="1"/>
<wire x1="8.1915" y1="12.3825" x2="8.1915" y2="13.0683" width="0.254" layer="1"/>
<wire x1="8.8773" y1="12.3825" x2="8.1915" y2="12.3825" width="0.254" layer="16"/>
<wire x1="9.3345" y1="11.9253" x2="8.8773" y2="12.3825" width="0.254" layer="16"/>
<wire x1="3.6195" y1="14.2113" x2="3.4925" y2="14.0675" width="0.254" layer="1"/>
<wire x1="9.3345" y1="11.9253" x2="9.525" y2="11.8" width="0.254" layer="16"/>
<via x="8.1915" y="12.3825" extent="1-16" drill="0.6"/>
</signal>
<signal name="N$1">
<contactref element="R8" pad="2"/>
<contactref element="LED2" pad="C"/>
<wire x1="7.9629" y1="5.5245" x2="9.3345" y2="6.8961" width="0.254" layer="16"/>
<wire x1="7.9629" y1="5.2959" x2="7.9629" y2="5.5245" width="0.254" layer="16"/>
<wire x1="7.7343" y1="5.0673" x2="7.9629" y2="5.2959" width="0.254" layer="16"/>
<wire x1="4.3053" y1="5.0673" x2="7.7343" y2="5.0673" width="0.254" layer="16"/>
<wire x1="2.2479" y1="7.1247" x2="4.3053" y2="5.0673" width="0.254" layer="16"/>
<wire x1="2.2479" y1="7.3533" x2="2.2479" y2="7.1247" width="0.254" layer="16"/>
<wire x1="3.3909" y1="8.4963" x2="2.2479" y2="7.3533" width="0.254" layer="1"/>
<wire x1="9.3345" y1="6.8961" x2="9.525" y2="7.0375" width="0.254" layer="16"/>
<wire x1="3.3909" y1="8.4963" x2="3.4925" y2="8.3525" width="0.254" layer="1"/>
<via x="2.2479" y="7.3533" extent="1-16" drill="0.6"/>
</signal>
</signals>
</board>
</drawing>
</eagle>

repository: HokieGeek/btkb

repo_name: HokieGeek/btkb

extension: brd


text:
DESCRIPTION = "The concurrent.futures module provides a high-level interface for asynchronously executing callables."
SECTION = "devel/python"
LICENSE = "PSF"
LIC_FILES_CHKSUM = "file://LICENSE;md5=834d982f973c48b6d662b5944c5ab567"
HOMEPAGE = "https://github.com/agronholm/pythonfutures"
DEPENDS = "python"

SRC_URI[md5sum] = "d1b299a06b96ccb59f70324716dc0016"
SRC_URI[sha256sum] = "9ec02aa7d674acb8618afb127e27fde7fc68994c0437ad759fa094a574adb265"

inherit pypi setuptools

BBCLASSEXTEND = "native nativesdk"

repository: astarche/meta-openembedded

repo_name: astarche/meta-openembedded

branch_name: refs/heads/nilrt/master/sumo


text:
// +build js

package queue

import (
	"context"
	"sync"
	"syscall/js"
	"time"

	"github.com/johnstarich/go-wasm/internal/indexeddb"
)

type Queue struct {
	ops        chan opRunner
	startOnce  sync.Once
	pushNotifs chan struct{}
}

func New(size int) *Queue {
	return &Queue{
		ops: make(chan opRunner, size),
	}
}

type opRunner struct {
	mode       indexeddb.TransactionMode
	storeNames []string
	op         indexeddb.Op
	result     chan<- js.Value
	err        chan<- error
}

func (q *Queue) Push(mode indexeddb.TransactionMode, storeNames []string, op indexeddb.Op) (<-chan js.Value, <-chan error) {
	result := make(chan js.Value, 1)
	err := make(chan error, 1)
	q.ops <- opRunner{
		mode:       mode,
		storeNames: storeNames,
		op:         op,
		result:     result,
		err:        err,
	}
	if q.pushNotifs != nil {
		q.pushNotifs <- struct{}{}
	}
	return result, err
}

func (q *Queue) Do(db *indexeddb.DB) ([]js.Value, error) {
	runners := q.readOps()
	mode := indexeddb.TransactionReadOnly
	storeNameSet := make(map[string]bool)
	for _, runner := range runners {
		if runner.mode == indexeddb.TransactionReadWrite {
			mode = runner.mode
		}
		for _, storeName := range runner.storeNames {
			storeNameSet[storeName] = true
		}
	}
	storeNames := make([]string, 0, len(storeNameSet))
	for name := range storeNameSet {
		storeNames = append(storeNames, name)
	}

	var results []js.Value
	requests, err := runOps(db, mode, storeNames, runners)
	if err == nil {
		results = make([]js.Value, len(requests))
		for i := range runners {
			result, resultErr := requests[i].Result()
			if resultErr != nil && err == nil {
				err = resultErr
				break
			}
			runners[i].result <- result
			results[i] = result
		}
	}
	for i := range runners {
		runners[i].err <- err
		close(runners[i].err)
		close(runners[i].result) // always close result chans, even on error
	}
	return results, err
}

func (q *Queue) readOps() []opRunner {
	var runners []opRunner
	for {
		select {
		case runner := <-q.ops:
			runners = append(runners, runner)
		default:
			return runners
		}
	}
}

func runOps(db *indexeddb.DB, mode indexeddb.TransactionMode, storeNames []string, runners []opRunner) (requests []*indexeddb.Request, err error) {
	if len(runners) == 0 {
		return nil, nil
	}
	txn, err := db.Transaction(mode, storeNames...)
	if err != nil {
		return nil, err
	}

	for _, runner := range runners {
		req, err := runner.op(txn)
		if err != nil {
			return nil, err
		}
		requests = append(requests, req)
	}

	err = txn.Commit()
	if err != nil {
		return nil, err
	}
	err = txn.Await()
	return requests, err
}

func (q *Queue) StartAsync(ctx context.Context, interval time.Duration, db *indexeddb.DB) {
	q.startOnce.Do(func() {
		q.pushNotifs = make(chan struct{}, cap(q.ops))
		go q.runDoLoop(ctx, interval, db)
	})
}

func (q *Queue) runDoLoop(ctx context.Context, interval time.Duration, db *indexeddb.DB) {
	maxSize := float64(cap(q.ops))
	timer := time.NewTimer(interval)
	prevInterval := interval

	const (
		minWaitPercent = 1   // must wait at least this long %-wise. needed to refill the queue
		maxWaitPercent = 100 // max wait, for responsiveness
	)
	minInterval := time.Duration(float64(interval) * minWaitPercent)
	maxInterval := time.Duration(float64(interval) * maxWaitPercent)
	for {
		select {
		case <-ctx.Done():
			timer.Stop()
			return
		case <-q.pushNotifs:
			if prevInterval > interval {
				if !timer.Stop() {
					<-timer.C
					timer.Reset(0)
				} else {
					prevInterval = minInterval
					timer.Reset(prevInterval)
				}
			}
		case <-timer.C:
			results, _ := q.Do(db) // errors handled by returned channels from q.Push()

			/*
				Reduce busy-wait with wait time multiplier:

				use fill % to calculate next wait interval

				low %:    0% filled -> 1.10x prev wait
				          1% filled -> 0.50x prev wait
				         25% filled -> 0.25x prev wait
				         50% filled -> 0.10x prev wait
				         75% filled -> 0.10x prev wait
				high %: 100% filled -> 0.10x prev wait
			*/

			fill := float64(len(results)) / maxSize
			var waitMultiplier float64
			switch {
			case fill >= 0.50:
				waitMultiplier = 0.10
			case fill >= 0.25:
				waitMultiplier = 0.25
			case fill > 0.00:
				waitMultiplier = 0.50
			default:
				waitMultiplier = 1.10
			}
			prevInterval = time.Duration(float64(prevInterval) * waitMultiplier)

			if prevInterval < minInterval {
				prevInterval = minInterval
			} else if prevInterval > maxInterval {
				prevInterval = maxInterval
			}
			timer.Reset(prevInterval)
		}
	}
}

repository: hookttg/go-wasm

repo_name: hookttg/go-wasm