text:
package aws

import (
	"encoding/json"
	"fmt"
	"io/ioutil"
	"math"
	"os"
	"sort"
	"strconv"
	"strings"
	"time"

	"github.com/aws/aws-sdk-go/aws"
	"github.com/aws/aws-sdk-go/aws/awserr"
	"github.com/aws/aws-sdk-go/service/dynamodb"
	"github.com/aws/aws-sdk-go/service/ec2"
	"github.com/aws/aws-sdk-go/service/ecs"
	"github.com/convox/rack/cache"
	"github.com/convox/rack/manifest"
	"github.com/convox/rack/manifest1"
	"github.com/convox/rack/options"
	"github.com/convox/rack/structs"
	"github.com/fsouza/go-dockerclient"
	shellquote "github.com/kballard/go-shellquote"
)

// StatusCodePrefix is sent to the client to let it know the exit code is coming next
const StatusCodePrefix = "F1E49A85-0AD7-4AEF-A618-C249C6E6568D:"

// ProcessExec runs a command in an existing Process
func (p *AWSProvider) ProcessExec(app, pid, command string, opts structs.ProcessExecOptions) (int, error) {
	log := Logger.At("ProcessExec").Namespace("app=%q pid=%q command=%q", app, pid, command).Start()

	pss, err := p.ProcessList(app, structs.ProcessListOptions{})
	if err != nil {
		return -1, log.Error(err)
	}

	pidFound := false
	for _, p := range pss {
		if p.Id == pid {
			pidFound = true
			break
		}
	}

	if !pidFound {
		return -1, errorNotFound(fmt.Sprintf("process id not found for %s", app))
	}

	arn, err := p.taskArnFromPid(pid)
	if err != nil {
		return -1, log.Error(err)
	}

	task, err := p.describeTask(arn)
	if err != nil {
		return -1, log.Error(err)
	}
	if len(task.Containers) < 1 {
		return -1, log.Errorf("no running container for process: %s", pid)
	}

	cires, err := p.describeContainerInstances(&ecs.DescribeContainerInstancesInput{
		Cluster:            aws.String(p.Cluster),
		ContainerInstances: []*string{task.ContainerInstanceArn},
	})
	if err != nil {
		return -1, log.Error(err)
	}
	if len(cires.ContainerInstances) < 1 {
		return -1, log.Errorf("could not find instance for process: %s", pid)
	}

	dc, err := p.dockerInstance(*cires.ContainerInstances[0].Ec2InstanceId)
	if err != nil {
		return -1, log.Error(err)
	}

	cs, err := dc.ListContainers(docker.ListContainersOptions{
		All: true,
		Filters: map[string][]string{
			"label": {fmt.Sprintf("com.amazonaws.ecs.task-arn=%s", arn)},
		},
	})
	if err != nil {
		return -1, log.Error(err)
	}
	if len(cs) != 1 {
		return -1, log.Errorf("could not find container for task: %s", arn)
	}

	cmd := []string{"sh", "-c", command}

	if opts.Entrypoint != nil && *opts.Entrypoint {
		c, err := dc.InspectContainer(cs[0].ID)
		if err != nil {
			return -1, err
		}

		cmd = append(c.Config.Entrypoint, cmd...)
	} else {
		a, err := p.AppGet(app)
		if err != nil {
			return -1, err
		}

		if a.Tags["Generation"] == "2" {
			cmd = append([]string{"/convox-env"}, cmd...)
		}
	}

	eres, err := dc.CreateExec(docker.CreateExecOptions{
		AttachStdin:  true,
		AttachStdout: true,
		AttachStderr: true,
		Tty:          true,
		Cmd:          cmd,
		Container:    cs[0].ID,
	})
	if err != nil {
		return -1, log.Error(err)
	}

	success := make(chan struct{})

	go func() {
		<-success
		if opts.Height != nil && opts.Width != nil {
			dc.ResizeExecTTY(eres.ID, *opts.Height, *opts.Width)
		}
		success <- struct{}{}
	}()

	err = dc.StartExec(eres.ID, docker.StartExecOptions{
		Detach:       false,
		Tty:          true,
		InputStream:  ioutil.NopCloser(opts.Stream),
		OutputStream: opts.Stream,
		ErrorStream:  opts.Stream,
		RawTerminal:  true,
		Success:      success,
	})

	if err != nil {
		return -1, log.Error(err)
	}

	ires, err := dc.InspectExec(eres.ID)
	if err != nil {
		return -1, log.Error(err)
	}

	return ires.ExitCode, log.Success()
}

// ProcessGet returns the specified process for an app
func (p *AWSProvider) ProcessGet(app, pid string) (*structs.Process, error) {
	log := Logger.At("ProcessGet").Namespace("app=%q pid=%s", app, pid).Start()

	tasks, err := p.appTaskARNs(app)
	if err != nil {
		return nil, log.Error(err)
	}

	for _, t := range tasks {
		if strings.HasSuffix(t, pid) {
			pss, err := p.taskProcesses([]string{t})
			if err != nil {
				return nil, log.Error(err)
			}

			if len(pss) > 0 {
				return &pss[0], nil
			}
		}
	}

	return nil, log.Error(errorNotFound(fmt.Sprintf("no such process: %s", pid)))
}

// ProcessList returns a list of processes for an app
func (p *AWSProvider) ProcessList(app string, opts structs.ProcessListOptions) (structs.Processes, error) {
	log := Logger.At("ProcessList").Namespace("app=%q", app).Start()

	tasks, err := p.appTaskARNs(app)
	if err != nil {
		return nil, log.Error(err)
	}

	ps, err := p.taskProcesses(tasks)
	if err != nil {
		return nil, log.Error(err)
	}

	if opts.Service != nil {
		pss := structs.Processes{}

		for _, p := range ps {
			if p.Name == *opts.Service {
				pss = append(pss, p)
			}
		}

		ps = pss
	}

	for i := range ps {
		ps[i].App = app
	}

	return ps, nil
}

func (p *AWSProvider) stackTasks(stack string) ([]string, error) {
	log := Logger.At("stackTasks").Namespace("stack=%q", stack).Start()

	srs, err := p.listStackResources(stack)
	if err != nil {
		log.Error(err)
		return nil, err
	}

	services := []string{}

	for _, sr := range srs {
		switch *sr.ResourceType {
		case "AWS::ECS::Service", "Custom::ECSService":
			services = append(services, *sr.PhysicalResourceId)
		}
	}

	tasks := []string{}

	for _, s := range services {
		err := p.ecs().ListTasksPages(&ecs.ListTasksInput{
			Cluster:     aws.String(p.Cluster),
			ServiceName: aws.String(s),
		},
			func(page *ecs.ListTasksOutput, lastPage bool) bool {
				for _, arn := range page.TaskArns {
					tasks = append(tasks, *arn)
				}
				return true
			},
		)
		if err != nil {
			log.Error(err)
			return nil, err
		}
	}

	log.Success()
	return tasks, nil
}

// appTaskARNs retuns a list of ECS Task (aka process) ARNs that correspond to an app
// This includes one-off processes, build tasks, etc.
func (p *AWSProvider) appTaskARNs(app string) ([]string, error) {
	tasks, err := p.stackTasks(fmt.Sprintf("%s-%s", p.Rack, app))
	if ae, ok := err.(awserr.Error); ok && ae.Code() == "ValidationError" {
		return nil, errorNotFound(fmt.Sprintf("no such app: %s", app))
	}
	if err != nil {
		return nil, err
	}

	// list one-off processes
	ores, err := p.ecs().ListTasks(&ecs.ListTasksInput{
		Cluster:   aws.String(p.Cluster),
		StartedBy: aws.String(fmt.Sprintf("convox.%s", app)),
	})
	if err != nil {
		return nil, err
	}

	for _, task := range ores.TaskArns {
		tasks = append(tasks, *task)
	}

	// list build processes
	if p.Cluster != p.BuildCluster {
		ores, err := p.ecs().ListTasks(&ecs.ListTasksInput{
			Cluster:   aws.String(p.BuildCluster),
			StartedBy: aws.String(fmt.Sprintf("convox.%s", app)),
		})
		if err != nil {
			return nil, err
		}

		for _, task := range ores.TaskArns {
			tasks = append(tasks, *task)
		}
	}

	return tasks, nil
}

const describeTasksPageSize = 100

func (p *AWSProvider) taskProcesses(tasks []string) (structs.Processes, error) {
	log := Logger.At("taskProcesses").Namespace("tasks=%q", tasks).Start()

	pss := structs.Processes{}

	for i := 0; i < len(tasks); i += describeTasksPageSize {
		ptasks := []string{}

		if len(tasks) < i+describeTasksPageSize {
			ptasks = append(ptasks, tasks[i:]...)
		} else {
			ptasks = append(ptasks, tasks[i:i+describeTasksPageSize]...)
		}

		psst := structs.Processes{}
		psch := make(chan structs.Process, len(ptasks))
		errch := make(chan error)

		if len(ptasks) == 0 {
			return structs.Processes{}, nil
		}

		iptasks := make([]*string, len(ptasks))

		for i := range ptasks {
			iptasks[i] = &ptasks[i]
		}

		tres, err := p.describeTasks(&ecs.DescribeTasksInput{
			Cluster: aws.String(p.Cluster),
			Tasks:   iptasks,
		})
		if err != nil {
			log.Error(err)
			return nil, err
		}

		ecsTasks := make([]*ecs.Task, len(tres.Tasks))
		copy(ecsTasks, tres.Tasks)

		// list tasks on build cluster too
		if p.Cluster != p.BuildCluster {
			tres, err := p.describeTasks(&ecs.DescribeTasksInput{
				Cluster: aws.String(p.BuildCluster),
				Tasks:   iptasks,
			})
			if err != nil {
				log.Error(err)
				return nil, err
			}

			for _, task := range tres.Tasks {
				ecsTasks = append(ecsTasks, task)
			}
		}

		for _, task := range ecsTasks {
			if p.IsTest() {
				p.fetchProcess(task, psch, errch)
			} else {
				go p.fetchProcess(task, psch, errch)
			}
		}

		for i := 0; i < len(ecsTasks); i++ {
			select {
			case <-time.After(30 * time.Second):
				return nil, fmt.Errorf("timeout")
			case err := <-errch:
				return nil, err
			case ps := <-psch:
				psst = append(psst, ps)
			}
		}

		pss = append(pss, psst...)
	}

	instances, err := p.rackInstances()
	if err != nil {
		return nil, err
	}

	for i, ps := range pss {
		if inst, ok := instances[ps.Instance]; ok {
			ps.Host = *inst.PrivateIpAddress
			pss[i] = ps
		}
	}

	sort.Slice(pss, pss.Less)

	log.Success()
	return pss, nil
}

// ProcessRun runs a new Process
func (p *AWSProvider) ProcessRun(app string, opts structs.ProcessRunOptions) (string, error) {
	log := Logger.At("ProcessRun").Namespace("app=%q service=%q", app, opts.Service).Start()

	if opts.Service == nil {
		return "", fmt.Errorf("must specify a service")
	}

	if opts.Stream != nil {
		return p.processRunAttached(app, opts)
	}

	td, err := p.taskDefinitionForRun(app, opts)
	if err != nil {
		return "", log.Error(err)
	}

	req := &ecs.RunTaskInput{
		Cluster:        aws.String(p.Cluster),
		Count:          aws.Int64(1),
		StartedBy:      aws.String(fmt.Sprintf("convox.%s", app)),
		TaskDefinition: aws.String(td),
	}

	if opts.Command != nil {
		req.Overrides = &ecs.TaskOverride{
			ContainerOverrides: []*ecs.ContainerOverride{
				{
					Name: aws.String(*opts.Service),
					Command: []*string{
						aws.String("sh"),
						aws.String("-c"),
						aws.String(*opts.Command),
					},
				},
			},
		}
	}

	task, err := p.runTask(req)
	if err != nil {
		return "", log.Error(err)
	}

	return arnToPid(*task.TaskArn), log.Success()
}

// ProcessStop stops a Process
func (p *AWSProvider) ProcessStop(app, pid string) error {
	log := Logger.At("ProcessStop").Namespace("app=%q pid=%q", app, pid).Start()

	arn, err := p.taskArnFromPid(pid)
	if err != nil {
		log.Error(err)
		return err
	}

	_, err = p.ecs().StopTask(&ecs.StopTaskInput{
		Cluster: aws.String(p.Cluster),
		Task:    aws.String(arn),
	})
	if err != nil {
		log.Error(err)
		return err
	}

	log.Success()
	return nil
}

