text:
package cache

import (
	"context"
	"sort"
	"sync"
	"time"

	"github.com/containerd/containerd/content"
	"github.com/containerd/containerd/diff"
	"github.com/containerd/containerd/errdefs"
	"github.com/containerd/containerd/filters"
	"github.com/containerd/containerd/gc"
	"github.com/containerd/containerd/leases"
	"github.com/docker/docker/pkg/idtools"
	"github.com/moby/buildkit/cache/metadata"
	"github.com/moby/buildkit/client"
	"github.com/moby/buildkit/identity"
	"github.com/moby/buildkit/session"
	"github.com/moby/buildkit/snapshot"
	"github.com/moby/buildkit/util/flightcontrol"
	digest "github.com/opencontainers/go-digest"
	imagespecidentity "github.com/opencontainers/image-spec/identity"
	ocispec "github.com/opencontainers/image-spec/specs-go/v1"
	"github.com/pkg/errors"
	"github.com/sirupsen/logrus"
	"golang.org/x/sync/errgroup"
)

var (
	ErrLocked   = errors.New("locked")
	errNotFound = errors.New("not found")
	errInvalid  = errors.New("invalid")
)

type ManagerOpt struct {
	Snapshotter     snapshot.Snapshotter
	MetadataStore   *metadata.Store
	ContentStore    content.Store
	LeaseManager    leases.Manager
	PruneRefChecker ExternalRefCheckerFunc
	GarbageCollect  func(ctx context.Context) (gc.Stats, error)
	Applier         diff.Applier
	Differ          diff.Comparer
}

type Accessor interface {
	GetByBlob(ctx context.Context, desc ocispec.Descriptor, parent ImmutableRef, opts ...RefOption) (ImmutableRef, error)
	Get(ctx context.Context, id string, opts ...RefOption) (ImmutableRef, error)

	New(ctx context.Context, parent ImmutableRef, s session.Group, opts ...RefOption) (MutableRef, error)
	GetMutable(ctx context.Context, id string, opts ...RefOption) (MutableRef, error) // Rebase?
	IdentityMapping() *idtools.IdentityMapping
	Metadata(string) *metadata.StorageItem
}

type Controller interface {
	DiskUsage(ctx context.Context, info client.DiskUsageInfo) ([]*client.UsageInfo, error)
	Prune(ctx context.Context, ch chan client.UsageInfo, info ...client.PruneInfo) error
}

type Manager interface {
	Accessor
	Controller
	Close() error
}

type ExternalRefCheckerFunc func() (ExternalRefChecker, error)

type ExternalRefChecker interface {
	Exists(string, []digest.Digest) bool
}

type cacheManager struct {
	records map[string]*cacheRecord
	mu      sync.Mutex
	ManagerOpt
	md *metadata.Store

	muPrune sync.Mutex // make sure parallel prune is not allowed so there will not be inconsistent results
	unlazyG flightcontrol.Group
}

func NewManager(opt ManagerOpt) (Manager, error) {
	cm := &cacheManager{
		ManagerOpt: opt,
		md:         opt.MetadataStore,
		records:    make(map[string]*cacheRecord),
	}

	if err := cm.init(context.TODO()); err != nil {
		return nil, err
	}

	// cm.scheduleGC(5 * time.Minute)

	return cm, nil
}

func (cm *cacheManager) GetByBlob(ctx context.Context, desc ocispec.Descriptor, parent ImmutableRef, opts ...RefOption) (ir ImmutableRef, rerr error) {
	diffID, err := diffIDFromDescriptor(desc)
	if err != nil {
		return nil, err
	}
	chainID := diffID
	blobChainID := imagespecidentity.ChainID([]digest.Digest{desc.Digest, diffID})

	descHandlers := descHandlersOf(opts...)
	if desc.Digest != "" && (descHandlers == nil || descHandlers[desc.Digest] == nil) {
		if _, err := cm.ContentStore.Info(ctx, desc.Digest); errors.Is(err, errdefs.ErrNotFound) {
			return nil, NeedsRemoteProvidersError([]digest.Digest{desc.Digest})
		} else if err != nil {
			return nil, err
		}
	}

	var p *immutableRef
	var parentID string
	if parent != nil {
		pInfo := parent.Info()
		if pInfo.ChainID == "" || pInfo.BlobChainID == "" {
			return nil, errors.Errorf("failed to get ref by blob on non-addressable parent")
		}
		chainID = imagespecidentity.ChainID([]digest.Digest{pInfo.ChainID, chainID})
		blobChainID = imagespecidentity.ChainID([]digest.Digest{pInfo.BlobChainID, blobChainID})

		p2, err := cm.Get(ctx, parent.ID(), NoUpdateLastUsed, descHandlers)
		if err != nil {
			return nil, err
		}
		if err := p2.Finalize(ctx, true); err != nil {
			return nil, err
		}
		parentID = p2.ID()
		p = p2.(*immutableRef)
	}

	releaseParent := false
	defer func() {
		if releaseParent || rerr != nil && p != nil {
			p.Release(context.TODO())
		}
	}()

	cm.mu.Lock()
	defer cm.mu.Unlock()

	sis, err := cm.MetadataStore.Search("blobchainid:" + blobChainID.String())
	if err != nil {
		return nil, err
	}

	for _, si := range sis {
		ref, err := cm.get(ctx, si.ID(), opts...)
		if err != nil && !IsNotFound(err) {
			return nil, errors.Wrapf(err, "failed to get record %s by blobchainid", sis[0].ID())
		}
		if ref == nil {
			continue
		}
		if p != nil {
			releaseParent = true
		}
		if err := setImageRefMetadata(ref, opts...); err != nil {
			return nil, errors.Wrapf(err, "failed to append image ref metadata to ref %s", ref.ID())
		}
		return ref, nil
	}

	sis, err = cm.MetadataStore.Search("chainid:" + chainID.String())
	if err != nil {
		return nil, err
	}

	var link ImmutableRef
	for _, si := range sis {
		ref, err := cm.get(ctx, si.ID(), opts...)
		if err != nil && !IsNotFound(err) {
			return nil, errors.Wrapf(err, "failed to get record %s by chainid", sis[0].ID())
		}
		if ref != nil {
			link = ref
			break
		}
	}

	id := identity.NewID()
	snapshotID := chainID.String()
	blobOnly := true
	if link != nil {
		snapshotID = getSnapshotID(link.Metadata())
		blobOnly = getBlobOnly(link.Metadata())
		go link.Release(context.TODO())
	}

	l, err := cm.ManagerOpt.LeaseManager.Create(ctx, func(l *leases.Lease) error {
		l.ID = id
		l.Labels = map[string]string{
			"containerd.io/gc.flat": time.Now().UTC().Format(time.RFC3339Nano),
		}
		return nil
	})
	if err != nil {
		return nil, errors.Wrap(err, "failed to create lease")
	}

	defer func() {
		if rerr != nil {
			if err := cm.ManagerOpt.LeaseManager.Delete(context.TODO(), leases.Lease{
				ID: l.ID,
			}); err != nil {
				logrus.Errorf("failed to remove lease: %+v", err)
			}
		}
	}()

	if err := cm.ManagerOpt.LeaseManager.AddResource(ctx, l, leases.Resource{
		ID:   snapshotID,
		Type: "snapshots/" + cm.ManagerOpt.Snapshotter.Name(),
	}); err != nil {
		return nil, errors.Wrapf(err, "failed to add snapshot %s to lease", id)
	}

	if desc.Digest != "" {
		if err := cm.ManagerOpt.LeaseManager.AddResource(ctx, leases.Lease{ID: id}, leases.Resource{
			ID:   desc.Digest.String(),
			Type: "content",
		}); err != nil {
			return nil, errors.Wrapf(err, "failed to add blob %s to lease", id)
		}
	}

	md, _ := cm.md.Get(id)

	rec := &cacheRecord{
		mu:     &sync.Mutex{},
		cm:     cm,
		refs:   make(map[ref]struct{}),
		parent: p,
		md:     md,
	}

	if err := initializeMetadata(rec, parentID, opts...); err != nil {
		return nil, err
	}

	if err := setImageRefMetadata(rec, opts...); err != nil {
		return nil, errors.Wrapf(err, "failed to append image ref metadata to ref %s", rec.ID())
	}

	queueDiffID(rec.md, diffID.String())
	queueBlob(rec.md, desc.Digest.String())
	queueChainID(rec.md, chainID.String())
	queueBlobChainID(rec.md, blobChainID.String())
	queueSnapshotID(rec.md, snapshotID)
	queueBlobOnly(rec.md, blobOnly)
	queueMediaType(rec.md, desc.MediaType)
	queueBlobSize(rec.md, desc.Size)
	queueCommitted(rec.md)

	if err := rec.md.Commit(); err != nil {
		return nil, err
	}

	cm.records[id] = rec

	return rec.ref(true, descHandlers), nil
}

// init loads all snapshots from metadata state and tries to load the records
// from the snapshotter. If snaphot can't be found, metadata is deleted as well.
func (cm *cacheManager) init(ctx context.Context) error {
	items, err := cm.md.All()
	if err != nil {
		return err
	}

	for _, si := range items {
		if _, err := cm.getRecord(ctx, si.ID()); err != nil {
			logrus.Debugf("could not load snapshot %s: %+v", si.ID(), err)
			cm.md.Clear(si.ID())
			cm.LeaseManager.Delete(ctx, leases.Lease{ID: si.ID()})
		}
	}
	return nil
}

// IdentityMapping returns the userns remapping used for refs
func (cm *cacheManager) IdentityMapping() *idtools.IdentityMapping {
	return cm.Snapshotter.IdentityMapping()
}

// Close closes the manager and releases the metadata database lock. No other
// method should be called after Close.
func (cm *cacheManager) Close() error {
	// TODO: allocate internal context and cancel it here
	return cm.md.Close()
}

// Get returns an immutable snapshot reference for ID
func (cm *cacheManager) Get(ctx context.Context, id string, opts ...RefOption) (ImmutableRef, error) {
	cm.mu.Lock()
	defer cm.mu.Unlock()
	return cm.get(ctx, id, opts...)
}

func (cm *cacheManager) Metadata(id string) *metadata.StorageItem {
	cm.mu.Lock()
	defer cm.mu.Unlock()
	r, ok := cm.records[id]
	if !ok {
		return nil
	}
	return r.Metadata()
}

// get requires manager lock to be taken
func (cm *cacheManager) get(ctx context.Context, id string, opts ...RefOption) (*immutableRef, error) {
	rec, err := cm.getRecord(ctx, id, opts...)
	if err != nil {
		return nil, err
	}
	rec.mu.Lock()
	defer rec.mu.Unlock()

	triggerUpdate := true
	for _, o := range opts {
		if o == NoUpdateLastUsed {
			triggerUpdate = false
		}
	}

	descHandlers := descHandlersOf(opts...)

	if rec.mutable {
		if len(rec.refs) != 0 {
			return nil, errors.Wrapf(ErrLocked, "%s is locked", id)
		}
		if rec.equalImmutable != nil {
			return rec.equalImmutable.ref(triggerUpdate, descHandlers), nil
		}
		return rec.mref(triggerUpdate, descHandlers).commit(ctx)
	}

	return rec.ref(triggerUpdate, descHandlers), nil
}

