• Assembles customer orders by accurately picking and counting items to fill the orders from the correct stock location, placing orders on pallets or in containers.
• Ensure an accurate count for each item selected.
• Utilize Motorola hand held scanner to facilitate the order picking process.
• Affixes labels and shipping information on packaging and onto shipping documentation.
• Must be able to lift 50 pounds.
• Certifications: Forklift certification preferred.
• Experience: 1 to 3 years related experience required.
• Must be able to observe company policies and safety procedures at all times.
• Must be able to give and welcome constructive feedback; contribute to building a positive team spirit.
• Must be able to treat others with respect; work with integrity and ethically; uphold organizational values.
• To perform this job successfully, basic computer skills are required.
• Must be able to read and write in English. Must be able to demonstrate comprehension of written English by successfully completing unassisted written tests, including, but not limited to, Work Instructions and Standard Operating Procedures.


text:
"Loveless" by Children Collide (Directed by David Michôd / Produced by Michael Cody (Flood Projects))
I see you David!
From Children Collide:
"Loveless is a song of strength and sorrow. A diamond in the rough. Buried deep within the frenzied beats and intelligible chaos that permeates the rest of the Theory of Everything album, Loveless is the most personal song to ride the airwaves courtesy of Children Collide. The accompanying video is also an incredible creative collaboration. Directed by lauded Animal Kingdom director David Michôd, Loveless is dually his first foray into music video and first release since the breakthrough success of his debut feature film [Animal Kingdom]. Frontman Johnny Mackay'€™s stark performance in the single shot video is near flawless. The unsettling appearance of Michôd himself in the video is chilling."
ARIA: Nominated for an ARIA (Australian Recording Industry Association) award for Best Music Video in 2011.
Sound Kilda, St Kilda Film Festival: Won – Best Music Video 2012
Extract from [V]Music Q&A with lead singer Johnny Mackay:
"How did you get Animal Kingdom director David Michôd involved?
I was going to pitch it to a couple of directors, but then I thought of David because he'd gone out with a friend of mine ages ago. I thought I could contact her and be a bit of a prick about it, but then I backed out because I thought, 'that's really unprofessional, I can't do that'. But then I had this dream that he was doing our video and he had this hilarious gay Vietnamese assistant. I woke up from this dream laughing at his assistant, then I jumped straight on Facebook and found him and wrote him a big, long message.
Did you tell him about your dream?
Yeah! I told him about the dream. He didn't end up having that assistant, so that was a bit disappointing but everything else was good. He was in Hawaii, then he got back to me from LA, then he was in France, so it was this long process of Facebook messages 'til we came to an understanding. I kind of just let him go with the concept. The concept was that I have to lose all of my hair and he had all of the other ideas, he filled in all the blanks. He put together a team of people – I think a lot of them worked on Animal Kingdom – and they were all really amazing.
So it wasn't your idea to go with the clown face?
No, no, no, that as David's. Besides getting rid of my hair, he filled in all the other parts."

redpajama_set_name: RedPajamaCommonCrawl


Ernie's work has been exhibited in shows throughout the country, including Elko, Nevada; Oklahoma City, Oklahoma; Fort Worth, Texas; Jordan Valley, Oregon; Paso Robles, California; Flagstaff, Arizona and Wickenburg, Arizona. He was chosen as one of the Top Ten Spur Makers from 1997 to 1999. In 2000, the Academy of Western Artists honored him with the Will Rogers Award as Spurmaker of the Year.


text:
package core

import (
	"database/sql"
	"encoding/json"
	"sync"
	"testing"
	"time"

	"github.com/OpenBazaar/jsonpb"
	"github.com/op/go-logging"

	"github.com/OpenBazaar/openbazaar-go/pb"
	"github.com/OpenBazaar/openbazaar-go/repo"
	"github.com/OpenBazaar/openbazaar-go/repo/db"
	"github.com/OpenBazaar/openbazaar-go/schema"
	"github.com/OpenBazaar/openbazaar-go/test/factory"
)