func arnToPid(arn string) string {
	parts := strings.Split(arn, "-")
	return parts[len(parts)-1]
}

// from https://github.com/docker/docker/blob/master/api/client/stats.go
func calculateCPUPercent(previousCPU, previousSystem uint64, v *docker.Stats) float64 {
	var (
		cpuPercent = 0.0
		// calculate the change for the cpu usage of the container in between readings
		cpuDelta = float64(v.CPUStats.CPUUsage.TotalUsage - previousCPU)
		// calculate the change for the entire system between readings
		systemDelta = float64(v.CPUStats.SystemCPUUsage - previousSystem)
	)

	if systemDelta > 0.0 && cpuDelta > 0.0 {
		cpuPercent = (cpuDelta / systemDelta) * float64(len(v.CPUStats.CPUUsage.PercpuUsage)) * 100.0
	}
	return cpuPercent
}

func commandString(cs []string) string {
	cmd := make([]string, len(cs))

	for i, c := range cs {
		if strings.Contains(c, " ") {
			cmd[i] = fmt.Sprintf("%q", c)
		} else {
			cmd[i] = c
		}
	}

	return strings.Join(cmd, " ")
}

func (p *AWSProvider) containerDefinitionForTask(arn string) (*ecs.ContainerDefinition, error) {
	cd, ok := cache.Get("containerDefinitionForTask", arn).(*ecs.ContainerDefinition)
	if ok {
		return cd, nil
	}

	res, err := p.describeTaskDefinition(&ecs.DescribeTaskDefinitionInput{
		TaskDefinition: aws.String(arn),
	})
	if err != nil {
		return nil, err
	}
	if len(res.TaskDefinition.ContainerDefinitions) < 1 {
		return nil, fmt.Errorf("invalid container definitions for task: %s", arn)
	}

	if !p.SkipCache {
		if err := cache.Set("containerDefinitionForTask", arn, res.TaskDefinition.ContainerDefinitions[0], 10*time.Second); err != nil {
			return nil, err
		}
	}

	return res.TaskDefinition.ContainerDefinitions[0], nil
}

func (p *AWSProvider) containerInstance(id string) (*ecs.ContainerInstance, error) {
	ci, ok := cache.Get("containerInstance", id).(*ecs.ContainerInstance)
	if ok {
		return ci, nil
	}

	res, err := p.describeContainerInstances(&ecs.DescribeContainerInstancesInput{
		Cluster:            aws.String(p.Cluster),
		ContainerInstances: []*string{aws.String(id)},
	})
	if err != nil {
		return nil, err
	}
	// check the build cluster too
	for _, f := range res.Failures {
		if f.Reason != nil && *f.Reason == "MISSING" && p.BuildCluster != p.Cluster {
			res, err = p.describeContainerInstances(&ecs.DescribeContainerInstancesInput{
				Cluster:            aws.String(p.BuildCluster),
				ContainerInstances: []*string{aws.String(id)},
			})
			if err != nil {
				return nil, err
			}
			break
		}
	}

	if len(res.ContainerInstances) != 1 {
		return nil, fmt.Errorf("could not find container instance: %s", id)
	}

	if !p.SkipCache {
		if err := cache.Set("containerInstance", id, res.ContainerInstances[0], 10*time.Second); err != nil {
			return nil, err
		}
	}

	return res.ContainerInstances[0], nil
}

func (p *AWSProvider) describeInstance(id string) (*ec2.Instance, error) {
	instance, ok := cache.Get("describeInstance", id).(*ec2.Instance)
	if ok {
		return instance, nil
	}

	res, err := p.ec2().DescribeInstances(&ec2.DescribeInstancesInput{
		InstanceIds: []*string{aws.String(id)},
	})
	if err != nil {
		return nil, err
	}
	if len(res.Reservations) != 1 || len(res.Reservations[0].Instances) != 1 {
		return nil, fmt.Errorf("could not find instance: %s", id)
	}

	if !p.SkipCache {
		if err := cache.Set("describeInstance", id, res.Reservations[0].Instances[0], 10*time.Second); err != nil {
			return nil, err
		}
	}

	return res.Reservations[0].Instances[0], nil
}

func (p *AWSProvider) describeTask(arn string) (*ecs.Task, error) {
	res, err := p.describeTasks(&ecs.DescribeTasksInput{
		Cluster: aws.String(p.Cluster),
		Tasks:   []*string{aws.String(arn)},
	})
	// check the build cluster too
	for _, f := range res.Failures {
		if f.Reason != nil && *f.Reason == "MISSING" && p.BuildCluster != p.Cluster {
			res, err = p.describeTasks(&ecs.DescribeTasksInput{
				Cluster: aws.String(p.BuildCluster),
				Tasks:   []*string{aws.String(arn)},
			})
			break
		}
	}
	if err != nil {
		return nil, err
	}
	if len(res.Tasks) != 1 {
		return nil, fmt.Errorf("could not fetch process status")
	}
	return res.Tasks[0], nil
}

func (p *AWSProvider) fetchProcess(task *ecs.Task, psch chan structs.Process, errch chan error) {
	if len(task.Containers) < 1 {
		errch <- fmt.Errorf("invalid task: %s", *task.TaskDefinitionArn)
		return
	}

	cd, err := p.containerDefinitionForTask(*task.TaskDefinitionArn)
	if err != nil {
		errch <- err
		return
	}

	ci, err := p.containerInstance(*task.ContainerInstanceArn)
	if err != nil {
		errch <- err
		return
	}

	env := map[string]string{}
	for _, e := range cd.Environment {
		env[*e.Name] = *e.Value
	}

	for _, o := range task.Overrides.ContainerOverrides {
		for _, p := range o.Environment {
			env[*p.Name] = *p.Value
		}
	}

	labels := map[string]string{}
	for k, v := range cd.DockerLabels {
		labels[k] = *v
	}

	container := task.Containers[0]

	ports := []string{}
	for _, p := range container.NetworkBindings {
		ports = append(ports, fmt.Sprintf("%d:%d", *p.HostPort, *p.ContainerPort))
	}

	ps := structs.Process{
		Id:       arnToPid(*task.TaskArn),
		Name:     *container.Name,
		App:      coalesces(labels["convox.app"], env["APP"]),
		Release:  coalesces(labels["convox.release"], env["RELEASE"]),
		Image:    *cd.Image,
		Instance: *ci.Ec2InstanceId,
		Ports:    ports,
	}

	// guard for nil
	if task.StartedAt != nil {
		ps.Started = *task.StartedAt
	}

	if len(cd.Command) > 0 {
		p := make([]string, len(cd.Command))

		for i, c := range cd.Command {
			p[i] = *c
		}

		ps.Command = shellquote.Join(p...)
	}

	if task.StartedBy != nil && *task.StartedBy == fmt.Sprintf("convox.%s", env["APP"]) {
		ps.Command = ""
	}

	if task.Overrides != nil && len(task.Overrides.ContainerOverrides) > 0 {
		for _, co := range task.Overrides.ContainerOverrides {
			if co.Name != nil && *co.Name == *container.Name && co.Command != nil && len(co.Command) == 3 {
				ps.Command = *co.Command[2]
			}
		}
	}

	if env["COMMAND"] != "" {
		ps.Command = env["COMMAND"]
	}

	// TODO: figure out a way to do this less expensively

	// dc, err := p.dockerInstance(ps.Instance)
	// if err != nil {
	//   errch <- err
	//   return
	// }

	// sch := make(chan *docker.Stats, 1)
	// err = dc.Stats(docker.StatsOptions{
	//   ID:     cs[0].ID,
	//   Stats:  sch,
	//   Stream: false,
	// })
	// if err != nil {
	//   fmt.Printf("docker stats error: %s", err)
	//   psch <- ps
	// }

	// stat := <-sch
	// if stat != nil {
	//   pcpu := stat.PreCPUStats.CPUUsage.TotalUsage
	//   psys := stat.PreCPUStats.SystemCPUUsage

	//   ps.CPU = truncate(calculateCPUPercent(pcpu, psys, stat), 4)

	//   if stat.MemoryStats.Limit > 0 {
	//     ps.Memory = truncate(float64(stat.MemoryStats.Usage)/float64(stat.MemoryStats.Limit), 4)
	//   }
	// }

	psch <- ps
}

func (p *AWSProvider) generateTaskDefinition1(app string, opts structs.ProcessRunOptions) (*ecs.RegisterTaskDefinitionInput, error) {
	if opts.Service == nil {
		return nil, fmt.Errorf("must specify a service")
	}

	service := *opts.Service

	a, err := p.AppGet(app)
	if err != nil {
		return nil, err
	}

	release, err := p.resolveRelease(app, cs(opts.Release, ""))
	if err != nil {
		return nil, err
	}

	r, err := p.ReleaseGet(app, release)
	if err != nil {
		return nil, err
	}

	m, err := manifest1.Load([]byte(r.Manifest))
	if err != nil {
		return nil, err
	}

	s, ok := m.Services[service]
	if !ok {
		return nil, fmt.Errorf("no such service: %s", service)
	}

	srs, err := p.listStackResources(fmt.Sprintf("%s-%s", p.Rack, app))
	if err != nil {
		return nil, err
	}

	sarn := ""
	sn := fmt.Sprintf("Service%s", upperName(service))

	secureEnvRoleName := ""

	for _, sr := range srs {
		if *sr.LogicalResourceId == sn {
			sarn = *sr.PhysicalResourceId
		}
		if *sr.LogicalResourceId == "SecureEnvironmentRole" {
			secureEnvRoleName = *sr.PhysicalResourceId
		}
	}
	if sarn == "" {
		return nil, fmt.Errorf("could not find service: %s", service)
	}
	if secureEnvRoleName == "" && s.UseSecureEnvironment() {
		return nil, fmt.Errorf("cound not find secure environment role for service: %s", service)
	}

	sres, err := p.describeServices(&ecs.DescribeServicesInput{
		Cluster:  aws.String(p.Cluster),
		Services: []*string{aws.String(sarn)},
	})
	if err != nil {
		return nil, err
	}
	if len(sres.Services) != 1 {
		return nil, fmt.Errorf("could not look up service for service: %s", service)
	}

	tres, err := p.describeTaskDefinition(&ecs.DescribeTaskDefinitionInput{
		TaskDefinition: sres.Services[0].TaskDefinition,
	})
	if err != nil {
		return nil, err
	}
	if len(tres.TaskDefinition.ContainerDefinitions) < 1 {
		return nil, fmt.Errorf("could not find container definition for service: %s", service)
	}

	senv := map[string]string{}

	for _, e := range tres.TaskDefinition.ContainerDefinitions[0].Environment {
		senv[*e.Name] = *e.Value
	}

	cd := &ecs.ContainerDefinition{
		DockerLabels: map[string]*string{
			"convox.process.type": aws.String("oneoff"),
		},
		Essential:         aws.Bool(true),
		Image:             aws.String(fmt.Sprintf("%s.dkr.ecr.%s.amazonaws.com/%s:%s.%s", a.Outputs["RegistryId"], p.Region, a.Outputs["RegistryRepository"], service, r.Build)),
		MemoryReservation: aws.Int64(512),
		Name:              aws.String(service),
		Privileged:        aws.Bool(s.Privileged),
	}

	if len(s.Command.Array) > 0 {
		cd.Command = make([]*string, len(s.Command.Array))
		for i, c := range s.Command.Array {
			cd.Command[i] = aws.String(c)
		}
	} else if s.Command.String != "" {
		cd.Command = []*string{aws.String("sh"), aws.String("-c"), aws.String(s.Command.String)}
	}

	env := map[string]string{}

	base := map[string]string{
		"APP":        app,
		"AWS_REGION": p.Region,
		"LOG_GROUP":  a.Outputs["LogGroup"],
		"PROCESS":    service,
		"RACK":       p.Rack,
		"RELEASE":    release,
	}

	for k, v := range base {
		env[k] = v
	}

	for _, e := range s.Environment {
		env[e.Name] = e.Value
	}

	settings, err := p.appResource(r.App, "Settings")
	if err != nil {
		return nil, err
	}

	if s.UseSecureEnvironment() {
		env["SECURE_ENVIRONMENT_URL"] = fmt.Sprintf("https://%s.s3.amazonaws.com/releases/%s/env", settings, release)
		env["SECURE_ENVIRONMENT_TYPE"] = "envfile"
		env["SECURE_ENVIRONMENT_KEY"] = p.EncryptionKey
	} else {
		for _, e := range strings.Split(r.Env, "\n") {
			p := strings.SplitN(e, "=", 2)
			if len(p) == 2 {
				env[p[0]] = p[1]
			}
		}
	}

	vars := []string{"SCHEME", "USERNAME", "PASSWORD", "HOST", "PORT", "PATH", "URL"}

	for _, l := range s.Links {
		prefix := strings.Replace(strings.ToUpper(l), "-", "_", -1)

		for _, v := range vars {
			k := fmt.Sprintf("%s_%s", prefix, v)

			lv, ok := senv[k]
			if !ok {
				return nil, fmt.Errorf("could not find link var: %s", k)
			}

			env[k] = lv
		}
	}

	keys := []string{}

	for k := range env {
		keys = append(keys, k)
	}

	sort.Strings(keys)

	for _, k := range keys {
		cd.Environment = append(cd.Environment, &ecs.KeyValuePair{
			Name:  aws.String(k),
			Value: aws.String(env[k]),
		})
	}

	tr := a.Parameters["TaskRole"]

	if secureEnvRoleName != "" && s.UseSecureEnvironment() {
		tr = fmt.Sprintf("convox/%s", secureEnvRoleName)
	}

	req := &ecs.RegisterTaskDefinitionInput{
		ContainerDefinitions: []*ecs.ContainerDefinition{cd},
		Family:               aws.String(fmt.Sprintf("%s-%s-%s", p.Rack, app, service)),
		TaskRoleArn:          &tr,
	}

	for i, mv := range s.MountableVolumes() {
		name := fmt.Sprintf("volume-%d", i)
		host := fmt.Sprintf("/volumes/%s-%s/%s%s", p.Rack, app, service, mv.Host)

		req.Volumes = append(req.Volumes, &ecs.Volume{
			Name: aws.String(name),
			Host: &ecs.HostVolumeProperties{
				SourcePath: aws.String(host),
			},
		})

		req.ContainerDefinitions[0].MountPoints = append(req.ContainerDefinitions[0].MountPoints, &ecs.MountPoint{
			SourceVolume:  aws.String(name),
			ContainerPath: aws.String(mv.Container),
			ReadOnly:      aws.Bool(false),
		})
	}

	return req, nil
}

