 of Technology, University of Michigan, Lawrence Berkeley National Laboratory, and University of Chicago, expressed their views and shared their latest cutting-edge research results. The conference, during which participants gave excellent talks and joined in heated discussions on a wide spectrum of topics, was widely praised by Chinese and foreign experts.
This conference has significantly improved China's international image as a major player in the studies of ultrafast spectroscopy of correlated quantum materials and nurtured China's capacity in the research area. The international participating colleagues hope that USCQM conferences would continue to be held, and would contribute to the development of this particular field on the international level and become an international benchmark conference of the field.How do you repurpose your content to digital formats quickly, accurately and cost effectively? You need a content conversion specialist who delivers.
As the world moves to an increasingly digital approach to accessing information, how do you keep up with the demand for your content across formats and platforms?
Let DDD help you convert legacy content into new digital formats. With more than a decade of experience in content management and production services, DDD has the knowledge and expertise to help you deliver high quality new or repurposed content in multiple formats.
DDD's Flexible and Versatile Approach to Content Conversion:
- Your content can start in any format. We use the optimal mix of OCR, automated data capture and double-key data entry to achieve accuracy rates as high as 99.995%.
- Your content is accurately converted from any source, including books, photos, forms, periodicals, and image files.
- Your content will be delivered in any format you require, including XML, HTML, PDF, ePub, Pagemaker, inDesign, FrameMaker, METS/ALTO, and industry standard database formats.
Benefits:
- Improve Engagement with Your Users: DDD’s metadata and tagging services ensure that your content will be found by search engines and readily accessible online or in database environments. With DDD as your content services partner, your content will reach new markets and generate new revenue streams by improving its searchability and intensifying engagement for users across multiple devices and platforms, including tablets and mobiles. You will deliver unprecedented access to information and materials that were previously unavailable in the digital marketplace.
- Your Content is Secure: DDD's experience and reputation for careful handling of delicate, fragile, rare and historic documents, means you can trust us. DDD will work carefully with you to ensure that your content is only accessible to the audiences you desire.
Our team ensures the fastest possible turnaround of your project with a customized conversion workflow.
Our Clients Include:
Case Study: Reader's Digest
Case Study: YaleWe'll never be 100% sure in #420 that we converted all references to Git hashes into Mercurial ones.
The mere possibility that upstream could create new columns pointing to Git hashes while we're implementing the migration is a good potential source of misses on our part.
But it's easy to keep the the hg-git map file for migrated repos, and it should be possible to implement a fallback that would be low level enough to catch everything.
This can be experimented with way before #420 is complete, and would provide us with interesting hints in any case.<gh_stars>0
// Copyright 2018 Comcast Cable Communications Management, LLC
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.

package frame

import (
	"testing"
	"time"

	"github.com/tuya/pulsar-client-go/pkg/api"
)

type dispatcherTestCase struct {
	register func() (response <-chan Frame, cancel func(), err error)
	notify   func(frame Frame) error
}

// dispatcherTestCases allows for the 3 types of dispatchers
// to be tested with the same tests, since they should all
// behave in the same way (register, notify)
func dispatcherTestCases() map[string]dispatcherTestCase {
	fd := NewFrameDispatcher()

	return map[string]dispatcherTestCase{
		"global": {
			register: fd.RegisterGlobal,
			notify:   fd.NotifyGlobal,
		},
		"prodSeqID": {
			register: func() (<-chan Frame, func(), error) { return fd.RegisterProdSeqIDs(1, 2) },
			notify:   func(f Frame) error { return fd.NotifyProdSeqIDs(1, 2, f) },
		},
		"reqID": {
			register: func() (<-chan Frame, func(), error) { return fd.RegisterReqID(42) },
			notify:   func(f Frame) error { return fd.NotifyReqID(42, f) },
		},
	}
}

func TestFrameDispatcher_Success(t *testing.T) {
	cases := dispatcherTestCases()

	for name, dtc := range cases {
		dtc := dtc
		t.Run(name, func(t *testing.T) {
			// make sure multiple register/notify calls work
			for i := 0; i < 3; i++ {
				resp, cancel, err := dtc.register()
				if err!= nil {
					t.Fatalf("register() err = %v", err)
				}

				// response frame. The type and contents are arbitrary
				expected := Frame{
					BaseCmd: &api.BaseCommand{
						Type: api.BaseCommand_CONNECTED.Enum(),
						Pong: &api.CommandPong{},
					},
				}

				notifyErr := make(chan error, 1)
				go func() { notifyErr <- dtc.notify(expected) }()

				select {
				case got := <-resp:
					if!got.Equal(expected) {
						t.Fatalf("got frame:\n%+v\nexpected:\n%+v", got, expected)
					}
					t.Logf("got expected frame:\n%+v", got)

					// ensure notify() returned with no errors
					select {
					case err := <-notifyErr:
						if err!= nil {
							t.Fatalf("notify() err = %v; nil expected", nil)
						}
					case <-time.After(time.Second):
						t.Fatal("expected notify() to return")
					}

				case <-time.After(time.Second):
					t.Fatal("expected read from response channel")
				}

				cancel()
			}
		})
	}
}

func TestFrameDispatcher_DupRegister(t *testing.T) {
	cases := dispatcherTestCases()

	for name, dtc := range cases {
		dtc := dtc
		t.Run(name, func(t *testing.T) {
			_, _, err := dtc.register()
			if err!= nil {
				t.Fatalf("register() err = %v", err)
			}

			// duplicate register
			_, _, err = dtc.register()
			if err == nil {
				t.Fatalf("duplicate register() err = %v; expected non-nil", err)
			}
			t.Logf("duplicate register() err (expected) = %v", err)
		})
	}
}

func TestFrameDispatcher_DupNotify(t *testing.T) {
	cases := dispatcherTestCases()

	for name, dtc := range cases {
		dtc := dtc
		t.Run(name, func(t *testing.T) {
			resp, cancel, err := dtc.register()
			if err!= nil {
				t.Fatalf("register() err = %v", err)
			}
			defer cancel()

			// response frame. The type and contents are arbitrary
			expected := Frame{
				BaseCmd: &api.BaseCommand{
					Type: api.BaseCommand_CONNECTED.Enum(),
					Pong: &api.CommandPong{},
				},
			}

			notifyErr := make(chan error, 2)
			go func() {
				for i := 0; i < 2; i++ {
					notifyErr <- dtc.notify(expected)
				}
			}()

			select {
			case <-resp:
			case <-time.After(time.Millisecond * 500):
				t.Fatal("expected read from response channel")
			}

			// first call to notify() should return nil error
			select {
			case err := <-notifyErr:
				if err!= nil {
					t.Fatalf("first notify() err = %v; nil expected", err)
				}