// getRecord returns record for id. Requires manager lock.
func (cm *cacheManager) getRecord(ctx context.Context, id string, opts ...RefOption) (cr *cacheRecord, retErr error) {
	checkLazyProviders := func(rec *cacheRecord) error {
		missing := NeedsRemoteProvidersError(nil)
		dhs := descHandlersOf(opts...)
		for {
			blob := digest.Digest(getBlob(rec.md))
			if isLazy, err := rec.isLazy(ctx); err != nil {
				return err
			} else if isLazy && dhs[blob] == nil {
				missing = append(missing, blob)
			}

			if rec.parent == nil {
				break
			}
			rec = rec.parent.cacheRecord
		}
		if len(missing) > 0 {
			return missing
		}
		return nil
	}

	if rec, ok := cm.records[id]; ok {
		if rec.isDead() {
			return nil, errors.Wrapf(errNotFound, "failed to get dead record %s", id)
		}
		if err := checkLazyProviders(rec); err != nil {
			return nil, err
		}
		return rec, nil
	}

	md, ok := cm.md.Get(id)
	if !ok {
		return nil, errors.Wrapf(errNotFound, "%s not found", id)
	}
	if mutableID := getEqualMutable(md); mutableID != "" {
		mutable, err := cm.getRecord(ctx, mutableID)
		if err != nil {
			// check loading mutable deleted record from disk
			if IsNotFound(err) {
				cm.md.Clear(id)
			}
			return nil, err
		}

		// parent refs are possibly lazy so keep it hold the description handlers.
		var dhs DescHandlers
		if mutable.parent != nil {
			dhs = mutable.parent.descHandlers
		}
		rec := &cacheRecord{
			mu:           &sync.Mutex{},
			cm:           cm,
			refs:         make(map[ref]struct{}),
			parent:       mutable.parentRef(false, dhs),
			md:           md,
			equalMutable: &mutableRef{cacheRecord: mutable},
		}
		mutable.equalImmutable = &immutableRef{cacheRecord: rec}
		cm.records[id] = rec
		return rec, nil
	}

	var parent *immutableRef
	if parentID := getParent(md); parentID != "" {
		var err error
		parent, err = cm.get(ctx, parentID, append(opts, NoUpdateLastUsed)...)
		if err != nil {
			return nil, err
		}
		defer func() {
			if retErr != nil {
				parent.mu.Lock()
				parent.release(context.TODO())
				parent.mu.Unlock()
			}
		}()
	}

	rec := &cacheRecord{
		mu:      &sync.Mutex{},
		mutable: !getCommitted(md),
		cm:      cm,
		refs:    make(map[ref]struct{}),
		parent:  parent,
		md:      md,
	}

	// the record was deleted but we crashed before data on disk was removed
	if getDeleted(md) {
		if err := rec.remove(ctx, true); err != nil {
			return nil, err
		}
		return nil, errors.Wrapf(errNotFound, "failed to get deleted record %s", id)
	}

	if err := initializeMetadata(rec, getParent(md), opts...); err != nil {
		return nil, err
	}

	if err := setImageRefMetadata(rec, opts...); err != nil {
		return nil, errors.Wrapf(err, "failed to append image ref metadata to ref %s", rec.ID())
	}

	cm.records[id] = rec
	if err := checkLazyProviders(rec); err != nil {
		return nil, err
	}
	return rec, nil
}

func (cm *cacheManager) New(ctx context.Context, s ImmutableRef, sess session.Group, opts ...RefOption) (mr MutableRef, err error) {
	id := identity.NewID()

	var parent *immutableRef
	var parentID string
	var parentSnapshotID string
	if s != nil {
		if _, ok := s.(*immutableRef); ok {
			parent = s.Clone().(*immutableRef)
		} else {
			p, err := cm.Get(ctx, s.ID(), append(opts, NoUpdateLastUsed)...)
			if err != nil {
				return nil, err
			}
			parent = p.(*immutableRef)
		}
		if err := parent.Finalize(ctx, true); err != nil {
			return nil, err
		}
		if err := parent.Extract(ctx, sess); err != nil {
			return nil, err
		}
		parentSnapshotID = getSnapshotID(parent.md)
		parentID = parent.ID()
	}

	defer func() {
		if err != nil && parent != nil {
			parent.Release(context.TODO())
		}
	}()

	l, err := cm.ManagerOpt.LeaseManager.Create(ctx, func(l *leases.Lease) error {
		l.ID = id
		l.Labels = map[string]string{
			"containerd.io/gc.flat": time.Now().UTC().Format(time.RFC3339Nano),
		}
		return nil
	})
	if err != nil {
		return nil, errors.Wrap(err, "failed to create lease")
	}

	defer func() {
		if err != nil {
			if err := cm.ManagerOpt.LeaseManager.Delete(context.TODO(), leases.Lease{
				ID: l.ID,
			}); err != nil {
				logrus.Errorf("failed to remove lease: %+v", err)
			}
		}
	}()

	if err := cm.ManagerOpt.LeaseManager.AddResource(ctx, l, leases.Resource{
		ID:   id,
		Type: "snapshots/" + cm.ManagerOpt.Snapshotter.Name(),
	}); err != nil {
		return nil, errors.Wrapf(err, "failed to add snapshot %s to lease", id)
	}

	if cm.Snapshotter.Name() == "stargz" && parent != nil {
		if rerr := parent.withRemoteSnapshotLabelsStargzMode(ctx, sess, func() {
			err = cm.Snapshotter.Prepare(ctx, id, parentSnapshotID)
		}); rerr != nil {
			return nil, rerr
		}
	} else {
		err = cm.Snapshotter.Prepare(ctx, id, parentSnapshotID)
	}
	if err != nil {
		return nil, errors.Wrapf(err, "failed to prepare %s", id)
	}

	md, _ := cm.md.Get(id)

	rec := &cacheRecord{
		mu:      &sync.Mutex{},
		mutable: true,
		cm:      cm,
		refs:    make(map[ref]struct{}),
		parent:  parent,
		md:      md,
	}

	if err := initializeMetadata(rec, parentID, opts...); err != nil {
		return nil, err
	}

	if err := setImageRefMetadata(rec, opts...); err != nil {
		return nil, errors.Wrapf(err, "failed to append image ref metadata to ref %s", rec.ID())
	}

	cm.mu.Lock()
	defer cm.mu.Unlock()

	cm.records[id] = rec // TODO: save to db

	// parent refs are possibly lazy so keep it hold the description handlers.
	var dhs DescHandlers
	if parent != nil {
		dhs = parent.descHandlers
	}
	return rec.mref(true, dhs), nil
}

func (cm *cacheManager) GetMutable(ctx context.Context, id string, opts ...RefOption) (MutableRef, error) {
	cm.mu.Lock()
	defer cm.mu.Unlock()

	rec, err := cm.getRecord(ctx, id, opts...)
	if err != nil {
		return nil, err
	}

	rec.mu.Lock()
	defer rec.mu.Unlock()
	if !rec.mutable {
		return nil, errors.Wrapf(errInvalid, "%s is not mutable", id)
	}

	if len(rec.refs) != 0 {
		return nil, errors.Wrapf(ErrLocked, "%s is locked", id)
	}

	if rec.equalImmutable != nil {
		if len(rec.equalImmutable.refs) != 0 {
			return nil, errors.Wrapf(ErrLocked, "%s is locked", id)
		}
		delete(cm.records, rec.equalImmutable.ID())
		if err := rec.equalImmutable.remove(ctx, false); err != nil {
			return nil, err
		}
		rec.equalImmutable = nil
	}

	return rec.mref(true, descHandlersOf(opts...)), nil
}

func (cm *cacheManager) Prune(ctx context.Context, ch chan client.UsageInfo, opts ...client.PruneInfo) error {
	cm.muPrune.Lock()

	for _, opt := range opts {
		if err := cm.pruneOnce(ctx, ch, opt); err != nil {
			cm.muPrune.Unlock()
			return err
		}
	}

	cm.muPrune.Unlock()

	if cm.GarbageCollect != nil {
		if _, err := cm.GarbageCollect(ctx); err != nil {
			return err
		}
	}

	return nil
}

func (cm *cacheManager) pruneOnce(ctx context.Context, ch chan client.UsageInfo, opt client.PruneInfo) error {
	filter, err := filters.ParseAll(opt.Filter...)
	if err != nil {
		return errors.Wrapf(err, "failed to parse prune filters %v", opt.Filter)
	}

	var check ExternalRefChecker
	if f := cm.PruneRefChecker; f != nil && (!opt.All || len(opt.Filter) > 0) {
		c, err := f()
		if err != nil {
			return errors.WithStack(err)
		}
		check = c
	}

	totalSize := int64(0)
	if opt.KeepBytes != 0 {
		du, err := cm.DiskUsage(ctx, client.DiskUsageInfo{})
		if err != nil {
			return err
		}
		for _, ui := range du {
			if ui.Shared {
				continue
			}
			totalSize += ui.Size
		}
	}

	return cm.prune(ctx, ch, pruneOpt{
		filter:       filter,
		all:          opt.All,
		checkShared:  check,
		keepDuration: opt.KeepDuration,
		keepBytes:    opt.KeepBytes,
		totalSize:    totalSize,
	})
}

func (cm *cacheManager) prune(ctx context.Context, ch chan client.UsageInfo, opt pruneOpt) error {
	var toDelete []*deleteRecord

	if opt.keepBytes != 0 && opt.totalSize < opt.keepBytes {
		return nil
	}

	cm.mu.Lock()

	gcMode := opt.keepBytes != 0
	cutOff := time.Now().Add(-opt.keepDuration)

	locked := map[*sync.Mutex]struct{}{}

	for _, cr := range cm.records {
		if _, ok := locked[cr.mu]; ok {
			continue
		}
		cr.mu.Lock()

		// ignore duplicates that share data
		if cr.equalImmutable != nil && len(cr.equalImmutable.refs) > 0 || cr.equalMutable != nil && len(cr.refs) == 0 {
			cr.mu.Unlock()
			continue
		}

		if cr.isDead() {
			cr.mu.Unlock()
			continue
		}

		if len(cr.refs) == 0 {
			recordType := GetRecordType(cr)
			if recordType == "" {
				recordType = client.UsageRecordTypeRegular
			}

			shared := false
			if opt.checkShared != nil {
				shared = opt.checkShared.Exists(cr.ID(), cr.parentChain())
			}

			if !opt.all {
				if recordType == client.UsageRecordTypeInternal || recordType == client.UsageRecordTypeFrontend || shared {
					cr.mu.Unlock()
					continue
				}
			}

			c := &client.UsageInfo{
				ID:         cr.ID(),
				Mutable:    cr.mutable,
				RecordType: recordType,
				Shared:     shared,
			}

			usageCount, lastUsedAt := getLastUsed(cr.md)
			c.LastUsedAt = lastUsedAt
			c.UsageCount = usageCount

			if opt.keepDuration != 0 {
				if lastUsedAt != nil && lastUsedAt.After(cutOff) {
					cr.mu.Unlock()
					continue
				}
			}

			if opt.filter.Match(adaptUsageInfo(c)) {
				toDelete = append(toDelete, &deleteRecord{
					cacheRecord: cr,
					lastUsedAt:  c.LastUsedAt,
					usageCount:  c.UsageCount,
				})
				if !gcMode {
					cr.dead = true

					// mark metadata as deleted in case we crash before cleanup finished
					if err := setDeleted(cr.md); err != nil {
						cr.mu.Unlock()
						cm.mu.Unlock()
						return err
					}
				} else {
					locked[cr.mu] = struct{}{}
					continue // leave the record locked
				}
			}
		}
		cr.mu.Unlock()
	}

	if gcMode && len(toDelete) > 0 {
		sortDeleteRecords(toDelete)
		var err error
		for i, cr := range toDelete {
			// only remove single record at a time
			if i == 0 {
				cr.dead = true
				err = setDeleted(cr.md)
			}
			cr.mu.Unlock()
		}
		if err != nil {
			return err
		}
		toDelete = toDelete[:1]
	}

	cm.mu.Unlock()

	if len(toDelete) == 0 {
		return nil
	}

	// calculate sizes here so that lock does not need to be held for slow process
	for _, cr := range toDelete {
		size := getSize(cr.md)

		if size == sizeUnknown && cr.equalImmutable != nil {
			size = getSize(cr.equalImmutable.md) // benefit from DiskUsage calc
		}
		if size == sizeUnknown {
			// calling size will warm cache for next call
			if _, err := cr.Size(ctx); err != nil {
				return err
			}
		}
	}

	cm.mu.Lock()
	var err error
	for _, cr := range toDelete {
		cr.mu.Lock()

		usageCount, lastUsedAt := getLastUsed(cr.md)

		c := client.UsageInfo{
			ID:          cr.ID(),
			Mutable:     cr.mutable,
			InUse:       len(cr.refs) > 0,
			Size:        getSize(cr.md),
			CreatedAt:   GetCreatedAt(cr.md),
			Description: GetDescription(cr.md),
			LastUsedAt:  lastUsedAt,
			UsageCount:  usageCount,
		}

		if cr.parent != nil {
			c.Parent = cr.parent.ID()
		}
		if c.Size == sizeUnknown && cr.equalImmutable != nil {
			c.Size = getSize(cr.equalImmutable.md) // benefit from DiskUsage calc
		}

		opt.totalSize -= c.Size

		if cr.equalImmutable != nil {
			if err1 := cr.equalImmutable.remove(ctx, false); err == nil {
				err = err1
			}
		}
		if err1 := cr.remove(ctx, true); err == nil {
			err = err1
		}

		if err == nil && ch != nil {
			ch <- c
		}
		cr.mu.Unlock()
	}
	cm.mu.Unlock()
	if err != nil {
		return err
	}

	select {
	case <-ctx.Done():
		return ctx.Err()
	default:
		return cm.prune(ctx, ch, opt)
	}
}