func (p *AWSProvider) generateTaskDefinition2(app string, opts structs.ProcessRunOptions) (*ecs.RegisterTaskDefinitionInput, error) {
	if opts.Service == nil {
		return nil, fmt.Errorf("must specify a service")
	}

	service := *opts.Service

	release, err := p.resolveRelease(app, cs(opts.Release, ""))
	if err != nil {
		return nil, err
	}

	r, err := p.ReleaseGet(app, release)
	if err != nil {
		return nil, err
	}

	env := structs.Environment{}

	if err := env.Load([]byte(r.Env)); err != nil {
		return nil, err
	}

	m, err := manifest.Load([]byte(r.Manifest), manifest.Environment(env))
	if err != nil {
		return nil, err
	}

	s, err := m.Service(service)
	if err != nil {
		return nil, err
	}

	sarn, err := p.appResource(app, fmt.Sprintf("Service%sService", upperName(service)))
	if err != nil {
		return nil, err
	}

	sres, err := p.describeServices(&ecs.DescribeServicesInput{
		Cluster:  aws.String(p.Cluster),
		Services: []*string{aws.String(sarn)},
	})
	if err != nil {
		return nil, err
	}
	if len(sres.Services) != 1 {
		return nil, fmt.Errorf("could not find service: %s", service)
	}

	tres, err := p.describeTaskDefinition(&ecs.DescribeTaskDefinitionInput{
		TaskDefinition: sres.Services[0].TaskDefinition,
	})
	if err != nil {
		return nil, err
	}
	if len(tres.TaskDefinition.ContainerDefinitions) < 1 {
		return nil, fmt.Errorf("could not find container definition for service: %s", service)
	}

	ocd := tres.TaskDefinition.ContainerDefinitions[0]

	labels := ocd.DockerLabels
	labels["convox.process.type"] = aws.String("oneoff")

	aid, err := p.accountId()
	if err != nil {
		return nil, err
	}

	reg, err := p.appResource(app, "Registry")
	if err != nil {
		return nil, err
	}

	settings, err := p.appResource(app, "Settings")
	if err != nil {
		return nil, err
	}

	senv := s.EnvironmentDefaults()

	for _, e := range ocd.Environment {
		senv[*e.Name] = *e.Value
	}

	senv["CONVOX_ENV_URL"] = fmt.Sprintf("s3://%s/releases/%s/env", settings, release)

	cenv := []*ecs.KeyValuePair{}

	for k, v := range senv {
		cenv = append(cenv, &ecs.KeyValuePair{Name: aws.String(k), Value: aws.String(v)})
	}

	cd := &ecs.ContainerDefinition{
		DockerLabels:      labels,
		Environment:       cenv,
		Essential:         aws.Bool(true),
		Image:             aws.String(fmt.Sprintf("%s.dkr.ecr.%s.amazonaws.com/%s:%s.%s", aid, p.Region, reg, service, r.Build)),
		MemoryReservation: aws.Int64(512),
		MountPoints:       tres.TaskDefinition.ContainerDefinitions[0].MountPoints,
		Name:              aws.String(service),
		Privileged:        aws.Bool(s.Privileged),
	}

	if s.Command != "" {
		cd.Command = []*string{aws.String("sh"), aws.String("-c"), aws.String(s.Command)}
	}

	req := &ecs.RegisterTaskDefinitionInput{
		ContainerDefinitions: []*ecs.ContainerDefinition{cd},
		Family:               aws.String(fmt.Sprintf("%s-%s-%s", p.Rack, app, service)),
		TaskRoleArn:          tres.TaskDefinition.TaskRoleArn,
		Volumes:              tres.TaskDefinition.Volumes,
	}

	return req, nil
}

func (p *AWSProvider) processRunAttached(app string, opts structs.ProcessRunOptions) (string, error) {
	if opts.Service == nil {
		return "", fmt.Errorf("must specify a service")
	}

	td, err := p.taskDefinitionForRun(app, opts)
	if err != nil {
		return "", err
	}

	timeout := "3600"

	if opts.Timeout != nil {
		timeout = strconv.Itoa(*opts.Timeout)
	}

	req := &ecs.RunTaskInput{
		Cluster:        aws.String(p.Cluster),
		Count:          aws.Int64(1),
		StartedBy:      aws.String(fmt.Sprintf("convox.%s", app)),
		TaskDefinition: aws.String(td),
	}

	if opts.Command != nil {
		req.Overrides = &ecs.TaskOverride{
			ContainerOverrides: []*ecs.ContainerOverride{
				{
					Name: aws.String(*opts.Service),
					Command: []*string{
						aws.String("sleep"),
						aws.String(timeout),
					},
					Environment: []*ecs.KeyValuePair{
						&ecs.KeyValuePair{Name: aws.String("COMMAND"), Value: aws.String(*opts.Command)},
					},
				},
			},
		}
	}

	task, err := p.runTask(req)
	if err != nil {
		return "", err
	}

	status, err := p.waitForTask(*task.TaskArn)
	if err != nil {
		return "", err
	}
	if status != "RUNNING" {
		return "", fmt.Errorf("error starting container")
	}

	pid := arnToPid(*task.TaskArn)

	if opts.Command != nil {
		code, err := p.ProcessExec(app, pid, *opts.Command, structs.ProcessExecOptions{
			Entrypoint: options.Bool(true),
			Height:     opts.Height,
			Stream:     opts.Stream,
			Width:      opts.Width,
		})
		if err != nil && !strings.Contains(err.Error(), "use of closed network") {
			return "", err
		}

		p.stopTask(*task.TaskArn, fmt.Sprintf("exit:%d", code))
	}

	return pid, nil
}

func (p *AWSProvider) ProcessWait(app, pid string) (int, error) {
	arn, err := p.taskArnFromPid(pid)
	if err != nil {
		return -1, err
	}

	task, err := p.describeTask(arn)
	if err != nil {
		return -1, err
	}

	if task.StoppedReason != nil && strings.HasPrefix(*task.StoppedReason, "exit:") {
		p := strings.Split(*task.StoppedReason, ":")
		if len(p) != 2 {
			return -1, fmt.Errorf("invalid exit code")
		}
		code, err := strconv.Atoi(p[1])
		if err != nil {
			return -1, fmt.Errorf("invalid exit code")
		}
		return code, nil
	}

	if len(task.Containers) < 1 {
		return -1, fmt.Errorf("could not find container for task: %s", arn)
	}

	return int(*task.Containers[0].ExitCode), nil
}

func (p *AWSProvider) rackInstances() (map[string]ec2.Instance, error) {
	req := &ec2.DescribeInstancesInput{
		Filters: []*ec2.Filter{
			&ec2.Filter{
				Name:   aws.String("tag:Rack"),
				Values: []*string{aws.String(os.Getenv("RACK"))},
			},
		},
	}

	instances := map[string]ec2.Instance{}

	err := p.ec2().DescribeInstancesPages(req, func(res *ec2.DescribeInstancesOutput, last bool) bool {
		for _, r := range res.Reservations {
			for _, i := range r.Instances {
				instances[*i.InstanceId] = *i
			}
		}
		return true
	})
	if err != nil {
		return nil, err
	}

	return instances, nil
}

func (p *AWSProvider) resolveRelease(app, release string) (string, error) {
	if release != "" {
		return release, nil
	}

	a, err := p.AppGet(app)
	if err != nil {
		return "", err
	}
	if a.Release == "" {
		return "", fmt.Errorf("no releases for app: %s", app)
	}

	return a.Release, nil
}

func (p *AWSProvider) runTask(req *ecs.RunTaskInput) (*ecs.Task, error) {
	res, err := p.ecs().RunTask(req)
	switch {
	case err != nil:
		return nil, err
	case len(res.Failures) > 0:
		switch *res.Failures[0].Reason {
		case "RESOURCE:MEMORY":
			return nil, fmt.Errorf("not enough memory available to start process")
		case "RESOURCE:PORTS":
			return nil, fmt.Errorf("no instance with available ports to start process")
		default:
			return nil, fmt.Errorf("could not start build: %s", *res.Failures[0].Reason)
		}
	case len(res.Tasks) != 1 || len(res.Tasks[0].Containers) != 1:
		return nil, fmt.Errorf("could not start process")
	}
	return res.Tasks[0], nil
}

func (p *AWSProvider) stopTask(arn string, reason string) error {
	_, err := p.ecs().StopTask(&ecs.StopTaskInput{
		Cluster: aws.String(p.Cluster),
		Reason:  aws.String(reason),
		Task:    aws.String(arn),
	})
	if err != nil {
		return err
	}

	for {
		res, err := p.describeTask(arn)
		if err != nil {
			return err
		}

		if res.StoppedReason != nil || (res.DesiredStatus != nil && *res.DesiredStatus == "STOPPED") {
			break
		}

		time.Sleep(250 * time.Millisecond)
	}

	return nil
}

func (p *AWSProvider) taskArnFromPid(pid string) (string, error) {
	running, err := p.tasksByStatus("RUNNING")
	if err != nil {
		return "", err
	}

	stopped, err := p.tasksByStatus("STOPPED")
	if err != nil {
		return "", err
	}

	tasks := append(running, stopped...)

	for _, arn := range tasks {
		if arnToPid(arn) == pid {
			return arn, nil
		}
	}

	return "", fmt.Errorf("could not find process")
}

func (p *AWSProvider) tasksByStatus(status string) ([]string, error) {
	req := &ecs.ListTasksInput{
		Cluster:       aws.String(p.Cluster),
		DesiredStatus: aws.String(status),
	}

	tasks := []string{}

	for {
		res, err := p.ecs().ListTasks(req)
		if err != nil {
			return nil, err
		}

		for _, arn := range res.TaskArns {
			tasks = append(tasks, *arn)
		}

		if res.NextToken == nil {
			break
		}

		req.NextToken = res.NextToken
	}

	return tasks, nil
}

func (p *AWSProvider) taskDefinitionsForPrefix(prefix string) ([]string, error) {
	tds := []string{}

	for {
		res, err := p.ecs().ListTaskDefinitions(&ecs.ListTaskDefinitionsInput{
			FamilyPrefix: aws.String(prefix),
		})
		if err != nil {
			return nil, err
		}

		for _, td := range res.TaskDefinitionArns {
			tds = append(tds, *td)
		}

		break
	}

	return tds, nil
}

