text:
Nuevas investigaciones para ayudar al acceso universal al saneamiento y la higiene en las ciudades del mañana
Aditi Chandak
WaterAid/Aditi Chandak - Gandy marketplace, where traders and farmers from Babati town and other nearby areas buy and sell everything from meat and vegetables to building materials, clothing and household items.
La rápida urbanización sin una expansión constante de los servicios de saneamiento e higiene es una preocupación mundial cada vez mayor. Como parte de la campaña de WaterAid para garantizar el acceso universal y sostenible, buscamos constantemente la manera en que las comunidades urbanas puedan recibir un mejor servicio de agua apta para el consumo y saneamiento. Timeyin Uwejamomere, gerente de Apoyo Técnico Urbano de WaterAid, y Aditi Chandak, asesor de Aprendizaje y Conocimiento, presentan un nuevo proyecto de investigación para guiar la coproducción de un plan de saneamiento e higiene para la ciudad de Babati en Tanzania, apoyado por la Investigación Aplicada de Saneamiento e Higiene para la Equidad del Consorcio (SHARE).
WaterAid has been awarded a research grant for a study to understand how collaborative and consultative approaches can help to deliver sustainable and inclusive plans for small towns. The project, titled 'Achieving universal access to adequate, sustainable and equitable sanitation and hygiene services in the cities of tomorrow' will be funded by a grant from the Sanitation and Hygiene Applied Research for Equity (SHARE) Consortium, and based in Babati, Tanzania.
It will involve a combination of methods including literature review, baseline studies, formative research, political economy analysis, participatory planning and scenario building to understand the Babati context. It is expected that the lessons will guide co-production of a sanitation and hygiene plan to achieve universal access to water, sanitation and hygiene (WASH) in the town, and inform wider sector policies for achieving universal access in other small towns in Tanzania.
Rapid urbanisation
In Tanzania, cities are growing at nearly twice the rate of the country's annual population growth. More than half of Tanzania's urban population do not have access to improved toilets, and compliance with good hygiene practices is low. Densely populated, unplanned urban settlements with inadequate sanitation and hygiene services pose significant health risks and have wider impacts on education, livelihoods, wellbeing, and human dignity.
WaterAid has partnered with the Arusha-based Nelson Mandela – African Institute of Science and Technology (NM-AIST) to conduct the research in Babati town, which is headquarters of Manyara Region, and mainly agrarian with a population of 93,108 (2012). In the wake of rapid urbanisation in Tanzania, Babati has become a bustling town, where around 3% of the Council's annual budget is spent on WASH.
Babati's services
The mandate of Babati Water Supply and Sewerage Service (BAWASA) is to supply water and on-site sanitation services (Water Act No.12 2009 and its 2013 regulations) to Babati residents. Both BAWASA and Babati Town Council (BTC) collect and dispose of faecal sludge for households – BAWASA covers services throughout the main town, while BTC covers rural areas but hand services in peri-urban areas over to BAWASA when they are established. The single truck used by BTC is often broken, so residents have to call on private service providers from Arusha, a two-hour journey away.
A 2014 survey indicated that about 90% of people in Babati have a household toilet. Of those households that owned a toilet, 42% had traditional pit latrines, 30% had ventilated improved pit latrines, and 18% had septic latrines. Babati is one of the towns where the National Sanitation Campaign was implemented. Assessment of school and public facilities indicated that toilets were of varying quality, with no consideration given to accessibility, particularly for people living with disability.
Challenges of context
The circumstances affecting sanitation and hygiene services in Babati are challenging. Issues to address include:
Faecal sludge management:
Poor quality toilet types and pits
Weak collective sanitation system for pit emptying and removal and treatment of faecal sludge and wastewater, including open dumping of both
Ineffective publicly managed trucking system for pit emptying and removal of faecal sludge and wastewater, with service downtimes during vehicle breakdowns
Solid waste management:
Weak collective system for collection and treatment of solid waste management, including open co-disposal of all waste types in an unsanitary dump-site
Poorly managed incinerator for medical waste treatment
Poor and inadequate facilities in public institutions and places – e.g. markets, hospitals, schools
Weak administrative structures for the adopted public–private partnership in solid waste management
Sanitation and water quality and safety:
High risk of toilet pits contaminating groundwater, surface water and drinking water and of water contamination from the Babati lake basin,
which is located at a level above some of the town's residences. A cemetery is also located within the basin catchment of the lake, which overflows during the rainy season
Household water supply coverage is about 45%, and daily production capacity does not meet demand. Coverage of school water supply has increased, and those with supply are metered, their water bills paid regularly through parent contributions.
Project launch and inception workshop
A series of launch workshops were organised by WaterAid from 25 April – 6 May, 2016, in Arusha, Babati, and Dar es Salaam, with all key project, community and national stakeholders. These included Babati Town Council, BAWASA, WaterAid, community representatives, NM-AIST, the Ministry of Water and Irrigation, Ministry of Health, and the Prime Minister's Office – Regional and Local Administration, donors (World Bank and KfW), and NGOs. The workshop helped in building a working relationship with the key partners and in the development of a research design plan, tools, and the strategy for data analysis and expected outputs. The workshops also brought consensus on roles and responsibilities, and feedback from stakeholders.
What this research means for WaterAid
WaterAid has worked in pro-poor town-wide planning before for small towns in India and Mozambique, but the development of these plans was outsourced to consultants. However, with the Babati project, WaterAid is partnering with a research university and will be directly engaged in the process to develop the Babati plan.
As a step forward, this research will help to develop the institutional memory and learning around pro-poor town-wide planning. It will also bring together our work in urban areas across other country programmes, while developing the sanitation and hygiene services and solution scenarios to develop pathways to universal access to WASH in Babati. The project will include demonstrations on hygiene promotion, solid waste management and entrepreneurial approaches in faecal sludge management.
This is an exciting research project – it will help us to understand how collaborative and consultative approaches can help to deliver sustainable and inclusive plans for small towns.
Aditi Chandak es asesora de Aprendizaje y Conocimiento de WaterAid. Timeyin Uwejamomere es gerente de Soporte Técnico Urbano de WaterAid.


text:
Finance has gone digital. How did we get here?
Ash Noah of the Association of International Certified Professional Accountants explains what precipitated finance's move toward automation, and how CFOs can best prepare.
Ash Noah
Jane Thier @thier_jane
Business leaders are looking to CFOs more than any other c-suite executive to help guide organizations as they navigate sweeping digital disruption. CFOs are up to the task, but they may not be ready quite yet, said Ash Noah, managing director of CGMA learning, education and development at the Association of International Certified Professional Accountants.
Noah has fine-tuned his predictions over his many decades in the finance industry. He told CFO Dive Monday the ways in which he has seen the finance function evolve with the introduction of new technology and how CFOs' operational and strategic insights have made them company leaders across industries.
How tech has disrupted the traditional business model
Noah has acknowledged "unprecedented change" as a result of digitization and new technology. The changes drive the business fundamentals and the type of support and partnering the business needs," he said. In January, Noah worked on a study, "Re-inventing finance for the digital world," to this effect. The study found that with the introduction of more and more technology, the finance function will no longer be evaluated purely on how costly it is to run, but will be judged on the added value it brings to the organization.
"In my former life as a CFO, I was really trying to help businesses make the right decisions. I helped with predominantly operational business decisions," he explained. "What I've seen, more and more, is technology disrupting business models. Not just the digitization of finance, but the digitization of the whole business model. That's what's fundamentally driving the change."
In his current role, Noah is a liaison to CFOs and CEOs, helping them and their teams create value while maintaining an understanding of how finance is evolving. Before joining the association in 2012, Noah served as CFO of the international unit of global transport and logistics provider TNT Express, leading finance teams in 45 countries through wide-scale transformations.
Change results in "guidance gap"
This changing environment has taken the largest toll on the finance department, Noah said. "Suddenly the business is saying, 'Mr. CFO, I need your help, I need you by my side. There are seismic changes taking place in my business, and I need help navigating through this situation, and redefining my strategy, and surviving.'"
Even as the CFO role keeps evolving, Noah says the change isn't as new as it may seem. "The finance role has always been strategic in nature," he explained. "It's just that we have not delivered what businesses have required."
Noah points to what professionals call "the guidance gap," which is "the guidance businesses need and what the CFO has provided," he said. Noah says the S&P 500 reports a gap of 65%, meaning CFOs only provide apt business guidance 35% of the time.
"That's a massive gap [between] where CFOs should be, with regards to supporting the business, and where they are," he said. "The gap is predominantly caused by massive acceleration, in terms of business models, and CFOs haven't been able to keep up."
The CFO's primary challenge, in the wake of all these expansions and changes, is to close the guidance gap.
Early steps towards digital revolution
Consider the new regulations, such as PCAOB, that came after the Sarbanes-Oxley Act of 2002, Noah says. "All that was really focused on compliance. From early 2000 right up to the crash of 2008, CFOs' offices focused on addressing the governance gap, and making sure the numbers were accurately reported, and procedures were controlled and operating effectively."
Since the crash, however, executive focus has shifted to survival, cutting costs, reengineering the business model, and trying to outdo competition, Noah recalls. As businesses rebounded into recovery, new technologies became available for gathering and interpreting data.
"I told CFOs that this technology isn't disrupting their role, but allows them to become strategic business advisors," Noah said. "If they can leverage these technologies, and get the right pool of talent with the right competencies, they can really deliver what the business needs. This [enables finance to] truly become that value-adding front office activity rather than transactional back office function we've always been."
Taking advantage of this transformational technology does not require CFOs becoming data engineers or data scientists. Noah says they need only the proficiency to partner with the business and understand how data and tech can be leveraged.
"Tech lets us find trends and relationships and insights that humans can't," he said, but companies need to communicate that without threatening their business. "Provide the business with alternatives, explain the insights, and explain what it means to the customer," he recommends.
Digital savvy-ness required for change preparedness
This communication is absolutely essential for the CFO to become a strategic advisor, drive value, and participate in the change that many enterprises are transforming in those ways. The question to pose — is finance playing a part in that transformation? Noah has found that finance teams are more digitally savvy.
CFOs who consider themselves digitally savvy are able to support their enterprises much more effectively than those who aren't. Only about 37% of CFOs consider themselves digital leaders; the rest said they're not participating in that enterprise-wide transformation, Noah found in his January study, "Agile Finance Unleashed: The Key Traits of Digital Finance Leaders."
At the end of the day, what Noah wants to do is help build out finance capabilities so that CFOs and their teams can actually participate in future value creation. "That's the whole thrust of our institution," he said. "Building teams and finance capabilities by finding the right skills and competencies. We're not tech the providers or consultants. What we do is help the profession identify and articulate appropriate skills, and create the programs to build them so CFOs don't have to figure it all out alone."
CFO Dive How CFOs can lead digitization efforts in 4 steps
Follow Jane Thier on Twitter
Filed Under: Technology Leadership
PwC releases ESG reporting app
Finance leaders are under pressure to measure their company's performance on environmental, social and governance values.
By Robert Freedman • Oct. 25, 2020
CFO KPI Close-up: Customer retention
Retaining customers begins with not giving them an excuse to leave, especially during times of economic uncertainty, three customer retention experts say.
By Jane Thier • Nov. 02, 2020
Get CFO news like this in your inbox daily. Subscribe to CFO Dive:
Subscribe to CFO Dive to get the must-read news & insights in your inbox.
Deep Dive 5 CFO trends to watch in 2021
Deep Dive 2021 Outlook: Why, and how, the CFO should lead ESG efforts
Middle market CFOs predict 'extraordinary' growth in 2021, survey finds
CFOs face challenging labor landscape under Biden administration
How General Mills CFO prioritizes ESG
The Business Case for Outsourcing Sales and Use Tax Returns
5 Critical Areas That CFOs Need to Focus on in 2021
How to Automate Sales Tax Compliance in the Cloud
Forbes How Two Public Company CFOs Guided Their Businesses Through 2020 Jan. 14
CFO Weighing COVID-19 (and Other Macro Factors) in Bankruptcy Valuations Jan. 14
The Wall Street Journal Finance Chiefs Prepare for Potential Rule Changes, Return to the Office Jan. 14
How Finance Leaders Apply Tech Advances to FinServ (CPE Credit) Webinar 2 pm ET • Jan 21, 2021
How Finance Leaders Inaugurate an Agile Approach to Digital Acceleration in Professional Services Firms (CPE Credit) Webinar 2 pm ET • Jan 28, 2021
Webinar - on demand The Next Evolution of Customer Engagement for Financial Services Bold360
eBook Budgeting, Planning and Forecasting OneStream
Download IPwe Portfolio Report: Is there hidden treasure in your patent portfolio? IPwe
CFOs, HR leaders optimistic about recovery in 2021, survey finds
By Jim Tyson • Jan. 14, 2021
Payments company CFO: We won't work with partners 'not aligned with our values'
By Jane Thier • Jan. 14, 2021
For post-pandemic world, put extra cash in IT
By Ted Knutson • Jan. 10, 2021
Google engineers unionize, but the focus isn't on money — yet
By Robert Freedman • Jan. 04, 2021
Large gulf between CFOs and reality on real-time capabilities, survey finds
By Robert Freedman • Dec. 17, 2020
Get CFO Dive in your inbox
Banking Dive
HR Dive