// DISPUTE CASES
func TestPerformTaskCreatesModeratorDisputeExpiryNotifications(t *testing.T) {
	// Start each case 50 days ago and have the lastDisputeExpiryNotifiedAt at a day after
	// each notification is suppose to be sent. With no notifications already queued,
	// it should produce all the old notifications up to the most recent one expected
	var (
		broadcastChannel = make(chan repo.Notifier, 0)
		timeStart        = time.Now().Add(time.Duration(-50*24) * time.Hour)
		twelveHours      = time.Duration(12) * time.Hour
		firstInterval    = repo.ModeratorDisputeExpiry_firstInterval
		secondInterval   = repo.ModeratorDisputeExpiry_secondInterval
		thirdInterval    = repo.ModeratorDisputeExpiry_thirdInterval
		lastInterval     = repo.ModeratorDisputeExpiry_lastInterval

		// Produces notification for 15, 40, 44 and 45 days
		neverNotified = &repo.DisputeCaseRecord{
			CaseID:                      "neverNotified",
			OrderState:                  pb.OrderState_DISPUTED,
			Timestamp:                   timeStart,
			LastDisputeExpiryNotifiedAt: timeStart.Add(twelveHours),
			BuyerContract: &pb.RicardianContract{
				VendorListings: []*pb.Listing{
					{Item: &pb.Listing_Item{Images: []*pb.Listing_Item_Image{{Tiny: "never-buyer-tinyimagehash", Small: "never-buyer-smallimagehash"}}}},
				},
			},
			VendorContract: &pb.RicardianContract{
				VendorListings: []*pb.Listing{
					{Item: &pb.Listing_Item{Images: []*pb.Listing_Item_Image{{}}}},
				},
			},
			IsBuyerInitiated: true,
		}
		// Produces notification for 40, 44 and 45 days
		notifiedUpToFifteenDay = &repo.DisputeCaseRecord{
			CaseID:                      "notifiedUpToFifteenDay",
			OrderState:                  pb.OrderState_DISPUTED,
			Timestamp:                   timeStart,
			LastDisputeExpiryNotifiedAt: timeStart.Add(firstInterval + twelveHours),
			BuyerContract: &pb.RicardianContract{
				VendorListings: []*pb.Listing{
					{Item: &pb.Listing_Item{Images: []*pb.Listing_Item_Image{{}}}},
				},
			},
			VendorContract: &pb.RicardianContract{
				VendorListings: []*pb.Listing{
					{Item: &pb.Listing_Item{Images: []*pb.Listing_Item_Image{{Tiny: "fifteen-vendor-tinyimagehash", Small: "fifteen-vendor-smallimagehash"}}}},
				},
			},
			IsBuyerInitiated: false,
		}
		// Produces notification for 44 and 45 days
		notifiedUpToFourtyDays = &repo.DisputeCaseRecord{
			CaseID:                      "notifiedUpToFourtyDay",
			OrderState:                  pb.OrderState_DISPUTED,
			Timestamp:                   timeStart,
			LastDisputeExpiryNotifiedAt: timeStart.Add(secondInterval + twelveHours),
			BuyerContract: &pb.RicardianContract{
				VendorListings: []*pb.Listing{
					{Item: &pb.Listing_Item{Images: []*pb.Listing_Item_Image{{Tiny: "fourty-buyer-tinyimagehash", Small: "fourty-buyer-smallimagehash"}}}},
				},
			},
			VendorContract: &pb.RicardianContract{
				VendorListings: []*pb.Listing{
					{Item: &pb.Listing_Item{Images: []*pb.Listing_Item_Image{{}}}},
				},
			},
			IsBuyerInitiated: true,
		}
		// Produces notification for 45 days
		notifiedUpToFourtyFourDays = &repo.DisputeCaseRecord{
			CaseID:                      "notifiedUpToFourtyFourDays",
			OrderState:                  pb.OrderState_DISPUTED,
			Timestamp:                   timeStart,
			LastDisputeExpiryNotifiedAt: timeStart.Add(thirdInterval + twelveHours),
			BuyerContract: &pb.RicardianContract{
				VendorListings: []*pb.Listing{
					{Item: &pb.Listing_Item{Images: []*pb.Listing_Item_Image{{}}}},
				},
			},
			VendorContract: &pb.RicardianContract{
				VendorListings: []*pb.Listing{
					{Item: &pb.Listing_Item{Images: []*pb.Listing_Item_Image{{Tiny: "fourtyfour-vendor-tinyimagehash", Small: "fourtyfour-vendor-smallimagehash"}}}},
				},
			},
			IsBuyerInitiated: false,
		}
		// Produces no notifications as all have already been created
		notifiedUpToFourtyFiveDays = &repo.DisputeCaseRecord{
			CaseID:                      "notifiedUpToFourtyFiveDays",
			OrderState:                  pb.OrderState_DISPUTED,
			Timestamp:                   timeStart,
			LastDisputeExpiryNotifiedAt: timeStart.Add(lastInterval + twelveHours),
			BuyerContract: &pb.RicardianContract{
				VendorListings: []*pb.Listing{
					{Item: &pb.Listing_Item{Images: []*pb.Listing_Item_Image{{}}}},
				},
			},
			VendorContract: &pb.RicardianContract{
				VendorListings: []*pb.Listing{
					{Item: &pb.Listing_Item{Images: []*pb.Listing_Item_Image{{}}}},
				},
			},
			IsBuyerInitiated: false,
		}
		existingRecords = []*repo.DisputeCaseRecord{
			neverNotified,
			notifiedUpToFifteenDay,
			notifiedUpToFourtyDays,
			notifiedUpToFourtyFourDays,
			notifiedUpToFourtyFiveDays,
		}

		appSchema = schema.MustNewCustomSchemaManager(schema.SchemaContext{
			DataPath:        schema.GenerateTempPath(),
			TestModeEnabled: true,
		})
	)

	if err := appSchema.BuildSchemaDirectories(); err != nil {
		t.Fatal(err)
	}
	defer appSchema.DestroySchemaDirectories()
	if err := appSchema.InitializeDatabase(); err != nil {
		t.Fatal(err)
	}

	database, err := appSchema.OpenDatabase()
	if err != nil {
		t.Fatal(err)
	}
	s, err := database.Prepare("insert into cases (caseID, state, buyerContract, vendorContract, timestamp, buyerOpened, lastDisputeExpiryNotifiedAt) values (?, ?, ?, ?, ?, ?, ?)")
	if err != nil {
		t.Fatal(err)
	}

	m := jsonpb.Marshaler{
		EnumsAsInts:  false,
		EmitDefaults: true,
		Indent:       "    ",
		OrigName:     false,
	}
	for _, r := range existingRecords {
		var isBuyerInitiated int // = 0
		if r.IsBuyerInitiated {
			isBuyerInitiated = 1
		}
		buyerContractData, err := m.MarshalToString(r.BuyerContract)
		if err != nil {
			t.Fatal(err)
		}
		vendorContractData, err := m.MarshalToString(r.VendorContract)
		if err != nil {
			t.Fatal(err)
		}
		_, err = s.Exec(r.CaseID, int(r.OrderState), buyerContractData, vendorContractData, int(r.Timestamp.Unix()), isBuyerInitiated, int(r.LastDisputeExpiryNotifiedAt.Unix()))
		if err != nil {
			t.Fatal(err)
		}
	}

	var (
		closeAsyncChannelVerifier = make(chan bool, 0)
		broadcastCount            = 0
	)
	go func() {
		for {
			select {
			case n := <-broadcastChannel:
				notifier, ok := n.(repo.Notifier)
				if !ok {
					t.Errorf("unable to cast as Notifier: %+v", n)
				}
				t.Logf("notification received: %s", notifier)
				broadcastCount++ // += 1
			case <-closeAsyncChannelVerifier:
				return
			}
		}
	}()

	datastore := db.NewSQLiteDatastore(database, new(sync.Mutex))
	worker := &recordAgingNotifier{
		datastore: datastore,
		broadcast: broadcastChannel,
		logger:    logging.MustGetLogger("testRecordAgingNotifier"),
	}

	worker.PerformTask()

	// Verify Notifications received in channel
	closeAsyncChannelVerifier <- true
	if broadcastCount != 10 {
		t.Error("Expected 10 notifications to be broadcast, found", broadcastCount)
	}

	// Verify NotificationRecords in datastore
	rows, err := database.Query("select caseID, lastDisputeExpiryNotifiedAt from cases")
	if err != nil {
		t.Fatal(err)
	}
	for rows.Next() {
		var (
			caseID                      string
			lastDisputeExpiryNotifiedAt int64
		)
		if err := rows.Scan(&caseID, &lastDisputeExpiryNotifiedAt); err != nil {
			t.Fatal(err)
		}
		switch caseID {
		case neverNotified.CaseID, notifiedUpToFifteenDay.CaseID, notifiedUpToFourtyDays.CaseID, notifiedUpToFourtyFourDays.CaseID:
			durationFromActual := time.Now().Sub(time.Unix(lastDisputeExpiryNotifiedAt, 0))
			if durationFromActual > (time.Duration(5) * time.Second) {
				t.Errorf("Expected %s to have lastDisputeExpiryNotifiedAt set when executed, was %s", caseID, time.Unix(lastDisputeExpiryNotifiedAt, 0).String())
			}
		case notifiedUpToFourtyFiveDays.CaseID:
			if lastDisputeExpiryNotifiedAt != notifiedUpToFourtyFiveDays.LastDisputeExpiryNotifiedAt.Unix() {
				t.Error("Expected notifiedUpToFourtyFiveDays to not update LastDisputeExpiryNotifiedAt")
			}
		default:
			t.Error("Unexpected dispute case")
		}
	}

	actualNotifications, count, err := datastore.Notifications().GetAll("", -1, []string{})
	if err != nil {
		t.Fatal(err)
	}

	if count != 10 {
		t.Errorf("Expected 10 notifications to be produced, but found %d", count)
	}

	var (
		checkNeverNotifiedFifteenDay               bool
		checkNeverNotifiedFourtyDay                bool
		checkNeverNotifiedFourtyFourDay            bool
		checkNeverNotifiedFourtyFiveDay            bool
		checkNotifiedToFifteenDaysFourtyDay        bool
		checkNotifiedToFifteenDaysFourtyFourDay    bool
		checkNotifiedToFifteenDaysFourtyFiveDay    bool
		checkNotifiedToFourtyDaysFourtyFourDay     bool
		checkNotifiedToFourtyDaysFourtyFiveDay     bool
		checkNotifiedToFourtyFourDaysFourtyFiveDay bool

		firstIntervalExpectedExpiresIn  = uint((repo.ModeratorDisputeExpiry_lastInterval - repo.ModeratorDisputeExpiry_firstInterval).Seconds())
		secondIntervalExpectedExpiresIn = uint((repo.ModeratorDisputeExpiry_lastInterval - repo.ModeratorDisputeExpiry_secondInterval).Seconds())
		thirdIntervalExpectedExpiresIn  = uint((repo.ModeratorDisputeExpiry_lastInterval - repo.ModeratorDisputeExpiry_thirdInterval).Seconds())
		lastIntervalExpectedExpiresIn   = uint(0)
	)

	for _, n := range actualNotifications {
		var (
			contract  = &pb.RicardianContract{}
			thumbnail = n.NotifierData.(repo.ModeratorDisputeExpiry).Thumbnail
			refID     = n.NotifierData.(repo.ModeratorDisputeExpiry).CaseID
			expiresIn = n.NotifierData.(repo.ModeratorDisputeExpiry).ExpiresIn
		)
		if refID == neverNotified.CaseID {
			if neverNotified.IsBuyerInitiated {
				contract = neverNotified.BuyerContract
			} else {
				contract = neverNotified.VendorContract
			}
			assertThumbnailValuesAreSet(t, thumbnail, contract)
			if expiresIn == firstIntervalExpectedExpiresIn {
				checkNeverNotifiedFifteenDay = true
				continue
			}
			if expiresIn == secondIntervalExpectedExpiresIn {
				checkNeverNotifiedFourtyDay = true
				continue
			}
			if expiresIn == thirdIntervalExpectedExpiresIn {
				checkNeverNotifiedFourtyFourDay = true
				continue
			}
			if expiresIn == lastIntervalExpectedExpiresIn {
				checkNeverNotifiedFourtyFiveDay = true
				continue
			}
		}
		if refID == notifiedUpToFifteenDay.CaseID {
			if notifiedUpToFifteenDay.IsBuyerInitiated {
				contract = notifiedUpToFifteenDay.BuyerContract
			} else {
				contract = notifiedUpToFifteenDay.VendorContract
			}
			assertThumbnailValuesAreSet(t, thumbnail, contract)
			if expiresIn == secondIntervalExpectedExpiresIn {
				checkNotifiedToFifteenDaysFourtyDay = true
				continue
			}
			if expiresIn == thirdIntervalExpectedExpiresIn {
				checkNotifiedToFifteenDaysFourtyFourDay = true
				continue
			}
			if expiresIn == lastIntervalExpectedExpiresIn {
				checkNotifiedToFifteenDaysFourtyFiveDay = true
				continue
			}
		}
		if refID == notifiedUpToFourtyDays.CaseID {
			if notifiedUpToFourtyDays.IsBuyerInitiated {
				contract = notifiedUpToFourtyDays.BuyerContract
			} else {
				contract = notifiedUpToFourtyDays.VendorContract
			}
			assertThumbnailValuesAreSet(t, thumbnail, contract)
			if expiresIn == thirdIntervalExpectedExpiresIn {
				checkNotifiedToFourtyDaysFourtyFourDay = true
				continue
			}
			if expiresIn == lastIntervalExpectedExpiresIn {
				checkNotifiedToFourtyDaysFourtyFiveDay = true
				continue
			}
		}
		if refID == notifiedUpToFourtyFourDays.CaseID && expiresIn == lastIntervalExpectedExpiresIn {
			if notifiedUpToFourtyFourDays.IsBuyerInitiated {
				contract = notifiedUpToFourtyFourDays.BuyerContract
			} else {
				contract = notifiedUpToFourtyFourDays.VendorContract
			}
			assertThumbnailValuesAreSet(t, thumbnail, contract)
			checkNotifiedToFourtyFourDaysFourtyFiveDay = true
		}
	}

	if checkNeverNotifiedFifteenDay != true {
		t.Errorf("Expected dispute expiry notification missing: checkNeverNotifiedFifteenDay")
	}
	if checkNeverNotifiedFourtyDay != true {
		t.Errorf("Expected dispute expiry notification missing: checkNeverNotifiedFourtyDay")
	}
	if checkNeverNotifiedFourtyFourDay != true {
		t.Errorf("Expected dispute expiry notification missing: checkNeverNotifiedFourtyFourDay")
	}
	if checkNeverNotifiedFourtyFiveDay != true {
		t.Errorf("Expected dispute expiry notification missing: checkNeverNotifiedFourtyFiveDay")
	}
	if checkNotifiedToFifteenDaysFourtyDay != true {
		t.Errorf("Expected dispute expiry notification missing: checkNotifiedToFifteenDaysFourtyDay")
	}
	if checkNotifiedToFifteenDaysFourtyFourDay != true {
		t.Errorf("Expected dispute expiry notification missing: checkNotifiedToFifteenDaysFourtyFourDay")
	}
	if checkNotifiedToFifteenDaysFourtyFiveDay != true {
		t.Errorf("Expected dispute expiry notification missing: checkNotifiedToFifteenDaysFourtyFiveDay")
	}
	if checkNotifiedToFourtyDaysFourtyFourDay != true {
		t.Errorf("Expected dispute expiry notification missing: checkNotifiedToFourtyDaysFourtyFourDay")
	}
	if checkNotifiedToFourtyDaysFourtyFiveDay != true {
		t.Errorf("Expected dispute expiry notification missing: checkNotifiedToFourtyDaysFourtyFiveDay")
	}
	if checkNotifiedToFourtyFourDaysFourtyFiveDay != true {
		t.Errorf("Expected dispute expiry notification missing: checkNotifiedToFourtyFourDaysFourtyFiveDay")
	}
}