func (cm *cacheManager) markShared(m map[string]*cacheUsageInfo) error {
	if cm.PruneRefChecker == nil {
		return nil
	}
	c, err := cm.PruneRefChecker()
	if err != nil {
		return errors.WithStack(err)
	}

	var markAllParentsShared func(string)
	markAllParentsShared = func(id string) {
		if v, ok := m[id]; ok {
			v.shared = true
			if v.parent != "" {
				markAllParentsShared(v.parent)
			}
		}
	}

	for id := range m {
		if m[id].shared {
			continue
		}
		if b := c.Exists(id, m[id].parentChain); b {
			markAllParentsShared(id)
		}
	}
	return nil
}

type cacheUsageInfo struct {
	refs        int
	parent      string
	size        int64
	mutable     bool
	createdAt   time.Time
	usageCount  int
	lastUsedAt  *time.Time
	description string
	doubleRef   bool
	recordType  client.UsageRecordType
	shared      bool
	parentChain []digest.Digest
}

func (cm *cacheManager) DiskUsage(ctx context.Context, opt client.DiskUsageInfo) ([]*client.UsageInfo, error) {
	filter, err := filters.ParseAll(opt.Filter...)
	if err != nil {
		return nil, errors.Wrapf(err, "failed to parse diskusage filters %v", opt.Filter)
	}

	cm.mu.Lock()

	m := make(map[string]*cacheUsageInfo, len(cm.records))
	rescan := make(map[string]struct{}, len(cm.records))

	for id, cr := range cm.records {
		cr.mu.Lock()
		// ignore duplicates that share data
		if cr.equalImmutable != nil && len(cr.equalImmutable.refs) > 0 || cr.equalMutable != nil && len(cr.refs) == 0 {
			cr.mu.Unlock()
			continue
		}

		usageCount, lastUsedAt := getLastUsed(cr.md)
		c := &cacheUsageInfo{
			refs:        len(cr.refs),
			mutable:     cr.mutable,
			size:        getSize(cr.md),
			createdAt:   GetCreatedAt(cr.md),
			usageCount:  usageCount,
			lastUsedAt:  lastUsedAt,
			description: GetDescription(cr.md),
			doubleRef:   cr.equalImmutable != nil,
			recordType:  GetRecordType(cr),
			parentChain: cr.parentChain(),
		}
		if c.recordType == "" {
			c.recordType = client.UsageRecordTypeRegular
		}
		if cr.parent != nil {
			c.parent = cr.parent.ID()
		}
		if cr.mutable && c.refs > 0 {
			c.size = 0 // size can not be determined because it is changing
		}
		m[id] = c
		rescan[id] = struct{}{}
		cr.mu.Unlock()
	}
	cm.mu.Unlock()

	for {
		if len(rescan) == 0 {
			break
		}
		for id := range rescan {
			v := m[id]
			if v.refs == 0 && v.parent != "" {
				m[v.parent].refs--
				if v.doubleRef {
					m[v.parent].refs--
				}
				rescan[v.parent] = struct{}{}
			}
			delete(rescan, id)
		}
	}

	if err := cm.markShared(m); err != nil {
		return nil, err
	}

	var du []*client.UsageInfo
	for id, cr := range m {
		c := &client.UsageInfo{
			ID:          id,
			Mutable:     cr.mutable,
			InUse:       cr.refs > 0,
			Size:        cr.size,
			Parent:      cr.parent,
			CreatedAt:   cr.createdAt,
			Description: cr.description,
			LastUsedAt:  cr.lastUsedAt,
			UsageCount:  cr.usageCount,
			RecordType:  cr.recordType,
			Shared:      cr.shared,
		}
		if filter.Match(adaptUsageInfo(c)) {
			du = append(du, c)
		}
	}

	eg, ctx := errgroup.WithContext(ctx)

	for _, d := range du {
		if d.Size == sizeUnknown {
			func(d *client.UsageInfo) {
				eg.Go(func() error {
					ref, err := cm.Get(ctx, d.ID, NoUpdateLastUsed)
					if err != nil {
						d.Size = 0
						return nil
					}
					s, err := ref.Size(ctx)
					if err != nil {
						return err
					}
					d.Size = s
					return ref.Release(context.TODO())
				})
			}(d)
		}
	}

	if err := eg.Wait(); err != nil {
		return du, err
	}

	return du, nil
}

func IsNotFound(err error) bool {
	return errors.Is(err, errNotFound)
}

type RefOption interface{}

type cachePolicy int

const (
	cachePolicyDefault cachePolicy = iota
	cachePolicyRetain
)

type withMetadata interface {
	Metadata() *metadata.StorageItem
}

type noUpdateLastUsed struct{}

var NoUpdateLastUsed noUpdateLastUsed

func HasCachePolicyRetain(m withMetadata) bool {
	return getCachePolicy(m.Metadata()) == cachePolicyRetain
}

func CachePolicyRetain(m withMetadata) error {
	return queueCachePolicy(m.Metadata(), cachePolicyRetain)
}

func CachePolicyDefault(m withMetadata) error {
	return queueCachePolicy(m.Metadata(), cachePolicyDefault)
}

func WithDescription(descr string) RefOption {
	return func(m withMetadata) error {
		return queueDescription(m.Metadata(), descr)
	}
}

func WithRecordType(t client.UsageRecordType) RefOption {
	return func(m withMetadata) error {
		return queueRecordType(m.Metadata(), t)
	}
}

func WithCreationTime(tm time.Time) RefOption {
	return func(m withMetadata) error {
		return queueCreatedAt(m.Metadata(), tm)
	}
}

// Need a separate type for imageRef because it needs to be called outside
// initializeMetadata while still being a RefOption, so wrapping it in a
// different type ensures initializeMetadata won't catch it too and duplicate
// setting the metadata.
type imageRefOption func(m withMetadata) error

// WithImageRef appends the given imageRef to the cache ref's metadata
func WithImageRef(imageRef string) RefOption {
	return imageRefOption(func(m withMetadata) error {
		return appendImageRef(m.Metadata(), imageRef)
	})
}

func setImageRefMetadata(m withMetadata, opts ...RefOption) error {
	md := m.Metadata()
	for _, opt := range opts {
		if fn, ok := opt.(imageRefOption); ok {
			if err := fn(m); err != nil {
				return err
			}
		}
	}
	return md.Commit()
}

func initializeMetadata(m withMetadata, parent string, opts ...RefOption) error {
	md := m.Metadata()
	if tm := GetCreatedAt(md); !tm.IsZero() {
		return nil
	}

	if err := queueParent(md, parent); err != nil {
		return err
	}

	if err := queueCreatedAt(md, time.Now()); err != nil {
		return err
	}

	for _, opt := range opts {
		if fn, ok := opt.(func(withMetadata) error); ok {
			if err := fn(m); err != nil {
				return err
			}
		}
	}

	return md.Commit()
}

func adaptUsageInfo(info *client.UsageInfo) filters.Adaptor {
	return filters.AdapterFunc(func(fieldpath []string) (string, bool) {
		if len(fieldpath) == 0 {
			return "", false
		}

		switch fieldpath[0] {
		case "id":
			return info.ID, info.ID != ""
		case "parent":
			return info.Parent, info.Parent != ""
		case "description":
			return info.Description, info.Description != ""
		case "inuse":
			return "", info.InUse
		case "mutable":
			return "", info.Mutable
		case "immutable":
			return "", !info.Mutable
		case "type":
			return string(info.RecordType), info.RecordType != ""
		case "shared":
			return "", info.Shared
		case "private":
			return "", !info.Shared
		}

		// TODO: add int/datetime/bytes support for more fields

		return "", false
	})
}

type pruneOpt struct {
	filter       filters.Filter
	all          bool
	checkShared  ExternalRefChecker
	keepDuration time.Duration
	keepBytes    int64
	totalSize    int64
}

type deleteRecord struct {
	*cacheRecord
	lastUsedAt      *time.Time
	usageCount      int
	lastUsedAtIndex int
	usageCountIndex int
}

func sortDeleteRecords(toDelete []*deleteRecord) {
	sort.Slice(toDelete, func(i, j int) bool {
		if toDelete[i].lastUsedAt == nil {
			return true
		}
		if toDelete[j].lastUsedAt == nil {
			return false
		}
		return toDelete[i].lastUsedAt.Before(*toDelete[j].lastUsedAt)
	})

	maxLastUsedIndex := 0
	var val time.Time
	for _, v := range toDelete {
		if v.lastUsedAt != nil && v.lastUsedAt.After(val) {
			val = *v.lastUsedAt
			maxLastUsedIndex++
		}
		v.lastUsedAtIndex = maxLastUsedIndex
	}

	sort.Slice(toDelete, func(i, j int) bool {
		return toDelete[i].usageCount < toDelete[j].usageCount
	})

	maxUsageCountIndex := 0
	var count int
	for _, v := range toDelete {
		if v.usageCount != count {
			count = v.usageCount
			maxUsageCountIndex++
		}
		v.usageCountIndex = maxUsageCountIndex
	}

	sort.Slice(toDelete, func(i, j int) bool {
		return float64(toDelete[i].lastUsedAtIndex)/float64(maxLastUsedIndex)+
			float64(toDelete[i].usageCountIndex)/float64(maxUsageCountIndex) <
			float64(toDelete[j].lastUsedAtIndex)/float64(maxLastUsedIndex)+
				float64(toDelete[j].usageCountIndex)/float64(maxUsageCountIndex)
	})
}

func diffIDFromDescriptor(desc ocispec.Descriptor) (digest.Digest, error) {
	diffIDStr, ok := desc.Annotations["containerd.io/uncompressed"]
	if !ok {
		return "", errors.Errorf("missing uncompressed annotation for %s", desc.Digest)
	}
	diffID, err := digest.Parse(diffIDStr)
	if err != nil {
		return "", errors.Wrapf(err, "failed to parse diffID %q for %s", diffIDStr, desc.Digest)
	}
	return diffID, nil
}

redpajama_set_name: RedPajamaGithub