redpajama_set_name: RedPajamaCommonCrawl


The Corte Madera Ecological Reserve Expansion project will restore tidal marsh by excavating 3.598 acres of filled lands on Marin Audubon Society (MAS) and CA Department of Fish & Wildlife (CDFW) property to create a restored marsh plain. A public access path will offer views of the restored and existing habitat in a manner that will not impact the habitat and species that depend on it. The project will include a .046 acre channel to connect the restored marsh to the existing marsh to the south. The applicant, Marin Audubon Society, is applying for a zoning map amendment, general plan amendment, and a grading and drainage permit as part of this project. Application materials and environmental documents can be accessed via the links below.


Bhubaneswar: During Ama Gaon Ama Bikash session, Chief Minister Shri Naveen Patnaik interacted with people from Sohela (Bargarh), Nichintkoili (Cuttack), Dharmasala (Jajpur) and Sorada (Ganjam) blocks.
He encouraged people to bring up more such issue of socio-economic development in their area and praised the spirit with which people have been turning up with suggestions. Based on their feedback, he promptly sanctioned 1214 development projects for 138 blocks worth ₹30.72 crore.
He directed the officials to commence work immediately and ensure timely completion for maximum benefit to people.


text:
It's not easy to teach middle school, or to be in middle school, or to raise a middle schooler. This year, a very hard thing has gotten even harder for teachers, students, and families.
By Tom Rademacher
Illustration Credit: James Heimer
I t's not easy to teach middle school, or to be in middle school, or to raise a middle schooler. This year, a very hard thing has gotten even harder for teachers, students, and families.
I have taught 8th grade for over a decade. I know firsthand that most students really want to learn. They react well to work that is challenging and important and interesting. When they are physically in school, I can use proximity and presentation and pressure to get them to do all sorts of stuff they don't want to do.
That gets a lot more challenging when I'm teaching from my home to theirs.
Pandemic teaching is at its worst when it tries to re-create school: Asking kids to sit for hours, asking teachers to watch students while they try to sit for hours—the idea that watching someone teach is the same as learning doesn't hold up. I spend five times more energy to produce lessons that are far, far less impactful.
At its best, pandemic teaching lets go of a lot of the stuff of school—worksheets, dress codes, and lectures—and focuses instead on the goal of learning. We teachers are finding success when we rely more on creativity than compliance. Yes, there's lots of trial and lots and lots of failure. But I've never been disappointed by what students can do when they're given a chance.
Last spring, we were just getting by, doing anything to keep kids engaged and to give their brains a chance to think about things other than the world burning down around them. We showed them grace and concern when it was all too much. I gave a final project where students were able to pick anything they were passionate about and find a way to share that passion with each other from a distance. There were podcasts about the NBA, impassioned pleas for gun control, treatises on alternative fuels, and essays about the removal of politics from school (I have my own feelings on this, but the writing was amazing). One of my favorite projects was an insightful critical analysis of Sharknado 2.
This fall, we're all getting used to whatever "this" is and settling in for months and months more of it. We all realize we're going to need to get some work done. We miss seeing each other in person. Students, especially, are increasingly desperate to get back to school, but they're also getting better at using email and message features to ask questions and stay in touch with teachers. They are more willing to share their jokes, their pets, their feelings, their lives with each other. They are showing up. This fall, my last class of the day was having an impromptu argument over Fat Bear Week 2020, which is a competition to vote on which bear at Katmai National Park in Alaska is most ready for winter. The class had taken sides for either Chonk (the former champion) or 747 (the young challenger). As 747 pulled ahead, one student shouted, "just wait until Alaska votes! Everyone knows Alaska is a swing state for bears! Chonk will pull ahead!"
Another student picked up his ukelele and spoke directly to the classmate who was hoping Alaska would put Chonk over the top. "I wrote a song just for you," he said, before strumming a few chords. Then, he looked into his camera and said, deadpan, "We all know 747 is the fat king. Stop trying."
It's early, but I already know this will be a strong contender for best moment of the year for me because it reminded me for the millionth time that the kids are OK. The kids are weird and hilarious and brilliant, and they just need all the chances we can give them to show it.
Tom Rademacher (B.A. '04, M.E. '07) teaches English at St. Anthony Middle School in the New Brighton school district. He was named the 2014 Minnesota Teacher of the Year


text:
History of the Roman Empire from Augustus to Domitian
History of the Roman Empire from Augustus to Domitian - CL734
Spring 6 15 (7.5) DR M Wibier checkmark-circle
This module examines in detail the history of the Roman Empire from the commencement of the Principate of Augustus in 30 BC to the death of the Emperor Domitian in AD 96. It will also provide both a survey of a major period of Roman imperial history and an opportunity to study in greater depth the administrative, social, economic and religious developments of this period. Students will read widely from the ancient sources, historical, literary and documentary, and will be introduced to the inscriptional evidence for imperial history. This module will concentrate on the main administrative, social, economic and religious developments throughout the period rather than on the details of political and military history.
Students will read widely in the major ancient sources, including Tacitus, Pliny and Suetonius, and will be introduced to the inscriptional and documentary evidence for imperial history.
Critical Source analysis (800 words) – 25%
Short Popularising Assessment (800 words) – 25%
Essay (1,500 words) – 50%
Indicative list, current at time of publication.
Alston, R.A. (1998) Aspects of Roman History AD 14-96, Abingdon: Routledge.
Garnsey, P. & Saller, R. (2015) The Roman Empire, 2nd edition, London: Bloomsbury.
Lewis, N. & Reinhold, M. (1990) Roman civilisation: A Sourcebook, Vol II: The Empire, 3rd edition, New York: Harper & Row.
Millar, F. (1981) The Roman Empire and its Neighbours, 2nd ed, London: Duckworth.
Potter, D.S. (2010) A Companion to the Roman Empire, Oxford: Blackwells.
Sherk R.L. (1988) The Roman Empire: Augustus to Hadrian, Cambridge: CUP.
Wells, C.M. (1992) The Roman Empire, 2nd edition, London: Fontana.
Articulate the main events, issues and themes in the history of the Roman Empire from the commencement of the Principate of Augustus to the death of the Emperor Domitian in AD 96 and to critically evaluate their significance.
Demonstrate an ability to devise arguments to evaluate the functioning of the complex processes relating to administrative, constitutional, social, economic and religious change in the Roman Empire during this period.
Critically evaluate historical interpretations of special features of the period such as the evolution of the imperial bureaucracy and the working of the mechanism of patronage, both in the centre and the provinces.
Evaluate the use of the relevant different kinds of evidence (official, literary, visual and archaeological) and show critical awareness of the use of key documents, and have developed an ability to use the different categories of evidence to critique the investigation of historical problems in the history of the Roman Empire.
Construct historical arguments, orally and in writing, which demonstrate analytical ability, independence of thought and knowledge of the ancient sources, literary and otherwise and be able to critically evaluate their own arguments developed from these sources.
Be familiar with the ancient sources, historical, literary, documentary, and inscriptional evidence and be aware of the limits of our knowledge in the development of academic argumentation;


Did you remember to spring ahead? 1 am magically became 2 am as we lost a precious hour this weekend.
We left Standard Time, an old relic from the days when we were all farmers relying on the sun to determine when we awake and when we literally hit the hay, for Daylight Time. If I had my way, we'd stay here for good. Why move a good hour of sunlight in the evening to the morning for the sake of an antiquated lifestyle?
If we unite as one voice, we can do something about this. Standard Time is for suckers. Resist adjusting your clocks on November 4. Daylight Saving Time Forever!
Talk to Ford. As new leader of the effed up PC party ......that could be one of his promises !
That's crazy talk Boon!!! People like you want to watch the world burn! First we stop adjusting our clocks in November and before you know it a cow is marrying a chicken!!
@Philly-Bob Then at least there'd be more light in the evening for a late-night cow-chicken party!
I'm in SK and the clocks stay on normal (daylight) time. It's not even an issue here.
Daylight savings has nothing to do with farming and never did. It's a strange myth that doesn't stand up to any scrutiny. Why would a farmer care what time the sun comes up or goes down?
The idea of finally stopping the pointless twice-a-year clock changing has been recently suggested and received much support in many, maybe most, provinces and states, and indeed much the world that still does it. Besides perhaps having to shift school hours to be slightly later to prevent kids having to leave for school in the morning when it's still dark, the only real issue now seems to be "but (almost) everyone else still does it". What's needed is for all the premiers and governors to contact each other and agree "we'll do it if you do".
According to John Oliver's TV show and other articles, it started in the First World War, and never had anything to do with farming and farmers.
Farmers were actually opposed to the clock-changing being implemented in the first place, but by the later part of the 20th century didn't care one way or the other, and now are just like every one else in finding it to be pointless and slightly annoying.
On the other hand, while it is a very minor nuisance, I have never claimed to be affected by it in any other way.
@H.o.E. The United States experimented with Winter Daylight Savings Time in 1974 as an energy saving measure and the issue of young children waiting for school buses in the dark in January and February was the major reason it was not implemented again in 1975.
Curiously, Ontario remained on Standard Time until April. I was in Grade 11 at the time and it was awesome to be able to watch Johnny Carson do his Tonight Show monologue at 10:30 when you had to get up early to go to school the next morning.
I was in elementary school at the time. Like I said above, in hindsight, it was an incredibly weak excuse to continue the twice-a-year clock changing. Just give them a year of warning, so when that school year starts in September of the year we stop the pointless clock-changing, every school that may find that to be a problem can simply shift their hours to start slightly later in the morning (for example, instead of 9 a.m., make it 9:30 or 10). It seems that would easier than making the entire rest of the population bizarrely move their clocks twice a year.
fine refuse(!) alley, so I'm never in need of an alarm clock!!!