// PURCHASES
func TestPerformTaskCreatesBuyerDisputeTimeoutNotifications(t *testing.T) {
	// Start each purchase 50 days ago and have the lastDisputeTimeoutNotifiedAt at a day after
	// each notification is suppose to be sent. With no notifications already queued,
	// it should produce all the old notifications up to the most recent one expected
	var (
		broadcastChannel = make(chan repo.Notifier, 0)
		timeStart        = time.Now().Add(time.Duration(-50*24) * time.Hour)
		twelveHours      = time.Duration(12) * time.Hour
		firstInterval    = repo.BuyerDisputeTimeout_firstInterval
		secondInterval   = repo.BuyerDisputeTimeout_secondInterval
		thirdInterval    = repo.BuyerDisputeTimeout_thirdInterval
		lastInterval     = repo.BuyerDisputeTimeout_lastInterval

		// Produces no notifications as contract is undisputeable
		neverNotifiedButUndisputeable = &repo.PurchaseRecord{
			Contract:                     factory.NewUndisputeableContract(),
			OrderID:                      "neverNotifiedButUndisputed",
			OrderState:                   pb.OrderState(pb.OrderState_PENDING),
			Timestamp:                    timeStart,
			LastDisputeTimeoutNotifiedAt: time.Unix(0, 0),
		}
		// Produces notification for 15, 40, 44 and 45 days
		neverNotified = &repo.PurchaseRecord{
			Contract:                     factory.NewDisputeableContract(),
			OrderID:                      "neverNotified",
			OrderState:                   pb.OrderState(pb.OrderState_PENDING),
			Timestamp:                    timeStart,
			LastDisputeTimeoutNotifiedAt: time.Unix(0, 0),
		}
		// Produces notification for 40, 44 and 45 days
		notifiedUpToFifteenDay = &repo.PurchaseRecord{
			Contract:                     factory.NewDisputeableContract(),
			OrderID:                      "notifiedUpToFifteenDay",
			OrderState:                   pb.OrderState(pb.OrderState_PENDING),
			Timestamp:                    timeStart,
			LastDisputeTimeoutNotifiedAt: timeStart.Add(firstInterval + twelveHours),
		}
		// Produces notification for 44 and 45 days
		notifiedUpToFourtyDay = &repo.PurchaseRecord{
			Contract:                     factory.NewDisputeableContract(),
			OrderID:                      "notifiedUpToFourtyDay",
			OrderState:                   pb.OrderState(pb.OrderState_PENDING),
			Timestamp:                    timeStart,
			LastDisputeTimeoutNotifiedAt: timeStart.Add(secondInterval + twelveHours),
		}
		// Produces notification for 45 days
		notifiedUpToFourtyFourDays = &repo.PurchaseRecord{
			Contract:                     factory.NewDisputeableContract(),
			OrderID:                      "notifiedUpToFourtyFourDays",
			OrderState:                   pb.OrderState(pb.OrderState_PENDING),
			Timestamp:                    timeStart,
			LastDisputeTimeoutNotifiedAt: timeStart.Add(thirdInterval + twelveHours),
		}
		// Produces no notifications as all have already been created
		notifiedUpToFourtyFiveDays = &repo.PurchaseRecord{
			Contract:                     factory.NewDisputeableContract(),
			OrderID:                      "notifiedUpToFourtyFiveDays",
			OrderState:                   pb.OrderState(pb.OrderState_PENDING),
			Timestamp:                    timeStart,
			LastDisputeTimeoutNotifiedAt: timeStart.Add(lastInterval + twelveHours),
		}
		existingRecords = []*repo.PurchaseRecord{
			neverNotifiedButUndisputeable,
			neverNotified,
			notifiedUpToFifteenDay,
			notifiedUpToFourtyDay,
			notifiedUpToFourtyFourDays,
			notifiedUpToFourtyFiveDays,
		}

		appSchema = schema.MustNewCustomSchemaManager(schema.SchemaContext{
			DataPath:        schema.GenerateTempPath(),
			TestModeEnabled: true,
		})
	)
	neverNotified.Contract.VendorListings[0].Item.Images = []*pb.Listing_Item_Image{{Tiny: "never-tinyimagehashOne", Small: "never-smallimagehashOne"}}
	notifiedUpToFifteenDay.Contract.VendorListings[0].Item.Images = []*pb.Listing_Item_Image{{Tiny: "fifteen-tinyimagehashOne", Small: "fifteen-smallimagehashOne"}}
	notifiedUpToFourtyDay.Contract.VendorListings[0].Item.Images = []*pb.Listing_Item_Image{{Tiny: "fourty-tinyimagehashOne", Small: "fourty-smallimagehashOne"}}
	notifiedUpToFourtyFourDays.Contract.VendorListings[0].Item.Images = []*pb.Listing_Item_Image{{Tiny: "fourtyfour-tinyimagehashOne", Small: "fourtyfour-smallimagehashOne"}}
	notifiedUpToFourtyFiveDays.Contract.VendorListings[0].Item.Images = []*pb.Listing_Item_Image{{Tiny: "fourtyfive-tinyimagehashOne", Small: "fourtyfive-smallimagehashOne"}}

	if err := appSchema.BuildSchemaDirectories(); err != nil {
		t.Fatal(err)
	}
	defer appSchema.DestroySchemaDirectories()
	if err := appSchema.InitializeDatabase(); err != nil {
		t.Fatal(err)
	}
	database, err := appSchema.OpenDatabase()
	if err != nil {
		t.Fatal(err)
	}

	m := jsonpb.Marshaler{
		EnumsAsInts:  false,
		EmitDefaults: true,
		Indent:       "    ",
		OrigName:     false,
	}
	for _, r := range existingRecords {
		contractData, err := m.MarshalToString(r.Contract)
		if err != nil {
			t.Fatal(err)
		}
		_, err = database.Exec("insert into purchases (orderID, contract, state, timestamp, lastDisputeTimeoutNotifiedAt) values (?, ?, ?, ?, ?)", r.OrderID, contractData, int(r.OrderState), int(r.Timestamp.Unix()), int(r.LastDisputeTimeoutNotifiedAt.Unix()))
		if err != nil {
			t.Fatal(err)
		}
	}

	var (
		closeAsyncChannelVerifier = make(chan bool, 0)
		broadcastCount            = 0
	)
	go func() {
		for {
			select {
			case n := <-broadcastChannel:
				notifier, ok := n.(repo.Notifier)
				if !ok {
					t.Errorf("unable to cast as Notifier: %+v", n)
				}
				t.Logf("notification received: %s", notifier.GetType())
				broadcastCount++ // += 1
			case <-closeAsyncChannelVerifier:
				return
			}
		}
	}()

	datastore := db.NewSQLiteDatastore(database, new(sync.Mutex))
	worker := &recordAgingNotifier{
		datastore: datastore,
		broadcast: broadcastChannel,
		logger:    logging.MustGetLogger("testRecordAgingNotifier"),
	}

	worker.PerformTask()

	// Verify Notifications received in channel
	closeAsyncChannelVerifier <- true
	if broadcastCount != 10 {
		t.Error("Expected 10 notifications to be broadcast, found", broadcastCount)
	}

	// Verify NotificationRecords in datastore
	rows, err := database.Query("select orderID, lastDisputeTimeoutNotifiedAt from purchases")
	if err != nil {
		t.Fatal(err)
	}
	for rows.Next() {
		var (
			orderID                      string
			lastDisputeTimeoutNotifiedAt int64
		)
		if err := rows.Scan(&orderID, &lastDisputeTimeoutNotifiedAt); err != nil {
			t.Fatal(err)
		}
		switch orderID {
		case neverNotified.OrderID, notifiedUpToFifteenDay.OrderID, notifiedUpToFourtyDay.OrderID, notifiedUpToFourtyFourDays.OrderID:
			durationFromActual := time.Now().Sub(time.Unix(lastDisputeTimeoutNotifiedAt, 0))
			if durationFromActual > (time.Duration(5) * time.Second) {
				t.Errorf("Expected %s to have lastDisputeTimeoutNotifiedAt set when executed, was %s", orderID, time.Unix(lastDisputeTimeoutNotifiedAt, 0).String())
			}
		case notifiedUpToFourtyFiveDays.OrderID:
			if lastDisputeTimeoutNotifiedAt != notifiedUpToFourtyFiveDays.LastDisputeTimeoutNotifiedAt.Unix() {
				t.Error("Expected notifiedUpToFourtyFiveDays to not update LastDisputeExpiredNotifiedAt")
			}
		case neverNotifiedButUndisputeable.OrderID:
			if lastDisputeTimeoutNotifiedAt != neverNotifiedButUndisputeable.LastDisputeTimeoutNotifiedAt.Unix() {
				t.Error("Expected notifiedUpToFourtyFiveDays to not update LastDisputeExpiredNotifiedAt")
			}
		default:
			t.Error("Unexpected purchase")
		}
	}

	var count int64
	err = database.QueryRow("select count(*) from notifications").Scan(&count)
	if err != nil {
		t.Fatal(err)
	}
	if count != 10 {
		t.Errorf("Expected 10 notifications to be produced, but found %d", count)
	}

	rows, err = database.Query("select notifID, serializedNotification, timestamp from notifications")
	if err != nil {
		t.Fatal(err)
	}

	var (
		checkNeverNotifiedPurchaseFirstNotificationSeen  bool
		checkNeverNotifiedPurchaseSecondNotificationSeen bool
		checkNeverNotifiedPurchaseThirdNotificationSeen  bool
		checkNeverNotifiedPurchaseLastNotificationSeen   bool
		checkFifteenDayPurchaseSecondNotificationSeen    bool
		checkFifteenDayPurchaseThirdNotificationSeen     bool
		checkFifteenDayPurchaseLastNotificationSeen      bool
		checkFourtyDayPurchaseThirdNotificationSeen      bool
		checkFourtyDayPurchaseLastNotificationSeen       bool
		checkFourtyFourDayPurchaseLastNotificationSeen   bool

		firstIntervalExpectedExpiresIn  = uint((repo.BuyerDisputeTimeout_totalDuration - repo.BuyerDisputeTimeout_firstInterval).Seconds())
		secondIntervalExpectedExpiresIn = uint((repo.BuyerDisputeTimeout_totalDuration - repo.BuyerDisputeTimeout_secondInterval).Seconds())
		thirdIntervalExpectedExpiresIn  = uint((repo.BuyerDisputeTimeout_totalDuration - repo.BuyerDisputeTimeout_thirdInterval).Seconds())
		lastIntervalExpectedExpiresIn   = uint((repo.BuyerDisputeTimeout_totalDuration - repo.BuyerDisputeTimeout_lastInterval).Seconds())
	)
	for rows.Next() {
		var (
			nID, nJSON string
			nTimestamp sql.NullInt64
			n          *repo.Notification
		)
		if err = rows.Scan(&nID, &nJSON, &nTimestamp); err != nil {
			t.Error(err)
			continue
		}
		if err := json.Unmarshal([]byte(nJSON), &n); err != nil {
			t.Error("Failed unmarshalling notification:", err.Error())
			continue
		}
		var (
			refID     = n.NotifierData.(repo.BuyerDisputeTimeout).OrderID
			expiresIn = n.NotifierData.(repo.BuyerDisputeTimeout).ExpiresIn
			thumbnail = n.NotifierData.(repo.BuyerDisputeTimeout).Thumbnail
		)
		if refID == neverNotified.OrderID {
			assertThumbnailValuesAreSet(t, thumbnail, neverNotified.Contract)
			if expiresIn == firstIntervalExpectedExpiresIn {
				checkNeverNotifiedPurchaseFirstNotificationSeen = true
				continue
			}
			if expiresIn == secondIntervalExpectedExpiresIn {
				checkNeverNotifiedPurchaseSecondNotificationSeen = true
				continue
			}
			if expiresIn == thirdIntervalExpectedExpiresIn {
				checkNeverNotifiedPurchaseThirdNotificationSeen = true
				continue
			}
			if expiresIn == lastIntervalExpectedExpiresIn {
				checkNeverNotifiedPurchaseLastNotificationSeen = true
				continue
			}
		}
		if refID == notifiedUpToFifteenDay.OrderID {
			assertThumbnailValuesAreSet(t, thumbnail, notifiedUpToFifteenDay.Contract)
			if expiresIn == secondIntervalExpectedExpiresIn {
				checkFifteenDayPurchaseSecondNotificationSeen = true
				continue
			}
			if expiresIn == thirdIntervalExpectedExpiresIn {
				checkFifteenDayPurchaseThirdNotificationSeen = true
				continue
			}
			if expiresIn == lastIntervalExpectedExpiresIn {
				checkFifteenDayPurchaseLastNotificationSeen = true
				continue
			}
		}
		if refID == notifiedUpToFourtyDay.OrderID {
			assertThumbnailValuesAreSet(t, thumbnail, notifiedUpToFourtyDay.Contract)
			if expiresIn == thirdIntervalExpectedExpiresIn {
				checkFourtyDayPurchaseThirdNotificationSeen = true
				continue
			}
			if expiresIn == lastIntervalExpectedExpiresIn {
				checkFourtyDayPurchaseLastNotificationSeen = true
				continue
			}
		}
		if refID == notifiedUpToFourtyFourDays.OrderID && expiresIn == lastIntervalExpectedExpiresIn {
			assertThumbnailValuesAreSet(t, thumbnail, notifiedUpToFourtyFourDays.Contract)
			checkFourtyFourDayPurchaseLastNotificationSeen = true
		}
	}

	if checkNeverNotifiedPurchaseFirstNotificationSeen != true {
		t.Errorf("Expected notification missing: checkNeverNotifiedPurchaseFirstNotificationSeen")
	}
	if checkNeverNotifiedPurchaseSecondNotificationSeen != true {
		t.Errorf("Expected notification missing: checkNeverNotifiedPurchaseSecondNotificationSeen")
	}
	if checkNeverNotifiedPurchaseThirdNotificationSeen != true {
		t.Errorf("Expected notification missing: checkNeverNotifiedPurchaseThirdNotificationSeen")
	}
	if checkNeverNotifiedPurchaseLastNotificationSeen != true {
		t.Errorf("Expected notification missing: checkNeverNotifiedPurchaseLastNotificationSeen")
	}
	if checkFifteenDayPurchaseSecondNotificationSeen != true {
		t.Errorf("Expected notification missing: checkFifteenDayPurchaseSecondNotificationSeen")
	}
	if checkFifteenDayPurchaseThirdNotificationSeen != true {
		t.Errorf("Expected notification missing: checkFifteenDayPurchaseThirdNotificationSeen")
	}
	if checkFifteenDayPurchaseLastNotificationSeen != true {
		t.Errorf("Expected notification missing: checkFifteenDayPurchaseLastNotificationSeen")
	}
	if checkFourtyDayPurchaseThirdNotificationSeen != true {
		t.Errorf("Expected notification missing: checkFourtyDayPurchaseThirdNotificationSeen")
	}
	if checkFourtyDayPurchaseLastNotificationSeen != true {
		t.Errorf("Expected notification missing: checkFourtyDayPurchaseLastNotificationSeen")
	}
	if checkFourtyFourDayPurchaseLastNotificationSeen != true {
		t.Errorf("Expected notification missing: checkFourtyFourDayPurchaseLastNotificationSeen")
	}
}