func (p *AWSProvider) taskDefinitionForRun(app string, opts structs.ProcessRunOptions) (string, error) {
	if opts.Service == nil {
		return "", fmt.Errorf("must specify a service")
	}

	service := *opts.Service

	release, err := p.resolveRelease(app, cs(opts.Release, ""))
	if err != nil {
		return "", nil
	}

	item, err := p.fetchRelease(app, release)
	if err != nil {
		return "", err
	}

	var tasks map[string]string
	err = json.Unmarshal([]byte(coalesce(item["definitions"], "{}")), &tasks)
	if err != nil {
		return "", err
	}

	if task, ok := tasks[fmt.Sprintf("%s.run", service)]; ok {
		return task, nil
	}

	a, err := p.AppGet(app)
	if err != nil {
		return "", err
	}

	var td *ecs.RegisterTaskDefinitionInput

	switch a.Tags["Generation"] {
	case "2":
		td, err = p.generateTaskDefinition2(app, opts)
		if err != nil {
			return "", err
		}
	default:
		td, err = p.generateTaskDefinition1(app, opts)
		if err != nil {
			return "", err
		}
	}

	if opts.Stream == nil {
		group, err := p.stackResource(p.rackStack(app), "LogGroup")
		if err != nil {
			return "", err
		}

		for i := range td.ContainerDefinitions {
			td.ContainerDefinitions[i].LogConfiguration = &ecs.LogConfiguration{
				LogDriver: aws.String("awslogs"),
				Options: map[string]*string{
					"awslogs-group":         aws.String(*group.PhysicalResourceId),
					"awslogs-region":        aws.String(p.Region),
					"awslogs-stream-prefix": aws.String("service"),
				},
			}
		}
	}

	res, err := p.ecs().RegisterTaskDefinition(td)
	if err != nil {
		return "", err
	}

	tasks[fmt.Sprintf("%s.run", service)] = *res.TaskDefinition.TaskDefinitionArn

	jtasks, err := json.Marshal(tasks)
	if err != nil {
		return "", err
	}

	_, err = p.dynamodb().UpdateItem(&dynamodb.UpdateItemInput{
		TableName: aws.String(p.DynamoReleases),
		Key: map[string]*dynamodb.AttributeValue{
			"id": {S: aws.String(release)},
		},
		UpdateExpression: aws.String("set definitions = :definitions"),
		ExpressionAttributeValues: map[string]*dynamodb.AttributeValue{
			":definitions": {S: aws.String(string(jtasks))},
		},
	})
	if err != nil {
		return "", err
	}

	return *res.TaskDefinition.TaskDefinitionArn, nil
}

// truncat a float to a given precision
// ex:  truncate(3.1459, 2) -> 3.14
func truncate(f float64, precision int) float64 {
	p := math.Pow10(precision)
	return float64(int(f*p)) / p
}

func (p *AWSProvider) waitForTask(arn string) (string, error) {
	timeout := time.After(300 * time.Second)
	tick := time.Tick(1 * time.Second)

	for {
		select {
		case <-tick:
			task, err := p.describeTask(arn)
			if err != nil {
				return "", err
			}
			if status := *task.LastStatus; status != "PENDING" {
				return status, nil
			}
		case <-timeout:
			return "", fmt.Errorf("timeout starting process")
		}
	}
}

redpajama_set_name: RedPajamaGithub


text:
Nothing But Thieves T-Shirt Women
Broken Machine 2017 T-Shirt Women
Nothing But Thieves band Licensed Merchandise
Hailing from Southend in Essex, England, Nothing But Thieves make passionate guitar-based rock that balances indie artfulness with a pop sensibility. They have scored 3 Top Ten U.K. albums with 2015's Nothing But Thieves, 2017's Broken Machine, and 2020's Moral Panic. Formed in 2012, Nothing But Thieves feature singer Conor Mason, guitarist Joe Langridge-Brown, guitarist Dominic Craik, bassist Philip Blake, and drummer James Price.
Nothing But Thieves T-Shirt Men

redpajama_set_name: RedPajamaCommonCrawl


I was at the grocery store last week buying wild Alaskan salmon (previously frozen) at an affordable $9.99 a pound, as another customer was asking the "fishmonger" for a cut of the wild salmon. When this customer spied the farmed Atlantic salmon for a mere $4.99 a pound, he immediately changed his order to the farmed, I suspect based on the cost.
I had to stop myself from saying anything, lest I came off sounding like a crazy lecturing enviro-nutball. Which, of course, I sometimes am.
"The Bush administration wants to allow ocean farming for shellfish, salmon and saltwater species in federal waters for the first time, hoping to grab a greater share of the $70 billion aquaculture market."
Lovely. Don't get me started.
Anyway, what would you do? Or what do you do? Would you have launched into the many reasons why choosing wild, in spite of the cost, is better than farmed? Or would you hold your tongue? Do you even care?
I would have purchased the wild salmon...and I think I would have held my tongue. This has actually happened to me before too. I stood there, dying to say something, anything, but was afraid I'd come across harsh and sarcastic.
Soooo, unless the other person asks, I would not say a thing, but I would want to.
I should challenge myself to start friendly conversation and inquire why farmed over wild? Is it just the price? Then, if the person shows any interest in holding a conversation, I could maybe sneak in why I choose wild salmon, maybe, if I'm feeling brave.
That gives me an idea. Say you see someone buying the farmed. You could ask them "do you know what the difference is between the farmed and wild caught"?
If they say "no", then you could suggest one of the reasons, like "oh, I heard something about the farmed having higher amounts of PCBs but I wasn't sure if that's true."
This is why I don't buy fish. Some it is better to buy farmed, so better wild. I can't keep it straight! Is there a handy list somewhere?
I'd like someone to tell me nicely if I was buying the wrong fish at the store.
The Monterey Bay Aquarium has a handy little pocket guide that tells you which fish is better wild versus farmed. And which things to avoid altogether.
There are different regional guides as well as a national one. You can find it here.
Thanks for the info on the guide. I'll put it in my purse and now I can start eating fish!
Yeah, I was avoiding fish until I found out about the guide a few years back! It's mighty handy!


text:
The Queen's Royal Surrey Regiment was a line infantry regiment of the British Army which existed from 1959 to 1966. In 1966, it was amalgamated with the Queen's Own Buffs, The Royal Kent Regiment, the Royal Sussex Regiment and the Middlesex Regiment (Duke of Cambridge's Own) to form the Queen's Regiment, which later merged with the Royal Hampshire Regiment in September 1992 to form the Princess of Wales's Royal Regiment (Queen's and Royal Hampshires).

History
As a consequence of defence cuts in the late 1950s, the Queen's Royal Regiment (West Surrey) and the East Surrey Regiment were amalgamated on 14 October 1959 to form the 1st Battalion, Queen's Royal Surrey Regiment.

In 1961 the 1st Queen's Surreys was sent to Aden. In 1962 the regiment joined the Hong Kong garrison, remaining there on a 2-year posting before heading for Münster, West Germany in 1964 as part of the British Army of the Rhine.

In 1966 the regiment's short existence came to an end when it, along with the three other remaining regiments of the Home Counties Brigade, was amalgamated to form the Queen's Regiment, one of the new 'large' regiments that were formed in the 1960s.

Territorials
When the regiment was formed, the Territorial Army battalions of the merging regiments continued to use their former titles. However, in 1961, a reduction in the size of the TA lead to the formation of 3rd and 4th Queen's Surreys:
3rd Battalion (TA) was formed of units affiliated to the Queen's Royal Regiment: the 5th and 6th battalions and the 565th Light Anti-Aircraft Regiment, Royal Artillery (the successor to 4th Battalion). Its headquarters were in Guildford.
4th Battalion (TA) was formed from former battalions of the East Surrey Regiment: the 6th East Surreys and the 23rd London Regiment. The battalion headquarters were in Kingston upon Thames.

The two territorial battalions were disbanded in 1967, with their successor units in the Territorial and Army Volunteer Reserve (TAVR) being "A" Company (Queen's Surreys) of the 5th (Volunteer) Battalion, Queen's Regiment  and the 6th (Territorial) Battalion, Queen's Regiment (Queen's Surreys).

Regimental museum
The Queen's Royal Surrey Regiment archives were put in storage when Regimental Headquarters and Museum in the Keep at Kingston upon Thames closed. Colonel JW Sewell reached agreement with the National Trust to re-establish the regiment's museum at Clandon Park House, West Clandon. The regiment's archives and library are located at the Surrey History Centre in Woking.

The Queen's Royal Surrey Regiment Museum opened in 1981 with exhibits including uniforms, medals, weapons, regalia, photographs and memorabilia. The museum was upgraded in 2001. In 2011, with part funding from the Heritage Lottery Fund further redevelopment took place and, in July that year, the museum merged with those of the Princess of Wales's Royal Regiment and the Queen's Regiment to become The Surrey Infantry Museum. In April 2015 Clandon Park House caught fire as a result of an electrical fault in the basement. The Surrey Infantry Museum was lost in the fire as it was located in the basement and remains closed as of 2020 with the remnants of the collection held primarily at Surrey History Centre.