text:
package org.cloudbus.cloudsim.examples.power;

import java.io.BufferedWriter;
import java.io.File;
import java.io.FileWriter;
import java.io.IOException;
import java.text.DecimalFormat;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.LinkedList;
import java.util.List;
import java.util.Map;
import java.util.Scanner;

import org.cloudbus.cloudsim.Cloudlet;
import org.cloudbus.cloudsim.CloudletSchedulerDynamicWorkload;
import org.cloudbus.cloudsim.Datacenter;
import org.cloudbus.cloudsim.DatacenterBroker;
import org.cloudbus.cloudsim.DatacenterCharacteristics;
import org.cloudbus.cloudsim.Host;
import org.cloudbus.cloudsim.HostDynamicWorkload;
import org.cloudbus.cloudsim.HostStateHistoryEntry;
import org.cloudbus.cloudsim.Log;
import org.cloudbus.cloudsim.Pe;
import org.cloudbus.cloudsim.Storage;
import org.cloudbus.cloudsim.Vm;
import org.cloudbus.cloudsim.VmAllocationPolicy;
import org.cloudbus.cloudsim.VmSchedulerTimeSharedOverSubscription;
import org.cloudbus.cloudsim.VmStateHistoryEntry;
import org.cloudbus.cloudsim.power.PowerDatacenter;
import org.cloudbus.cloudsim.power.PowerDatacenterBroker;
import org.cloudbus.cloudsim.power.PowerHost;
import org.cloudbus.cloudsim.power.PowerHostUtilizationHistory;
import org.cloudbus.cloudsim.power.PowerVm;
import org.cloudbus.cloudsim.power.PowerVmAllocationPolicyMigrationAbstract;
import org.cloudbus.cloudsim.provisioners.BwProvisionerSimple;
import org.cloudbus.cloudsim.provisioners.PeProvisionerSimple;
import org.cloudbus.cloudsim.provisioners.RamProvisionerSimple;
import org.cloudbus.cloudsim.util.MathUtil;

/**
 * The Class Helper.
 *
 * If you are using any algorithms, policies or workload included in the power package, please cite
 * the following paper:
 *
 * Anton Beloglazov, and Rajkumar Buyya, "Optimal Online Deterministic Algorithms and Adaptive
 * Heuristics for Energy and Performance Efficient Dynamic Consolidation of Virtual Machines in
 * Cloud Data Centers", Concurrency and Computation: Practice and Experience (CCPE), Volume 24,
 * Issue 13, Pages: 1397-1420, John Wiley & Sons, Ltd, New York, USA, 2012
 *
 * @author Anton Beloglazov
 */
public class Helper {

	/**
	 * Creates the vm list.
	 *
	 * @param brokerId the broker id
	 * @param vmsNumber the vms number
	 *
	 * @return the list< vm>
	 */
	public static List<Vm> createVmList(int brokerId, int vmsNumber) {
		List<Vm> vms = new ArrayList<Vm>();
		for (int i = 0; i < vmsNumber; i++) {
			int vmType = i / (int) Math.ceil((double) vmsNumber / Constants.VM_TYPES);
			vms.add(new PowerVm(
					i,
					brokerId,
					Constants.VM_MIPS[vmType],
					Constants.VM_PES[vmType],
					Constants.VM_RAM[vmType],
					Constants.VM_BW,
					Constants.VM_SIZE,
					1,
					"Xen",
					new CloudletSchedulerDynamicWorkload(Constants.VM_MIPS[vmType], Constants.VM_PES[vmType]),
					Constants.SCHEDULING_INTERVAL));
		}
		return vms;
	}

	/**
	 * Creates the host list.
	 *
	 * @param hostsNumber the hosts number
	 *
	 * @return the list< power host>
	 */
	public static List<PowerHost> createHostList(int hostsNumber) {
		List<PowerHost> hostList = new ArrayList<PowerHost>();
		for (int i = 0; i < hostsNumber; i++) {
			int hostType = i % Constants.HOST_TYPES;

			List<Pe> peList = new ArrayList<Pe>();
			for (int j = 0; j < Constants.HOST_PES[hostType]; j++) {
				peList.add(new Pe(j, new PeProvisionerSimple(Constants.HOST_MIPS[hostType])));
			}

			hostList.add(new PowerHostUtilizationHistory(
					i,
					new RamProvisionerSimple(Constants.HOST_RAM[hostType]),
					new BwProvisionerSimple(Constants.HOST_BW),
					Constants.HOST_STORAGE,
					peList,
					new VmSchedulerTimeSharedOverSubscription(peList),
					Constants.HOST_POWER[hostType]));
		}
		return hostList;
	}

	/**
	 * Creates the broker.
	 *
	 * @return the datacenter broker
	 */
	public static DatacenterBroker createBroker() {
		DatacenterBroker broker = null;
		try {
			broker = new PowerDatacenterBroker("Broker");
		} catch (Exception e) {
			e.printStackTrace();
			//System.exit(0);
		}
		return broker;
	}

	/**
	 * Creates the datacenter.
	 *
	 * @param name the name
	 * @param datacenterClass the datacenter class
	 * @param hostList the host list
	 * @param vmAllocationPolicy the vm allocation policy
	 * @param simulationLength
	 *
	 * @return the power datacenter
	 *
	 * @throws Exception the exception
	 */
	public static Datacenter createDatacenter(
			String name,
			Class<? extends Datacenter> datacenterClass,
			List<PowerHost> hostList,
			VmAllocationPolicy vmAllocationPolicy) throws Exception {
		String arch = "x86"; // system architecture
		String os = "Linux"; // operating system
		String vmm = "Xen";
		double time_zone = 10.0; // time zone this resource located
		double cost = 3.0; // the cost of using processing in this resource
		double costPerMem = 0.05; // the cost of using memory in this resource
		double costPerStorage = 0.001; // the cost of using storage in this resource
		double costPerBw = 0.0; // the cost of using bw in this resource

		DatacenterCharacteristics characteristics = new DatacenterCharacteristics(
				arch,
				os,
				vmm,
				hostList,
				time_zone,
				cost,
				costPerMem,
				costPerStorage,
				costPerBw);

		Datacenter datacenter = null;
		try {
			datacenter = datacenterClass.getConstructor(
					String.class,
					DatacenterCharacteristics.class,
					VmAllocationPolicy.class,
					List.class,
					Double.TYPE).newInstance(
					name,
					characteristics,
					vmAllocationPolicy,
					new LinkedList<Storage>(),
					Constants.SCHEDULING_INTERVAL);
		} catch (Exception e) {
			e.printStackTrace();
			//System.exit(0);
		}

		return datacenter;
	}

	/**
	 * Gets the times before host shutdown.
	 *
	 * @param hosts the hosts
	 * @return the times before host shutdown
	 */
	public static List<Double> getTimesBeforeHostShutdown(List<Host> hosts) {
		List<Double> timeBeforeShutdown = new LinkedList<Double>();
		for (Host host : hosts) {
			boolean previousIsActive = true;
			double lastTimeSwitchedOn = 0;
			for (HostStateHistoryEntry entry : ((HostDynamicWorkload) host).getStateHistory()) {
				if (previousIsActive == true && entry.isActive() == false) {
					timeBeforeShutdown.add(entry.getTime() - lastTimeSwitchedOn);
				}
				if (previousIsActive == false && entry.isActive() == true) {
					lastTimeSwitchedOn = entry.getTime();
				}
				previousIsActive = entry.isActive();
			}
		}
		return timeBeforeShutdown;
	}

	/**
	 * Gets the times before vm migration.
	 *
	 * @param vms the vms
	 * @return the times before vm migration
	 */
	public static List<Double> getTimesBeforeVmMigration(List<Vm> vms) {
		List<Double> timeBeforeVmMigration = new LinkedList<Double>();
		for (Vm vm : vms) {
			boolean previousIsInMigration = false;
			double lastTimeMigrationFinished = 0;
			for (VmStateHistoryEntry entry : vm.getStateHistory()) {
				if (previousIsInMigration == true && entry.isInMigration() == false) {
					timeBeforeVmMigration.add(entry.getTime() - lastTimeMigrationFinished);
				}
				if (previousIsInMigration == false && entry.isInMigration() == true) {
					lastTimeMigrationFinished = entry.getTime();
				}
				previousIsInMigration = entry.isInMigration();
			}
		}
		return timeBeforeVmMigration;
	}