func TestPerformTaskCreatesPurchaseExpiryNotifications(t *testing.T) {
	// Start each purchase 50 days ago and have the LastDisputeExpiryNotifiedAt at a day after
	// each notification is suppose to be sent. With no notifications already queued,
	// it should produce all the old notifications up to the most recent one expected
	var (
		broadcastChannel = make(chan repo.Notifier, 0)
		timeStart        = time.Now().Add(time.Duration(-50*24) * time.Hour)
		twelveHours      = time.Duration(12) * time.Hour
		firstInterval    = repo.BuyerDisputeExpiry_firstInterval
		secondInterval   = repo.BuyerDisputeExpiry_secondInterval
		lastInterval     = repo.BuyerDisputeExpiry_lastInterval

		// Produces no notifications as state is PENDING and not disputed
		neverNotifiedButUndisputeable = &repo.PurchaseRecord{
			Contract:                    factory.NewUndisputeableContract(),
			OrderID:                     "neverNotifiedButUndisputed",
			OrderState:                  pb.OrderState(pb.OrderState_PENDING),
			Timestamp:                   timeStart,
			DisputedAt:                  time.Unix(0, 0),
			LastDisputeExpiryNotifiedAt: time.Unix(0, 0),
		}
		// Produces notification for 15, 40 and 44 days
		neverNotified = &repo.PurchaseRecord{
			Contract:                    factory.NewDisputeableContract(),
			OrderID:                     "neverNotified",
			OrderState:                  pb.OrderState(pb.OrderState_DISPUTED),
			Timestamp:                   timeStart,
			DisputedAt:                  timeStart,
			LastDisputeExpiryNotifiedAt: time.Unix(0, 0),
		}
		// Produces notification for 40 and 44 days
		notifiedUpToFifteenDay = &repo.PurchaseRecord{
			Contract:                    factory.NewDisputeableContract(),
			OrderID:                     "notifiedUpToFifteenDay",
			OrderState:                  pb.OrderState(pb.OrderState_DISPUTED),
			Timestamp:                   timeStart,
			DisputedAt:                  timeStart,
			LastDisputeExpiryNotifiedAt: timeStart.Add(firstInterval + twelveHours),
		}
		// Produces notification for 44 days
		notifiedUpToFourtyDay = &repo.PurchaseRecord{
			Contract:                    factory.NewDisputeableContract(),
			OrderID:                     "notifiedUpToFourtyDay",
			OrderState:                  pb.OrderState(pb.OrderState_DISPUTED),
			Timestamp:                   timeStart,
			DisputedAt:                  timeStart,
			LastDisputeExpiryNotifiedAt: timeStart.Add(secondInterval + twelveHours),
		}
		// Produces no notifications as all have already been created
		notifiedUpToFourtyFiveDays = &repo.PurchaseRecord{
			Contract:                    factory.NewDisputeableContract(),
			OrderID:                     "notifiedUpToFourtyFiveDays",
			OrderState:                  pb.OrderState(pb.OrderState_DISPUTED),
			Timestamp:                   timeStart,
			DisputedAt:                  timeStart,
			LastDisputeExpiryNotifiedAt: timeStart.Add(lastInterval + twelveHours),
		}
		existingRecords = []*repo.PurchaseRecord{
			neverNotifiedButUndisputeable,
			neverNotified,
			notifiedUpToFifteenDay,
			notifiedUpToFourtyDay,
			notifiedUpToFourtyFiveDays,
		}

		appSchema = schema.MustNewCustomSchemaManager(schema.SchemaContext{
			DataPath:        schema.GenerateTempPath(),
			TestModeEnabled: true,
		})
	)
	neverNotified.Contract.VendorListings[0].Item.Images = []*pb.Listing_Item_Image{{Tiny: "never-tinyimagehashOne", Small: "never-smallimagehashOne"}}
	notifiedUpToFifteenDay.Contract.VendorListings[0].Item.Images = []*pb.Listing_Item_Image{{Tiny: "fifteen-tinyimagehashOne", Small: "fifteen-smallimagehashOne"}}
	notifiedUpToFourtyDay.Contract.VendorListings[0].Item.Images = []*pb.Listing_Item_Image{{Tiny: "fourty-tinyimagehashOne", Small: "fourty-smallimagehashOne"}}
	notifiedUpToFourtyFiveDays.Contract.VendorListings[0].Item.Images = []*pb.Listing_Item_Image{{Tiny: "fourtyfive-tinyimagehashOne", Small: "fourtyfive-smallimagehashOne"}}

	if err := appSchema.BuildSchemaDirectories(); err != nil {
		t.Fatal(err)
	}
	defer appSchema.DestroySchemaDirectories()
	if err := appSchema.InitializeDatabase(); err != nil {
		t.Fatal(err)
	}
	database, err := appSchema.OpenDatabase()
	if err != nil {
		t.Fatal(err)
	}

	m := jsonpb.Marshaler{
		EnumsAsInts:  false,
		EmitDefaults: true,
		Indent:       "    ",
		OrigName:     false,
	}
	for _, r := range existingRecords {
		contractData, err := m.MarshalToString(r.Contract)
		if err != nil {
			t.Fatal(err)
		}
		_, err = database.Exec("insert into purchases (orderID, contract, state, timestamp, lastDisputeExpiryNotifiedAt, disputedAt) values (?, ?, ?, ?, ?, ?)", r.OrderID, contractData, int(r.OrderState), int(r.Timestamp.Unix()), int(r.LastDisputeExpiryNotifiedAt.Unix()), int(r.DisputedAt.Unix()))
		if err != nil {
			t.Fatal(err)
		}
	}

	var (
		closeAsyncChannelVerifier = make(chan bool, 0)
		broadcastCount            = 0
	)
	go func() {
		for {
			select {
			case n := <-broadcastChannel:
				notifier, ok := n.(repo.Notifier)
				if !ok {
					t.Errorf("unable to cast as Notifier: %+v", n)
				}
				if notifier.GetType() == repo.NotifierTypeBuyerDisputeExpiry {
					broadcastCount++ // += 1
					t.Logf("Notification Recieved: %+v\n", notifier)
				} else {
					t.Errorf("Unexpected notification received: %s", notifier.GetType())
				}
			case <-closeAsyncChannelVerifier:
				return
			}
		}
	}()

	datastore := db.NewSQLiteDatastore(database, new(sync.Mutex))
	worker := &recordAgingNotifier{
		datastore: datastore,
		broadcast: broadcastChannel,
		logger:    logging.MustGetLogger("testRecordAgingNotifier"),
	}

	worker.PerformTask()

	// Verify Notifications received in channel
	closeAsyncChannelVerifier <- true
	if broadcastCount != 6 {
		t.Error("Expected 6 notifications to be broadcast, found", broadcastCount)
	}

	// Verify NotificationRecords in datastore
	rows, err := database.Query("select orderID, lastDisputeExpiryNotifiedAt from purchases")
	if err != nil {
		t.Fatal(err)
	}
	for rows.Next() {
		var (
			orderID                     string
			lastDisputeExpiryNotifiedAt int64
		)
		if err := rows.Scan(&orderID, &lastDisputeExpiryNotifiedAt); err != nil {
			t.Fatal(err)
		}
		switch orderID {
		case neverNotified.OrderID, notifiedUpToFifteenDay.OrderID, notifiedUpToFourtyDay.OrderID:
			durationFromActual := time.Now().Sub(time.Unix(lastDisputeExpiryNotifiedAt, 0))
			if durationFromActual > (time.Duration(5) * time.Second) {
				t.Errorf("Expected %s to have lastDisputeExpiryNotifiedAt set when executed, was %s", orderID, time.Unix(lastDisputeExpiryNotifiedAt, 0).String())
			}
		case notifiedUpToFourtyFiveDays.OrderID:
			if lastDisputeExpiryNotifiedAt != notifiedUpToFourtyFiveDays.LastDisputeExpiryNotifiedAt.Unix() {
				t.Error("Expected notifiedUpToFourtyFiveDays to not update LastDisputeExpiredNotifiedAt")
			}
		case neverNotifiedButUndisputeable.OrderID:
			if lastDisputeExpiryNotifiedAt != neverNotifiedButUndisputeable.LastDisputeExpiryNotifiedAt.Unix() {
				t.Error("Expected notifiedUpToFourtyFiveDays to not update LastDisputeExpiredNotifiedAt")
			}
		default:
			t.Error("Unexpected purchase")
		}
	}

	var count int64
	err = database.QueryRow("select count(*) from notifications").Scan(&count)
	if err != nil {
		t.Fatal(err)
	}
	if count != 6 {
		t.Errorf("Expected 6 notifications to be produced, but found %d", count)
	}

	rows, err = database.Query("select notifID, serializedNotification, timestamp from notifications")
	if err != nil {
		t.Fatal(err)
	}

	var (
		checkNeverNotifiedPurchaseFirstNotificationSeen  bool
		checkNeverNotifiedPurchaseSecondNotificationSeen bool
		checkNeverNotifiedPurchaseLastNotificationSeen   bool
		checkFifteenDayPurchaseSecondNotificationSeen    bool
		checkFifteenDayPurchaseLastNotificationSeen      bool
		checkFourtyDayPurchaseLastNotificationSeen       bool

		firstIntervalExpectedExpiresIn  = uint((repo.BuyerDisputeExpiry_totalDuration - repo.BuyerDisputeExpiry_firstInterval).Seconds())
		secondIntervalExpectedExpiresIn = uint((repo.BuyerDisputeExpiry_totalDuration - repo.BuyerDisputeExpiry_secondInterval).Seconds())
		lastIntervalExpectedExpiresIn   = uint((repo.BuyerDisputeExpiry_totalDuration - repo.BuyerDisputeExpiry_lastInterval).Seconds())
	)
	for rows.Next() {
		var (
			nID, nJSON string
			nTimestamp sql.NullInt64
			n          *repo.Notification
		)
		if err = rows.Scan(&nID, &nJSON, &nTimestamp); err != nil {
			t.Error(err)
			continue
		}
		if err := json.Unmarshal([]byte(nJSON), &n); err != nil {
			t.Error("Failed unmarshalling notification:", err.Error())
			continue
		}
		var (
			refID     = n.NotifierData.(repo.BuyerDisputeExpiry).OrderID
			expiresIn = n.NotifierData.(repo.BuyerDisputeExpiry).ExpiresIn
			thumbnail = n.NotifierData.(repo.BuyerDisputeExpiry).Thumbnail
		)
		if refID == neverNotified.OrderID {
			assertThumbnailValuesAreSet(t, thumbnail, neverNotified.Contract)
			if expiresIn == firstIntervalExpectedExpiresIn {
				checkNeverNotifiedPurchaseFirstNotificationSeen = true
				continue
			}
			if expiresIn == secondIntervalExpectedExpiresIn {
				checkNeverNotifiedPurchaseSecondNotificationSeen = true
				continue
			}
			if expiresIn == lastIntervalExpectedExpiresIn {
				checkNeverNotifiedPurchaseLastNotificationSeen = true
				continue
			}
		}
		if refID == notifiedUpToFifteenDay.OrderID {
			assertThumbnailValuesAreSet(t, thumbnail, notifiedUpToFifteenDay.Contract)
			if expiresIn == secondIntervalExpectedExpiresIn {
				checkFifteenDayPurchaseSecondNotificationSeen = true
				continue
			}
			if expiresIn == lastIntervalExpectedExpiresIn {
				checkFifteenDayPurchaseLastNotificationSeen = true
				continue
			}
		}
		if refID == notifiedUpToFourtyDay.OrderID {
			assertThumbnailValuesAreSet(t, thumbnail, notifiedUpToFourtyDay.Contract)
			if expiresIn == lastIntervalExpectedExpiresIn {
				checkFourtyDayPurchaseLastNotificationSeen = true
				continue
			}
		}
	}

	if checkNeverNotifiedPurchaseFirstNotificationSeen != true {
		t.Errorf("Expected notification missing: checkNeverNotifiedPurchaseFirstNotificationSeen")
	}
	if checkNeverNotifiedPurchaseSecondNotificationSeen != true {
		t.Errorf("Expected notification missing: checkNeverNotifiedPurchaseSecondNotificationSeen")
	}
	if checkNeverNotifiedPurchaseLastNotificationSeen != true {
		t.Errorf("Expected notification missing: checkNeverNotifiedPurchaseLastNotificationSeen")
	}
	if checkFifteenDayPurchaseSecondNotificationSeen != true {
		t.Errorf("Expected notification missing: checkFifteenDayPurchaseSecondNotificationSeen")
	}
	if checkFifteenDayPurchaseLastNotificationSeen != true {
		t.Errorf("Expected notification missing: checkFifteenDayPurchaseLastNotificationSeen")
	}
	if checkFourtyDayPurchaseLastNotificationSeen != true {
		t.Errorf("Expected notification missing: checkFourtyDayPurchaseLastNotificationSeen")
	}
}