text:
{-# LANGUAGE Haskell98 #-}
{-# LINE 1 "Data/Streaming/Filesystem.hs" #-}

{-# LANGUAGE CPP #-}
{-# LANGUAGE DeriveDataTypeable #-}
{-# LANGUAGE ScopedTypeVariables #-}
-- | Streaming functions for interacting with the filesystem.
module Data.Streaming.Filesystem
    ( DirStream
    , openDirStream
    , readDirStream
    , closeDirStream
    , FileType (..)
    , getFileType
    ) where

import Data.Typeable (Typeable)

import System.Posix.Directory (DirStream, openDirStream, closeDirStream)
import qualified System.Posix.Directory as Posix
import qualified System.Posix.Files as PosixF
import Control.Exception (try, IOException)

readDirStream :: DirStream -> IO (Maybe FilePath)
readDirStream ds = do
    fp <- Posix.readDirStream ds
    case fp of
        "" -> return Nothing
        "." -> readDirStream ds
        ".." -> readDirStream ds
        _ -> return $ Just fp

getFileType :: FilePath -> IO FileType
getFileType fp = do
    s <- PosixF.getSymbolicLinkStatus fp
    case () of
        ()
            | PosixF.isRegularFile s -> return FTFile
            | PosixF.isDirectory s -> return FTDirectory
            | PosixF.isSymbolicLink s -> do
                es' <- try $ PosixF.getFileStatus fp
                case es' of
                    Left (_ :: IOException) -> return FTOther
                    Right s'
                        | PosixF.isRegularFile s' -> return FTFileSym
                        | PosixF.isDirectory s' -> return FTDirectorySym
                        | otherwise -> return FTOther
            | otherwise -> return FTOther

data FileType
    = FTFile
    | FTFileSym -- ^ symlink to file
    | FTDirectory
    | FTDirectorySym -- ^ symlink to a directory
    | FTOther
    deriving (Show, Read, Eq, Ord, Typeable)


text:
Ideal Churches of Scientology
Advanced Organizations
Flag Land Base
Bringing Scientology to the World
David Miscavige—Scientology's Ecclesiastical Leader
Scientology TV
How We Help News
How to Resolve Conflicts
The Dynamics of Existence
The Components of Understanding
Solutions for a Dangerous Environment
Assists for Illnesses and Injuries
The Emotional Tone Scale
Answers to Drugs
Ethics and Conditions
The Cause of Suppression
Basics of Organizing
Fundamentals of Public Relations
Targets and Goals
The Technology of Study
DAVID MISCAVIGE
HUMAN RIGHTS:
TEACHING TOLERANCE AND PEACE
Well knowing Mr. Hubbard's strong admonition to national governments to uphold the fundamental human rights and abide by and implement the 30 articles of the Universal Declaration of Human Rights, Mr. Miscavige inspired the initiation of the Church of Scientology human rights campaign.
Central to Scientology beliefs is a conviction that all humankind is entitled to inalienable rights. So it is that for more than 50 years Scientologists have championed the principles of the Universal Declaration of Human Rights.
Today, the Church of Scientology sponsors the largest non-governmental information campaign to make the Universal Declaration of Human Rights known the world over.
The Church's human rights initiative sponsors groups and activities and provides its materials to individuals, groups and government agencies in 93 nations. This includes:
What Are Human Rights? booklets and Public Service Announcements that educate youth and adults on the 30 articles of the Universal Declaration of Human Rights in terms anyone can understand.
A study guide, activities manual and educator's classroom kit that give teachers, human rights groups and governments effective tools to educate youth and adults on their human rights.
An accompanying documentary video, The Story of Human Rights, that complements the Public Service Announcements, booklets and educator materials as a further tool to bring about a universal awareness and respect for human rights.
Previous The Truth About Drugs
Next Scientology Volunteer Ministers
At the Helm in the Era of Expansion
Building for the Future of the Scientology Religion
Scientology Spiritual Headquarters
Creating a Renaissance for Scientology
Spearheading Planetary Social Betterment Campaigns
Landmark Events
Scientology Today Scientology Today
Scientology Around the World Scientology Around the World
Church Locator
Scientology Ecclesiastical Leader

redpajama_set_name: RedPajamaCommonCrawl


Welcome to GlobalVillages - we are reconstructing this wiki on a new server and its currently not yet fully operational.
GIVE is active since 1992 and was previously a department of the Center for Social Innovation, Vienna.
Our main focus is sustainable development in its relation to information and communication technologies. Information and communication are the most powerful tools to shape physical environments, and GIVE is devoted to the full comprehension of this power.
GIVE has created two major events: the "Global Village" Conference and Exhibition in the Vienna City Hall, and the "Cultural Heritage in the Global Village" event in the Vienna Museum of Modern Arts as an Austria presidency Event for EU. It has produced research on Telecenters and Telework and empowered locations and also a film about the "monastery of the future" - and much more!


Realtek High Definition Audio is a MEDIA hardware device. This driver was developed by Realtek. The hardware id of this driver is HDAUDIO/FUNC_01&VEN_10EC&DEV_0269&SUBSYS_144DC0AE.
This driver received an average rating of 3 stars out of 15320 votes.


The Armored Patrol – WoT, WoWS & WT: News, leaks, and more!
Throughout 2019, we will be revising the characteristics of various vehicles in World of Tanks, trying to find an optimal balance. It's an ongoing process, and we carefully consider your feedback to better understand in which direction we should proceed. Our ultimate goal is to make all vehicles competitive on the battlefield, while maintaining the unique features of each tank.
At WG Fest last December, we announced an upcoming rebalance of five iconic vehicles. One of them, the Kranvagn, will receive its portion of consistent improvements soon with Update 1.5. Now it's time to pay attention to some medium tanks and adjust their key battle parameters. Let's take a closer look!
The STB-1 is a versatile, fast-accelerating vehicle with a well-sloped turret and good gun depression angles. This vehicle is ideal for mid-to-close combat, and it's designed to constantly deal damage. The STB-1 commonly plays the role of an active aggressor on the front line, or of an effective support vehicle – the latter is how this vehicle was initially conceived. Its DPM is very impressive and is one of the best in World of Tanks, while its gun stabilization leaves much to be desired. So it's time to make it more competitive and add some new touches to its profile!
Finally, we are looking to equip the STB-1 with a commonly requested game feature: hydropneumatic suspension — just like the one available with the top-tier Swedish medium tanks. We will thoroughly test this feature, and if we are satisfied with the test results, we will definitely equip this vehicle with it.
In addition, we're going to rebalance the performance of some other vehicles in the Japanese Tech Tree, especially those sitting at Tier VIII, the STA-1 and the STA-2. The DPM of the STA-1 will increase, making it more competitive.
We also carefully analyzed your feedback regarding the STA-2 and its gameplay and realized this mobile tank could be even more effective, so we will also slightly improve some of its key characteristics. We will unveil the detailed changes of this Premium machine a bit later, after finalizing the settings of other vehicles.
Last year's edition of Tankfest was already quite impressive. The biggest display of historic moving armour of the world welcomed one hell of a gem in the shape of a venerable B1 Bis tank. And in 2019, we aim to raise the bar!
Join us in Bovington, U.K., from 28 to 30 June for another weekend's worth of tank-fun and awesome World of Tanks activities. You can already get your tickets on the Tank Museum's website.
There are a lot of announcements coming, so keep your eyes peeled for more Tankfest news, and make sure to follow us on Facebook for more. Get excited, commanders, this edition is a big one.
Gold Friends Membership: Can't get enough of tanks? With the Gold Friends Membership, you get access to the Tankfest, both Tiger Days, and many other advantages!
The Grand Battles became available to the Tier VIII vehicles (if the corresponding box is checked in the game settings).
Fixed the issues of the shaking camera in the Sniper mode when switching between the drive modes.
Type 5 Heavy: changed the engine power from 1,200 to 1,370 h.p.
May the bunny visit your garage!
Sub_Octavian shared this info through stream today with femennenly, all content I am sharing here is subject to change, no confirmed dates, just 0.8.4.0 is the likeliest possible patch that any of this new content could arrive.
This new soviet commander shall be akin to Admiral Halsey and Admiral Yamamoto. He will however not be earned in the same manner of having an entire campaign dedicated to acquiring him. WG wants to test a new method of in-game tasks that may be easier then those campaigns, no details are given as to how this new system may function, just that it is a test bed for future commanders to be earned in the future.
His Talents are Hidden Reserve and Will to Win. Hidden Reserve functions in the same manner as it does for Yamamoto. Will to Win is a new tallent unique to this commander, designed to be easier to activate talent then the other admirals. Upon your ship HP dropping below 10%, a Damage Control Party is activated, dispersion of enemy shells is increased by 20%, and a repair party repairing 7.5% per second is activated. All 3 effects are active for 30 seconds, and only activates once per battle. No consumable charges get spent.


At the first of march 2015 the RSRC 2XV had a match against the second team of DSR streepje C. This match was on a beautiful Sunday, supported by some nice weather and the trusted voice of Meindert Osinga. After a good warming-up by the guidance of our trusted captain Frank 'make them bleed' Hoogenboom, the match started at 14:30 on RSRC's pitch, with the surprise support of Pim 'I'll come if I got time' Mante.
The first half RSRC made a good effort to score against DSR-C, but DSR-C being on the 3rd place of the competition was a bit stronger than RSRC 2XV beginning on the 8th place of the competition. The scrums were about even but at the rucks and line-outs, DSR-C was stronger and RSRC clearly lacked some experience.
Also in open play was DSR-C a bit more experienced and were putting pressure on us. After the first half losing by a considerable margin, we changed our goal of the game. The second half we started with the goal of trying to stop DSR-C from winning with a high score and trying to score at least some points our self. We weren't able to completely hold off DSR-C in the second half, but we didn't give up. But in the end we weren't able to score at least 1 point and lost by 0-66. This score was a lot better than the last game against the second team of DSR-C which ended in a crazy loss of 112-0. Some more practice should do the trick.


text:
Margaret Greenwood
To ask the Secretary of State for Health and Social Care, what assessment he made of the effect of the transition of functions from the Health Protection Agency to Public Health England on the England's preparedness for infection surveillance and control.
Public Health England (PHE) was established in 2013 as an executive agency of the Department. PHE brought together multiple different bodies including the Health Protection Agency to provide comprehensive national surveillance programmes for both infectious and non-communicable diseases and to strengthen preparedness plans.
The United Kingdom's infectious disease surveillance system will be further strengthened by the creation of the new National Institute for Health Protection in 2021, which will bring together the expertise of PHE, alongside NHS Test and Trace and the Joint Biosecurity Unit, to ensure the UK has the best capability to monitor and control infectious diseases and respond to health protection incidents.


After sidelining Gov. Deval Patrick's proposal to make alcohol licensing a purely local responsibility, the House and Senate have approved a few local licensing requests.
The House passed a pair of bills based on legislation proposed by Acton Sen. James Eldridge and Holliston Rep. Carolyn Dykema. One bill (H 4311) specifies a license for Panzano Market in Southborough and the other (H 4312) authorizes a license for Sperry's Country Market Beer and Wine. Both businesses are located on Turnpike Road.
The Senate gave the green light to a bill allowing the town of Easton to grant one more license, which is limited to North Easton Village under a proposal based on legislation filed by Rep. Claire Cronin. The Consumer Protection and Professional Licensure Committee is still weighing a Rep. Kate Hogan bill to grant five alcohol licenses to people operating businesses at Highland Commons in Hudson (H 4313) and a Rep. Jay Barrows bill (H 4361) specifying licenses for the Mansfield Crossing Pouring License Area and the Mansfield Marketplace/The Pavilion Pouring License Area.
The governor in April proposed as part of his economic development bill a plan to place authority for granting liquor licenses in the hands of municipalities, which the governor said would "allow local communities to make responsible decisions regarding their economic development and growth." Patrick is reviewing a redrafted version of the so-called jobs bill that does not contain that proposal.


Currently, over 65 million people around the world have been forced from their homes; among them are nearly 21 million refugees. Thus, the discussion of refugees and refugee camps on a global scale is ever more salient given the recent heightened attention to the global crises. This thesis uses an interdisciplinary Science, Technology, and Society (STS) approach to analyze the United Nations High Commissioner for Refugees (UNHCR) policies, refugee camps, and their implication in the greater society.
Shenoi, Sonia, "Inside the Tent: An In-Depth Analysis on Refugee Camps Through a Science, Technology, and Society Perspective" (2017). Scripps Senior Theses. 1056.


text:
Pulse Pounding Thrillers
Here are a few Bestsellers to get our hearts pounding. Enjoy!
The Eighth Sister: A Thriller (Charles Jenkins Book 1)
by Robert Dugoni
An Amazon Charts, Washington Post, and Wall Street Journal bestseller.
A pulse-pounding thriller of espionage, spy games, and treachery by the New York Times bestselling author of the Tracy Crosswhite Series.
Former CIA case officer Charles Jenkins is a man at a crossroads: in his early sixties, he has a family, a new baby on the way, and a security consulting business on the brink of bankruptcy. Then his former bureau chief shows up at his house with a risky new assignment: travel undercover to Moscow and locate a Russian agent believed to be killing members of a clandestine US spy cell known as the seven sisters.
Desperate for money, Jenkins agrees to the mission and heads to the Russian capital. But when he finds the mastermind agent behind the assassinations — the so-called eighth sister — she is not who or what he was led to believe. Then again, neither is anyone else in this deadly game of cat and mouse.
Pursued by a dogged Russian intelligence officer, Jenkins executes a daring escape across the Black Sea, only to find himself abandoned by the agency he serves. With his family and freedom at risk, Jenkins is in the fight of his life — against his own country.
Everything We Keep: A Novel
by Kerry Lonsdale
(13,316 Reviews)
Genre: Literature & Fiction | Women's Fiction
An Amazon Charts and Wall Street Journal bestseller.
A luminous debut with unexpected twists, Everything We Keep explores the devastation of loss, the euphoria of finding love again, and the pulse-racing repercussions of discovering the truth about the ones we hold dear and the lengths they will go to protect us.
Sous chef Aimee Tierney has the perfect recipe for the perfect life: marry her childhood sweetheart, raise a family, and buy out her parents' restaurant. But when her fiancé, James Donato, vanishes in a boating accident, her well-baked future is swept out to sea. Instead of walking down the aisle on their wedding day, Aimee is at James's funeral — a funeral that leaves her more unsettled than at peace.
As Aimee struggles to reconstruct her life, she delves deeper into James's disappearance. What she uncovers is an ocean of secrets that make her question everything about the life they built together. And just below the surface is a truth that may set Aimee free… or shatter her forever.
Map of Bones: A Sigma Force Novel (Sigma Force Series Book 2)
by James Rollins
Genre: Literature & Fiction | Thrillers | Action & Adventure
The bones lead to ancient mysteries and present-day terror… To follow them means death.
During a crowded service at a cathedral in Germany, armed intruders in monks' robes unleash a nightmare of blood and destruction. But the killers have not come for gold; they seek a more valuable prize: the bones of the Magi who once paid homage to a newborn savior… a treasure that could reshape the world.
With the Vatican in turmoil, Sigma Force under the command of Grayson Pierce leaps into action, pursuing a deadly mystery that weaves through sites of the Seven Wonders of the World and ends at the doorstep of an ancient, mystical, and terrifying secret order. For there are those with dark plans for the stolen sacred remains that will alter the future of humankind… when science and religion unite to unleash a horror not seen since the beginning of time.
PreviousDay Two: Person
NextPick Up After Your Doggie


Our dish for today was quite an impromptu one as it was Friday and our pantry was running low, we usually go for grocery on Saturdays. Luckily, I have some ingredients that I know can make a really good dish and most of it was mostly common pantry items, a dish with a Spanish flair. I love those flavours, maybe because the Filipino cuisine is influenced heavily by the Spanish so today we will be making some Chorizo, Pork Belly and Chickpeas which is prepared together in a casserole with herbs and spices like fennel seeds, onions, garlic, thyme, bay leaves and tomatoes, a simple dish to make yet the flavours are amazing.
Onions, tomatoes and garlic are such a wonderful yet simple flavours to impart to any dish then add some additional Spanish flavours like Chorizo and paprika then it will be a sure-fire winner like our dish today.
Place Dutch Oven on top of a stove top, add olive oil then brown pork belly on all sides. Remove the pork then set it aside.
Add the chorizo and let it cook for a minute.
Add the carrots, onions, garlic, fennel seeds, chilli flakes and paprika, sauté in low heat for 5 minutes.
Add the tomato paste, brown sugar and red wine vinegar, cook in high heat for a minute then pour the chopped tomatoes.
Stir in the pork, season with salt and freshly ground black pepper then mix evenly to coat the pork with the sauce, cover your Dutch oven then place in a 160C preheated oven and cook for 1 hour and 45 minutes. Mix gently and check liquid level occasionally, add water as needed.
Stir in the chick peas, return to the oven then continue to cook for 15 more minutes.
Remove from oven, stir in some chopped parsley then serve.


text:
Optimize Resource Hub
Optimize Help Center
The language, lexicon and lingo of testing.
In order to get the most out of Optimize, it's important to understand a few concepts and terms.
A/B test
(A/B/n test, experiment)
A randomized experiment using two or more variants of the same web page (A and B). Variant A is the original and variant B through n each contain at least one element that is modified from the original.
Learn more about how to create an A/B test.
A list of changes that are applied to one or more elements on your web page when your visitor arrives. Optimize creates a change list automatically when using the editor.
In a multivariate test (MVT) with multiple sections, a combination is a set of changes created by selecting a single variant from each section. The total number of combinations is the product of the number of variants in each section.
See also: Multivariate test.
(Container snippet, container ID, measurement ID)
A container holds all of the Optimize configuration information for a website's experiences (tests and personalizations). A "container snippet" is a small piece of JavaScript code that's added to a web page where you want to use Optimize to present users with a new experience, while a "container ID" is an alphanumeric string (e.g. "GTM-A1B2CD") that uniquely identifies it. You will also see container ID referred to as "OPT_MEASUREMENT_ID" in code samples.
Learn more about accounts and containers.
(from GA Conversion)
A completed activity that is important to the success of your business. Examples include a completed sign-up for your email newsletter (a Goal conversion) and a purchase (a transaction, sometimes called an Ecommerce conversion).
See also: Conversion rate, Experiment conversions, Calculated conversion rate.
(from GA Conversion rate)
The conversion rate is the number of objective conversions divided by the total number of sessions.
Calculated conversion rate
(CCR, observed conversion rate)
Experiment Conversions divided by Experiment Sessions expressed as a percentage.
Credible interval
A credible interval is a range of possible values for the experience objective you are trying to measure. An experience doesn't know the true value of the objective because it sees only a sample of the site traffic. The range of possible values is based on this observed sample.
(DOM)
A platform- and language-independent standard object model for representing HTML or XML and related formats.
Editor page
The web page used as a template when defining the changes for a variant. Note: this may differ from your URL targeting rules.
(Test, experience)
An experiment is a method of testing different variants of web pages to determine which is most effective at achieving an objective. Examples include A/B, redirect, and multivariate tests.
Experiment sessions
All sessions attributed to the experiment. User attribution starts when the experiment is shown to the user and ends when the experiment ends. All sessions during this period, whether the experiment was applied or not, will be counted.
Experiment conversions
Conversions in any experiment session excluding conversions in the first session per user that occur prior to the experiment being shown.
Fractional-factorial experiment
When only a subset of all possible combinations are served in order to find results quickly. These experiments sacrifice the detailed interaction analysis available with full-factorial experiments for greater speed in finding results.
Full-factorial experiment
Every combination of a multivariate experiment is served to users, to understand all interactions between variants. These generally take longer to reach significance but also allow for detailed measurement of interactions.
(Google Analytics goals)
See objectives.
The variant that performs best against the objective.
Modeled conversion rate
(MCR, estimate conversion rate, projected conversion rate)
The conversion rate you can expect to see over the long run based on data observed to date. Optimize considers day of week (and other signals) in its statistical simulations so the modeled conversion rate may differ from the historical conversion rate measured to date.
Modeled improvement
(MI, credible level of improvement)
The relative difference between the conversion rate of the variant and the original for a given objective. The credible interval is the likely range the ratio between the conversion rate of the variant and the original will fall. Optimize uses Bayesian analysis to determine how the variants will perform over the long run and the credible interval is the Bayesian analogue of a confidence interval.
Modeled objective rate
The long-run average of where Optimize expects the value of the specified objective to land. For example, if you have a revenue objective, Optimize is modeling the long-run average revenue per session. If you have a pageview objective, Optimize is modeling the long-run average pageviews per session.
Multivariate test
(MVT, compound test)
An experiment that tests two or more sections to understand their effects on each other. For example, variants of a headline can be tested at the same time as variants of a hero image. Instead of showing which page variant is most effective (as in an A/B test), a multivariate test identifies the most effective combination of variants. Rather than the two or three page variants found in simple A/B tests, multivariate tests frequently test multiple variants of multiple page elements simultaneously. Learn more about how to create a multivariate test.
(System objectives, Analytics goals, and custom objectives)
An objective is the website metric you wish to optimize. Think of objectives as the metrics or activities that you'll measure your variants against, e.g. pageviews, bounce rate, time on site, etc. There are three types of objectives in Optimize: system objectives, Analytics goals, and custom objectives. Learn more about objectives.
Observed data is sourced from the linked Google Analytics property, as of the date in the timestamp in the report.
Seen in: Optimize reports.
Optimize analysis
Optimize analysis includes Probability to be best (PBB), Probability to beat original (PBO), Modeled conversion rate (MCR), and Modeled improvement (MI).
Your current web page, prior to any modification.
A personalization is a set of changes made to your website for a specific group of visitors. Unlike experiments, personalizations can run forever and don't have variants. A personalization is a single set of website changes that are shown to all visitors that meet the targeting conditions. Learn more about personalization.
Probability to beat original
(PBO, probability to beat baseline)
The probability that a given variant will result in a better conversion rate than the original.
Probability to be best
(PBB)
The probability that a given variant performs better than all other variants.
Redirect destination
A separate and unique web page used as a variant in a redirect experiment.
Redirect test
(Split URL test)
A type of A/B test that allows you to test separate web pages against each other. In redirect tests variants are identified by URL or path instead of an element(s) on the page. Redirect tests are useful when you want to test two very different landing pages, or a complete redesign of a page. Learn more about how to create a redirect test.
(Factor, element)
A section is a group of variants, each of which can modify multiple page elements (e.g. a headline, image, or button). An A/B test only contains one section (with one or more variants), while a multivariate test (MVT) tests multiple sections simultaneously.
(from: GA: Session)
The period of time a user is active on your site or app. By default, if a user is inactive for 30 minutes or more, any future activity is attributed to a new session. Users that leave your site and return within 30 minutes are counted as part of the original session.
Targeting rules
(URL targeting rules, rules)
Rules are the building blocks of Optimize targeting. An experiment will only execute when its targeting rules are met. Rules can be used to target everything from geographic regions to specific user behavior.
The original and all variants.
(Variation, level)
A variant can be anything from a change to a single element, or changes to multiple elements, or a totally different page in an experiment. In an A/B test the unit of variant can be a web page or an element of a web page. In a multivariate experiment (MVT) you have multiple variants of each section.
Add a banner to your website
Test suggestions
Google Ads best practices
Optimize and Google Search
Optimize JavaScript API
Optimize JavaScript API for third-party developers
Optimize security requirements
Google Marketing Platform Partners
Terms of service – directory
Optimize Terms of Service
Contact the Optimize team
DeutschespañolfrançaisIndonesiaitalianoNederlandsportuguês (Brasil)русскийहिन्दी日本語한국어 English


Now you have the opportunity & facility to share your New Year Greetings with your Loved Ones and Friends, but not only that, you can decorate your pictures with amazing effects and icons to make it more fun to share on FaceBook and other social networking site to get unbelievable number of likes.
Happy "New Year" Greetings 2018, Happy New Year Cards 2018, Happy "New Year" wishes 2018 and quotes.
1. You can choose your card from varieties of images from the scroll view of thumbnails.
2. You can easily share your favorite e-card by clicking Share button at the top of the application at the action bar via your favorite social networks such as Facebook, whatsapp or you can email it.
3. There's no limit to the number of greetings you can send.
5. Happy "New Year 2018" Cards for all like you can send e-cards to your friends and family.
6. This app includes very beautiful elements on the cards such as flowers, roses, candles, hearts, balloons, gifts etc.
7. This is an absolutely free app.
10. Compatible with 99% mobile phone devices.
11. This app fully support and looks very beautiful on vertical orientation of any mobile device.
12. Download the app right away and wish your near and dear one on this special occasion with the beautiful collection of greetings.
13. in this app you may also find New Year Cards 2018 for whatsapp.
14. New Year Greeting Cards Collection. Happy New Year Wishes 2018.
15. Happy New Year Greeting Card for sister, for friend, for love, Happy New Year warm wishes.
Attention to all the awesome app seekers. one of the best ever application for new year greetings and wishes is now available. Just download this application and start sending advance new year greetings to your family, friends, lovers, strangers and anyone whom you wanna send your wishes this new year.
This is the latest and newly build application specially meant to provide you a new unique way for sending wishes on this auspicious day of new year. New year day brings in start of a fresh new year, lets celebrate the beginning of this new year and start sending awesome newyear greetings to our known.
Let this new year bring in Joy, happiness, love and loads of friendship in our lives. A new way to make the start of year unique and beautiful with the new year wallpapers decorated all over our screen. This new year quote application will provide you the best quote images which you may then send to the person of your choice to make their day beautiful.


I don't want to believe that on the whole, people are stupid. As I get older and grumpier though I'm finding it more difficult to reconcile my liberalism and my faith in the eventual betterment of humanity with the evidence. We are a week and a half away from closing the book on a year that saw the merits of wealth and greed extolled over the virtues of altruism, self-sacrifice and the understanding that we are all in this together. We have seen science demonized, facts ignored and truthiness become the guiding principle of government – as Asimov feared, brazen ignorance treated at the same level as expertise. Being right is not enough. Loud, not love, conquers all. And the worst part is, we all know better, but we let the bad guys win anyway. Why? Are we just too lazy? Has humanity just collectively decided to not give a rat's hind parts?
Dennis Miller, with whom I agree on absolutely nothing, had a great line on one of his specials back in the 90's, the last time I remember when optimism ruled the day. He asked, "Why have we become so quick to exalt the banal, and so begrudging of the truly consequential?" Who'd have thought that fifteen years later, it would only get worse? The most famous family in the world right now is so not for their charitable work or their noble contributions to their fellow citizens, but because they are vapid, shallow and fundamentally useless seekers of celebrity. It would benefit us all if we paid greater attention to the tribulations of our own families (which, ironically, has no financial cost) than forking out cash and felling acres of forest to keep up with the talent-bereft Kardashians. And ridding ourselves of this scourge can be as simple as tuning them out and asking a friend to do the same. If countless videos of adorable cats can go viral, why not also a campaign to raise our collective intellect? As a start, I promise that this is the last time you will see that name on this blog. They will no longer take up rent-free space on Graham's Crackers.
What else can we do to step up our game in 2012? Why not make this the year that we cease endorsing bullies or the use of bullying tactics in any form, be it in the high school halls, the pursuit of elected office or government itself? If repeated viewings of The Karate Kid have taught me anything, it's that nobody really likes the Cobra-Kai douchebags or wants to see them win. Similarly, we should stop rewarding the political equivalents of Johnny and Sensei Kreese with our vote and consequently the right to mooch off the tax dollars that we entrust to them to ensure we are healthy, safe and free of fear. Let's demand maturity, tolerance and intelligent debate from all parties and stop electing or otherwise supporting hormone-juiced frat boys who honed their diplomatic skills playing Call of Duty while high on Red Bull and vodka coolers. Our governments, like our schools, really can Get Better.
Read books that do not have vampires in them, and at least one that is over 100 years old.
See more live theatre and local musicians.
Go for long walks amidst the trees.
Instead of just posting what you're doing on Facebook, ask your friends what they're doing. Make plans to see them more often.
Unfollow Charlie Sheen, Snooki and any other famous-for-being-train-wrecks on Twitter and encourage a friend to do the same.
Never use LOL or OMG again. Learn a few phrases in Latin to pepper your status updates with instead.
Support your local conservation authorities by exploring your neighbourhood parks.
Listen to music made by people who are not supermodel-attractive.
Write something – a blog, a book, a haiku, it doesn't matter which.
Don't vote for the guy who's angry all the time. He has issues, and none of them involve making your life better.
Do something friendly for a neighbour you barely know.
Don't buy Us Weekly, People or any other tabloid magazine devoted to celebrities. If you must, then plant one tree, bush or shrub for every issue you just can't live without.
Hug a puppy, kitten, bunny, lamb, pony or any suitable baby animal.
Make your own list of suggestions like this and pass them on.
Start with the little things. You'll be surprised how much you like them and how much you don't miss the other noise. Maybe together we can start, very slowly, turning this behemoth called civilization away from the shoals of ignorance and back toward the heights of what it is within our capability as human beings to achieve, absent only the decision to realize that potential. I promise it'll be worth it.


text:
/*	$NetBSD: drbbc.c,v 1.5 1999/03/14 22:42:12 is Exp $	*/

/*-
 * Copyright (c) 1997 The NetBSD Foundation, Inc.
 * All rights reserved.
 *
 * This code is derived from software contributed to The NetBSD Foundation
 * by Ignatios Souvatzis.
 *
 * Redistribution and use in source and binary forms, with or without
 * modification, are permitted provided that the following conditions
 * are met:
 * 1. Redistributions of source code must retain the above copyright
 *    notice, this list of conditions and the following disclaimer.
 * 2. Redistributions in binary form must reproduce the above copyright
 *    notice, this list of conditions and the following disclaimer in the
 *    documentation and/or other materials provided with the distribution.
 * 3. All advertising materials mentioning features or use of this software
 *    must display the following acknowledgement:
 *        This product includes software developed by the NetBSD
 *        Foundation, Inc. and its contributors.
 * 4. Neither the name of The NetBSD Foundation nor the names of its
 *    contributors may be used to endorse or promote products derived
 *    from this software without specific prior written permission.
 *
 * THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS
 * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
 * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
 * PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS
 * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
 * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
 * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
 * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
 * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
 * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
 * POSSIBILITY OF SUCH DAMAGE.
 */

#include <sys/param.h>
#include <sys/kernel.h>
#include <sys/device.h>
#include <sys/systm.h>
#if 0
#include <machine/psl.h>
#endif
#include <machine/cpu.h>
#include <amiga/amiga/device.h>
#include <amiga/amiga/custom.h>
#include <amiga/amiga/cia.h>
#include <amiga/amiga/drcustom.h>
#include <amiga/dev/rtc.h>

#include <dev/ic/ds.h>

int draco_ds_read_bit __P((void *));
void draco_ds_write_bit __P((void *, int));
void draco_ds_reset __P((void *));

void drbbc_attach __P((struct device *, struct device *, void *));
int drbbc_match __P((struct device *, struct cfdata *, void *));

int dracougettod __P((struct timeval *));
#ifdef __NOTYET__
int dracousettod __P((struct timeval *));
#endif

struct drbbc_softc {
	struct device sc_dev;
	struct ds_handle sc_dsh;
};

struct cfattach drbbc_ca = {
	sizeof(struct drbbc_softc),
	drbbc_match,
	drbbc_attach
};

struct drbbc_softc *drbbc_sc;

int
drbbc_match(pdp, cfp, auxp)
	struct device *pdp;
	struct cfdata *cfp;
	void *auxp;
{
	if (is_draco() && matchname(auxp, "drbbc") && (cfp->cf_unit == 0))
		return (1);
	else
		return (0);
}

void
drbbc_attach(pdp, dp, auxp)
	struct device *pdp, *dp;
	void *auxp;
{
	int i;
	struct drbbc_softc *sc;
	u_int8_t rombuf[8];

	sc = (struct drbbc_softc *)dp;

	sc->sc_dsh.ds_read_bit = draco_ds_read_bit;
	sc->sc_dsh.ds_write_bit = draco_ds_write_bit;
	sc->sc_dsh.ds_reset = draco_ds_reset;
	sc->sc_dsh.ds_hw_handle = (void *)(DRCCADDR + DRIOCTLPG*NBPG);

	sc->sc_dsh.ds_reset(sc->sc_dsh.ds_hw_handle);

	ds_write_byte(&sc->sc_dsh, DS_ROM_READ);
	for (i=0; i<8; ++i)
		rombuf[i] = ds_read_byte(&sc->sc_dsh);

	hostid = (rombuf[3] << 24) + (rombuf[2] << 16) +
		(rombuf[1] << 8) + rombuf[7];

	printf(": ROM %02x %02x%02x%02x%02x%02x%02x %02x (DraCo sernum %ld)\n",
		rombuf[7], rombuf[6], rombuf[5], rombuf[4],
		rombuf[3], rombuf[2], rombuf[1], rombuf[0],
		hostid);

	ugettod = dracougettod;
	usettod = (void *)0;
	drbbc_sc = sc;
}

int
draco_ds_read_bit(p)
	void *p;
{
	struct drioct *draco_ioct;

	draco_ioct = p;

	while (draco_ioct->io_status & DRSTAT_CLKBUSY);

	draco_ioct->io_clockw1 = 0;

	while (draco_ioct->io_status & DRSTAT_CLKBUSY);

	return (draco_ioct->io_status & DRSTAT_CLKDAT);
}

void
draco_ds_write_bit(p, b)
	void *p;
	int b;
{
	struct drioct *draco_ioct;

	draco_ioct = p;

	while (draco_ioct->io_status & DRSTAT_CLKBUSY);

	if (b)
		draco_ioct->io_clockw1 = 0;
	else
		draco_ioct->io_clockw0 = 0;
}

void
draco_ds_reset(p)
	void *p;
{
	struct drioct *draco_ioct;

	draco_ioct = p;

	draco_ioct->io_clockrst = 0;
}

int
dracougettod(tvp)
	struct timeval *tvp;
{
	u_int32_t clkbuf;
	u_int32_t usecs;

	drbbc_sc->sc_dsh.ds_reset(drbbc_sc->sc_dsh.ds_hw_handle);

	ds_write_byte(&drbbc_sc->sc_dsh, DS_ROM_SKIP);

	ds_write_byte(&drbbc_sc->sc_dsh, DS_MEM_READ_MEMORY);
	/* address of seconds/256: */
	ds_write_byte(&drbbc_sc->sc_dsh, 0x02);
	ds_write_byte(&drbbc_sc->sc_dsh, 0x02);

	usecs = (ds_read_byte(&drbbc_sc->sc_dsh) * 1000000) / 256;
	clkbuf = ds_read_byte(&drbbc_sc->sc_dsh)
	    + (ds_read_byte(&drbbc_sc->sc_dsh)<<8)
	    + (ds_read_byte(&drbbc_sc->sc_dsh)<<16)
	    + (ds_read_byte(&drbbc_sc->sc_dsh)<<24);

	/* BSD time is wr. 1.1.1970; AmigaOS time wrt. 1.1.1978 */

	clkbuf += (8*365 + 2) * 86400;

	tvp->tv_sec = clkbuf;
	tvp->tv_usec = usecs;

	return (1);
}


text:
Vali Höll on staying sane through injury, Red Bull's APC, her new team, and getting ready to defend her Crankworx win
Outside the universal challenges of 2020, Vali Höll managed to hit some major highs. She won her first international elite DH race at Crankworx Innsbruck, a moment the world had been eagerly anticipating after years of watching her climb the Junior ranks. Unfortunately, it was followed by an additional low. A crash in practice at World Champs left her with two torn ligaments and a fracture in her ankle. Now well into 2021, she's back on the bike, setting her sights on what's coming, and ready to charge.
Crankworx: This has been a strange off-season for everyone with COVID, with a next level of challenge for you as you've been rehabbing an ankle injury. How are you doing these days? We see you've been back on the bike!
Vali Höll: Actually I'm doing really good. I just recovered from my second surgery and I'm ready to jump back on the DH bike. It's funny, I actually thought I would be really moody sitting at home, rehabbing and being bored but somehow I just learned that I can't control everything, so I just take it how it comes.
CWX: Have you been spending time at Red Bull's Athlete Performance Centre (APC) in Salzburg over the course of your rehab? How much does it help to have support like that to get you back on the bike and in solid form, physically and mentally?
VH: Not a lot of people know how big of a help Red Bull actually is, people just see the helmet and crazy events, which is sick, but they really care about their athletes. Two hours after my crash they had already sent all the MRI info and data to specialists and the next day I already had an appointment with a well-known surgeon. Two weeks after the surgery I went straight to the APC and spent two full months, Monday to Friday, rehabbing. It was sick! From physio treatments to mental performance coaching to cooking classes, I was never bored or had time to feel sad.
CWX: You're on a new team in 2021 – how've you been feeling on your new bike as you get ready to kick off race season with the RockShox Trek Race Team?
VH: To be honest I haven't spent a full day on the DH bike yet, so it's stressing me a little bit. But I rode a bit on the Slash and on the Rail and I felt super comfortable straight on, so I'm pretty optimistic that it will be the same on the Session.
CWX: You posted recently on social that you're training for different Crankworx disciplines. What have you been doing? Have you been having fun trying out different style of riding?
VH: I actually enjoy riding Pumptrack and Slalom, but the last time I got injured and last year was just a few days before Worlds so I didn't want to empty the tank for that race, so I only rode the Downhill event. But I'd love to be strong at more disciplines.
CWX: You podiumed on the Pump Track in 2018 and won the DH at Crankworx Innsbruck this past year. What other Crankworx accomplishments would you like to achieve?
VH: Queen of Crankworx would be something, but all the girls really train for the Speed & Style events, which is super impressive, but I've never really done any dirt jumping. Who knows, maybe I can get into it a bit, but at the moment I have some stuff to do on the DH bike, ha ha ha.
CWX: With the dates now out there for Crankworx Innsbruck this year (June 16-20, 2021) how does it feel to have this festival in your home country confirmed and know you're going to race in Innsbruck in a few months?!
VH: It's amazing to have a bit of normality back, even if it's without spectators. We're still racing against the clock and I feel the same when I cross the finish line with or without people cheering. But obviously it's way better if your friends and fam can come by and maybe a have a gin and tonic with you afterwards, ha ha, so we'll see what happens!
CWX: Do you have any goals for Crankworx Innsbruck 2021?
VH: Defending my DH win would be sick. It feels weird to write it down but it's actually the first time I really won something. It's different from a Junior win because I really was the fastest of all women on that day. 🙂
Check out the preview of what's to come, June 16-20, 2021 as Vali, and the Crankworx World Tour, return to Innsbruck.


This is very good news. This case and Lexmark vs. Static Control are the most blatant examples of companies invoking the DMCA to stifle legitimate competition.
During oral arguments on this motion, Plaintiff acknowledged that under its interpretation of DMCA, a garage owner violates the Act if he or she loses the transmitter that came with its Chamberlain rolling code GDO, but manages to operate the opener by somehow circumventing the rolling code. This court agrees with Defendant that the DMCA does not require such a conclusion.


Customer pricing groups (available with the basic version) and detailed pricing (available with the premium version) are two different ways of applying customer pricing to products.
Applying customer pricing through customer pricing groups involves creating a group, selecting a group of products, then assigning a discount for each pricing tier within that group for those products. Different discounts for different products would require separating those products in their own customer pricing group.
The detailed pricing functionality allows for easier management of individual products and their respective discounts compared to using customer pricing groups. Products and customer pricing tags are listed in a grid type format and you're able to specify the fixed price or discount for a particular product or variant. This is especially helpful in the situation where each product or variant has its own discount percentage or fixed price.
Another advantage is that all products are isolated from each other (unlike with products in customer pricing groups) updating one variant/customer tag discount only causes the app to process that one product, instead of all of the products that happen to be in a customer pricing group.
Note: Detailed Pricing discounts will apply ahead of Customer Pricing Group discounts.


text:
(844) 476-6976, Ext #401
Jennifer Birch - Director
Jennifer Birch is the Director of the Arts After School and Community Music School Programs. She received a degree in Marine Technology while training in surface supplied air diving to be a commercial diver specializing in underwater inspection. Eventually this career lead her back to her interest in the arts, specifically photography, and eventually an interest in music and its correlation to academic success in children. As one of the founding members of the Belgrade Community Theatre Committee in Belgrade, ME which brings Missoula theatre to her local primary school in order to foster the creativity and enhance the innate capabilities in each participating child. She has also been heavily involved in the Pineland Suzuki Music School for over 10 years helping to make learning string instruments accessible and affordable for children 4 - high school age. er five children are very involved in the performing arts and as her middle child attended Snow Pond Arts Academy for two years she naturally transitioned over to help establish a new arts driven after school program in central Maine that will transcend barriers such as financial resources, and unique needs to transform lives by actively engaging people in the arts.
Christine Little - AAS Program Coordinator
Christine Little is our AAS Program Coordinator, she teaches expressive art, creative dance therapy and Christine received her BFA in Dance from the Boston Conservatory and her MA in Dance Movement Therapy from Naropa University. She has taught dance and creative movement to children and adults for over 30 years and still feels joyful and passionate about her art. Christine plays a variety of musical instruments and is a certified Music Mind Games teacher. In addition, she has had extensive training in Recreation Therapy and brings all of this experience to bear when facilitating individual and group creative arts sessions.
Amy Bley - Theater & Art Teacher
Amy Bley is a senior at the University of Maine at Augusta where she studies Liberal and Fine Arts. She is also a teacher of Jewish studies at the Temple Beth El Hebrew School in Augusta, in addition to teaching theater and art at Snow Pond After School Arts. She was just chosen as one of the Rising Scholars at UMA!! She has a love for children, teaching and makes her programs fun as well as educational.
Alexis Burbank - Art Teacher
Alexis Burbank, our art teacher, graduated from University of Maine in Machias with a Fine Arts Degree. She is a freelance artist focusing on illustration. She is currently working on a children's book that will be published in 2019.
Brendan Wilson
Brendan Wilson is teaching private lessons and music theory at the Arts After School Program at Snow Pond Center for the Arts. Brendan was born in Ivins, Utah, starting piano at age 5.He continued to play some piano and sing through high school until making a decision to pursue in Music Education at the University of Vermont, receiving a Bachelor's in 2014.
Read more: Brendan Wilson


A term used to refer to apparitions, supposedly of the dead, or to explain happenings where the cause is unknown. See more pictures of Ghosts.
Acronym for Unidentified Flying Object. Thought by many to be visitors from other words or other dimensions. See more pictures of UFOs.
The study of creatures such as the Yeti, whose existence has not been accepted by mainstream science. See more pictures of Cryptozoology.
Common paranormal activity that is not easily classified or is thought to be a part of two or more of the above categories. Examples are rods, bizarre lights, and anti-gravity. See more pictures of Unexplained.


And a French source with a text, which might be close to the original of 1393 ..
Le Ménagier de Paris was first published in print form by Baron Jérôme Pichon in 1846. The book was made available in English translation in its entirety only in 2009, published by Cornell University Press; until that publication, the most complete translation in English was Eileen Power's 1928 The Goodman of Paris. Since earlier translations and editions have focused mainly on the recipes, the book is often incorrectly referred to as a medieval cookbook or an "advice and household hints book," and mined for the history of medieval cuisine.
So likely the edition is from Baron Jérôme Pichon. Studying the text I noted, that Pichon was mentioned as president of a society, which had arranged the work. Crapelet was only the printer.


text:
Q: How to get a link to go to a specific div on another page Say I have a link that says:
Services
When I click on that link I want to obviously go to the services page, but what I am trying to figure out is how can I get that link to take me to a specific section on that page.
The thing is, the page I want to show a specific section, it does not show unless I hit a tab. Here is what my services page looks like. You will see if you click a tab a specific section will show up.
https://jsfiddle.net/esayoaqg/1/
If I clicked on a link referring to Service 1, I want the link to go to the services page and show the div #service1.
How can I do this?
Service 1
Service 2
Service 3

$(function(){

    //get the section name from hash
    var sectionName = window.location.hash.slice(1);

    //then show the section
    $('#service-display-box').show();
    //$('#' + sectionName ).show();
    $('#service' + sectionName).show().siblings().hide();
})

A: you could use hash sign #:
Services

//services.html

...

UPDATED:
if you need to auto show a section after page loaded, you could do something like:
$(function(){

    //get the section name from hash
    var sectionName = window.location.hash.slice(1);

    //then show the section
    $('#' + sectionName ).show();
})

A: You can use
blah blah

show this content

and then use a show content based on scroll or window location..
Most likely will need javascript of the sorts to get it how you want.

A: You can use an anchor, but it will not set the hidden element to visible.
You'll need to add some javascript to display it.
Based on the example in your fiddle, it would be as follows:
var index = location.hash.indexOf('#service');
if(index > -1) {
    var serviceId = parseInt(location.hash.substring(index));
    if(serviceId) {
        $('#service-display-box').show();
        $('#service' + serviceId).show().siblings().hide();
    }
}

redpajama_set_name: RedPajamaStackExchange


text:
Q: Richfaces 3 on Payara 5: Request prolog cannot be read I'm attempting to move an existing Richfaces 3.3.4 / JSF 1.2 application off Glassfish 3 (for a number of reasons) onto Payara 5.192.  The application runs fine with a couple exceptions, the primary problem being rich:fileUpload doesn't work.
I added multipart-config to web.xml, but that didn't resolve the problem:
    <context-param>
        <param-name>javax.faces.DISABLE_FACELET_JSF_VIEWHANDLER</param-name>
        <param-value>true</param-value>
    </context-param>
    <servlet>
        <servlet-name>Faces Servlet</servlet-name>
        <servlet-class>javax.faces.webapp.FacesServlet</servlet-class>
        <load-on-startup>1</load-on-startup>
        <multipart-config>
            <max-file-size>33554432</max-file-size>
            <max-request-size>335544320</max-request-size>
        </multipart-config>
    </servlet>

Here is the error:
org.ajax4jsf.exception.FileUploadException: IO Error parsing multipart request
    at org.ajax4jsf.request.MultipartRequest.parseRequest(MultipartRequest.java:388)
    at org.richfaces.component.FileUploadPhaselistener.beforePhase(FileUploadPhaselistener.java:63)
    at com.sun.faces.lifecycle.Phase.handleBeforePhase(Phase.java:201)
    at com.sun.faces.lifecycle.Phase.doPhase(Phase.java:74)
    at com.sun.faces.lifecycle.RestoreViewPhase.doPhase(RestoreViewPhase.java:109)
    at com.sun.faces.lifecycle.LifecycleImpl.execute(LifecycleImpl.java:177)
    at javax.faces.webapp.FacesServlet.executeLifecyle(FacesServlet.java:707)
    at javax.faces.webapp.FacesServlet.service(FacesServlet.java:451)
    at org.apache.catalina.core.StandardWrapper.service(StandardWrapper.java:1628)
    at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:339)
    at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:209)
    at org.ajax4jsf.webapp.BaseXMLFilter.doXmlFilter(BaseXMLFilter.java:206)
    at org.ajax4jsf.webapp.BaseFilter.handleRequest(BaseFilter.java:290)
    at org.ajax4jsf.webapp.BaseFilter.processUploadsAndHandleRequest(BaseFilter.java:367)
    at org.ajax4jsf.webapp.BaseFilter.doFilter(BaseFilter.java:515)
    at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:251)
    at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:209)
    at org.apache.catalina.core.ApplicationDispatcher.doInvoke(ApplicationDispatcher.java:822)
    at org.apache.catalina.core.ApplicationDispatcher.invoke(ApplicationDispatcher.java:688)
    at org.apache.catalina.core.ApplicationDispatcher.processRequest(ApplicationDispatcher.java:527)
    at org.apache.catalina.core.ApplicationDispatcher.doDispatch(ApplicationDispatcher.java:496)
    at org.apache.catalina.core.ApplicationDispatcher.dispatch(ApplicationDispatcher.java:378)
    at org.apache.catalina.core.StandardHostValve.custom(StandardHostValve.java:507)
    at org.apache.catalina.core.StandardHostValve.dispatchToErrorPage(StandardHostValve.java:701)
    at org.apache.catalina.core.StandardHostValve.status(StandardHostValve.java:385)
    at org.apache.catalina.core.StandardHostValve.throwable(StandardHostValve.java:319)
    at org.apache.catalina.core.StandardHostValve.postInvoke(StandardHostValve.java:217)
    at org.apache.catalina.connector.CoyoteAdapter.doService(CoyoteAdapter.java:373)
    at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:238)
    at com.sun.enterprise.v3.services.impl.ContainerMapper$HttpHandlerCallable.call(ContainerMapper.java:520)
    at com.sun.enterprise.v3.services.impl.ContainerMapper.service(ContainerMapper.java:217)
    at org.glassfish.grizzly.http.server.HttpHandler.runService(HttpHandler.java:182)
    at org.glassfish.grizzly.http.server.HttpHandler.doHandle(HttpHandler.java:156)
    at org.glassfish.grizzly.http.server.HttpServerFilter.handleRead(HttpServerFilter.java:218)
    at org.glassfish.grizzly.filterchain.ExecutorResolver$9.execute(ExecutorResolver.java:95)
    at org.glassfish.grizzly.filterchain.DefaultFilterChain.executeFilter(DefaultFilterChain.java:260)
    at org.glassfish.grizzly.filterchain.DefaultFilterChain.executeChainPart(DefaultFilterChain.java:177)
    at org.glassfish.grizzly.filterchain.DefaultFilterChain.execute(DefaultFilterChain.java:109)
    at org.glassfish.grizzly.filterchain.DefaultFilterChain.process(DefaultFilterChain.java:88)
    at org.glassfish.grizzly.ProcessorExecutor.execute(ProcessorExecutor.java:53)
    at org.glassfish.grizzly.nio.transport.TCPNIOTransport.fireIOEvent(TCPNIOTransport.java:524)
    at org.glassfish.grizzly.strategies.AbstractIOStrategy.fireIOEvent(AbstractIOStrategy.java:89)
    at org.glassfish.grizzly.strategies.WorkerThreadIOStrategy.run0(WorkerThreadIOStrategy.java:94)
    at org.glassfish.grizzly.strategies.WorkerThreadIOStrategy.access$100(WorkerThreadIOStrategy.java:33)
    at org.glassfish.grizzly.strategies.WorkerThreadIOStrategy$WorkerThreadRunnable.run(WorkerThreadIOStrategy.java:114)
    at org.glassfish.grizzly.threadpool.AbstractThreadPool$Worker.doWork(AbstractThreadPool.java:569)
    at org.glassfish.grizzly.threadpool.AbstractThreadPool$Worker.run(AbstractThreadPool.java:549)
    at java.lang.Thread.run(Thread.java:748)