	/**
	 * Prints the results.
	 *
	 * @param datacenter the datacenter
	 * @param lastClock the last clock
	 * @param experimentName the experiment name
	 * @param outputInCsv the output in csv
	 * @param outputFolder the output folder
	 */
	public static void printResults(
			PowerDatacenter datacenter,
			List<Vm> vms,
			double lastClock,
			String experimentName,
			boolean outputInCsv,
			String outputFolder) {
		Log.enable();
		List<Host> hosts = datacenter.getHostList();

		int numberOfHosts = hosts.size();
		int numberOfVms = vms.size();

		double totalSimulationTime = lastClock;
		double energy = datacenter.getPower() / (3600 * 1000);
		int numberOfMigrations = datacenter.getMigrationCount();

		Map<String, Double> slaMetrics = getSlaMetrics(vms);

		double slaOverall = slaMetrics.get("overall");
		double slaAverage = slaMetrics.get("average");
		double slaDegradationDueToMigration = slaMetrics.get("underallocated_migration");
		// double slaTimePerVmWithMigration = slaMetrics.get("sla_time_per_vm_with_migration");
		// double slaTimePerVmWithoutMigration =
		// slaMetrics.get("sla_time_per_vm_without_migration");
		// double slaTimePerHost = getSlaTimePerHost(hosts);
		double slaTimePerActiveHost = getSlaTimePerActiveHost(hosts);

		double sla = slaTimePerActiveHost * slaDegradationDueToMigration;

		List<Double> timeBeforeHostShutdown = getTimesBeforeHostShutdown(hosts);

		int numberOfHostShutdowns = timeBeforeHostShutdown.size();

		double meanTimeBeforeHostShutdown = Double.NaN;
		double stDevTimeBeforeHostShutdown = Double.NaN;
		if (!timeBeforeHostShutdown.isEmpty()) {
			meanTimeBeforeHostShutdown = MathUtil.mean(timeBeforeHostShutdown);
			stDevTimeBeforeHostShutdown = MathUtil.stDev(timeBeforeHostShutdown);
		}

		List<Double> timeBeforeVmMigration = getTimesBeforeVmMigration(vms);
		double meanTimeBeforeVmMigration = Double.NaN;
		double stDevTimeBeforeVmMigration = Double.NaN;
		if (!timeBeforeVmMigration.isEmpty()) {
			meanTimeBeforeVmMigration = MathUtil.mean(timeBeforeVmMigration);
			stDevTimeBeforeVmMigration = MathUtil.stDev(timeBeforeVmMigration);
		}

		if (outputInCsv) {
			File folder = new File(outputFolder);
			if (!folder.exists()) {
				folder.mkdir();
			}
			File folder1 = new File(outputFolder + "/stats");
			if (!folder1.exists()) {
				folder1.mkdir();
			}
			File folder2 = new File(outputFolder + "/time_before_host_shutdown");
			if (!folder2.exists()) {
				folder2.mkdir();
			}
			File folder3 = new File(outputFolder + "/time_before_vm_migration");
			if (!folder3.exists()) {
				folder3.mkdir();
			}
			File folder4 = new File(outputFolder + "/metrics");
			if (!folder4.exists()) {
				folder4.mkdir();
			}

			StringBuilder data = new StringBuilder();
			String delimeter = ",";

			data.append(experimentName + delimeter);
			data.append(parseExperimentName(experimentName));
			data.append(String.format("%d", numberOfHosts) + delimeter);
			data.append(String.format("%d", numberOfVms) + delimeter);
			data.append(String.format("%.2f", totalSimulationTime) + delimeter);
			data.append(String.format("%.5f", energy) + delimeter);
			data.append(String.format("%d", numberOfMigrations) + delimeter);
			data.append(String.format("%.10f", sla) + delimeter);
			data.append(String.format("%.10f", slaTimePerActiveHost) + delimeter);
			data.append(String.format("%.10f", slaDegradationDueToMigration) + delimeter);
			data.append(String.format("%.10f", slaOverall) + delimeter);
			data.append(String.format("%.10f", slaAverage) + delimeter);
			// data.append(String.format("%.5f", slaTimePerVmWithMigration) + delimeter);
			// data.append(String.format("%.5f", slaTimePerVmWithoutMigration) + delimeter);
			// data.append(String.format("%.5f", slaTimePerHost) + delimeter);
			data.append(String.format("%d", numberOfHostShutdowns) + delimeter);
			data.append(String.format("%.2f", meanTimeBeforeHostShutdown) + delimeter);
			data.append(String.format("%.2f", stDevTimeBeforeHostShutdown) + delimeter);
			data.append(String.format("%.2f", meanTimeBeforeVmMigration) + delimeter);
			data.append(String.format("%.2f", stDevTimeBeforeVmMigration) + delimeter);

			if (datacenter.getVmAllocationPolicy() instanceof PowerVmAllocationPolicyMigrationAbstract) {
				PowerVmAllocationPolicyMigrationAbstract vmAllocationPolicy = (PowerVmAllocationPolicyMigrationAbstract) datacenter
						.getVmAllocationPolicy();

				double executionTimeVmSelectionMean = MathUtil.mean(vmAllocationPolicy
						.getExecutionTimeHistoryVmSelection());
				double executionTimeVmSelectionStDev = MathUtil.stDev(vmAllocationPolicy
						.getExecutionTimeHistoryVmSelection());
				double executionTimeHostSelectionMean = MathUtil.mean(vmAllocationPolicy
						.getExecutionTimeHistoryHostSelection());
				double executionTimeHostSelectionStDev = MathUtil.stDev(vmAllocationPolicy
						.getExecutionTimeHistoryHostSelection());
				double executionTimeVmReallocationMean = MathUtil.mean(vmAllocationPolicy
						.getExecutionTimeHistoryVmReallocation());
				double executionTimeVmReallocationStDev = MathUtil.stDev(vmAllocationPolicy
						.getExecutionTimeHistoryVmReallocation());
				double executionTimeTotalMean = MathUtil.mean(vmAllocationPolicy
						.getExecutionTimeHistoryTotal());
				double executionTimeTotalStDev = MathUtil.stDev(vmAllocationPolicy
						.getExecutionTimeHistoryTotal());

				data.append(String.format("%.5f", executionTimeVmSelectionMean) + delimeter);
				data.append(String.format("%.5f", executionTimeVmSelectionStDev) + delimeter);
				data.append(String.format("%.5f", executionTimeHostSelectionMean) + delimeter);
				data.append(String.format("%.5f", executionTimeHostSelectionStDev) + delimeter);
				data.append(String.format("%.5f", executionTimeVmReallocationMean) + delimeter);
				data.append(String.format("%.5f", executionTimeVmReallocationStDev) + delimeter);
				data.append(String.format("%.5f", executionTimeTotalMean) + delimeter);
				data.append(String.format("%.5f", executionTimeTotalStDev) + delimeter);

				writeMetricHistory(hosts, vmAllocationPolicy, outputFolder + "/metrics/" + experimentName
						+ "_metric");
			}

			data.append("\n");

			writeDataRow(data.toString(), outputFolder + "/stats/" + experimentName + "_stats.csv");
			writeDataColumn(timeBeforeHostShutdown, outputFolder + "/time_before_host_shutdown/"
					+ experimentName + "_time_before_host_shutdown.csv");
			writeDataColumn(timeBeforeVmMigration, outputFolder + "/time_before_vm_migration/"
					+ experimentName + "_time_before_vm_migration.csv");

		} else {
			Log.setDisabled(false);
			Log.printLine();
			Log.printLine(String.format("Experiment name: " + experimentName));
			Log.printLine(String.format("Number of hosts: " + numberOfHosts));
			Log.printLine(String.format("Number of VMs: " + numberOfVms));
			Log.printLine(String.format("Total simulation time: %.2f sec", totalSimulationTime));
			Log.printLine(String.format("Energy consumption: %.2f kWh", energy));
			Log.printLine(String.format("Number of VM migrations: %d", numberOfMigrations));
			Log.printLine(String.format("SLA: %.5f%%", sla * 100));
			Log.printLine(String.format(
					"SLA perf degradation due to migration: %.2f%%",
					slaDegradationDueToMigration * 100));
			Log.printLine(String.format("SLA time per active host: %.2f%%", slaTimePerActiveHost * 100));
			Log.printLine(String.format("Overall SLA violation: %.2f%%", slaOverall * 100));
			Log.printLine(String.format("Average SLA violation: %.2f%%", slaAverage * 100));
			// Log.printLine(String.format("SLA time per VM with migration: %.2f%%",
			// slaTimePerVmWithMigration * 100));
			// Log.printLine(String.format("SLA time per VM without migration: %.2f%%",
			// slaTimePerVmWithoutMigration * 100));
			// Log.printLine(String.format("SLA time per host: %.2f%%", slaTimePerHost * 100));
			Log.printLine(String.format("Number of host shutdowns: %d", numberOfHostShutdowns));
			Log.printLine(String.format(
					"Mean time before a host shutdown: %.2f sec",
					meanTimeBeforeHostShutdown));
			Log.printLine(String.format(
					"StDev time before a host shutdown: %.2f sec",
					stDevTimeBeforeHostShutdown));
			Log.printLine(String.format(
					"Mean time before a VM migration: %.2f sec",
					meanTimeBeforeVmMigration));
			Log.printLine(String.format(
					"StDev time before a VM migration: %.2f sec",
					stDevTimeBeforeVmMigration));

			if (datacenter.getVmAllocationPolicy() instanceof PowerVmAllocationPolicyMigrationAbstract) {
				PowerVmAllocationPolicyMigrationAbstract vmAllocationPolicy = (PowerVmAllocationPolicyMigrationAbstract) datacenter
						.getVmAllocationPolicy();

				double executionTimeVmSelectionMean = MathUtil.mean(vmAllocationPolicy
						.getExecutionTimeHistoryVmSelection());
				double executionTimeVmSelectionStDev = MathUtil.stDev(vmAllocationPolicy
						.getExecutionTimeHistoryVmSelection());
				double executionTimeHostSelectionMean = MathUtil.mean(vmAllocationPolicy
						.getExecutionTimeHistoryHostSelection());
				double executionTimeHostSelectionStDev = MathUtil.stDev(vmAllocationPolicy
						.getExecutionTimeHistoryHostSelection());
				double executionTimeVmReallocationMean = MathUtil.mean(vmAllocationPolicy
						.getExecutionTimeHistoryVmReallocation());
				double executionTimeVmReallocationStDev = MathUtil.stDev(vmAllocationPolicy
						.getExecutionTimeHistoryVmReallocation());
				double executionTimeTotalMean = MathUtil.mean(vmAllocationPolicy
						.getExecutionTimeHistoryTotal());
				double executionTimeTotalStDev = MathUtil.stDev(vmAllocationPolicy
						.getExecutionTimeHistoryTotal());

				Log.printLine(String.format(
						"Execution time - VM selection mean: %.5f sec",
						executionTimeVmSelectionMean));
				Log.printLine(String.format(
						"Execution time - VM selection stDev: %.5f sec",
						executionTimeVmSelectionStDev));
				Log.printLine(String.format(
						"Execution time - host selection mean: %.5f sec",
						executionTimeHostSelectionMean));
				Log.printLine(String.format(
						"Execution time - host selection stDev: %.5f sec",
						executionTimeHostSelectionStDev));
				Log.printLine(String.format(
						"Execution time - VM reallocation mean: %.5f sec",
						executionTimeVmReallocationMean));
				Log.printLine(String.format(
						"Execution time - VM reallocation stDev: %.5f sec",
						executionTimeVmReallocationStDev));
				Log.printLine(String.format("Execution time - total mean: %.5f sec", executionTimeTotalMean));
				Log.printLine(String
						.format("Execution time - total stDev: %.5f sec", executionTimeTotalStDev));
			}
			Log.printLine();
		}

		Log.setDisabled(true);
	}

	/**
	 * Parses the experiment name.
	 *
	 * @param name the name
	 * @return the string
	 */
	public static String parseExperimentName(String name) {
		Scanner scanner = new Scanner(name);
		StringBuilder csvName = new StringBuilder();
		scanner.useDelimiter("_");
		for (int i = 0; i < 4; i++) {
			if (scanner.hasNext()) {
				csvName.append(scanner.next() + ",");
			} else {
				csvName.append(",");
			}
		}
		scanner.close();
		return csvName.toString();
	}