// SALES
func TestPerformTaskCreatesVendorDisputeTimeoutNotifications(t *testing.T) {
	// Start each sale 50 days ago and have the lastDisputeTimeoutNotifiedAt at a day after
	// each notification is suppose to be sent. With no notifications already queued,
	// it should produce all the old notifications up to the most recent one expected
	var (
		broadcastChannel = make(chan repo.Notifier, 0)
		timeStart        = time.Now().Add(time.Duration(-50*24) * time.Hour)
		twelveHours      = time.Duration(12) * time.Hour
		lastInterval     = repo.VendorDisputeTimeout_lastInterval

		// Produces notification for 45 days
		neverNotified = &repo.SaleRecord{
			Contract:                     factory.NewDisputeableContract(),
			OrderID:                      "neverNotified",
			OrderState:                   pb.OrderState(pb.OrderState_FULFILLED),
			Timestamp:                    timeStart,
			LastDisputeTimeoutNotifiedAt: time.Unix(0, 0),
		}
		// Produces no notifications as all have already been created
		notifiedUpToFourtyFiveDays = &repo.SaleRecord{
			Contract:                     factory.NewDisputeableContract(),
			OrderID:                      "notifiedUpToFourtyFiveDays",
			OrderState:                   pb.OrderState(pb.OrderState_FULFILLED),
			Timestamp:                    timeStart,
			LastDisputeTimeoutNotifiedAt: timeStart.Add(lastInterval + twelveHours),
		}
		// Produces no notifications as contract is undisputeable
		neverNotifiedButUndisputeable = &repo.SaleRecord{
			Contract:                     factory.NewUndisputeableContract(),
			OrderID:                      "neverNotifiedButUndisputeable",
			OrderState:                   pb.OrderState(pb.OrderState_FULFILLED),
			Timestamp:                    timeStart,
			LastDisputeTimeoutNotifiedAt: time.Unix(0, 0),
		}
		existingRecords = []*repo.SaleRecord{
			neverNotified,
			notifiedUpToFourtyFiveDays,
			neverNotifiedButUndisputeable,
		}

		appSchema = schema.MustNewCustomSchemaManager(schema.SchemaContext{
			DataPath:        schema.GenerateTempPath(),
			TestModeEnabled: true,
		})
	)
	neverNotified.Contract.VendorListings[0].Item.Images = []*pb.Listing_Item_Image{{Tiny: "never-tinyimagehashOne", Small: "never-smallimagehashOne"}}
	notifiedUpToFourtyFiveDays.Contract.VendorListings[0].Item.Images = []*pb.Listing_Item_Image{{Tiny: "fourtyfive-tinyimagehashOne", Small: "fourtyfive-smallimagehashOne"}}

	if err := appSchema.BuildSchemaDirectories(); err != nil {
		t.Fatal(err)
	}
	defer appSchema.DestroySchemaDirectories()
	if err := appSchema.InitializeDatabase(); err != nil {
		t.Fatal(err)
	}
	database, err := appSchema.OpenDatabase()
	if err != nil {
		t.Fatal(err)
	}

	m := jsonpb.Marshaler{
		EnumsAsInts:  false,
		EmitDefaults: true,
		Indent:       "    ",
		OrigName:     false,
	}
	for _, r := range existingRecords {
		contractData, err := m.MarshalToString(r.Contract)
		if err != nil {
			t.Fatal(err)
		}
		_, err = database.Exec("insert into sales (orderID, contract, state, timestamp, lastDisputeTimeoutNotifiedAt) values (?, ?, ?, ?, ?)", r.OrderID, contractData, int(r.OrderState), int(r.Timestamp.Unix()), int(r.LastDisputeTimeoutNotifiedAt.Unix()))
		if err != nil {
			t.Fatal(err)
		}
	}

	var (
		closeAsyncChannelVerifier = make(chan bool, 0)
		broadcastCount            = 0
	)
	go func() {
		for {
			select {
			case n := <-broadcastChannel:
				notifier, ok := n.(repo.Notifier)
				if !ok {
					t.Errorf("unable to cast as Notifier: %+v", n)
				}
				t.Logf("notification received: %s", notifier)
				broadcastCount++ // += 1
			case <-closeAsyncChannelVerifier:
				return
			}
		}
	}()

	datastore := db.NewSQLiteDatastore(database, new(sync.Mutex))
	worker := &recordAgingNotifier{
		datastore: datastore,
		broadcast: broadcastChannel,
		logger:    logging.MustGetLogger("testRecordAgingNotifier"),
	}

	worker.PerformTask()

	// Verify Notifications received in channel
	closeAsyncChannelVerifier <- true
	if broadcastCount != 1 {
		t.Error("Expected 1 notifications to be broadcast, found", broadcastCount)
	}

	// Verify NotificationRecords in datastore
	rows, err := database.Query("select orderID, lastDisputeTimeoutNotifiedAt from sales")
	if err != nil {
		t.Fatal(err)
	}
	for rows.Next() {
		var (
			orderID                      string
			lastDisputeTimeoutNotifiedAt int64
		)
		if err := rows.Scan(&orderID, &lastDisputeTimeoutNotifiedAt); err != nil {
			t.Fatal(err)
		}
		switch orderID {
		case neverNotified.OrderID:
			durationFromActual := time.Now().Sub(time.Unix(lastDisputeTimeoutNotifiedAt, 0))
			if durationFromActual > (time.Duration(5) * time.Second) {
				t.Errorf("Expected %s to have lastDisputeTimeoutNotifiedAt set when executed, was %s", orderID, time.Unix(lastDisputeTimeoutNotifiedAt, 0).String())
			}
		case notifiedUpToFourtyFiveDays.OrderID:
			if lastDisputeTimeoutNotifiedAt != notifiedUpToFourtyFiveDays.LastDisputeTimeoutNotifiedAt.Unix() {
				t.Error("Expected notifiedUpToFourtyFiveDays to not update LastDisputeTimeoutNotifiedAt")
			}
		case neverNotifiedButUndisputeable.OrderID:
			if lastDisputeTimeoutNotifiedAt != neverNotifiedButUndisputeable.LastDisputeTimeoutNotifiedAt.Unix() {
				t.Error("Expected notifiedUpToFourtyFiveDays to not update LastDisputeTimeoutNotifiedAt")
			}
		default:
			t.Error("Unexpected sale")
		}
	}

	var count int64
	err = database.QueryRow("select count(*) from notifications").Scan(&count)
	if err != nil {
		t.Fatal(err)
	}
	if count != 1 {
		t.Errorf("Expected 1 notification to be produced, but found %d", count)
	}

	rows, err = database.Query("select notifID, serializedNotification, timestamp from notifications")
	if err != nil {
		t.Fatal(err)
	}

	var (
		checkNeverNotifiedSaleLastNotificationSeen bool

		firstIntervalExpectedExpiresIn = uint(0)
	)
	for rows.Next() {
		var (
			nID, nJSON string
			nTimestamp sql.NullInt64
			n          *repo.Notification
		)
		if err = rows.Scan(&nID, &nJSON, &nTimestamp); err != nil {
			t.Error(err)
			continue
		}
		if err := json.Unmarshal([]byte(nJSON), &n); err != nil {
			t.Error("Failed unmarshalling notification:", err.Error())
			continue
		}
		var (
			refID     = n.NotifierData.(repo.VendorDisputeTimeout).OrderID
			expiresIn = n.NotifierData.(repo.VendorDisputeTimeout).ExpiresIn
			thumbnail = n.NotifierData.(repo.VendorDisputeTimeout).Thumbnail
		)
		if refID == neverNotified.OrderID && expiresIn == firstIntervalExpectedExpiresIn {
			assertThumbnailValuesAreSet(t, thumbnail, neverNotified.Contract)
			checkNeverNotifiedSaleLastNotificationSeen = true
			continue
		}
	}

	if checkNeverNotifiedSaleLastNotificationSeen != true {
		t.Errorf("Expected notification missing: checkNeverNotifiedSale_LastNotificationSeen")
	}
}