Regimental Colonels
The Colonels of the Regiment were:
1959–1964: Maj-Gen. John Francis Metcalfe, CB, CBE
1964–1966: Maj-Gen. Francis James Claude Piggott, CB, CBE, DSO (to Queen's Regiment as Deputy Colonel)

Alliances
The regiment's alliances included:
 The Queen's York Rangers (1st American Regiment) -- Canada (1959–1966)
 South Alberta Light Horse—Canada (1959–1966)
 2nd Infantry Battalion (The City of Newcastle Regiment) -- Australia (1959–60)
 Royal New South Wales Regiment—Australia (1960–1966)
 The Northern Rhodesia Regiment (1959–1964)

Freedoms
  1964: Battersea.

References

External links

 Surrey Infantry Museum

Infantry regiments of the British Army
Military units and formations established in 1959
Military units and formations disestablished in 1966
Military units and formations in Surrey

redpajama_set_name: RedPajamaWikipedia


text:
Q: image retrieving in sqlite I am using using sqlite in my project
Previously I had saved image in data but now I am saving image in bytes like following code
NSUInteger len = [entObject.photoImageData length];
 Byte *byteData = (Byte*)malloc(len);
 memcpy(byteData, [entObject.photoImageData bytes], len);
insertString = [NSString stringWithFormat:@"INSERT INTO TBL_COUNTDOWN (DAIRYID,EVENTID,DESCRIPTION,EVENTIMAGE) VALUES (\"%@\",\"%d\",\"No Data\",\"%s\")",self.dairyId,self.eventId,byteData];

For retrieving image I am using following code
NSData *dataForCachedImage = [[NSData alloc] initWithBytes:sqlite3_column_blob(statement, 3) length: sqlite3_column_bytes(statement, 3)];
                    NSLog(@"dataForCachedImage/getAllEvents is %@",dataForCachedImage);
                    UIImage *cachedImage = [UIImage imageWithData:dataForCachedImage];
                    NSLog(@"cachedImage/getAllEvents is %@",cachedImage);

For dataForCachedImage in NSLog I am getting data but for cachedImage I getting null
I dont no whats wrong in my code. Please help me
Thanks in advance

A: You can save image to document directory and store its path to sqlite database
save Image code is as follows
 #define DOCUMENTS_FOLDER [NSHomeDirectory() stringByAppendingPathComponent:@"Documents"]

 // Create a new dated file
 NSDate *now = [NSDate dateWithTimeIntervalSinceNow:0];
 NSString *caldate = [now description];

 NSString *filePath= [NSString stringWithFormat:@"%@/%@.jpg", DOCUMENTS_FOLDER,caldate];
 NSURL *url = [NSURL fileURLWithPath:filePath];

 UIImage *image = [UIImage imageNamed:@"name.jpg"];
 NSData *imageData = UIImagePNGRepresentation(image);

 [imageData writeToFile:filePath atomically:YES];

anytime you want to retrieve Image then get it then use following method to getImage
- (UIImage*)getImage
{
 NSString *imagePath = [DOCUMENTS_FOLDER stringByAppendingPathComponent:@"imagename.jpg"];
 UIImage *img = [UIImage imageWithContentsOfFile:imagePath];
 return img;
}

deleting file
  NSFileManager *fileManager=[NSFileManager defaultManager];
  [fileManager removeItemAtPath:savedFilePath error:nil];

may this will help you..

redpajama_set_name: RedPajamaStackExchange


text:
Books I've Written
'Dolly: My Life and Other Unfinished Business'
Dolly shares her story in first autobiography "Dolly: My Life and Other Unfinished Business"
In 1994, Dolly published her first book, an autobiography, "Dolly: My Life and Other Unfinished Business" on the HarperCollins imprint. The book recounts her childhood growing up poor in the foothills of the Great Smoky Mountains of Tennessee and talks about her music, religion, marriage and many other aspects of her life like her opinions about plastic surgery and her larger-than-life persona.
Dolly's incredible personality was a big part of the promotional tour for the book.
"I love it that people can laugh at my expense,"
she says, her blue-green eyes widening for emphasis.
"I laugh at my expense. It's not like I have not left myself wide open for all this. This is part of who I am, part of who I want to be… Why would I get offended and upset for somebody to make jokes about the very thing that I laid right out there for them to make jokes about?"
She mentions her appearance on the "Late Show With David Letterman" and laughs at the Top-10 list he revealed, "Surprises in the Dolly Parton Autobiography. Number 10: At birth, doctor thought he was delivering triplets. Number 6: Went on world tour in early '70s with Dalai Lama in a show called 'A Couple of Dollys.' Number 1: Consulted on the Wonderbra project."
"Dolly: My Life and Other Unfinished Business" reached the New York Times Bestseller list and stayed there for two months.
Books I've Written Books, Dolly: My Life and Other Unfinished Business, My Life, New York Times Bestseller
Team Dolly'Dolly: My Life and Other Unfinished Business' 10.01.1994


We've all seen the "road-side" stands selling Bonsai trees. They're everywhere. But have you ever stopped to see just who would sell these little trees from "Karate Kid" on the backside of the desert?
The Bonsai tree stand was parked at Wienerschnitzel on 45th and Bell. How often is it that you see Japanese living art in the parking lot of a fast food chain named for an Austrian delicacy? Two cultural worlds colliding on a Friday morning, and I was caught in the middle.
The individual working the Bonsai stand was by far the friendliest person I've met in my one year of living in Amarillo. Their laughter and happiness were infectious, and soon I was smiling and laughing while looking at the trees.
My Bonsai tree now sits on my desk, and I take it outside daily for sunlight. I water it according to instructions and keep a light mist on it. I don't know how or why, but my Bonsai brings me happiness and a tranquil feeling every time I look at it.
My editor saw me watering and caring for my Bonsai recently and announced to the office, "Hey everyone! Charlie may not care about much of anything, but he sure will water that tree!"
The Bonsai is like a dog that doesn't bite you or pee on the carpet. It needs your attention without ever being annoying about it. I love it.


text:
Q: Python matplotlib shows weired y-axis number with big number I have files produced by Linux top, sar, vmstat, etc. I've extracted data, for example memory consumption, from those files. Now I want to draw, for example memory consumption curve with Python.
I can write the following code:
from matplotlib import pyplot

x = [1, 2, 3, 4]
y = [3, 4, 5, 6]

pyplot.plot(x, y)
pyplot.xlabel("X - axis")
pyplot.ylabel("Y - axis")
pyplot.title('Hello Matplotlib!')

pyplot.show()

Which can produce the following graph:

But when I use similar code to show memory consumption, matplotlib shows weired graph:
from matplotlib import pyplot
from datetime import datetime
# Memory consumption report time
x = [datetime.strptime(d, '%Y-%m-%d %H:%M:%S') for d in ('2021-02-26 23:22:52',
                                                         '2021-02-26 23:27:52',
                                                         '2021-02-26 23:43:22',
                                                         '2021-02-27 00:03:34')]
# Memory consumption in KiB
y = [169908, 169908, 169908, 170004]

pyplot.plot(x, y)
pyplot.gcf().autofmt_xdate()
pyplot.xlabel("Time")
pyplot.ylabel("Memory consumption")
pyplot.title('Memory monitor')

pyplot.show()

I shows the following graph:

The curve itself looks correct, but the number on Y - axis is weired: why it shows negative number?
How can I get correct memory consumption number (in KiB here) on Y - axis?


text:
Future Tense.
Central Track Contributor November 14, 2012
Scenes From Last Night's Future Islands and Talk Normal Show at the Prophet Bar.
Yesterday morning, Jack Gilbert, a great American poet, died at the age of 87.
Later that night, before Future Islands began playing their first song, "Give Us The Wind," at Dallas' Prophet Bar, vocalist Samuel Herring dedicated his band's set to the poet.
It wasn't an altogether surprising move. The synth-pop/new wave band from Baltimore is known for their emotive and affecting lyrics. And this night showcased just that side of the band.
No doubt drawing inspiration from Herring, who aggressively dances and jumps around the stage while throwing punches in the air as he performs, the crowd itself — or at least those immediately surrounding the small Prophet Bar stage — couldn't contain themselves, creating an almost mosh pit at they danced. And yet, without fail, the mood continuously returned to a jovial point between songs.
Also continuous throughout the set? The unrelenting requests of songs by impatient, but joking audience members. Herring took this all in stride, though, explaining that "there has to be a little foreplay before jumping into the goods."
So, after leaving the stage for a brief pre-encore respite, the band returned to the spotlight to offer up a final three-song set based on the requests, and beginning with "Vireo's Eye."
Next came "The Great Fire," which Herring explained was based on a Gilbert poem called "The Great Fires." To say that the performance of this particular song was exceptionally emotional compared with the rest of the set is probably an understatement. And that means a lot, given the set's high emotions throughout. Still, it's true: As the chorus began and the crowd sang what would be Jenn Wasner's portion, Herring only encouraged them to sing it even louder.
Fortunately, the night ended on a lighter note — as light as Future Islands can achieve, at least — as the band played "Old Friend" from their album Wave Like Home. By the time that song finished, it seemed an apt way to describe everyone in the room.
Previous ArticleFresh to Def.
Next ArticleSpeed Demon.
Central Track Contributor
Frances Tingle January 18, 2022
Eric Grubbs January 18, 2022
Stephanie Salas-Vega January 17, 2022
Song Of The Day: Lone Rebel — "All On Me"
[PREMIERE] Song Of The Day: Kalid Abdul – "2Broke2Die"
Deep Ellum's New Proposed Noise Regulations.


text:
@ModuleGen(name = "vertx-bitsy-rom-service", groupPackage = "org.cstamas.vertx.bitsy.rom.service")
package org.cstamas.vertx.bitsy.rom.service;

import io.vertx.codegen.annotations.ModuleGen;


Crompton House Sixth Form is a centre of excellence for post sixteen education which fully equips its students with the skills and knowledge necessary to live as twenty first century citizens in a multicultural democracy, focusing on the development of the whole person.
Jonathan tagged along to a photoshoot for Stockport SAYS to hear what SAYS were all about and why they're hoping to change services for the young people of Stockport.
Here's one of 12 short videos presenting Raise The Youth's work – Hair & Beauty.


text:
Home > Perennials > Blue Cohosh >
Package *
3 Plants $17.97 10 Plants $45.99 50 Plants $79.99 100 Plants $139.99
When do you want your order to ship?
Now Fall 2019
Blue cohosh is a member of the barberry family of plants, which proliferate in the eastern region of the United States where rainfall is plentiful, and dense hardwood forests can give it slight shade from the hot sun. It gets its name from the pretty blue fruit that grows in clusters on the end of its stems covered in light green foliage after the tiny yellow flowers have fallen off in the spring. But some also call it by the name given to it by Native Americans, which is "squaw root."
This perennial grows up to 3 feet in height once it has reached full maturity. This usually only takes a season to achieve, so it is a beautiful addition to gardens which are newly planted and still a bit bare. It will produce the most fruit and grow faster if it is fertilized in the early part of the spring and later in the fall when it focuses its growth in its roots.
Blue cohosh can be planted by itself, but it works best when several of them are set side-by-side in a hedge because they help to pollinate each other this way.
And this ensures that they bare fruit. Those who have small container gardens can still grow them individually in a pot with good drainage out on their balcony or porch though. Woodland areas often have this wildflower growing under large canopy trees.
This plant is known for its medicinal attributes to pregnant women, especially its labor-inducing hormone balancing properties when it is combined with its close relative "black cohosh." So some gardeners grow large groups of it, which allows them to harvest some of the plant's roots at the end of each season.
The roots have to be dried and ground up before the Blue Cohosh is made into a tea.
Virginia Bluebells
Bugleweed


text:
Meisseni Szent Bennó (Hildesheim, 1010 – Meißen, 1106. június 16.) a németországi Meißen püspöke volt.

Életének korai szakaszáról keveset tudni; nem bizonyítottak azok a feltételezések, hogy a nemes szász Woldenburg család tagja, vagy hogy fiatalkorában a hildesheimi Szent Mihály-kolostorban tanult, ahogy későbbi életrajzírói állították. Valószínűbb, hogy Goslar kanonokjaként kezdte pályafutását. 1066-ban IV. Henrik német-római császár kinevezte a meisseni egyházmegye élére. 1073-ban a szász felkelés támogatója volt, bár Hersfeldi Lambert és más kortársak szerint nem nagy szerepet vállalt benne. Henrik bebörtönöztette Bennót, de 1078-ban kiengedte, azzal a feltétellel, hogy hűségesküt tesz neki, amelyet azonban Bennó nem tartott meg. Újra az uralkodó ellenségeit támogatta, emiatt az 1085-ös mainzi zsinaton megfosztották püspöki hivatalától. Ezután Bennó Guiberthez fordult, aki III. Kelemen néven ellenpápa volt ebben az időben, és akit Henrik támogatott. Elismerte, hogy a császár ellen fordult, és feloldozást nyert Kelementől, aki Henrik kegyelmébe ajánlotta. Ezzel visszakerült a püspöki székbe.

Bennó ígéretet tett, hogy befolyását a szászok megbékítésére használja, de ezt az ígéretét sem tartotta be, és 1097-ben III. Orbánt ismerte el törvényes pápának. Ez az utolsó cselekedete, ami történelmileg kimutatható; későbbi tevékenységére, melyek misszionáriusi tevékenységéről, templomépítéséről és az egyházzene iránti elkötelezettségéről szólnak, nincs bizonyíték.

Bennó sokat tett egyházmegyéjéért egyházi reformokkal – a hildebrandi reformokat követve – és anyagi fejlesztésekkel is. Szülőhazájában, Szászországban a középkor vége felé már szentként tisztelték. Meissen későbbi kanonokjai és György szász herceg a 15. század végén összefogtak, hogy elérjék Bennó szentté avatását – a kanonokok szerették volna elérni, hogy szűkebb pátriájuk hírnevét emelje egy helybéli szent, a herceg pedig olyasvalakit keresett, aki megfelelő példakép lehet az egyház megreformálásához. VI. Adorján pápa 1523-ban avatta szentté Bennót. Bár a szentté avatásnak nem volt sok köze a lutheri reformációhoz, az ebben az időben zajló viták során mindkét fél jelképnek tekintette: Luther a szentek kultuszával kapcsolatos korai írásaiban szidalmazta, a katolikus reformerek az ortodoxia jelképét látták benne, a Wittelsbach család pedig München és Bajorország védőszentjévé tette, miután sírját 1539-ben protestánsok meggyalázták.

John Foxe angol protestáns történész és mártírológus elismételte azokat a vádakat, melyeket Bennó hozott fel VII. Gergely pápa ellen az invesztitúraharcok során – többek közt a nekromancia vádját, egy gyilkossági kísérlet megszervezését, ítélet nélküli kivégzéseket, igazságtalan kiközösítéseket, egy korábbi barátja megkínzását, valamint az eucharisztia tagadását és meggyalázását.

Bennó ünnepnapja június 16. Ábrázolásain gyakran könyvvel ábrázolják, illetve hallal, amelynek a szájában kulcs van (Bennó a halászat védőszentje is). A halas ábrázolás egy legendából ered, mely szerint IV. Henrik megparancsolta, hogy a székesegyház kulcsát dobják az Elba folyóba; később egy halász megtalálta egy hal gyomrában és elvitte a püspöknek.

Források

 David Collins SJ: Reforming Saints. Oxford: Oxford University Press, 2008. pp. 3–6, 28-39, 45-46.
 Christoph Volkmar: Die Heiligenerhebung Bennos von Meißen (1523/24). Spätmittelalterliche Frömmigkeit, landesherrliche Kirchenpolitik und reformatorische Kritik im albertinischen Sachsen in der frühen Reformationszeit (Reformationsgeschichtliche Studien und Texte; 146), Münster 2002.
 David Collins SJ: "Bursfelders, Humanists, and the Rhetoric of Sainthood: The Late Medieval vitae of Saint Benno". Revue Benedictine 111 (2001): 508-556.
 Philip M. Soergel: Wondrous in his Saints (Berkeley: Univ. Calif. Pr., 1993), 181-191.

Külső hivatkozások
St. Benno page at Christian Iconography

Német szentek
Német katolikus püspökök
Szászok
11. századi püspökök
1010-ben született személyek
1106-ban elhunyt személyek


text:
Dulquer Salmaan – Not Here To Compete, Bollywood Debut
October 17, 2017 by Bollywoodtoday.in	No Comments
By Team NewsHelpline
Malayalam Superstar Dulquer Salmaan is all set to make his Bollywood debut alongside Irrfan Khan in the film titled "Karwaan", says he is not here to compete with anyone.
"I don't see myself coming to compete with anybody. There is enormous talent here. I am here only to do good work. I do not want to lose my focus in the Malayalam film industry. That is where I primarily work. I will work in Tamil and Hindi only based on the work I get offered" quips Dulquer about facing competition in Bollywood.
Further talking about his Bollywood Debut, Dulquer added, "It should be out in April or May next year. It is called Karwaan. It has me, Mithila Palkar, Irrfan Khan and Amala Akkineni. It is a pretty interesting cast. It is a road trip film and is funny and light-hearted"
Dulquer Salmaan is son of veteran actor Mammootty, popularly referred to as DQ, has a massive fan following but remain unperturbed by it.
"I don't think too much about it. I think it is really sweet but that's about it, I think it is better if I don't think about these things" said Dulquer, when asked about fan following.
Dulquer will also be seen playing the role of legendary actor Gemini Ganesan in the biopic on actress Savithri. Talking about his role in the film, he said, "I spoke to his family and went with what the director told me. I am trying to capture what he was more off screen than on screen. I am not going to imitate him or his performances. I am going to get the essence of the man off screen."
"Karwaan" is an upcoming comedy road movie, which also stars Mithila Palkar, Kriti Kharbanda and Hussain Dalal in pivotal roles.


text:
Brenda Fricker Biography
By Kylie - Dec 28, 2020
Quick Facts Of Brenda Fricker
Famous as an Academy Award-winning Irish actress.
Known for her performance in the biopic, "My Left Foot"(1989).
Desmond Frederick Fricker
Grainne Fricker
$11 million.
5ft. 7inch.(1.7m)
Brenda Fricker is an Irish retired actress who is well known for her performance in the biopic, "My Left Foot"(1989) for which she even won an Academy Award for Best Supporting Actress. In her decade long career that spanned for 60 years on stage and screen appearing in more than 30 films and television roles, Fricker has undoubtedly managed to establish herself as one of the prominent actresses of all time.
Her other work includes; "The Field"(1990), "Home Alone 2: Lost in New York"(1992), "Veronica Guerin"(2003), "Inside I'm Dancing"(2004), and "Albert Nobbs"(2011). She is also a theatre actress who has appeared in productions of famous plays like "Cat On a Hot Tin Roof".
For her excellence in her field for decades, she was honored with the inaugural Maureen O'Hara Award at the Kerry Film Festival in 2008. She was recently listed at number 26 on The Irish Times list of Ireland's greatest film actors in 2020.
What is Brenda Fricker Famous for?
Where was Brenda Fricker Born?
Brenda Fricker was born on February 17, 1945, in Dublin, Ireland. Her birth name is Brenda Fricker. Her nationality is Irish. Fricker belongs to the White ethnicity while Aquaris is her zodiac sign.
Brenda Fricker was born as the daughter of her well-to-do family; Desmond Frederick Fricker(father) ad Bina(mother). Her father, Desmond served as a broadcaster with RTE and a journalist for The Irish Times back then while her mother, Bina was a teacher at Stratford College.
Brenda grew up in her hometown along with her sister, Grainne Fricker during which she developed an interest to become an actress. However, after her high school graduation, she worked as an assistant to the art editor of the Irish Times initially aspiring to become a reporter.
By the fate of chance, she stepped a step ahead in the world of the film industry with her small uncredited part in the 1964 film Of "Human Bondage" at ae of 19. She also got a chance to appear in Ireland's first soap opera, "Tolka Row".
Source: @liambluett
Brenda Fricker's Career Highlights
Brenda Fricker started her career as an actress with one of her first TV roles as staff nurse Maloney in "Coronation Street" in 1977.
She then went on to become popular when she was cast as Megan Roach in the BBC One television drama series, "Casualty".
In 1989, she got her big break when she was cast as Christy Brown's mother in the hit biopic, "My Left Foot". Her role actually earned her an Academy Award for Best Supporting Actress gaining her international acclaim.
A year later, in 1990, she rejoined Jim Sheridan(director of My Left Foot) in his other drama film, "The Field".
She then starred in the Australian-produced short series, "Brides of Christ"(1991) and also co-starred in the TV miniseries, "Seekers"(1992).
Following her worldwide popularity, she went on to appear in a high-profile Hollywood film, "Home Alone 2: Lost in New York" as the Central Park Pigeon Lady in 1992.
In 1993, she portrayed May Mackenzie in the romantic comedy film, "So I Married an Axe Murderer".
She then portrayed Maggie in the 1994 family comedy, "Angels in the Outfield".
Her last Hollywood film role was as Ethel Twitty in "A Time to Kill" in 1996.
She then played Bernie Guerin, mother of Veronica Guerin in the film, "Veronica Guerin" in 2003.
She also starred as nurse Eileen in the film, "Inside I'm Dancing"(2004).
In 2007, she co-starred in Richard Attenborough's post-World War II drama, "Closing the Ring".
In 2011, she played a supporting role in the drama film, "Albert Nobbs". The same year, she became half of the first pair of Oscar-winning actors to play a same-sex couple in "Cloudburst".
Her last appearance in movies was as Brenda in "A Long Way from Home" and as Mrs. Smith in "Forgive Me" both in 2013.
Source: @amazon
Brenda Fricker's Husband
Brenda Fricker has been married just once through her lifetime. Her first and the only marriage was with Barry Davies. Davies is a director with whom she got married in 1979 but they ended up their relationship in 1988 after almost 9 years of their marriage.
Fricker currently lives in The Liberties, Dublin. Even in the Christmas of 2020, she spent her time alone stating that "Christmas can be a dark time". Besides, she loves to be with her pet dogs, drinking Guinness, reading poetry, and playing snooker.
Brenda Fricker's Net Worth
Brenda Fricker has quite good earnings from her professional career as an actress. Having her career started initially as a theatre actress back in 1964, Fricker has managed to come a long way up becoming one of the popular actresses in her decade-long career.
With her appearance on several movies and TV shows, Fricker has undoubtedly managed to amass a wealthy fortune. Her source of income is surely her appearances in movies and series. Including which her net worth is estimated to be around $11 million.
Brenda Fricker's Height
Brenda Fricker is a gorgeous lady with a well maintained average body physique in her 70s. She stands tall with a height of 5ft. 7inches.(1.72m) while her body weighs around 80kg. Her body measurement is around 36-35-32 inches with a bra size of 36B, 6(US) as her dress size, and 6(US) as her shoe size. She has a fair complexion with blonde hair and green eyes.
#Oscar
#My Left Foot
#Home Alone
#Pigeon Lady
Permalink: https://gossipgist.com/brenda-fricker
Pierluigi Collina Biography
Kylie / December 28, 2020
Justin Shearer Biography
Gelson / December 28, 2020


Breezy Palms Resort is 70 miles from Miami International Airport and 95 miles from Ft. Lauderdale Airport on U.S. 1 (mile marker 80, Oceanside) in Islamorada. We are also 80 miles from Key West, about an hour and a half drive.
Swimmers can enjoy both the warm Atlantic and our sparkling fresh-water pool year-round in Breezy Palms tropical family resort paradise located 80 miles south Miami, Florida. We have 320 feet of ocean frontage, with a sheltered harbor, spacious dock (which is well-lit for night fishing), and an easily accessible boat ramp.
You'll be enchanted by the fabulous view of this Florida family resort, while soaking up the sun on our sandy oceanfront lounging area or having cookouts on our barbeques under the swaying palms.
Islamorada is the "Sport Fishing Capital of the World," with every variety of exciting game fish and delicious table fare available in the Florida Keys area. At our family resort, you will find charter boats are conveniently nearby, or you can chart your own course.
The Famous Alligator Reef is just four miles offshore; an ideal area for scuba diving, snorkeling and underwater photography. Onshore, the beautifully landscaped grounds of our Florida family resort, offer volleyball and shuffleboard.


text:
UNDERRATED EASTWOOD: FIREFOX (1982)
January 23, 2020 January 23, 2020 robertemmetsweeney1 Comment
Beginning on July 9th, the Film Society at Lincoln Center in NYC will be mounting their misleadingly titled"Complete Clint Eastwood" series, which will run all the films he directed, but only a select few of his key acting turns (it's a superb program regardless). It's in honor of his 80th birthday, which our own Susan Doll celebrated a few months back. With Clint well represented on home video, it's easy for anyone outside NYC to curate their own Eastwood retrospective, and one that I suggest deserves re-evaluation is his 1982 spy thriller, Firefox. His entire early 80s output, from Bronco Billy (1980) through Sudden Impact (1983), is extraordinary and relatively forgotten, but Firefox, perhaps due to its bizarre sci-fi trappings, has been judged harshly and dumped into the late-night cable dustbin.
Eastwood plays Mitchell Gant, a retired Air Force pilot suffering from hallucinations of his time as a POW in the Vietnam War. He's called back into action after the U.S. learns that the USSR had completed construction of a high-tech MiG-31 plane, code-named Firefox. Able to fly at 6-times the speed of sound, invisible to radar, and with a weapons system commanded by the pilot's mind, eliminating reaction time during dogfights, it could swing the arms race and the momentum of the Cold War. Gant is tasked to steal it because of his language skills, since the plane's system will work only with someone thinking in Russian. In comparing it to his more satiric Eiger Sanction, Eastwood said, "Firefox was more 'square', more traditional. It was about bad guys with pink eyes, but ordinary characters faced with an impossible mission."
Gant is so ordinary as to be anonymous. Thrust rather unwillingly into the teeth of the Cold War, he is a bundle of anxiety. Eastwood works out various permutations of uneasiness on his face, raising his lips in grimaces and lowering them in scowls representative of a man supremely uncomfortable in his own skin. Shuttled from disguise to disguise and personality to personality (from an American heroin dealer to a tourist to a Russian pilot) acts as a subtle commentary on his own constructed personas. The ironic anti-heroism of his Man With no Name and the obsessive obstreperousness of Dirty Harry, then, are merely other skins, and his queasy performance reflects his ambiguous relationship to them. All of his films, it seems, are re-evaluations and deconstructions of his own personality, and Firefox is one of the earliest and smartest examples of this (taken up later by Sudden Impact straight through to Unforgiven and Gran Torino).
Gant isn't a heroic figure as much as a man buoyed by circumstance. He never seems in control, pushed forward by his CIA handlers, then handed off to his resistance contacts in Russia, always instructed carefully, never in charge of his own fake lives. In fact, Gant is repeatedly chastised for his performances, encouraged to feign sickness to cover-up his awkward acting chops. His awkwardness and ever-present fear make this film more in the vein of John Le Carre than James Bond, and Bruce Surtees' low-light photography perfectly expressive of its harshly deterministic narrative. Each of the men he meets is invested body and soul for the future of Russia, and stoically give up their lives for their cause, while Gant is a confused hired gun doing the job because he's the only one who can. He seems without ideology, disturbed by the resistance fighters heroic sacrifices, giving their lives on the slim chance that Gant will succeed. It's a utilitarian spy movie, a morbid landscape where bodies are disposed of after they fulfill their mission, a grim game where deaths are freely given for the slim hope of success. Dave Kehr has even described the film's terseness as "Bressonian" in his Chicago Reader capsule review, and it's hard to disagree, or even think of another 80s action movie where that could even be remotely applicable.
In an interview with Michael Henry, he says that Firefox "is the only one of my pictures I used storyboards on." And while he specifically mentions how he mapped out the final plane special effects sequences, the film as a whole seems finely structured. The major movement is from the dark spy sequences to the bright blue skies of the flight out of Russia, but there are micro-movements inside, including some expertly paced cross-cutting sequences. The opener cuts between the U.S. government war room and the attempt to convince Gant to join the mission at his woodsy home.
It quickly dispenses with the back-story while introducing the idea that Gant is a small pawn in major geo-political movements. This becomes clear during the final cross-cutting sequence, which shifts between the Soviet and U.S. war rooms tracking Gant's movements in the air, with Gant himself caught in the middle, speaking Russian to an obliging super-plane.
Gant seems happiest in this final movement, cut off from humanity, and submerging his personality into a machine.He's destroying his individuality while ostensibly flying to freedom. The images brighten as thematically the film grows even darker – self-annihilation as a kind of euphoric release.
Posted in Action, HollywoodTagged Clint Eastwood, Firefox


KRIVIDA Safety lancets are single-use devices with double spring technology for capillary blood sampling dedicated to healthcare professionals. They are an integral component to the sharps-injury prevention programs in hospitals, clinics, laboratories, doctor's offices. By using safety lancets needle-stick injuries and infections can be eliminated.


MANRYU (1897-1973. Real name, Shizu Tamukai) was one of the most popular Geisha during the last years of the Meiji-era (until 1912), and probably into the early years of the Taisho period. Not only popular in Tokyo, but in all Japan, as she was one of the few, original advertising poster girls for all kinds of products in her day.


INTERESTING? How so, Sen. Clark?
Russians pump the fake news on social media, but they get help from the likes of Sen. Alan Clark of Lonsdale.
Clark went to Facebook to propagate the gun lobby theme that students from Florida leading a gun reform movement were actors or somehow props for others.
A legislative aide in Florida was fired for putting out this nonsense. Could we fire Alan Clark?
He thinks it a strange coincidence that David Hogg has been on TV in Florida and California. Appearances in two different years on different topics a coincidence?
Not that facts matter to Alan Clark, but perhaps he should read how, through the miracle of digital communication, the Florida student, David Hogg, could have appeared in a video made when he was on vacation in California in 2017 and then this week, 2018, in Florida on unrelated topics.
How many times has Alan Clark been on TV? Once is too many. But his Facebook fans eat up the gun nuttery.


text:
Home Perspectives A War of Lies
A War of Lies
A war that is supposed to help feed the desperate people of Afghanistan will in fact help starve them.
A war supposedly brought on by Taliban intransigence was actually provoked by our own government.
A war that the majority of the American people believe is about their grief, anger and desire for revenge is really about the cold-blooded calculations of a small elite seeking to extend its power.
And a war that is supposed to make us safer has put us in far greater danger by increasing the likelihood of further terrorist attacks.
Let's take those points in order.
Our undeclared war on Afghanistan is the culmination of a decade of U.S. aggression with a humanitarian façade.
Once the natural sympathies of the American people were touched by the plight of the long-suffering Afghan people, public opinion swung toward helping them. In response to this, the administration concocted the most shameless and cynical cover story for military strikes in recent memory.
The idea, leaked last Thursday, went like this:
++The Afghan people are starving, so we need to do food drops. (Never mind that all those experienced in humanitarian aid programs are opposed to food drops because they are dangerous and wasteful, and, most important, preclude setting up the on-the-ground distribution networks necessary to making aid effective.)
++We need to destroy the Taliban's air defenses before doing food drops.
++The transport planes may be endangered by the Stinger anti-aircraft missiles that the United States supplied the mujaheddin in the 1980s when they were fighting the Soviet Union, and some of which ended up in the Taliban's hands.
++We have to destroy the Taliban's air defense. Because so much of it is mobile, we have to bomb all over.
The bombing will seriously hinder existing aid efforts. The World Food Program operates a bakery in Kabul on which thousands of families depend, as well as many other programs. A number of United Nations organizations have been mounting a major new coordinated humanitarian campaign. These efforts were not endangered by the Taliban before, but the chaos and violence created by this bombing — combined with a projected assault by the Northern Alliance — will likely force UN personnel to withdraw, with disastrous effects for the Afghan people.
To add insult to injury, in the first day the United States dropped only 37,500 packaged meals, far below the daily needs of even a single large refugee camp. With 7.5 million people on the brink of death and existing programs disrupted, this is a drop in the bucket compared to the damage caused by this new war.
Those who starve or freeze will not be the only innocents to die. It should finally be clear to all that "surgical strikes" are a myth. In the Gulf War, only 7 percent of the munitions used were "smart," and those missed the target roughly half the time. One of those surgical strikes destroyed the Amiriyah bomb shelter, killing somewhere from 400 to 1,500 women and children. In Operation Infinite Reach, the 1998 attacks on Afghanistan, some of the cruise missiles went astray and hit Pakistan. Military officials have already admitted that not all of the ordnance being used is "smart," and even the current generation of smart weapons hit their target only 70 to 80 percent of the time.
Contrary to U.S. propaganda, civilian targets are always on the list. There are already reports that Mullah Omar, the leader of the Taliban, was targeted for assassination, and the Defense Ministry in Kabul — surely no more military a target than the Pentagon — and located in the middle of the city, has been destroyed.
This is standard U.S. practice. In the Gulf War, virtually every power station in Iraq was destroyed, with untold effects on civilians. A correspondent for al-Jazeera TV reported that power went out in Kabul when the bombing started, although it was restored in some places within hours. Targeting of any pitiful remnants of civilian infrastructure in Afghanistan would be consistent with past U.S. policy.
George Bush said we are not at war with the Afghan people — just as we were not at war with the Iraqi people or the Serbian people. The hundreds of thousands of Afghans who fled the cities knew better.
Military analysts suggest that the timing of the strikes had to do with the weather. Another possible interpretation is that the Taliban's recently-expressed willingness to negotiate posed too great a danger that peace might break out. The Orwellian use of the term "diplomacy" to describe the consistent U.S. policy of no negotiations — accept our peremptory demands or else — helps to mask the fact that the administration always intended to launch this war.
The same tactic was used against Serbia; at the Rambouillet negotiations in March 1999, demands were pitched just high enough that the Serbian government could not go along.
In this case, the Taliban's offer to detain bin Laden and try him before an Islamic court, while unacceptable, was a serious initial negotiating position and would have merited a serious counteroffer — unless one had already decided to go to war.
The administration has many reasons for this war.
++The policy of imperial credibility, carried to such destructive extremes in Vietnam. In perhaps the last five years of direct U.S. involvement there, the goal was not to "win," but to inflict such a price on Vietnam that other nations would not think of crossing the United States.
++The oil and natural gas of central Asia, the next Middle East. Afghanistan's location between the Caspian basin and huge markets in Japan, China and the Indian subcontinent gives it critical importance. A U.S-controlled client state in Afghanistan, presumably under the exiled octogenarian former king, Zahir Shah, would give U.S. corporations great leverage over those resources. Just as in the Middle East, the United States does not seek to own all those resources, but it wants to dictate the manner in which the wells and pipelines are developed and used.
++The potential to push a radical right-wing domestic agenda. War makes it easier to expand police powers, restrict civil liberties, and increase the military budget.
This war is about the extension of U.S. power. It has little to do with bringing the terrorists to justice, or with vengeance. Judging from initial polls, the war has been popular as the administration trades on people's desire for revenge — but we should hardly confuse the emotional reaction of the public with the motivation of the administration. Governments do not feel emotions.
This war will not make us more secure. For weeks, many in the antiwar movement — and some careful commentators in more mainstream circles — have been saying that military action was playing into the hands of Osama bin Laden, who may have been hoping for such an attack to spark the flames of anti-American feeling in the Muslim world. Bin Laden's pre-taped speech, broadcast on al-Jazeera television after the bombing started, vindicates that analysis.
"Either you are with us or you are with the terrorists," Bush said on Sept. 20. Bin Laden's appeal to the ummah, the whole Islamic world, echoed this logic: "The world is divided into two sides — the side of faith and the side of infidelity."
The American jihad may yet be matched by a widely expanded Islamic one, something unlikely had we not bombed. Remember, we have seen only the opening shots of what many officials are calling a long-term, multi-front war in which the secretary of defense has told us there will be no "silver bullet." The administration has clearly been preparing the American people to accept an extended conflict.
Bin Laden's world is Bush's, in some strangely distorted mirror. A world divided as they seem to want would have no place in it for those of us who want peace with justice.
All is not yet lost. The first step is for us to send a message, not just to our government but to the whole world, saying, "This action done in our name was not done by our will. We are against the killing of innocents anywhere in the world."
The next step is for us to build a movement that can change our government's barbaric and self-destructive policy.
If we don't act now to build a new world, we may just be left with no world.
Mahajan is a doctoral candidate in physics and Jensen is a professor of journalism at the University of Texas at Austin. Both are members of the coordinating committee of the National Network to End the War Against Iraq.
Previous articleRethinking negotiations
Next articleGutter Journalism in Times of War
The Shame of Katrina is still with us
There is No News Today
The Myth of 'Bengali Migration' to Arakan
Are Men Unqualified to Criticize the Pro-Abortion Movement?


Changes $oldFieldname to $newFieldname. $filename is checked for both names: if it already contains the new name or doesn't contain old one, nothing happens.–You probably want to use this function only in some sort of database managment script.
Prior to version 1.2 this function's name was ptb_changeFieldName.


Dwayne Johnson has welcomed his third daughter — and he's right back in newborn mode. The actor better known as "the Rock" announced the arrival of his second child with Lauren Hashian by sharing a photo of dad and baby sweetly cuddling skin to skin. The hulking star is seen peacefully holding little Tiana Gia Johnson to his tattooed torso as he sits in his wife's hospital bed. The "blessed and grateful" dad — who also has 2-year-old Jasmine with Hashian and 16-year-old Simone Alexandra Johnson from his marriage to Dany Garcia — marveled over bringing another "strong girl into this world." The actor, 45, said Tiana "came into this world like a force of nature," and called his future wife Hashian a rock star. Big truck, big muscles, big heart.


text:
Boylston Market era un edificio ubicado en la ciudad de Boston, la más importante de Massachusetts (Estados Unidos). Fue diseñado por el arquitecto Charles Bulfinch y construido en 1810 en la esquina de las calles Boylston y Washington. El Boylston Hall ocupaba el tercer piso del edificio y funcionaba como un espacio para reuniones y presentaciones. Fue demolido en 1887.

Historia
La Asociación de Boylston Market desarrolló el edificio. John Quincy Adams fue el primer presidente de la asociación. En 1809, los propietarios pagaron 20 560 dólares por la tierra que anteriormente pertenecía a Joseph C. Dyer (y a Samuel Welles antes que él). El nuevo edificio "fue nombrado en honor al benevolente y filantrópico Ward Nicholas Boylston".

Arquitectura

La construcción comenzó en abril de 1810 y se completó el mismo año. El edificio de 3 pisos medía 120 pies de largo y 50 pies de ancho. "En el primer piso hay 12 puestos de venta de víveres. El segundo está separado por una avenida longitudinal, a cuyos lados hay 4 espaciosas habitaciones. El tercer piso consta de una sala de 100 pies de largo con todo el ancho del edificio. la altura central del techo es de 24 pies. Contiene una orquesta y 2 cómodos salones contiguos".

"En 1859 se hizo una extensión de 12 metros". "En 1870, la estructura de ladrillo macizo se retiró de la calle tres metros y medio sin molestar a los ocupantes".

Inquilinos
Los primeros inquilinos incluyeron la Sociedad Linnaean de Nueva Inglaterra y el Museo de Nueva York de Edward Savage hacia 1812, ambos "elegantemente equipados con curiosidades naturales y artificiales". La Handel and Haydn Society celebró conciertos en la sala durante varios años. En 1845, algunos de los miembros del Sindicato de Protección de los Trabajadores abrieron una tienda en el segundo piso. Otros vendedores en el mercado incluían a los comerciantes de mantequilla y queso M. C. Strout y F. H. Thomas (c. 1877).

Los eventos especiales en Boylston Hall incluyeron la Convención contra la esclavitud de Nueva Inglaterra, 1834;  Celebraciones del 4 de julio de la Sociedad Antiesclavista de Nueva Inglaterra en la década de 1830; y "Gran Panorama serial de México" de Corydon Donnavan, c. 1848: "Capt. Donnavan, durante varios meses prisionero durante la reciente guerra en [México], dará un discurso explicativo, relatando muchos incidentes de la guerra, la vida mexicana, los modales, etc., mientras la pintura pasa ante la audiencia ".

Demolición
El mercado de Boylston fue demolido en 1887. En su lugar, se erigió el "Edificio Boylston". El campanario de la estructura original del mercado de Boylston fue a la Iglesia Metodista Calvary en Arlington, en 1921.

En la cultura
El poeta John Pierpont se refiere al mercado de Boylston en su poema de 1840 The Drunkard's Funeral (El funeral del borracho).

Galería

Referencias

Obras de Charles Bulfinch
Cultura de Boston
Historia de Boston
Edificios y estructuras de Boston
Edificios y estructuras demolidos de Estados Unidos


Our combination of enterprise hardware, the latest virtualisation technology and our user-friendly web interface make our cloud servers the ideal solution for your business.
Instant access to virtually unlimited resources.
All Cloud Servers deployed and ready to use within 5 minutes!
All our equipment is housed in a secured server pod at the Vocus Data Centre in Alexandria, Sydney. Building access is restricted to approved card access holders and all equipment is housed in locked cabinets. Cloud People only use enterprise class hardware from the most respected vendors in the business. Our primary storage is fibre channel SAS SANs.
Our cloud platform is designed and configured with the highest levels of redundancy. Every layer of our cloud is duplicated and configured for automatic failover. In the event of a physical server node failure the affected cloud servers will be restarted automatically on another node. We constantly monitor our platform. High-frequency checks means failure of individual components are confirmed faster and resolved quicker. The performance of our platform is also monitored externally from forty locations globally.
Every customer is provided access to our server backup technology – for free. Full server snapshot images can be scheduled to occur daily and weekly, or manually run on demand. These snapshots allow customers to completely restore a cloud server to a known good state in a matter of minutes. These backups are stored on physically separated and fully secured secondary storage systems.


text:
About the HN
2015 ALL RIGHT RESERVED - cairo WordPress Theme
Home Women's Basketball What the newest Indiana Miss Basketball can do for IUWBB
What the newest Indiana Miss Basketball can do for IUWBB
Austin Render
Jorie Allen received the coveted Indiana Miss Basketball jersey Sunday evening. (Indiana Athletics)
The newest recipient of the Indiana Miss Basketball award will be suiting it up for the Hoosiers next season. Indiana's incoming freshman, Jorie Allen, received the award Sunday and is now the third ever Hoosier to own that title, joining future teammate Ali Patberg and 1987 IU alum Lori Meinerding.
In her senior campaign at Bedford North Lawrence, Allen averaged 19.1 points and eight rebounds per game and became the all-time leading scorer in school history with 1,930 career points.
Another weapon
What does this all mean for Indiana? Well it adds yet another weapon to an already loaded Indiana roster for next season. They will return four of five starters from last year's NCAA-Tournament team (depending on the recovery of Bendu Yeaney after undergoing surgery to repair her ruptured left Achilles). They also return several key weapons off the bench in Grace Berger, Aleksa Gulbe, Keyanna Warthen and Chanel Wilson, who missed all of last season with injury.
Indiana also brings in a loaded freshman class alongside Allen, with Shaila Beeler, MacKenzie Holmes and Arielle Wisne making up the 18th overall class in the country according to ESPN and 12th in the nation, 4th in the Big Ten according to Collegiate Girls Basketball Report. Holmes is a five-star post player from Maine who seems to fit seamlessly into this year's team.
Filling the voids
As mentioned earlier, Yeaney underwent surgery in March to repair her ruptured left Achilles which she suffered in the second round of the NCAA Tournament. There's no timetable for her return so there's a chance someone will have to fill her spot in the lineup for some games next season.
Jorie Allen is a perfect candidate for that spot in the lineup. She is a 6-foot-1 wing who isn't afraid to mix it up on the boards, something that Yeaney was great at. At Bedford North Lawrence, Allen didn't take a ton of threes, shooting 14-of-69 in her four years with the Stars. However, with shooters around her like Patberg, Penn, Wise and Berger, three-point shooting won't necessarily be called for from Allen, similar to Yeaney's role in the offense.
Her length will give teams issues as well on the defensive side of the ball. Yeaney was arguably Indiana's best on-ball defender, but with Allen's 6-foot-1 frame, she could prove to be a problem for other teams' wing players as well.
It will be interesting to see, if Yeaney cannot go to start the season, will it be Allen or Berger to start in the backcourt with Patberg and Penn.
All of this talk about Allen doesn't even mention that Holmes, the other five-star in this class, could be the perfect fit to fill the one open starting spot in the post, replacing Kym Royster. At 6-foot-3, Holmes will be a matchup issue in the post for many teams and will pair well with Wise in the frontcourt.
Indiana calls upon their guards to help rebound the ball at high rates, especially this past year with a relatively small Indiana frontcourt. Wise and Royster combined to average 12.4 rebounds per game, but it's the numbers that the guards put up that stands out.
As a point guard, Patberg averaged five rebounds per game to go along with her 15.8 points and 4.8 assists per game. Yeaney added 4.1 rebounds per game and Penn and Berger combined for another 6.4 rebounds. The starting backcourt, plus Berger off the bench, combined for 15.5 rebounds per game.
Why does that matter? Because this was a key part Allen's game at Bedford North Lawrence. Allen averaged eight rebounds per game but is still expected to play the wing at Indiana. That's important because Moren puts an emphasis on guard rebounding to help out their bigs down low. Allen will fit right into what Moren wants out of her wings in terms of rebounding.
Overall, there's no denying that Allen, along with the rest of this freshman class, will be huge for this program to take the next step. Adding these five-star talents to an already loaded roster is sure to produce some positive steps for a team that was already in the NCAA Tournament a year ago.
Indiana Women's Basketball
iuwbb
Jorie Allen
I am a sophomore from Fort Wayne, Indiana majoring in Sports Media. Last year I worked with IUSTV Sports doing recap and feature packages for IU field hockey, women's basketball and baseball. I am one of the current WIUX Co-Sports Directors. I am a student broadcaster for WIUX as well as Big Ten Network Student U. You can reach me at austinrender99@gmail.com and you can follow me on Twitter @austinrender.
Report: Indiana hires Charlton Warren as new defensive coordinator, adding experience as defensive backs coach, recruiter
Indiana found its replacement for defensive coordinator Kane Wommack on Sunday. The new leader of the defense will be Charlton…
Hoosiers retain Big Ten Receiver of the Year, but lose key linemen. What does it mean for 2021?
A sense of belief was created around Indiana football in 2020, and it will return 18 of its 22 starters…
Indiana Basketball Podcast: Will The Pain And Suffering Ever End?
Thursday's loss to Purdue is Archie Miller's sixth straight, and it has us asking each other if the pain and…
Indiana has 'no answer' for Purdue offense as losing streak extends to eight
There were good stretches, energized efforts as a team, and it even was a one-point game with 13 minutes to…
'We take defense seriously': Indiana shuts down Purdue in commanding road win
Holding Purdue to an abysmal shooting performance, it is clear that the Indiana defense came to play, as the Hoosiers…
Indiana prepares to host rival Purdue in pivotal matchup
On the precipice of the second half of its schedule, Indiana has a monumental matchup Thursday in Bloomington that could…
Indiana Basketball Podcast: Time to Beat Purdue
Austin Render, Jackson Yeary and Connor Hines are back together for the latest episode. They break down the Wisconsin game…
The Basketball State
The Flagship
Three takeaways from Indiana women's basketball's 69-49 loss to Northwestern
Indiana Football Podcast: FIU Recap
Indiana Basketball is Getting a Winner in 2020 Commit Trey Galloway
2017 ALL RIGHT RESERVED - CAIRO NEWS WORDPRESS THEME by CODEPAGES


Who was considered for Aladdin?
Brad Kane was originally hired to be BOTH the speaking and singing voice of Aladdin, but at the last moment they gave the speaking voice to Scott Weinger.
Note: This Aladdin trivia and all movie trivia on notstarring.com is submitted and reviewed by movie fans from around the world. We strive to provide reliability in our movie trivia database, and we go to great lengths to try and corroborate entries. Still, by its nature, this type of trivia will always be prone to rumor and funny Hollywood gossip and should be relied upon with appropriate caution. Please help by reporting corrections for this Aladdin trivia or other movie trivia.


text:
When tenants aren't playing nice, what you do next will set the course for events to follow. These guidelines from eviction experts can help to avoid costly mistakes.
How Solid Is Your Residential Lease Agreement?
It has already been established in our step-wise guide for Landlords, how a well drafted lease agreement can simplify matters for the Landlord in the event of breach by the Tenant and also help to avoid unpleasant and costly rental disputes. Read: How To Evict A...
Spoliation And Illegal Eviction
Spoliation is usually the first thing that jumps to mind when a landlord is confronted with a problem tenant or illegal occupant. By resorting to creative, illegal tactics to get rid of the problem, a landlord could be putting an informed tenant in control...
How To Evict A Tenant
Tenant Not Paying Rent, Now What? Landlord-Tenant disputes come in many different shapes and forms but to best explain the process a Landlord could follow when a Tenant breaches the lease agreement, let's consider the most common scenario where a Tenant defaults on...
PIE Evictions
Prevention of Illegal Evictions from and Unlawful Occupation of Land Act (PIE) PIE sets out procedural and substantive requirements that must be satisfied before a court may grant an order of eviction. The procedural protection that PIE affords occupants...
ESTA Evictions
Extension of Security of Tenure Act (ESTA) ESTA applies only to occupiers of rural or peri-urban land, whose occupation is, or was, lawful in that they resided on the land with the consent of the owner. Occupiers under ESTA may not earn more than...
The Magistrates' Court Act
The landlord's tacit hypothec gives the landlord the right to attach all movable property, brought onto the property, in order to collect rent arrears. It is a powerful weapon against a defaulting tenant and can secure the landlord's claim for payment of...
Rental Housing Amendment Bill
The Rental Housing Amendment Bill was accepted by the National Assembly on 9 September 2014. It was however recalled for argument after just a few days. The main reason for further argument at this stage was that the committee wanted to do away with the term...
Lease Agreements & The Consumer Protection Act
The Consumer Protection Act 68 of 2008 has considerable impact on lease agreements. The Act has been passed in order to regulate and normalise the relationships between the suppliers of various goods and services and their consumers in the marketplace. In order to...
Rental Housing Act
The Rental Housing Act (RHA) bears specific reference to the termination of the lease agreement. Section 5(5) of the Act states: If on expiration of the lease the tenant remains in the dwelling with the express or tacit consent of the landlord, the parties are deemed...
EVICTION LAWYERS NEAR YOU
Property Litigation is a unique area of law and Specialist Eviction Attorneys are a scarce breed. Find Eviction Lawyers near you.
EVICTION LAWYER MAP
Attorneys List Here
© Grayston Media - All rights reserved.


The last item mentioned in HUD's most recent bulletin is the process for mistakes made when a case number is issued for a site condo that is not technically a "site condo" by HUD's definition.
I previously wrote an article about how determines the difference between a site condo and a typical condominium project. HUD does not require that site condo projects go through the approval process.
There has been an increase in case number requests for site condos although the units are located in a project that requires approval or are located in a PUD.
HUD is asking that lenders verify the type of property prior to requesting the case number.
If a case number is errantly assigned as a site condo when the unit is not in a site condo project, lenders and FHA staff cannot make data corrections. The correction requests must be submitted in writing to the jurisdictional Homeownership Center who will forward to Headquarters to coordinate with the contractor to make the necessary database changes.
That last paragraph is critical!
I am not involved with condominiums on the loan-level side of things, although I am well-versed in the guidelines. But I can only imagine how long it will take for a written request to be processed that has to be sent to Washington DC via the HOC so they can contact the contractor who maintains the database. My guess would be longer that it took me to type that last run-on sentence.
The bottom line here is to make absolutely certain that the unit is a site condominium before processing the case number assignment. The only way to do that is to review the legal documents to see if the project qualifies as site condos.


• Table 7.3 in EN 1998-1, which provides the limits for flange outstands to be met, for a structure to belong to a ductility class.
• Clauses 7.6.4(9) and 7.6.4(10) for fully encased profiles and clauses 7.6.5(4) to 7.6.5(6) for partially encased profiles, allowing for an increase in the limits of flange slenderness of encased H profiles by mitigating their buckling. The limits can be increased by up to 50% by means of specific measures: additional stirrups for fully encased profiles and additional straight bars welded to the inside of the flanges for partially encased profiles (see Fig. 7.8 in EN 1998-1).
Some general rules are valid for all types of members: beams, columns or diagonals.
For members in tension, reference is made to the rule of Eurocode 3 for steel sections;83 the effect of drilled holes has already been explained in Section 6.7.
assumed to be fully in compression; 'plus web connected' refers to clause 5.5.3(2) in Eurocode 4,82 'plus hoops or straight links' refers to clauses 7.6.4(9), 7.6.4(10), 7.6.5(4) and 7.6.5(5) of EN 1998-1.