	/**
	 * Gets the sla time per active host.
	 *
	 * @param hosts the hosts
	 * @return the sla time per active host
	 */
	protected static double getSlaTimePerActiveHost(List<Host> hosts) {
		double slaViolationTimePerHost = 0;
		double totalTime = 0;

		for (Host _host : hosts) {
			HostDynamicWorkload host = (HostDynamicWorkload) _host;
			double previousTime = -1;
			double previousAllocated = 0;
			double previousRequested = 0;
			boolean previousIsActive = true;

			for (HostStateHistoryEntry entry : host.getStateHistory()) {
				if (previousTime != -1 && previousIsActive) {
					double timeDiff = entry.getTime() - previousTime;
					totalTime += timeDiff;
					if (previousAllocated < previousRequested) {
						slaViolationTimePerHost += timeDiff;
					}
				}

				previousAllocated = entry.getAllocatedMips();
				previousRequested = entry.getRequestedMips();
				previousTime = entry.getTime();
				previousIsActive = entry.isActive();
			}
		}

		return slaViolationTimePerHost / totalTime;
	}

	/**
	 * Gets the sla time per host.
	 *
	 * @param hosts the hosts
	 * @return the sla time per host
	 */
	protected static double getSlaTimePerHost(List<Host> hosts) {
		double slaViolationTimePerHost = 0;
		double totalTime = 0;

		for (Host _host : hosts) {
			HostDynamicWorkload host = (HostDynamicWorkload) _host;
			double previousTime = -1;
			double previousAllocated = 0;
			double previousRequested = 0;

			for (HostStateHistoryEntry entry : host.getStateHistory()) {
				if (previousTime != -1) {
					double timeDiff = entry.getTime() - previousTime;
					totalTime += timeDiff;
					if (previousAllocated < previousRequested) {
						slaViolationTimePerHost += timeDiff;
					}
				}

				previousAllocated = entry.getAllocatedMips();
				previousRequested = entry.getRequestedMips();
				previousTime = entry.getTime();
			}
		}

		return slaViolationTimePerHost / totalTime;
	}

	/**
	 * Gets the sla metrics.
	 *
	 * @param vms the vms
	 * @return the sla metrics
	 */
	public static Map<String, Double> getSlaMetrics(List<Vm> vms) {
		Map<String, Double> metrics = new HashMap<String, Double>();
		List<Double> slaViolation = new LinkedList<Double>();
		double totalAllocated = 0;
		double totalRequested = 0;
		double totalUnderAllocatedDueToMigration = 0;

		for (Vm vm : vms) {
			double vmTotalAllocated = 0;
			double vmTotalRequested = 0;
			double vmUnderAllocatedDueToMigration = 0;
			double previousTime = -1;
			double previousAllocated = 0;
			double previousRequested = 0;
			boolean previousIsInMigration = false;

			for (VmStateHistoryEntry entry : vm.getStateHistory()) {
				if (previousTime != -1) {
					double timeDiff = entry.getTime() - previousTime;
					vmTotalAllocated += previousAllocated * timeDiff;
					vmTotalRequested += previousRequested * timeDiff;

					if (previousAllocated < previousRequested) {
						slaViolation.add((previousRequested - previousAllocated) / previousRequested);
						if (previousIsInMigration) {
							vmUnderAllocatedDueToMigration += (previousRequested - previousAllocated)
									* timeDiff;
						}
					}
				}

				previousAllocated = entry.getAllocatedMips();
				previousRequested = entry.getRequestedMips();
				previousTime = entry.getTime();
				previousIsInMigration = entry.isInMigration();
			}

			totalAllocated += vmTotalAllocated;
			totalRequested += vmTotalRequested;
			totalUnderAllocatedDueToMigration += vmUnderAllocatedDueToMigration;
		}

		metrics.put("overall", (totalRequested - totalAllocated) / totalRequested);
		if (slaViolation.isEmpty()) {
			metrics.put("average", 0.);
		} else {
			metrics.put("average", MathUtil.mean(slaViolation));
		}
		metrics.put("underallocated_migration", totalUnderAllocatedDueToMigration / totalRequested);
		// metrics.put("sla_time_per_vm_with_migration", slaViolationTimePerVmWithMigration /
		// totalTime);
		// metrics.put("sla_time_per_vm_without_migration", slaViolationTimePerVmWithoutMigration /
		// totalTime);

		return metrics;
	}

	/**
	 * Write data column.
	 *
	 * @param data the data
	 * @param outputPath the output path
	 */
	public static void writeDataColumn(List<? extends Number> data, String outputPath) {
		File file = new File(outputPath);
		try {
			file.createNewFile();
		} catch (IOException e1) {
			e1.printStackTrace();
			System.exit(0);
		}
		try {
			BufferedWriter writer = new BufferedWriter(new FileWriter(file));
			for (Number value : data) {
				writer.write(value.toString() + "\n");
			}
			writer.close();
		} catch (IOException e) {
			e.printStackTrace();
			System.exit(0);
		}
	}

	/**
	 * Write data row.
	 *
	 * @param data the data
	 * @param outputPath the output path
	 */
	public static void writeDataRow(String data, String outputPath) {
		File file = new File(outputPath);
		try {
			file.createNewFile();
		} catch (IOException e1) {
			e1.printStackTrace();
			System.exit(0);
		}
		try {
			BufferedWriter writer = new BufferedWriter(new FileWriter(file));
			writer.write(data);
			writer.close();
		} catch (IOException e) {
			e.printStackTrace();
			System.exit(0);
		}
	}

	/**
	 * Write metric history.
	 *
	 * @param hosts the hosts
	 * @param vmAllocationPolicy the vm allocation policy
	 * @param outputPath the output path
	 */
	public static void writeMetricHistory(
			List<? extends Host> hosts,
			PowerVmAllocationPolicyMigrationAbstract vmAllocationPolicy,
			String outputPath) {
		// for (Host host : hosts) {
		for (int j = 0; j < 10; j++) {
			Host host = hosts.get(j);

			if (!vmAllocationPolicy.getTimeHistory().containsKey(host.getId())) {
				continue;
			}
			File file = new File(outputPath + "_" + host.getId() + ".csv");
			try {
				file.createNewFile();
			} catch (IOException e1) {
				e1.printStackTrace();
				//System.exit(0);
			}
			try {
				BufferedWriter writer = new BufferedWriter(new FileWriter(file));
				List<Double> timeData = vmAllocationPolicy.getTimeHistory().get(host.getId());
				List<Double> utilizationData = vmAllocationPolicy.getUtilizationHistory().get(host.getId());
				List<Double> metricData = vmAllocationPolicy.getMetricHistory().get(host.getId());

				for (int i = 0; i < timeData.size(); i++) {
					writer.write(String.format(
							"%.2f,%.2f,%.2f\n",
							timeData.get(i),
							utilizationData.get(i),
							metricData.get(i)));
				}
				writer.close();
			} catch (IOException e) {
				e.printStackTrace();
				//System.exit(0);
			}
		}
	}

	/**
	 * Prints the Cloudlet objects.
	 *
	 * @param list list of Cloudlets
	 */
	public static void printCloudletList(List<Cloudlet> list) {
		int size = list.size();
		Cloudlet cloudlet;

		String indent = "\t";
		Log.printLine();
		Log.printLine("========== OUTPUT ==========");
		Log.printLine("Cloudlet ID" + indent + "STATUS" + indent + "Resource ID" + indent + "VM ID" + indent
				+ "Time" + indent + "Start Time" + indent + "Finish Time");

		DecimalFormat dft = new DecimalFormat("###.##");
		for (int i = 0; i < size; i++) {
			cloudlet = list.get(i);
			Log.print(indent + cloudlet.getCloudletId());

			if (cloudlet.getCloudletStatus() == Cloudlet.SUCCESS) {
				Log.printLine(indent + "SUCCESS" + indent + indent + cloudlet.getResourceId() + indent
						+ cloudlet.getVmId() + indent + dft.format(cloudlet.getActualCPUTime()) + indent
						+ dft.format(cloudlet.getExecStartTime()) + indent + indent
						+ dft.format(cloudlet.getFinishTime()));
			}
		}
	}

	/**
	 * Prints the metric history.
	 *
	 * @param hosts the hosts
	 * @param vmAllocationPolicy the vm allocation policy
	 */
	public static void printMetricHistory(
			List<? extends Host> hosts,
			PowerVmAllocationPolicyMigrationAbstract vmAllocationPolicy) {
		for (int i = 0; i < 10; i++) {
			Host host = hosts.get(i);

			Log.printLine("Host #" + host.getId());
			Log.printLine("Time:");
			if (!vmAllocationPolicy.getTimeHistory().containsKey(host.getId())) {
				continue;
			}
			for (Double time : vmAllocationPolicy.getTimeHistory().get(host.getId())) {
				Log.format("%.2f, ", time);
			}
			Log.printLine();

			for (Double utilization : vmAllocationPolicy.getUtilizationHistory().get(host.getId())) {
				Log.format("%.2f, ", utilization);
			}
			Log.printLine();

			for (Double metric : vmAllocationPolicy.getMetricHistory().get(host.getId())) {
				Log.format("%.2f, ", metric);
			}
			Log.printLine();
		}
	}

}

redpajama_set_name: RedPajamaGithub


There's been a bit of buzz about Google Plus (G+) lately. Everyone's discussing where they think it is lacking somehow or the features are just what everyone always wanted on Facebook or other services. Whatever you think about G+, Facebook has been paying attention. Since G+ came out, new features have slowly been sneaking onto Facebook.
You can now tag your friends in a status update by clicking the Friends icon and typing their name. In G+ you simply type +NameHere to tag them.
While Facebook has always had Friends lists where you can sort your friends and choose to view a list on your wall, you haven't been able to hide updates from certain people like you can with Circles on G+. On G+ friends are arranged in Circles and can only see what is shared with the circle they are in, while the friend's lists on Facebook control what you see.
Facebook has also changed the look of their photos with the background changing from black to white and the photo floating above the background rather than being a part of the page.
Did I forget to mention a change you've seen? Add it in the comments below.