func assertThumbnailValuesAreSet(t *testing.T, actualThumbnails repo.Thumbnail, contract *pb.RicardianContract) {
	if len(contract.VendorListings) == 0 {
		t.Error("Expected contract to have VendorListings but was empty. Unable to assert Thumbnail values.")
		return
	}
	if len(contract.VendorListings[0].Item.Images) == 0 {
		t.Error("Expected contract to have Item Images but was empty. Unable to assert Thumbnail values.")
		return
	}
	var (
		expectedTinyThumbnail  = contract.VendorListings[0].Item.Images[0].Tiny
		expectedSmallThumbnail = contract.VendorListings[0].Item.Images[0].Small
	)
	if expectedTinyThumbnail != actualThumbnails.Tiny {
		t.Error("Expected notification to include the tiny thumbnail")
		t.Error("Actual:", actualThumbnails.Tiny, "Expected:", expectedTinyThumbnail)
		t.Logf("Contract: %+v\n", contract)
	}
	if expectedSmallThumbnail != actualThumbnails.Small {
		t.Error("Expected notification to include the small thumbnail")
		t.Error("Actual:", actualThumbnails.Small, "Expected:", expectedSmallThumbnail)
		t.Logf("Contract: %+v\n", contract)
	}
}

redpajama_set_name: RedPajamaGithub


text:
He who speaks first, or laughs first, or lats (lets) their teeth be seen, gets nine nips, nine nobs, an* nine double douncornes, an' a gueed blow on the back o' the head.�Corgarff (Rev. Dr. Gregor).
Eendy, Beendy.
Eendy, Beendy, baniba, roe,
Caught a chicken by the toe;
To the east, to the west,
To the old crow's nest,
Hopping in the garden, swimming in the sea,
If you want a pretty girl, please take me.
�N. Scotland, locality forgotten (Rev. Dr. Gregor).
One girl dances forward from a line of children singing the words. Another from a line opposite responds, and they dance together. They look first to the east and then to the west by turning their heads in those directions alternately.
Farmer's Den, The.
All players but one form a ring, this one stands in the centre. The ring dances round singing the words� The farmer in his den, the farmer in his den, For it's oh, my dearie, the farmer's in his den. For the farmer takes a wife, For the farmer takes a wife; For it's oh, my dearie, the farmer takes a wife. The child in centre then chooses one from the circle, who goes in the middle, and the ring dances round again singing�
For the wife takes a child, &c. (as above). And choosing another child from the ring, then�
For the child takes a nurse, &c. (as above), For the nurse takes a dog, &c. (as above). Then all the players join in singing� For we all clap the dog, For we all clap the dog. For it's oh ! my dearie, we all clap the dog. While singing this all the players pat the one who was chosen as "dog" on his or her back.�Auchencairn, N.B. (Mary Haddon).


Nike Air Max 90 Hyperfuse PRM Womens Wine Red are intimate in its design and material. Once they come into the market.they are snapped up by the Nike Air Max 90 Hyperfuse Womens fans soon. Welcome to our store to find one pair Nike Air Max 90 Hyperfuse Womens which is your style and fits you best.


Nip-nap & Curlys are darn cute cat toys. Catnip infused using USA grown organic catnip. Potent, long lasting catnip scent that is irresistible to your cat! Hand-crafted using colorful cotton fabric and a synthetic filler. Vary in size from 2.25'' to 3'' in length depending on style.


text:
Q: Python Numba Recursive Method Implementation in Numba Class I am currently implementing a Python class wrapped by the Numba @jitcalss decorator.
My problem is about writing recursive methods. I know there are ways of writing recursive methods as iterative methods as well, but in my case, I believe that recursive use helps me to write a more traceable program script. As far as I see, Numba does not directly support recursive methods declared in Numba classes. The code below does not present my case directly but it is equivalent to my problem. When I run the code, the error thrown by the Python is given below as well. Any kind of suggestion/improvement/help is welcome
import numba

spec = []
@numba.experimental.jitclass(spec)
class basicClass(object):
    def __init__(self):
        pass

    def factorial(self,x):
        if x==1:
            return 1
        else:
            return x*self.factorial(x-1)

# MAIN BELOW
class_object = basicClass()
class_object.factorial(5)

The error is given below:
TypingError: Failed in nopython mode pipeline (step: nopython frontend)
- Resolution failure for literal arguments:
Failed in nopython mode pipeline (step: nopython frontend)
- Resolution failure for literal arguments:
Failed in nopython mode pipeline (step: nopython frontend)
compiler re-entrant to the same function signature
- Resolution failure for non-literal arguments:
None