Caused by: java.io.IOException: Request prolog cannot be read
    at org.ajax4jsf.request.MultipartRequest.readProlog(MultipartRequest.java:333)
    at org.ajax4jsf.request.MultipartRequest.initialize(MultipartRequest.java:369)
    at org.ajax4jsf.request.MultipartRequest.parseRequest(MultipartRequest.java:379)
    ... 47 more¡ëôwÍ$


text:
Food Crisis Platform
Resilient Cities Require Resilient Food Systems
Written by Kim Zeuli ICIC and Monica Munn The Rockefeller Foundation
City leaders are prioritizing resilience planning to better prepare for severe natural disasters such as earthquakes, hurricanes and superstorms. Food systems, however, have been largely overlooked in these planning efforts. Most cities expect to provide residents with food for a relatively short period of time—a few weeks at most—during the immediate aftermath of a natural disaster. But as Hurricane Katrina demonstrated in New Orleans, food system disruptions may last months or years and vary by neighborhood. Such long-lasting disruptions can create significant food access issues, especially for populations that are already food insecure.
100 Resilient Cities (100RC), pioneered by The Rockefeller Foundation, helps cities around the world become more resilient to the physical, social, and economic challenges that are a growing part of the 21st century. 100RC views resilience not just as shocks—earthquakes, fires, floods, etc.—but also as stresses that weaken the fabric of a city on a day-to-day or cyclical basis. New research from the Initiative for a Competitive Inner City (ICIC), supported by a grant from The Rockefeller Foundation, strongly suggests that city leaders should bring food systems to the forefront of discussions and planning around urban resilience.
The Resilience of America's Urban Food Systems: Evidence from Five Cities provides a compelling look at the vulnerability of urban food systems to natural disasters in Los Angeles, New Orleans and New York City. ICIC's analysis assumed a hypothetical 7.8 magnitude earthquake in Los Angeles, while looking at the actual impact of Hurricane Katrina in New Orleans and Superstorm Sandy in New York City.
An Urban Food System Resilience Framework
Considering the aspects of food systems that city leaders could realistically address (therefore not including food production), ICIC developed a unique framework that allows cities to identify and assess the resilience of their food systems to different types of disasters. It analyzes vulnerabilities at the neighborhood level to identify specific areas (and populations) within the city that would be disproportionately impacted by food system disruptions.
Urban Food System Vulnerabilities
The comparative analysis of food systems in Los Angeles, New Orleans and New York City finds both shared vulnerabilities and unique weaknesses that are a function of differences in each city's food system and their exposure to different natural disaster risks.
None of the cities were exposed to significant food processing vulnerabilities. Because of the global nature of the food system, a very small share of total food consumed in a city is processed and packaged locally. For example, if a major earthquake hit Los Angeles, some food processing plants would likely be damaged, but they are largely food exporters. The food consumed in Los Angeles, as is the case in most cities, is sourced from food processing plants across the country and world.
All three cities face food distribution vulnerabilities because of the location of some warehouse supplier facilities in "at risk" areas. Los Angeles faces the greatest risk, with the vast majority of its warehouse suppliers subject to earthquake damage. In New Orleans and New York City, only local warehouse suppliers are at risk, creating greater risks for smaller grocery and corner stores, which rely more on local warehouse suppliers for their food supplies.
Fresh food distribution markets concentrate many wholesalers in a single location, creating significant vulnerability if the market is located in an "at risk" area. Hunts Point, New York City's fresh food distribution market, highlights the unique vulnerabilities associated with this type of market. Hunts Point poses the greatest single food distribution vulnerability for New York City because of the concentration of wholesalers in a single location, its relative importance to the city's food retailers, and its location. A recent study finds that 25 percent of produce, 35 percent of meat, 45 percent of seafood, and 12 percent of all food distributed within the city moves through Hunts Point, which is located on 329 acres on a peninsula in the Bronx, making it vulnerable to flooding from storm surges.
All three cities have transportation routes vulnerable to extended closures in the aftermath of a disaster, creating potential supply chain disruptions. Both New York City and New Orleans are surrounded by water, funneling food distribution trucks onto bridges and tunnels, some of which are inherently prone to flooding because of their proximity to water. In Los Angeles, most of the transportation routes into the city would be impacted by the earthquake scenario that was analyzed.
For every city, food availability in some neighborhoods will be disproportionately impacted by a natural disaster. The greatest disparities in food availability still exist in New Orleans, but all three cities have some neighborhoods with food access vulnerabilities:
New York City had the fewest—slightly less than two percent of all neighborhoods.
Yet, after Sandy, some local grocery and corner stores in Staten Island and in the Rockaways were closed for an extended period of time—in some cases months or over one year.
In Los Angeles, 17 percent of all neighborhoods have food access vulnerabilities. One of the neighborhoods has no food retail stores.
In New Orleans, a quarter of all neighborhoods have food access vulnerabilities. Twelve of the neighborhoods have no food retail stores.
We learn from Katrina and Sandy that delayed or inadequate insurance and government assistance payments can hold up the reopening of smaller grocery and corner stores, adding another layer of food availability vulnerability in these neighborhoods. In addition, food banks in all three cities are located in "at risk" areas and would also face challenges meeting increased demand for an extended period of time.
Creating Resilient Urban Food Systems
The report offers five recommendations that serve as a playbook for city leaders to strengthen the resilience of their urban food systems and shorten the recovery window needed to return food systems to their normal state. While a strong local government role is essential, the recommendations reflect the fact that strengthening urban food system resilience requires leadership from both the public and private sectors.
Conduct a food system resilience assessment: As this study shows, every city will have unique food system vulnerabilities and an assessment of the entire food system is needed to inform resilience plans. Urban food systems remain largely unstudied and there is a lack of data on the origin of food, distribution paths and food retail. Boston, Los Angeles and New York City stand out as cities that have already started to analyze the resilience of their food systems.
Incorporate food systems into resilience planning initiatives and prioritize resilience on urban food agendas: Most cities overlook food systems in their resilience plans. Likewise, most urban food agendas do not currently prioritize resilience planning. Food system resilience should be a priority for city food agencies, food policy councils, and the U.S. Conference of Mayors Food Policy Task Force. There are approximately 200 food policy councils in the U.S., which are designed to influence local and state food policy and typically include representatives from across the food system. Food policy councils would create an efficient platform to advance food system resilience policies and initiatives.
Develop neighborhood food resilience plans: Planning should be prioritized for neighborhoods where food access would be disproportionately impacted by a natural disaster. In the long-term, food insecurity and a lack of food retail stores will need to be addressed. In the short-term, the resilience of food banks, the backbone of food safety nets, should be strengthened.
Strengthen food business resilience: Many smaller food businesses are likely to be underprepared for business disruptions. Cities should work with the food industry to ensure all food businesses have adequate insurance coverage and business continuity plans in place to ensure that they fully cover a wide range of potential disruptions. City leaders should leverage the expertise of large organizations to share best practices with other food businesses and to improve the logistics of food provisions in the aftermath of a disaster.
Develop government policies and practices that help food businesses quickly return to normal operations: Three government policies are critical for food business recovery—food safety inspections, the construction permit process, and transportation restrictions. Government agencies should develop a protocol for streamlining inspections and permitting, policies that eliminate restrictions on food business transportation, and a process for effectively communicating with all food businesses.
Climate change will only increase the occurrence and severity of natural disasters in U.S. cities, and city leaders need to be prepared to respond. City leaders may assume that resilience planning for the city's infrastructure in general is sufficient, since food distribution and retail depend on transportation and utilities. While resilient transportation networks and utilities are critical components of a resilient food system, they are not the only parts that matter. In addition, having a food system perspective in resilience planning will prioritize the most critical infrastructure investments to strengthen food distribution and food retail.
Cities that intentionally develop resilient food systems will ensure that food supplies return to pre-disaster levels as quickly and as equitably as possible, so that all residents have adequate access to food in their neighborhoods.
Learn more by reading the full report, The Resilience of America's Urban Food Systems: Evidence from Five Cities.
For more information, please contact Kim Zeuli at kzeuli@icic.org or 617.238.3012.
PrevPreviousDear 2050
Stay informed about the latest in Sustained Emergency Food Planning.
Start planning for a resilient future today.
info@feedingcitiesgroup.com
© 2023 The Feeding Cities Group | All rights reserved.


Meet up with a local in one of our 200 destinations!
Greeters are volunteers that love their city so much that they want to show their place TO YOU; for free!
Not as a guide, more like a newly met friend! Greeters can show you special places that have a personal meaning to them. They can also show things visitors specifically ask for such as parks, the best shopping spots, architecture marvels or city specific hidden treasures.
It is simple: find a destination by country or by roaming the map. Either way, it is easy to find your next trip destination.
Don't have Greeters in your area?