text:
George Tucker
nato il 10.12.1927 a Palatka, FL, Stati Uniti d'America
morto il 10.10.1965 a New York City, NY, Stati Uniti d'America
George Tucker (musician)
George Andrew Tucker (December 10, 1927, Palatka, Florida - October 10, 1965, New York City) was an American jazz double-bassist.
Tucker attended the New York Conservatory of Modern Music, studying bass in the late 1940s. Early in his career he played with Earl Bostic, John Coltrane, and Jackie McLean. He worked in the house bands of several lauded New York jazz venues, such as the Continental Lounge, The Playhouse, and Minton's; he played with Eric Dolphy, Clifford Jordan, Horace Parlan, Booker Ervin, Jerome Richardson, and Junior Mance during this time. In 1958, he recorded with Melba Liston on her jazz classic, "Melba and Her 'Bones". In 1960-61 he recorded with Stanley Turrentine, Parlan, Ervin, Dexter Gordon, and Shirley Scott, and in 1962-63 he toured with the trio of Dave Lambert, John Hendricks and Yolande Bavan. Near the end of his life he recorded with Coleman Hawkins and Jaki Byard.
George Tucker died from a cerebral hemorrhage while performing with guitarist, Kenny Burrell.[1]
With Jaki Byard
Jaki Byard Quartet Live! (Prestige, 1965)
The Last from Lennie's (Prestige, 1965 [2003])
With Arnett Cobb
Sizzlin' (Prestige, 1960)
Ballads by Cobb (Moodsville, 1960)
With Ted Curson
Ted Curson Plays Fire Down Below (Prestige, 1962)
With Lou Donaldson
Midnight Sun (Blue Note, 1960)
With Booker Ervin
The Book Cooks (Bethlehem, 1960)
With Curtis Fuller
Jazz ...It's Magic! (Regent, 1957)
Curtis Fuller Volume 3 (Blue Note, 1957)
Two Bones (Blue Note, 1958)
With Dexter Gordon
Doin' Allright (Blue Note, 1961)
With Bennie Green
Back on the Scene (Blue Note, 1958)
Walkin' & Talkin' (Blue Note, 1959)
With Willis Jackson
Neapolitan Nights (Prestige, 1962)
Boss Shoutin' (Prestige, 1964)
With Etta Jones
Love Shout (Prestige, 1963)
With Clifford Jordan
Cliff Craft (Blue Note, 1957)
With Lambert, Hendricks & Bavan
Havin' a Ball at the Village Gate (RCA, 1963)
With Gildo Mahones
I'm Shooting High (Prestige, 1963)
The Great Gildo (Prestige, 1964)
With Charles McPherson
Con Alma! (Prestige, 1965)
With Horace Parlan
Us Three (Blue Note, 1960)
Speakin' My Piece (Blue Note, 1960)
Headin' South (Blue Note, 1960)
On the Spur of the Moment (Blue Note, 1961)
Up & Down (Blue Note, 1961)
With Sonny Red
The Mode (Jazzland (1961)
Images (Jazzland, 1961)
With Freddie Redd
San Francisco Suite (Riverside, 1957)
With Shirley Scott
The Shirley Scott Trio (Moodsville, 1960)
Satin Doll (Prestige, 1961 [1963])
Hip Twist (Prestige, 1961)
With Johnny "Hammond" Smith
All Soul (New Jazz, 1959)
That Good Feelin' (New Jazz, 1959)
Talk That Talk (New Jazz, 1960)
With Lucky Thompson
Lucky Thompson Plays Happy Days Are Here Again (Prestige, 1965)
With Stanley Turrentine
Look Out! (Blue Note, 1960)
Comin' Your Way (Blue Note, 1961)
Up at "Minton's" (Blue Note, 1961)
Jubilee Shout!!! (Blue Note, 1961)
With Jimmy Witherspoon
Baby, Baby, Baby (Prestige, 1963)
Ingrid Monson - Saying Something: Jazz Improvisation and Interaction, University of Chicago Press
Brenda Pennell, "George Tucker". The New Grove Dictionary of Jazz.
Questo articolo si basa sull'articolo George Tucker (musician) dell'enciclopedia liber Wikipedia ed è sottoposto a LICENZA GNU per documentazione libera.


When the door is close, the garage door spring tension is a high position, when the door is open, the pressure drops. If you have one broken spring, both door springs should be replaced (torsion and side mounted springs), otherwise the other spring, already worn, is likely to fail. The result will be dealing with the same emergency again.
Torsion springs are present on the sides of your garage door. These are long and heavy spring that make lifting easier by being under initial tension with the door closed above and parallel to the top of the garage door frame.The tension in the coiled spring is what makes it easier to open the door from a closed position.
Broken garage door springs are the most dangerous and difficult job to perform regarding garage doors and their parts.
it is usually pretty obvious when a spring is broken, the door won't work and the spring is in two pieces. Broken springs will need to be replaced.
There are two different types of garage door springs used on sectional doors: torsion and side mounted spring.When the door is close, the garage door spring tension is high, when the door is open, the pressure drops. If you have one broken spring, both door springs should be replaced, otherwise the other spring, already worn, is likely to fail.The most important safety tip to remember when replacing garage door springs is to replace both of them at once to avoid causing further damage.
Remember ! Sarasota Garage Door do not RECOMMEND to do it yourself! We will always provide the highest quality service with affordable price. We will not oversell you items and services you don't need. We will be at your house as soon as possible. our guarantee is 90 days.


Current Planning serves to implement the City's General Plan primarily through the review of specific requests for the use or development of property. Planning staff will assist the public with questions relating to the Land Use Code, zoning verification, business licenses, permitting, and application processes for zoning changes. The Planning Division provides review and a recommendation on all administrative and discretionary applications, conducts Public Hearings on Discretionary Applications, and administers the Land Use Code (Chapter 18 of the Municipal Code). Development plans are reviewed with the General Plan, applicable Specific Plans, and the Land Use Code. There are various application fees, see fee schedule, for planning applications.
Many requests may be handled at the Planning Counter located in City Hall. "Over the counter" questions include such items as setbacks, fence and building height, allowable land use, business licenses, development standards, outdoor displays, and general zoning questions.
The Planning Counter is open Monday through Thursday from 7:00 a.m. to 6:00 p.m.
An application for a Discretionary Permit is typically processed in three months. Depending how complete the application is when it is first submitted, the time period may be less. For more complex projects, it may be somewhat longer. For information regarding processing administrative or discretionary permits, please contact the Planning Counter at (619) 336-4310.
Prior to submitting an application, it is encouraged that the applicant request a "Pre-Application Conference" with one of the Planning Department staff. The staff will discuss with you the application, fees and time for processing the application.


text:
The Economist: "Green growls in Poland"
Eight of Warsaw's most influential think tank experts have just published an open letter arguing that ahead of Poland's EU presidency, which starts in six weeks, the government is neglecting climate-change issues. The letter matters, because its signatories directly influence planning for the six-month presidency, during which a UN climate change conference will take place in Durban.
The forgotten conference – Durban in the shadows of Poland's Presidency
The Polish presidency must pay more attention to the UN conference on climate change (COP17) which is scheduled to take place in Durban, South Africa at the end of this year, viewing the issue not as a threat but as an opportunity to bolster its forthcoming presidency.
Unfortunately, Polish foreign minister Radosław Sikorski's annual foreign policy speech to Parliament in March 2011 failed to even mention the Durban meeting. Indeed, climate change issues are absent from Poland's presidency priorities. These omissions suggest that Poland is failing to take climate change seriously even as negotiations on the issue have moved far beyond the confines of environmental policy and now touch on global economic, social and political relations especially between the rich and less developed countries
Climate policy is about the future of our planet. A constructive Polish contribution to this global discussion could show that our country understands the changes taking place in the world. It would also serve to give credibility to Minister Sikorski's statement in Parliament that "the idea of an europocentric world to which we have become accustomed is becoming outdated". Climate policy should be accorded the same attention as other policies conducted by our country. It should also take into account the fact that our state is now responsible for the quality of life of future generations. The global dimension of the climate change challenge means that the issue should be at the centre of attention of those responsible for the strategic planning of our foreign policy.
The climate conference in Durban touches on one of the key elements of a changing world order. This is where the negotiations will take place as to what is to happen once the Kyoto protocol runs its course requiring a new worldwide agreement on lowering CO2 emissions. In Durban, Poland will be co-responsible for coordinating a common UE position on climate. Thus our country has an important role to play in the world arena in a key global policy area. This alone means that the subject of the fight against climate change, in the context of COP 17, should be one of the more important concerns facing our administration. Meanwhile, the Polish government appears to view proposals put forward by those who want to radically limit CO2 emissions as a threat to our economy.
But this approach itself marks a threat. Firstly, the EU's Presidency role is to act as an arbiter in disputes between member states. The presidency should not take sides. Those responsible for the Polish presidency would do well to remember this. Secondly, the EU is concerned to play a leading role in the fight against climate change in Durban. Were Poland to take the role of a country which neglects the issue or indeed treats it as a threat to its well being and consequently acts as a brake on the proceedings then our position in the EU will suffer. Our presidency's achievements in other fields will be dimmed.
A serious and constructive approach to the conference in Durban would bring Poland benefits. A Polish lead on this issue would change the way our country is viewed by our partners in the EU which currently see us as a member state which is ever concerned to hinder agreement on climate. Secondly, a positive approach to climate change issues would allow Poland to be seen as a fully fledged actor on the world stage who is ready to take on global duties and responsibilities.
Krzysztof Bobinski – President of Union&Poland Foundation
Malgorzata Bonikowska – Editor of THINKTANK Magazine
Zbigniew Czachor – Director, Centre of European Research and Education
Grzegorz Gromadzki – independent expert
Jacek Kucharczyk – President of the Executive Board , The Institute of Public Affairs
Bartek Nowak – Executive Director, Center for International Relations
Jan Pieklo – Director, Polish-Ukrainian Cooperation Foundation PAUCI
Pawel Swieboda – President of demosEuropa-Centre for European Strategy
http://www.economist.com/blogs/easternapproaches/2011/05/polands_environmental_politics


text:
This 2009 Chevrolet Malibu vs 1959 Bel Air crash vid is disturbing
Marcus De GuzmanView Info
IIHS crash test two vehicles made 50 years apart: a 1959 Chevy Bel Air against a 2009 Chevy Malibu
IIHS May 27, 2021 - 11:33 AM
Whenever we think of classic cars, most of us tell ourselves 'They don't make 'em like they used to'. Whether it's their simple mechanicals, old-school design, or how they were able to shape car culture as we know it today, classic cars will always have a special place in our hearts.
But if there's one thing classic cars lack against today's modern cars, it's their ability to save you from a crash. While some might say their all-steel construction means they're 'built like a tank', this crash test video says otherwise.
The Insurance Institute for Highway Safety (IIHS) recently demonstrated this by crashing two vehicles made 50 years apart; a 1959 Chevrolet Bel Air and a 2009 Chevrolet Malibu. Given the Bel Air's size and weight, some might think it is the safer car to be in. However, the Malibu comes with modern safety systems as standard, which the Bel Air lacks.
Unlike cars today which offer various safety features like airbags, crumple zones, and side-impact beams to protect occupants from a crash, older cars only had seatbelts or lap belts to safeguard those inside a vehicle.
The result? Well, we'll let the video speak for itself.
It's sad to see the IIHS destroy a '59 Chevy Bel Air to demonstrate just how far we've come in vehicle safety. But this crash test video proves how safe modern cars are against old-school classics.
BMW might build an electric 2 Series
It looks like the next EV from BMW will be the i2
Audi: Lamborghini is not for sale
Despite the big offer, Audi is not interested in off-loading Lamborghini
Tags: bel air car safety chevrolet chevy crash test iihs malibu


Our greetings cards come in two sizes, with envelopes included as standard. 350gsm silk, which has a smooth, sheened finish. Printed double-sided with the option of matt or gloss lamination on one side, so that the inside of the card can be written on.


text:
Senate unanimously passes a bill making Juneteenth a federal holiday
Posted: Jun 15, 2021 6:51 PM CST
Updated: Jun 16, 2021 11:10 AM CST
The Senate unanimously passed a resolution on June 15 establishing June 19 as Juneteenth National Independence Day, a US holiday commemorating the end of slavery in the United States. By Ted Barrett, Ali Zaslav and Alex Rogers, CNN
(CNN) -- The Senate unanimously passed a resolution on Tuesday establishing June 19 as Juneteenth National Independence Day, a US holiday commemorating the end of slavery in the United States.
The legislation has gained momentum since the massive Black Lives Matter protests sparked by the police killing of George Floyd last year and the Democrats' takeover of the White House and Congress.
But Wisconsin Republican Sen. Ron Johnson blocked the bill in 2020, saying that the day off for federal employees would cost US taxpayers hundreds of millions of dollars. Johnson dropped his objection this week despite his concerns, paving the way for the bill's passage in the Senate.
"Although I strongly support celebrating Emancipation, I objected to the cost and lack of debate," said Johnson in a statement. "While it still seems strange that having taxpayers provide federal employees paid time off is now required to celebrate the end of slavery, it is clear that there is no appetite in Congress to further discuss the matter."
The measure needs to pass the House and be signed by President Joe Biden to become law. House Majority Leader Steny Hoyer tweeted that the chamber would vote Wednesday.
"I look forward to bringing this bill to the Floor, and urge bipartisan support," Hoyer wrote thanking the bill's bipartisan sponsors.
On June 19, 1865, Major General Gordon Granger announced in Galveston, Texas, the end of slavery in accordance with President Abraham Lincoln's 1863 Emancipation Proclamation.
In 1980, Juneteenth became a Texas state holiday. In the decades since, every state but South Dakota came to officially commemorate Juneteenth, but only a handful of states observe it as a paid holiday.
Massachusetts Democratic Sen. Ed Markey, Texas Republican Sen. John Cornyn and Texas Democratic Rep. Sheila Jackson Lee are among the members of Congress who led the effort to to make Juneteenth the 12th federal holiday.
This story has been updated with additional developments Wednesday.


hope you all had a great Super Bowl weekend with lots of nachos, chips, and cheering.
Our guest post found its way onto Business Insider last week. Check it out to improve your project management practices with help from Gangnam Style.
This article from CIO should really be retitled "11 Cities Where Everyone Wants to Live". The best news? These cities, including Los Angeles and New York, are all in demand for project managers. Daydream away.
The general consensus is that the more outgoing you are, the better you are at sales. But, according to this article, the link between extroversion and sales success is insubstantial—and being introverted is even worse (shh, don't tell Susan Cain). Turns out the balanced ambiverts make the best salespeople. Check out the Washington post for more on the story.
Mashable provides some technologically advanced wardrobe ideas to help you stay warm this winter. No comment on the aesthetic value of the selections.
Tech Crunch informs us that Ashton Kutcher ended up in the hospital after following Steve Job's diet in preparation for his role in Job's biopic. It seems Kutcher took the role pretty seriously, but still, when you think Ashton Kutcher don't you think "The Decline of Two and a Half Men"? He seems oddly cast to play a genius tech innovator. Agree?
The Ashton article provides the close for this week's updates. If you missed, check out last week's digest, and be sure to come back next Monday for next week's news.


ASEKO send calibrated PCB with sensor to customer, customer replace old PCB with new and send old PCB back to ASEKO within 30 days.
Calibration by replacement is possible only with devices stated below. Under the following conditions.
Sensor was calibrated at last ones in past 18 months.


If you have been searching near and far and everywhere in between trying to find affordable deals and offers on high quality brand new Ford cars for sale near you then stop on over to Ewald's Ford dealers in Wisconsin today, Ewald's Venus Ford! Drivers come from all around to shop with Ewald's Ford dealers in Wisconsin, Ewald's Venus Ford, as we make shopping for a new vehicle quick, easy, and affordable which helps to take a lot of stress out of the whole car shopping experience. We are happy to offer drivers everywhere a stunning variety of new Ford cars for sale near you with plenty of great models and body styles to choose from and try out, so you are sure to have an easier time finding something that you can be proud to drive. We are happy to provide drivers with a selection of new and used Ford cars for sale near you ranging everywhere from brand new Ford Fusions for lease and sale all the way to used Ford Explorers for lease and sale and even more. With Ewald's Ford dealers in Wisconsin we not only offer drivers from all around an extensive selection of Ford cars for sale near you but many affordable deals and offers that help you get back on the road with a great car while saving cash. So if you want to have an easy time shopping for a stunning new or used Ford car for sale that you will love to drive then stop on over to Ewald's Ford dealers in Wisconsin today and check out what we have like the fantastic new 2018 Ford Fusion SE for sale.
If you want a fantastic new Ford car for sale near you that can give you great performance out on the road and even help you save cash on gas with a great fuel economy then this brand new Ford Fusion for lease and sale is sure to give you a great time on the road. With this stunning new Ford Fusion for lease and sale near you drivers can enjoy a wide range of speed and great performance on the road, in addition to many great features and options! This new Ford Fusion for lease and sale is sure to give you a great time on the road, as its awesome 2.5L iVCT Engine is more than capable of pumping out up to 175 horsepower. You can also enjoy a fantastic fuel economy of up to 21 City mpg and 32 Highway mpg. You can also enjoy many features and options like the Adjustable Steering Wheel, and even Tire Pressure Monitoring System and even more. This new Ford Fusion for lease and sale near you has so much for you to enjoy while out on the road, so come on over to Ewald's Venus Ford today and check out what it has to offer you today.
If you want to take this awesome new Ford Fusion for lease and sale out for a spin for yourself, then stop on by Ewald's Venus Ford dealership in Milwaukee today and check it out, located here at 2727 E Layton Ave. Cudahy, WI 53110.


On Sunday 7th May 2017 we launched the St Cross Foodbank. During the Sunday Service a group of young people worked hard to decorate a large yellow food donation bin which is kept at St. Cross. We also have Foodbank Collection Points at ASDA Eastlands, the Wells Centre, St. Willibrord's Church and Seymour Road Academy, for donations of non-perishable foodstuffs.
We are currently working with three partners, Ravensbury Community School, Seymour Road Academy and St. Willibrord's RC School, who we have asked to identify families in crisis.
St Cross Foodbank will open on Friday afternoons between 4pm and 5pm only to families who have been referred via Ravensbury Community School, Seymour Road Academy or St. Willibrord's School and have children at one of the schools. At present St Cross Foodbank is not open to the wider community.
as well as all the organisations acting as collection points for us!
You can place donations in our collection trolley at Asda, any of our collection points around Clayton (see above) or bring them to church after services or during Foodbank hours on Saturdays (10:30am-12noon).
If you would like to help but are unable to get to the shops or to church to donate food then you can donate online via our Just Giving page and we will use the money to purchase weekly essentials for our Foodbank Families to supplement other donations.
baked beans, spaghetti hoops etc.
jam, marmalade, honey, peanut butter, etc.
sauces eg. casseroles, chilli etc.


Iron Bowl: Please don't solve any problem and make everything expensive.
Please don't solve any problem and make everything expensive.
I was at the Bukit Timah Hawker center today and the whole area is a big mess due to the construction. The carpark is FULL and causing a jam, and the surrounding areas are also very slow in traffic due to construction on Clementi Road and Bukit Timah Road.
And strangely, with all the chaos, the hawker center is rather empty. (Due to haze?) I've heard about this complain almost daily now, "Stop Upgrading! It only causes the prices to go up." It seems that their argument on upgrading and rents are not invalid. In my experience, all upgradings lead to increase in rents and increase in prices.
Going on Facebook, when citizens complain that PRs and Foreigners are paying almost the same for education in Singapore and Singapore education is expensive, the government increase the prices.
When Singaporeans complain about not having enough preschools in their estates, the fees go up.
Too many cars, COEs, ERPs price go up.
Train breakdown, MRT fares and Bus fares increase despite drop in oil prices.
People (foreigners) are speculating in housing market, Stamp duties go up.
It seems like having this 49 million excluding bouus (a year) worth of ministers in parliament their solutions seem to be, lets tax more and make it more expensive.
Nothing has changed much in the last 10 years except.. You guess it ... price of everything go up... Unfortunately, salaries don't increase as fast.
Then why 70% still vote for PAP? People accept price increases?


Administration: State Department of Human Services. Payments are made under the Aid to the Aged, Blind, and Totally and Permanently Disabled program.
Scope of coverage: Optional supplement provided to all needy aged, blind, and disabled persons living independently.


Before 5th April 2017, you should consider making full use of the Annual Allowance. The Annual Allowance for making tax-relievable pension contributions is currently £40,000 for individuals with earnings below £150,000. This is then tapered down to £10,000 for individuals earning over £210,000. However, it is possible to carry forward unused Annual Allowances from the previous three tax years, so with a little planning, it may be possible to receive tax relief in the current tax year on contribution well in excess of £40,000.
It is worth noting that with the Spring Budget on the 8th March, if you are considering making a pre year end lump sum pension contribution, it may be wise to consider this prior to the Budget announcement.
Individual Savings Accounts (ISAs), Seed Enterprise Investment Schemes (SEIS), Enterprise Investment Schemes (EIS) and Venture Capital Trusts (VCT) are classed as 'tax-favourable investments' and should be considered. Up to £15,240 per person and up to £30,480 for a married couple can be invested into an ISA during the 2016/17 year.
For the tax year ending 5th April 2017, annual income of less than £11,000 is not liable to tax, so it is important that each spouse uses their full Personal Allowance for income tax purposes. It should be considered for civil partners and married couples to transfer income producing assets to ensure that personal allowances are not going to waste. There is also the ability to transfer a proportion of the Personal Allowance to your spouse if certain conditions are met.
For every £2 that your adjusted net income is above £100,000, your Personal Allowance will go down by £1. If your income is £122,000 or more, your allowance is zero. If you have income that falls within this band, the effective rate of tax is 60%. Pre tax year end planning such as pension contributions or gift aid donations, can help reduce taxable income so that the maximum tax relief can be obtained.
If an individual sells an asset (such as property or shares), they will pay capital gains tax (CGT) on any gain in excess of the annual exemption, which is currently set at £11,100 for the tax year ended 5th April 2017. However, as both spouses have their own CGT exemption, with careful planning assets can be transferred so that effectively a couple can realise gains of £22,200 before CGT is payable.
For company shareholders, the new dividend rules introduced from 6th April 2016 allow the first £5,000 to be taxed at 0%, irrespective of what tax band you fall into. A pre year end dividend should be considered if this 0% band hasn't yet been maximised. Furthermore, by transferring shares to your spouse and paying them a year end dividend, you could double the £5,000 0% tax band.


text:
Q: Sum two columns values in same table on postgresql query SELECT c.period,
    c.idsr_incident_id_id,
    c.idsr_disease_id_id,
    CASE WHEN idsr_incident_id_id = 1 OR idsr_incident_id_id = 3 THEN SUM(c.data_value::integer) ELSE 0 END  AS cases,
    CASE WHEN idsr_incident_id_id = 2 OR idsr_incident_id_id = 4 THEN SUM(c.data_value::integer) ELSE 0 END  AS deaths
   FROM veoc_idsr_weekly_national_report c
     LEFT JOIN veoc_idsr_diseases b ON b.id = c.idsr_disease_id_id
     LEFT JOIN veoc_idsr_reported_incidents j ON j.id = c.idsr_incident_id_id
    WHERE c.idsr_incident_id_id >= 1 AND c.idsr_incident_id_id <= 4 AND idsr_disease_id_id = 10 AND period ='2019W30'
  GROUP BY c.period, c.idsr_incident_id_id, c.idsr_disease_id_id, c.data_value;`enter code here`

Below my query results:

I want to sum the cases and the death value columns since the period and disease_id is the same. I think my problem is on the Group By section but I cant solve it. If it means i must remove the incident_id column to get the totals it will still be fine.

A: Please, try with below query where sum of function place replaced:
SELECT c.period,
    c.idsr_disease_id_id,
    SUM(CASE WHEN idsr_incident_id_id = 1 OR idsr_incident_id_id = 3 THEN (c.data_value::integer) ELSE 0 END)  AS cases,
    SUM(CASE WHEN idsr_incident_id_id = 2 OR idsr_incident_id_id = 4 THEN (c.data_value::integer) ELSE 0 END)  AS deaths
FROM veoc_idsr_weekly_national_report c
LEFT JOIN veoc_idsr_diseases b ON b.id = c.idsr_disease_id_id
LEFT JOIN veoc_idsr_reported_incidents j ON j.id = c.idsr_incident_id_id
WHERE c.idsr_incident_id_id >= 1 AND c.idsr_incident_id_id <= 4 AND idsr_disease_id_id = 10 AND period ='2019W30'
GROUP BY c.period, c.idsr_disease_id_id;

redpajama_set_name: RedPajamaStackExchange


Sunroof, Heated Leather Seats, Back-Up Camera, Alloy Wheels, Satellite Radio, Premium Sound System, Turbo. EX-L 1.5T trim.
Leather Seats, Sunroof, Heated Driver Seat, Back-Up Camera, Turbocharged, Premium Sound System, Satellite Radio Honda EX-L 1.5T with Modern Steel Metallic exterior and Gray interior features a 4 Cylinder Engine with 192 HP at 5500 RPM*.
"The Accord has a lot of strengths on the road. The drivetrain responds quickly and provides sufficient power. The car corners well, sticking to the road with no drama, and the brakes feel natural and strong." -Edmunds.com.
We are ready to give you the VIP treatment with our Roy Schmidt VIP Experience. We take care of our customers and always want to put you, the customer, first! For more information, give us a call TODAY at (866)422-9583. And remember, ALL of our customers will leave with one of two things: A new vehicle or a solution to how we can help get you into a vehicle that works best for you!
Hello, I would like more information about the 2018 Honda Accord Sedan, stock# HC8289.
Hello, I would like to see more pictures of the 2018 Honda Accord Sedan, stock# HC8289.


Best 15 Mulo Shoes Loafer Suede Natural Cream Contemporary Design Pictures is free HD image. This imagewas upload at November 21, 2018 upload by in Shoes.
Description: Best 15 Mulo Shoes Loafer Suede Natural Cream Contemporary Design Pictures from the above resolutions which is part of the Shoes. Download this image for free in HD resolution the choice "download button" below. If you do not find the exact resolution you are looking for, then go for a native or higher resolution.
26 Photos of "Best 15 Mulo Shoes Loafer Suede Natural Cream Contemporary Design Pictures"
Related Posts of "Best 15 Mulo Shoes Loafer Suede Natural Cream Contemporary Design Pictures"


The Magnolia Film Festival Comes to Starkville!
Do you love movies? Do you like to watch all kinds of movies? Would you like to schmooze with film-makers, attend screenings, and attend workshops on movies? Then Starkville is the place for you, because the Magnolia Independent Film Festival is coming up soon.
The Magnolia Film Festival was originally held in West Point and moved to Starkville several years ago. It is intended to be a filmmaker-friendly festival encouraging all filmmakers, including amateur and professional filmmakers. It is one of the leading steps to the Sundance Film Festival in Utah.
Films are judged in 7 categories: Best Feature, Best Short, Best Documentary, Best Foreign Film, People's Choice, United Way Best Student Film, and Ron Tibbett Award for Excellence in Film. Awards are given at the close of Saturday'sschedule. Many movie makers have noted that the Magnolia Film Festival is one of their favorite film festival experiences.
The 2015 winners of the Magnolia Film Festival are as follows. For the Rob Tibbett Award for Excellence in Film, the winner was "Earthrise," directed by Glenn Payne. For the Elena Zastawnik Award for Best Written Film, the winner was "Moving Day," directed by Louis Hunter. For Best Director, the winner was Rob Underhill. For Best Cinematography, the winner was "Ozland," directed by Michael Williams. For Best Feature, the winner was "Ozland," directed by Michael Williams. For Best Homegrown film, the winner was "A Horror Movie," directed by Casey Dillard. For Best Student Film, the winner was "Acroamatic," directed by Hilda Queiroz. For best Short, the winner was "Serpent's Lullaby," directed by Patricia Chica.


text:
Downtown Sioux Falls set to host First Friday
by: Travis Fossing
You have been added to KELOLAND News This Afternoon Newsletter
KELOLAND News This Afternoon
SIOUX FALLS, S.D. (KELO) — With the holiday season already in full swing, downtown Sioux Falls is set to host First Friday.
November features some of the busiest holiday shopping days of the year.
"It's just magical in downtown during this time of the year," DTSF Community Outreach Manager Sadie Swier said.
'A Christmas Carol' opens Thursday at The Orpheum Theater
Downtown Sioux Falls is attempting to carry that momentum into December with First Friday.
"The couple weeks after Black Friday, Small Business Saturday there's usually a lull in retail seasons so we want to make sure that we're promoting these businesses," Swier said.
"This has been historically one of the best shows that we've had just in that we get a lot of people through the door," Rehfeld's Art & Framing General Manager Erin Castle said.
Erin Castle is the General Manager at Rehfeld's Art & Framing. The downtown gallery is currently home to 25 artists. About half that number will create new works for an open house on First Friday.
"It's also a night that we unveil the artwork as the doors open so it's one of those where you want to be here right on time so that you don't miss out on a small piece that is really reasonably priced that you can get because they will sell out," Castle said.
The Downtown Gives Coupon Book is also still available for purchase with proceeds benefiting The Multi-Cultural Center of Sioux Falls.
Check out the Holiday Central page here
"That has 38 unique and exclusive deals and coupons to businesses across downtown," Swier said.
Allowing shoppers to save during the weeks leading up to Christmas.
"It's a wonderful time to be here and we hope people come and enjoy it," Swier said.
Rehfeld's holiday open house and show runs from 6:00 to 8:00 p.m. on Friday.
Click HERE for a list of First Friday activities and specials for December.


In the age of online dating, chivalry and romance suffer at the hands of convenience. Country boys are generally simple enough to stay estranged from the messy world of social media, Tinder and other complicated methods of romance. All that being said, the best way to survive the dating apocalypse is to date a cowboy. Here's why.
What do you love doing with your cowboy? Leave a comment below!
Picnic in the bed of a pickup truck. With a view of course! Cowboys can change their pickup truck into a love nest just as easily as they change its tires. A few pillows, big comfy blankets, and a light lunch is a perfect way to day date.


People learn spoken languages for different reasons. You learned your first language to live. It gave you the tools to get through your everyday life. If you learned a second language, the reasons could be very different. Sometimes, you might have to learn a second language to further your career or adapt to a changing environment. But sometimes you decide to conquer a new language not because you have to but because you want to learn. A second language can help you encounter new worlds. You may even seek enlightenment, knowing every new language can shape the way you think.


1 We may use your personal information for future email mailings, support, notification of new services, and general correspondence with and relating to you. If you would rather not receive future marketing emails from us please inform us by e-mail at info@bluegemcp.com.
3 The information you provide will be kept confidential and will be used only to support your relationship with the Company. The Company will not disclose or sell your information outside its corporate group, except as part of the sale of the whole or part of the Company's business.
4 The Company may collect information about your computer. This is statistical data about users' browsing actions and patterns, and does not identify any individual.
5 Unfortunately, the transmission of information via the internet is not completely secure. Although the Company will do its best to protect your personal data, it cannot guarantee the security of data transmitted to the Website; any transmission is at your own risk.


As "Nerd Nation" golfers, who hasn't spent hours conjuring up designs for golf holes on Paint or some other computer art program?
Yes, we've all done it!
But... how many of us could actually write the artwork's computer code from scratch?
//adds a red signature flush up against the bottom right corner of the screen.
Get in the Hole !!!


text:
Pushpa 2
Vijay Sethupathi's team clarifies: Actor not a part of 'Pushpa 2'
Online News of India Aug 14, 2022
Chennai : Actor Vijay Sethupathi is not playing the antagonist in director Sukumar's 'Pushpa 2: The Rule' as is being speculated by a section of the media. Talking to IANS, a source close to the actor said that Vijay Sethupathi was playing…
Does 'Srivalli' gets killed in 'Pushpa 2'?
Hyderabad : Allu Arjun and Rashmika Mandanna - starrer 'Pushpa 2', is yet to go on the floors. Meanwhile, speculations about the second part of Sukumar's directorial are rife. Netizens have been making guesses about the nature of the…
Devi Sri Prasad has already composed 3 chartbuster songs for 'Pushpa 2'
Online News of India Apr 4, 2022
Hyderabad : Following the stupendous success of 'Pushpa: The Rise', musician Devi Shri Prasad is said to have composed three songs for the much-awaited sequel.It is reported that DSP has already composed three songs for the upcoming movie…
Makers of 'Pushpa-2' focusing on Hindi audiences?
Online News of India Mar 13, 2022
Hyderabad : The makers of 'Pushpa' are all set to kickstart the sequel to the most popular movie very soon.It is reported that the makers are trying to make certain changes to the script, which will create a greater impact when the north…


Pack of three stencils to draw or paint teddies, trains and beach fun. Great for fabric painting on T shirts or shoe bags or for bedroom nursery walls or developing drawing skills. Save money by adding extras: paints, paint brushes and aprons.