During: resolving callee type: BoundFunction((<class 'numba.core.types.misc.ClassInstanceType'>, 'factorial') for instance.jitclass.basicClass#22839d9cf70<>)
During: typing of call at <ipython-input-7-ab7b9737001d> (16)

File "<ipython-input-7-ab7b9737001d>", line 16:
    def factorial(self,x):
        <source elided>
        else:
            return x*self.factorial(x-1)
            ^

- Resolution failure for non-literal arguments:
None

During: resolving callee type: BoundFunction((<class 'numba.core.types.misc.ClassInstanceType'>, 'factorial') for instance.jitclass.basicClass#22839d9cf70<>)
During: typing of call at <string> (3)

File "<string>", line 3:

A: This is not supported. The documentation states:

Recursion support in numba is currently limited to self-recursion with explicit type annotation for the function. This limitation comes from the inability to determine the return type of a recursive call.

The thing is you cannot specify a type of the function since it depends of self which contains the function...

redpajama_set_name: RedPajamaStackExchange


Our Office is located in the financial district of Miami. Brickell Avenue is the Wallstreet of Miami, all important Banks are located here. You find a various of Law Offices, the Consulate of Peru, the General Attorney of Florida, the Florida Bar and as well some other companies in our Office Building.


Qingming, in Chinese, means 'clear and bright', is one of the 24 Solar Terms, and is an important traditional festival referred to as Tomb-Sweeping Day or the Mourning Day. The festival can be traced back to the Zhou Dynasty (1046-256 BC). The day is for commemorating ancestors and sweeping tombs, and is also the common link between the Chinese nations. The words "Clear" and "Bright" describe the weather in this period such that it is a golden opportunity for spring cultivation and getting close to nature. The day before Qingming Festival is Cold Food Day when people are forbidden fire and only eat cold food. As time went by, the two festivals intermingled.
On the 20th May, 2006, Qingming Festival was added to the National Intangible Cultural Heritage List.
In The Spring and Autumn period (770-475BC), Chong'er, prince of the Jin State, with his followers ran away from his country to avoid persecution. They had suffered hunger and cold in exile. Legend has it that a supporter named Jie Zitui cut a piece of flesh from his own leg to save the starving Chong'er. After 19 years, when Chong'er succeeded to his father's throne, his followers all strived for credit, except for the loyal Jie Zitui. Therefore, other followers were rewarded, and Jie Zitui was totally forgotten. Then Jie retired with his mother to the Mian Mountain.
Chong'er, Duke Wen of the Jin State, felt guilty, and wanted to bring him back. But it is very difficult to find people in the steep mountains and dense forests. Someone suggested that he set a fire to smoke Jie Zitui out. Following the Duke's order, the fire was lit, and lasted three whole days and nights. As the result, Jie and his mother were burned to death beside an old willow. There was a blood-letter that said, "Cutting flesh only for lord, hoping owner always develops clear and bright policies". After that, Duke Chong'er wailed for Jie's death and ordered all fires of every house to be put out and only cold food to be allowed on the anniversary of his death.
Sacrifices have varied according to different periods. In the cemetery, Chinese people burn some paper money in the belief that deceased relatives can use it in their afterlife. It is a Confucian tradition in China. Nowadays, those offerings have become more fashionable and keep up with times.
Paper money, golden paper ingots, and some candles are in increased demand during the Qingming Festival. It is common to visit relatives' graves and offer flowers on it and bring some fresh fruits, homemade food, and white spirit.
These days, paper offerings of items on Sweeping Tomb Day are faux iPhone products, luxury cars with a driver, branded bags and clothes, and enormous villas with swimming pools. In recent years, users on the internet can find a set of services of sweeping tombs for someone who cannot do it in person, to clean graves, place flowers, and pay respect. Even the ways to express devotion to the deceased has become virtual. Many mourners can do their sacrifice online. Users can create web shrines with candles on the sacrifice website, and then they can offer different kinds of virtual tributes, such as pictures of one's favorite foods and flowers.
Artists are keen on an art creation about the Qingming Festival. "Along the River During the Qingming Festival" is a panoramic painting by Zhang Zeduan in the Northern Dynasty (960-1127AD). It is one of the China's top 10 most famous paintings and is treated as a national treasure collected in the Palace Museum of Beijing. This hand scroll painting is 25.2 cm in height and 528.7cm long. It vividly depicts the lives of people of all ranks in the capital city of Bianjing (today's Kaifeng, Henan Province) during the Qingming Festival. The bustling road, busy market, vigorous village, heavy traffic, and business trade reveal the splendor and real economic condition of the capital city at that time.


WE HAVE A FEW GOING TO MANY CEDARS CAMPGROUND IN HOWENWALD, TN.. CHECK OUT THIER SITE. GREAT PLACE.. CAMP SITES ARE HUDGE COMPARED TO MOST.. GREAT RIDING.. THEY WILL HAVE MUSIC AND DANCING SAT NITE. ANYONE ELSE GOIN???
I have a really good picture of you from the ride at Cordell Hull when everyone was saddling up...do you want me to send it to you or post it?
MY Arabian mare is on craigs list finally ... hope all is well with yall... still trying to kick my cold.
Howdy Sista! How R U Feeling??
Hey cowgirl hope you doing good and can't wait to saddle up and do it again... Take care and I will talk to ya soon.
Can't believe you know Snookie Rickets!!!!!!!
He got me set up in the horse riding business about 12 years ago. I hadn't ridden since I was a kid but always wanted to get back to riding some day. Finally did it.
Thanks woman and great picture!
Hi Tina & Bobby--Would Snookie be in Watertown? In years past I did some riding with Penny Stuart on her land and I believe on Snookie's. Would this be the same person??


I have sold a property at 2997 SOUTHERN CRES in Abbotsford.
One owner! 2 storey full basement home, 10,156 sq.ft. private greenbelt park like lot complete with in ground pool. Vaulted ceiling, spiral staircase, hardwood floor, carousel family size eating nook adjacent to large family room. Mainfloor den, 3 bedrooms. Huge master with sitting area and 4 pce ensuite. Pride of ownership is evident in this home with continuous ongoing detail and maintenance. Easy East/West freeway access for the commuter.


Need to build your brand value? Need to increase sales? Need free yet effective advertising for decades? Our Brand Building Service will guarantee exponential increase in sales, for decades to come. The best thing is you will not only get everything free but earn huge revenues as well.
Earn advertising revenue instead of spending on advertising?
You do the above by doing the following.
Too much work, we know, but we have a way out of that. Let us do it all for you. Simple. You concentrate on your core business. Our Brand Building Service is that one stone for you.
Various ways we will promote the magazine, the newsletter, and the portal throughout the target area.
What Else for Your Brand-Building?
Your social media presence established through other social media accounts like Twitter, Instagram, etc.
To make all the above happen, buy Cosmos Media's BRAND-BUILDING SERVICE.
What makes us confident of the success of the media model for you?


Scrap car Purley, sell car Purley, scrap my car in Purley!
If you are in Purley or any of its surrounding areas and you need to sell or scrap a car for cash quickly and easily, you'll be glad to know we are here to help! You can sell your car for CASH and have it collected from Purley for FREE. We buy all types of used cars and vans fro £50 to £20000.
We are always looking for cars to buy for cash in Purley, so it really doesn't matter what condition your vehicle is in – we will offer you a fair cash price for your car and buy it off you. If you car has been in an accident, or failed its MOT or has broken down, just get in touch and we will agree a price and arrange to collect your car.
We will arrange for one of our experienced drivers from Purley to pick up your car and pay you the agreed price in CASH (as long as the car is as described). Then we will take it away, for free, to our local depot. Once we have transported your car from Purley, we will take care of the necessary DVLA paperwork. We are fully licensed to collect scrap cars.


We're PUMPED for THIS Friday night!
For the past few months we've been working gigs with one of our personal favorite bands; The Six Shot Revival. Let me tell you, we KILL it those nights. Not only are we all doing what we want to do on that stage, we all enjoy the other entertainment, too! THIS Friday, January 18th, at Ground Zero in Spartanburg, SC, Captain & Maybelle will be hosting a night of music and more with The Six Shot Revival, Shotgun Disciple and Red Seriph.
We have a sweet lineup and sideshow stunts to keep everyone going! At this club, the first club in the country that let the Captain (aka Chris Steele) take a microphone in front of a crowd, we ALWAYS throw down like we're at home! Limits WILL get pushed. The music WILL get loud. And the night WILL be memorable for everyone there.


text:
Advertising in social-media age: A whole new ball game
July 15, 2013 13:35 IST
Globally, 90 per cent of the advertising fails to grab consumers' attention. On the other hand, consumers are increasingly moving to the digital media to air their views on businesses and brands. With this in mind, the concept of earned media as a marketing tool has gained currency among marketers. But does it offer enough value?
And is it as free as it is touted to be?
Homi Battiwalla, Senior Director, Marketing - Colas, Juices & Hydration, PepsiCo India
The spread of the social media has drastically changed the way consumers perceive and absorb marketing messages. They are engaging more often in real-time conversations, particularly on social networks and other digital platforms. This has propelled marketers to relook at their marketing campaigns to deepen consumer engagement in a more cost effective manner. Today, the social marketing media - paid, earned and owned - define the level of consumer engagement, the various forms of financing and and the metrics for measuring performance.
Of the three tools, earned media is the most sought-after since it helps a brand create authentic social media footprint. For example, a consumer is more likely to buy a product based on an earned media recommendation from a Facebook friend. Having said that, there is no one-size-fits-all solution when it comes to deciding the marketing tools for a social media campaign. The answer will be different for different brands.
Click NEXT to read more...
At PepsiCo India, we believe in investing in all forms media marketing for each of our campaigns. We have equal focus on paid and earned media. To elaborate, along with traditional advertising and marketing, we invest extensively in paid media through social networking channels such as Twitter, Facebook and leading search websites such as Google and Yahoo!
Further, we leverage our own channels - that is, the company website, Facebook fan page etc across the digital domain on a regular basis. As a company, we acknowledge the fact that consumers need a platform to express their opinions and initiate a dialogue once they are exposed to traditional media and advertising.
In that sense, the digital medium, whether paid or owned, acts as a response mechanism for consumers. It is important for brands to consider how they can plan the content to allow users to express themselves. For the launch of Pepsi's new campaign for this year, 'Oh Yes Abhi!', we used a great mix of traditional and online media to bring alive our brand positioning of 'impatience'.
Starting our teaser campaign online, we went on to initiate conversations around the idea of 'impatience' through Twitter and Facebook. On Facebook, we developed posters and on Twitter, we created some 'abhi' (right now) moments for our consumers that exemplified the various dimensions of 'impatience'.
Prema Sagar, Principal & founder, Genesis Burson-Marsteller
If you were to ask any successful individual about his or her mantra for success, you are most likely to hear him talk about his focus on the goal. There is no single path to reach there. Often it is a combination of things that help an individual get where he or she wants to. In business it is no different. To my mind, a corporation or a brand cannot focus on paid or earned media in isolation; it cannot be an either-or situation.
The communication needs and the objectives of a brand will dictate the vehicles it will choose. And more often than not, it will be a mix of the two. As a brand, you have to communicate directly to your consumers. At the same time, you do want to initiate forced positive conversations among consumer groups to help grow the brand. Consumer perceptions about a brand are not built solely on what the company says.
They are also formed on the basis of their experiences and those of people they know. Word of mouth is not a new phenomenon. In the world of social media, your circle expands manifold and there are as many voices as there are people. There is no doubt that it has created a big opportunity for brands.
But brands and corporations should not confuse the message with the medium. Twenty-first century communication will be defined by an integrated approach to brand building and corporate reputation. Brands will have a message and that message will be translated on various platforms, paid and earned, by their partners. Only a united approach will lead to a strong return on investment for the company.
This brings me to the critical aspect of communication in the information age - the fact that content is the king. Whether it is for direct consumption by the consumer or for reaching out to the influencers or for generating conversations in the digital space, unless the content is appealing to your audience, it will not result in the kind of impact a brand will aspire to.
Coming back to the issue of individual success and the path one may choose to achieve it, there are lessons for brands to learn. As long as your approach to communication is founded on strong ethics, your brand is secure.
This ranges from the quality of claims you make in an advertisement to making adequate disclosures on social media platforms (when say you are tweeting about a brand you work on). Paid media in the garb of earned media is a recipe for crisis and could inflict long-term damage to organisations, brands and individuals. That is what we must guard ourselves against.
Harish Bijoor, Brand-expert & CEO, Harish Bijoor Consults
The brand manager is in a dilemma today. In the old days, all media was paid for. Today, you have yet another animal on the rampage: earned media. While paid media is what you buy as ads, irrespective of the medium, earned media is what you earn as coverage in the media that is viral, editorial in disguise and C2C (consumer to consumer) with reference to reach, credibility and consumer buy-in.
The dilemma is simple and complex at the same time. A simplistic level the question is which is better. Which is the one that gives your brand the best bang. The complex part of the dilemma is the measurement of efficacy. How do you know which avatar of media worked for your brand? How do you know what paid media did for you as opposed to earned media? And how do you plant your marketing bucks on each?
I will put my weight behind paid media for now. Paid media is specific, controlled by the brand to the point of it being a science, is dished out with consistency which a consumer is used to and largely, the credibility of paid media remain reasonably intact to date.
While advertising is being trusted less and less by consumers, it is yet to reach the bathos point in India in terms of credibility and credulity norms. To that extent, all paid mediums are still trusted, except paid PR. Paid PR sadly has hit the bathos point in India with consumers switching off any communication that looks overtly paid for in PR terms.
Advertising, on the other hand, does not suffer that status and stigma as yet. Consumers are aware that all advertising is paid for by the brand. So there is no subterfuge. The consumer does believe that it is the right and the privilege of the brand to advertise itself overtly. In many segments, advertising is seen to be a form of public service as well, as it is informative and explains what the consumer wants to learn.
Earned media is, however, a tough cookie to understand. While in the early days, what you earned through such media exposure was considered 'editorial' in nature and 'user-centric' in output, now there is growing consumer distrust in such messages as well.
As the tales of brand interventions in the earned media space gain ground, consumers have figured out that tweets, Facebook likes and LinkedIn messages could be 'bought' as well. My point is a simple one. Most consumers still love brands and understand the role, power and utility of paid-for advertising. She distrusts paid PR because it looks part editorial and part paid-for.


The Heritage Leather 1001 Axe Sheath is a top quality leather sheath that will fit most standard 4.5lb axes. Made from genuine top grain leather this axe sheath will not only protect your axe but will look good once it has been installed onto your axe. All Heritage Leather Company products are Made in the USA.
The Heritage Leather Company 1001 Axe Sheath is the standard axe sheath for any 4.5lb axe. This axe sheath is widely used in the commercial, government, and military sectors with our stock of them coming direct from the US military. If you have a standard 4.5lb axe you deserve the best sheath for it and this leather axe sheath from Heritage is by far the best made axe sheath.


text:
Merike Rõtova (née Merike Kuningas; born August 19, 1936), is an Estonian chess player, International Correspondence Chess Grandmaster (LGM, 1996).

Biography
Rõtova was born in Tallinn. Her father was literary scholar, literary and theatre critic, cultural historian and translator Oska Kuningas. Her younger sister was writer Astrid Reinla and her first cousin was actress Helle Kuningas. She graduated from secondary school in Türi (1954) and the University of Tartu (1959). From 1959 to 1978 she worked as a literary editor in the Estonian radio, from 1978 to 1980 - as an editor in the publishing house "Eesti Raamat", but from 1980 to 1991 - as a coach of youth children sports school. Since 1992 the Estonian Correspondence Chess Federation board member.

Her father Oskar Kuningas (1911-1997), also a chess player and journalist, taught her to play chess. Rõtova won silver (1975) and bronze medals (1999) in Estonian Women's Chess Championship. Twice (1993, 1994) she had the second place in the World Senior Chess Championship.

Rõtova is a correspondence chess player who holds the titles of Lady International Correspondence Chess Master (LIM, 1991), Lady International Correspondence Chess Grandmaster (LGM, 1996), and won Silver Bertl von Massow Medal (2003) and Gold Bertl von Massow Medal (2008). She won bronze medal in 2nd Ladies Correspondence Chess World Championship (1972–77) and silver medal in 3rd Ladies Correspondence Chess World Championship (1978–84). As member the USSR team won the gold medal in 3rd Ladies Correspondence Chess Olympiad Final (1986–92).

Rõtova is married to an Estonian chess master Boris Rõtov (1937-1987). The couple have a son, Igor Rõtov (1963-) and daughter Regina Narva (WFM, 1970-), who were also chess players. Her granddaughters Triin Narva (WCM, 1994-) and Mai Narva (WIM, 1999-) are also chess players. Mai Narva is two times Estonian Women's Chess Championship winner (2014, 2016) and European U16 Girls Champion (2014).

References

External links

1936 births
Living people
Estonian female chess players
Soviet female chess players
University of Tartu alumni
Sportspeople from Tallinn

redpajama_set_name: RedPajamaWikipedia


text:
class Image
  class Url
    SUBDIRECTORIES = {
      full_size: "orig",
      huge: "1280",
      large: "960",
      medium: "640",
      small: "320",
      thumbnail: "thumb"
    }

    SUBDIRECTORY_TO_SIZE = {
      "orig"  => :full_size,
      "1280"  => :huge,
      "960"   => :large,
      "640"   => :medium,
      "320"   => :small,
      "thumb" => :thumbnail
    }

    attr_accessor :size, :id, :transferred, :extension

    def initialize(args)
      size = args[:size]
      size = SUBDIRECTORY_TO_SIZE[size] unless size.is_a?(Symbol)
      size = :full_size if size == :original
      self.size        = size
      self.id          = args[:id]
      self.transferred = args[:transferred]
      self.extension   = args[:extension]
    end

    def url
      for source in source_order
        return source_url(source) if source_exists?(source)
      end
      source_url(fallback_source)
    end

    def source_exists?(source)
      spec = specs(source)[:test]
      case spec
      when :transferred_flag
        transferred
      when /^file:/
        path = spec[7..-1]
        local_file_exists?(path)
      when /^http:/
        remote_file_exists?(url = spec)
      else
        fail "Invalid image source test spec for #{source.inspect}: #{spec.inspect}"
      end
    end

    def local_file_exists?(path)
      File.exist?(file_name(path))
    end

    def remote_file_exists?(url)
      url = URI.parse(url)
      result = Net::HTTP.new(url.host, url.port).request_head(url.path)
      result.code == 200
    end

    def source_url(source)
      spec = specs(source)[:read]
      file_name(spec)
    end

    def file_name(root)
      "#{root}/#{subdirectory}/#{id}.#{extension}"
    end

    def subdirectory
      SUBDIRECTORIES[size] || fail("Invalid size: #{size.inspect}")
    end

    def source_order
      MO.image_precedence[size] || MO.image_precedence[:default]
    end

    def fallback_source
      MO.image_fallback_source
    end

    def specs(source)
      MO.image_sources[source] || fail("Missing image source: #{source.inspect}")
    end
  end
end


text:
Adrenaline-fueled count shows scant growth in Mexican wolf population
"We need the data so that we can make better decisions going forward for wolf recovery," veterinarian Susan Dicks (right) said of the testing and collaring of the wolves. "We can also make better decisions about wolf impact on humans and livestock." (Jenna Miller/Cronkite News)
Jenna Miller/Cronkite News
Originally Published: March 6, 2018 9:47 a.m.
Veterinarian Ole Alcumbrac said his position in the count is gunner. He is accompanied in the helicopter by a pilot and a "mugger," a biologist who tracks the wolves by listening to the frequencies emitted by their collars. (Jenna Miller/Cronkite News)
ALPINE, Ariz. — Ole Alcumbrac has just eight minutes.
A wolf sprints across a field of dry grass, a helicopter clattering above. About 30 feet above ground, Alcumbrac —eyes glued to the wolf — leans out of an open door, into the turbulence, raises his dart gun and aims for its rump.
The chase is adrenaline-fueled, but there's a rhythm. If Alcumbrac, a project veterinarian for the U.S. Fish and Wildlife Service, fails to dart the wolf in eight minutes, he must allow it to rest for at least five minutes before trying one more time. And if he doesn't hit his target on the second attempt, the wolf is free to go — until another day.
On this trip in late January, Alcumbrac's aim is true; the wolf slows to a crawl, then stops.
"It's a challenge, plain and simple," Alcumbrac said.
The chase was part of the federal agency's annual program to monitor endangered Mexican gray wolves living in the wilds of eastern Arizona and western New Mexico. The service tries to get an accurate count of the wolves, which have been listed as endangered since 1976.
The Mexican gray wolf once was prevalent in parts of the Southwest, but intensive trapping and hunting had nearly wiped out the wolves by the 1970s. They are the smallest, rarest and genetically most distinct subspecies of gray wolves in North America, officials said.
A program to reintroduce the wolves into the wild began 20 years ago, and the population has been growing slowly.
The field team said the information gathered in annual surveys plays an important role in that growth. They take great pains to capture and care for the wolves.
Alcumbrac stays within the eight-minute limit because he doesn't want to cause unnecessary stress or overheat the wolf, which could injure or kill it.
The dart, which is filled with the sedative Telazol, will knock out a wolf for only a short time. The team has to work quickly, landing the copter, racing to the wolf, and carting it back to the helicopter for a quick trip to a waiting team of biologists and veterinarians, stationed in trailers or makeshift facilities in rural locations across the wolves' territory.
The team treats the captured wolves for any injuries, administers vaccines and fits the wolves with tracking collars before releasing them at the same spot where they were captured. The medical treatment is meant to keep the wolves healthy, and the collars help to monitor their movements throughout the year.
This year, the team captured and collared 24 Mexican gray wolves, more than any previous year.
However, after strong population growth of 16 wolves in 2016, the 2017 survey showed an increase of just one in the past year, bringing the number in Arizona and New Mexico to 114.
"It was a disappointment that we didn't grow this year," said Sherry Barrett, U.S. Fish and Wildlife Service Mexican wolf recovery coordinator. "It slows our time towards recovery."
She said officials hope for a 10 percent population growth each year, but they expect some fluctuation. They measure the growth rate as an average over a number of years to account for these disparities. The average population growth rate over the past 10 years was 7 percent.
Wildlife advocates file a lawsuit against a revised Mexican Gray Wolf Recovery Plan | Cronkite News by Cronkite News
However, a group of conservationists and environmental advocacy groups say progress isn't being made quickly enough. They sued the federal government earlier this year in an attempt to strike down a revised Fish and Wildlife management plan for the Mexican gray wolf.
The original management plan for the subspecies, approved in 1982, sought to establish 750 wolves among three prime habitat areas: two in the Southern Rockies of Colorado, Utah and northern Arizona, and one in eastern Arizona and western New Mexico.
Of those, officials have only reintroduced the wolf to Arizona and New Mexico habitats. They also are working with the Mexican government to monitor a population of 30 wolves in Mexico.
The revised plan, which was announced in November, calls for downlisting the Mexican gray from an endangered species to threatened species if the population reaches 320 wolves between the U.S. animals and one population in Mexico. The government would take the wolf off the list entirely if the U.S. population alone reaches 320 wolves. The plan does not call reintroducing wolves into any additional U.S. habitats in the Southern Rockies.
Conservation groups filed two lawsuits in the U.S. District Court of Arizona, and they hope to compel the U.S. Fish and Wildlife Service to establish a new wolf management plan.
"(The plan) is just not going to do an adequate job of recovering the Mexican gray wolf," said Christopher Smith, wildlife advocate at WildEarth Guardians, a conservation group in Santa Fe that is a co-plaintiff in one of the suits. "It's a massive departure from the science-based draft plan that they had initially proposed."
Critics of the revised plan said the habitat for the second wolf population in Mexico is inferior to the available habitats in the Southern Rockies. They also say the current wolf population will struggle to thrive if the government does not expand its habitat.
According to the U.S. Fish and Wildlife Service management plan, the wolves may not roam north of Interstate 40, which runs east to west across north-central Arizona. If they find a wolf outside the boundaries, they capture and return it to its designated habitat.
Wolves have long been a hot button political issue, and the wolf plan has faced opposition from ranchers concerned about the wolves preying on livestock. Smith, of WildEarth Guardians, said he believes vocal ranchers have had a negative impact on the policy.
Matthew Bishop, an environmental activist and lawyer from Western Environmental Law Center, said both lawsuits are based on the 1973 Endangered Species Act, which requires the government to manage endangered species according to the best available science. The nonprofit, which focuses on conservation in the West, is a co-plaintiff in one suit.
"We think this (revision), at the end of the day, has to do more with political boundaries and political concerns," Bishop said. "It violates the law."
A Fish and Wildlife spokesman declined to comment, saying the agency can't talk about pending litigation.
However, John Oakleaf, Fish and Wildlife Services field projects coordinator, said the revised plan reflects the gains the program has made in the past 35 years. When the original plan was written, the Mexican gray wolf program was working to build a captive population, and no animals had been released into the wild.
Oakleaf, who helped to draft the revision, said it's more realistic and concrete than the previous plan because it establishes clear goals the federal government must achieve to end its involvement.
"That's really our goal, to turn it over to state management and step away," Oakleaf said. "I'll be the happiest man when that happens."
He said they hope the second population established in Mexico succeeds, but if the wolf can't thrive there, the agency will consider other habitats. Although the wolf program has been controversial, Oakleaf said he believes administrators have struck an appropriate balance.
For his part, Alcumbrac tries to stay focused on the progress made to date.
"It's just been a great deal of satisfaction and pleasure for the past 12 years seeing a population return from almost extinction," he said.
Arizona files motions to protect interest in Mexican wolf recovery
Groups file suit challenging Mexican wolf recovery plan
Feds release final revisions to Mexican wolf recovery plan, detail species' road to recovery
AZGFD, regional business leaders address Mexican wolf recovery plan
Mexican Gray wolves rebound; latest numbers cause for optimism