text:
Cawthorne, England: tourism, information and visitor reviews
Cawthorne is situated in England (part of Great Britain), in the Borough of Barnsley region. It is also a local administrative centre.
Place name: Cawthorne
Main Region: Borough of Barnsley
Latitude: 53.56667 South (53°34'0"N)
Distance from Cawthorne to other selected towns in England
distance from Liverpool: 94 km
Find driving distances to Cawthorne from all destinations in England at Europe driving distances
We have located 9 other place(s) listed nearby (within 7 kilometres of Cawthorne):
Clayton West
Darton
Denby Dale
Dodworth
Yorkshire Sculpture Park (Park) (5 km)
Elsecar Heritage Centre (Museum) (13 km)
Selected monuments in or near Cawthorne (not a comprehensive list,
Stainborough Lowe (Castle) (6 km)
Bolsterstone Castle (Castle) (11 km)
Sandal Castle (Castle) (12 km)
Wakefield Lowe Hill (Castle) (13 km)
Chantry Chapel (Church) (14 km)
Almondbury Castle Hill (Castle) (14 km)
Mirfield Castle Hall Hill (Castle) (14 km)
Bradfield Bailey Hill (Castle) (15 km)
Bradfield Castle Hill (Castle) (16 km)
Nostell Priory (Stately home) (16 km)
Huddersfield Hill House (Castle) (17 km)
St James' Church, Meltham Mills (Church) (17 km)
St. Peter's Church (Church) (18 km)
Stanley Methodist Church (Church) (18 km)
Zion Christian Centre (Church) (18 km)
Christ Church (Church) (19 km)
Rotherham (Castle) (19 km)
Whitwood Ferry Hill (Castle) (21 km)
Torside Castle (Castle) (23 km)
Pontefract Castle (Castle) (23 km)
Natural highlights such as lakes, forests and mountains close to Cawthorne.
Pugneys Country Park (Nature reserve) (11 km)
Dale Dyke Reservoir (Reservoir) (17 km)
Howden Reservoir (Reservoir) (18 km)
Blackmoorfoot Reservoir (Reservoir) (19 km)
Oldfield Hill (Hill) (19 km)
Black Hill (Hill) (20 km)
Derwent Reservoir (Reservoir) (20 km)
Woodhead Reservoir (Reservoir) (21 km)
Bleaklow Hill (Hill) (22 km)
Fairnurn Ings (Nature reserve) (27 km)
Golf courses and race tracks in the vicinity of Cawthorne.
Wakefield Golf Club (Golf course) (12 km)
Spring Mill Golf Club (Golf course) (13 km)
Low Laithes Golf Club (Golf course) (14 km)
Normanton Golf Club (Golf course) (17 km)
Lofthouse Hil Golf Club (Golf course) (18 km)
Oulton Park Golf Course (Golf course) (21 km)
Pontefract Racecourse (Racecourse) (22 km)
Railway stations identified as being in or close to Cawthorne.
Silkstone Common Railway Station (4 km)
Darton Railway Station (4 km)
Dodworth Railway Station (4 km)
Penistone Railway Station (5 km)
Denby Dale Railway Station (5 km)
Barnsley Interchange (7 km)
Shepley Railway Station (8 km)
Stocksmoor Railway Station (10 km)
Wombwell Railway Station (12 km)
Sandal & Agbrigg Railway Station (13 km)
Brockholes Railway Station (13 km)
Elsecar Railway Station (13 km)
Ravensthorpe Railway Station (13 km)
Rockingham Station (14 km)
Mirfield Railway Station (14 km)
Wakefield Westgate Railway Station (14 km)
Honley Railway Station (14 km)
Chapeltown Railway Station (14 km)
Wakefield Kirkgate Railway Station (14 km)
Dewsbury Railway Station (14 km)
Berry Brow Railway Station (15 km)
Fitzwilliam Railway Station (16 km)
Deighton Railway Station (16 km)
Huddersfield Railway Station (16 km)
Batley Railway Station (16 km)
Lockwood Railway Station (16 km)
Streethouse Railway Station (17 km)
Outwood Railway Station (17 km)
Goldthorpe Railway Station (18 km)
Normanton Railway Station (18 km)
Thurnscoe Railway Station (18 km)
Moorthorpe Railway Station (19 km)
Bolton-on-Dearne Railway Station (19 km)
Featherstone Railway Station (19 km)
Brighouse Railway Station (19 km)
South Elmsall Railway Station (20 km)
Meadowhall Interchange (20 km)
Swinton Railway Station (20 km)
Slaithwaite Railway Station (21 km)
Rotherham Central Railway Station (21 km)
Mexborough Railway Station (21 km)
Pontefract Tanshelf Railway Station (22 km)
Glasshoughton Railway Station (22 km)
Castleford Railway Station (23 km)
Pontefract Baghill Railway Station (23 km)
Pontefract Monkhill Railway Station (24 km)
Halifax Railway Station (25 km)
Know Cawthorne or operate a tourist attraction here?
If you know Cawthorne and could share a review or comment, or you have an attraction in Cawthorne please share this with our visitors:


Weleda Baby Calendula Soap. Mild cleanser, lightly fragrant. Natural care for delicate skin.
Weleda Calendula Soap contains extracts of soothing biodynamically grown Calendula and organic Chamomile flowers. This gentle soap forms a creamy lather, which delicately cleanses the skin and is ideal for the sensitive skin of babies and young children at bathtime. Weleda soaps are made from pure organically grown vegetable oils, which nourish and protect the natural protective layer of the skin.
- Dermatologically tested for use on sensitive skin.
- Suitable for use from birth onwards.
INGREDIENTS: Sodium Palmate, Sodium Cocoate, Water, Sodium Olivate, Glycerin, Fragrance*, Limonene*, Linalool*, Citronellol*, Geraniol*, Calendula Officinalis Flower Extract, Chamomilla Recutita (Matricaria) Extract, Iris Germanica Root Extract, Viola Tricolor Extract, Oryza Sativa (Rice) Extract, Malt Extract, Sodium Chloride. *from Natural Essential Oils.
Free from synthetic fragrances, colors, preservatives and raw materials derived from mineral oil.


text:
Q: Short story in Asimov's - recreated aquatic ape used for murder In the 1990s (I think), I read a short story in Asimov's magazine that used the then-popular (though never really accepted in the scientific community, I think) theory that mankind evolved from apes that dwelt on the shorelines and spent substantial time in the water. In this story, someone had recreated a group of such apes to populate a beach near his mansion, and an enemy used the apes in some way to murder the owner of the estate (perhaps by modifying his own body briefly to impersonate such an ape, to get into close proximity to the owner without detection). It feels like an Egan or Stableford story (though I'm probably thinking of Egan's "The Extra" which is not quite the same — though has the same culture of wealth and decadence).

A: This is almost definitely "Reef Apes" by David Smeds, Asimov's August 1992.
Sometime in the mid-distant future Louis Sheldon has re-created a species of reef apes in a sanctuary off the East African coast.

"Note the bipedal gait, the humanlike noses, the lack of body hair, the pendulous breasts. We've only evolved our Proconsul stock one point five million years into the aquatic phase, and already they've clearly entered the genus Homo. Say hello to your great-great-great grandparents."

He wishes to rise to the status of adept in biology (he is currently a mere master), but half the reason for his drive is to seduce a woman named Veronica Rizal he had a fling with a hundred years previously.  He arranges to encounter her, but she is completely uninterested in him, and shuts him down.
In rage and jealousy he mimics the shape of a lover of hers in order to sleep with her.  When she discovers this she tries to have him charged but her lawyer convinces her that she wouldn't be able to prove it. (He patterned his shape after her lover, but ensured his DNA stayed his own, which is a crime but hard to prove.)
5 years later, alone in his sanctuary, he is attacked by Jerry, one of his apes.  Except it isn't really Jerry, it's Veronica in the shape of an ape.  (Taking the shape of something that isn't a person is not a crime.)  She proceeds to half drown him, break his arms, and he is facing an indefinite period of excruciating pain at her hands before she leaves him dead.
(Note that death is a temporary condition and his body will heal.  But he will remember.)
The story is available at the Internet Archive.

redpajama_set_name: RedPajamaStackExchange


text:
Q: Weird behavior to plot a set of functions I have this code, totally functional
$Assumptions = h > 0;
p4[x_, h_] := x^4/24 + h*x^3/9 + h^2*x^2/12 - h^4/72;
q4[x_, h_] := x^4/24 - h*x^3/9 + h^2*x^2/12 - h^4/72
Flatten@Table[{D[p4[x, 3], {x, n}], D[q4[x, 3], {x, n}]}, {n, 0, 3}]

But when I try to plot all these functions together I try to use the code
Plot[Flatten@Table[{D[p4[x, 3], {x, n}], D[q4[x, 3], {x, n}]}, {n, 0, 3}], {x, -3, 3}, PlotLegends -> "Expressions"]

for some reason it doesnt work. Probably this is a silly mistake but I cant see how to solve it. Some help will be appreciated, thank you.


text: Q: create Shopware tables with references(one to one, one to many, many to many). Magrations and model I want to create tables that will be connected to each other. I took some info from https://developer.shopware.com/docs/guides/plugins/plugins/framework/data-handling/add-data-associations but didn't find SQL. I would like to see the whole process of creating associations: one to one, one to many, many to many (migrations and models) to understand it.


text:
Home World Americas Crimes Against Humanity: Indigenous Children Starved By Canadian Government Researchers 'In The...
Crimes Against Humanity: Indigenous Children Starved By Canadian Government Researchers 'In The Name of Science'
Genocide is state sponsored mass murder. It takes two forms, the most known is the annihilation of an entire race or ethnic group. Then there is the more subtle form that takes effect over generations – "deliberately inflicting on the group conditions of life calculated to bring about its physical destruction in whole or part", as defined by Barbara Harff and Ted Robert Gurr, "Toward Empirical Theory of Genocides and Politicides: Identification and Measurement of Cases Since 1945." Center on Law and Globalization.In 1928, a government official predicted Canada would end its "Indian problem" within two generations. Indigenous children of Canada were deliberately starved in the 1940s and '50s by government researchers in the name of science.
Rochelle Johnston wrote on Rabble, an online news source covering Canada:
"While there may not have been a master plan to execute every Aboriginal person in Canada, throughout much of our history there has been a deeply and widely held belief that First Nations, Metis and Inuit, as groups, should cease to exist. Reducing the number of Aboriginal people and eliminating those who weren't willing to assimilate into Euro-Canadian society was helpful to this cause. Evidence of genocidal desires can be found in any number of government documents and public statements, and when the conditions were right, Canadians, whether bureaucrats, researchers, doctors, missionaries, social workers or entrepreneurs, felt justified in carrying out a range of genocidal acts."
Milk rations were halved for years at residential schools across the country. Essential vitamins were kept from people who needed them. Dental services were withheld because gum health was a measuring tool for scientists and dental care would distort research.
For over a decade, indigenous children and adults were unknowingly subjected to nutritional experiments by Canadian government bureaucrats.
This disturbing look into government policy toward indigenous peoples after World War II comes to light in recently published historical research.
When Canadian researchers went to a number of northern Manitoba reserves in 1942, they found rampant malnourishment. But instead of recommending increased federal support to improve the health of hundreds of the people suffering from a collapsing fur trade and already limited government aid, they decided against it. Nutritionally deprived people would be the perfect test subjects, researchers thought.
The details come from Ian Mosby, a post-doctorate at the University of Guelph, whose research focused on one of the most horrific aspects of government policy toward indigenous peoples during a time when rules for research on humans were just being adopted by the scientific community.
Researching the development of health policy for a different research project, Mosby uncovered "vague references to studies conducted on 'Indians' " and began to investigate. Government documents eventually revealed a long-standing, government-run experiment that came to span the entire country and involved at least 1,300 indigenous, most of them children.
Any time the body is depleted of vital liquids and nutrients, there are several physical side effects that take place. These effects essentially happen because the body is trying to conserve energy for survival. According to the LiveStrong Foundation, even if a child survived long periods of starvation, they might experience abnormal growth and other forms of permanent damage. For example, nearly all bone development happens before adulthood, so children who fail to get sufficient calcium in their diets are likely to experience osteoporosis or other bone composition problems later as adults.
Academics and social activists have said Canada's historical treatment of indigenous people meets the UN definition of genocide, which is the intent to destroy a national, ethnic, racial or religious group through any of a number of means. They include killing the group's members, causing them serious mental or physical harm, subjecting them to unsustainable living conditions, preventing births and forcibly transferring their children to another group.
This atrocity is one of many church-run, government-funded assimilation efforts of residential schools for native children, to rid them of their heritage. The aims were devastating for those who were subjected to various physical and emotional abuse; many were forced removed from their families and tribes.
Johnston writes, "If it wasn't for Canada, and a contingent of colonizing nations who in 1948 gutted a whole section of the UN Genocide Convention, the other "kinder" and "gentler" techniques of genocide we were and are still using against Aboriginal peoples would also be crimes."
In 2008, the Canadian government made a formal public apology to the surviving children of the residential schools, their families and their nation.
Main Image:
Main Image Credit:
Indigenous children were abused, mistreated, removed from their families and used as test subjects.
Barbara Harff
Canadian Indian residential school system
Cultural assimilation
Rochelle Johnston
Ted Robert Gurr
Previous articleFBI Pressures Muslims on No-Fly List to Become Informants in Exchange for Travel Rights
Next articlePakistani Family Recounts Drone Horror Before Congress
After One Year Without Electricity, Officials Claim Puerto Rico's Power is Finally Back On
Puerto Rico: Teachers Denounce Closing of 283 Public Schools

redpajama_set_name: RedPajamaCommonCrawl


text:
Genetic Effects on Cognition are Stronger as We Age
No two people age the same way. Some become stereotypically absent-minded while others remain just as cognitively sharp as their younger counterparts. Shaping these differences in behavior is a complicated interplay between genes and lifestyle.
A growing body of research is teasing out the relative roles of genetics and lifestyle factors in cognition in old age. In a new paper in Trends in Cognitive Sciences, Goran Papenberg of the Aging Research Center at the Karolinska Institute and Stockholm University in Sweden and colleagues discussed studies of the effects of well-established genes on brain and behavior across the entire adult lifespan or at least several age cohorts.
While the number of available studies is still limited, they support the idea that genes play a bigger role in cognition, and brain structure and function as we age – part of the "resource-modulation hypothesis." At the same time, lifestyle choices, such as diet and exercise, can moderate the gene-related effects.
Papenberg spoke with CNS about the hypothesis, what the literature says about genetics and lifestyle, and some key takeaways for us all as we age.
CNS: What is the resource-modulation hypothesis?
Papenberg: The resource-modulation hypothesis posits that effects of common genetic variations on brain and cognition may become stronger in old age, contributing to between-person differences. The hypothesis assumes that the relationship between brain resources and cognition is non-linear. Brain resources denote the structural and neurochemical properties of the brain. In older age, brain resources are lowered due to aging-related declines in brain integrity. In young age, brain resources are high and differences in cognition between individuals with different genotypes are smaller or not detectable.
In old age, the same genotype differences become stronger because small differences in brain resources result in larger differences in cognition. So, young individuals carrying disadvantageous genotypes may not differ so much from young individuals carrying more beneficial genotypes. With aging, however, individuals with disadvantageous genotypes of different genes show stronger declines than those individuals with a more beneficial genotype.
CNS: What was the major goal of your new paper?
Papenberg: Our major goal was to describe the increasing evidence that supports the resource-modulation hypothesis. At the same time, we try to highlight some questions that need to be addressed and tested in future studies.
So far, we do not really understand the mechanisms behind the magnification of genetic effects with aging. The question is whether lower brain resources per se lead to increased genetic effects in old age. Alternatively, the stronger genetic effects could be mediated through lifestyle factors that may influence the expression of a gene.
CNS: What types of lifestyle factors?
Papenberg: Leading a physically active lifestyle is probably one of the most powerful lifestyle factors that may counteract the negative effects of a particular genotype in old age. Physical activity affects the body through many different pathways, which makes it a very broad intervention. Of course, with other beneficial lifestyle choices (e.g., nutrition), the beneficial effects of physical activity may even be enhanced.
CNS: What were you most excited to find?
Papenberg: It was exciting to see that the patterns of stronger genetic effects in older age seem to generalize across different genes, behavioral measures, and indicators of brain integrity. Of course, it is rewarding to see that findings of other research groups resemble data we have seen in previous studies, at a time when there was not much evidence in favor of the resource-modulation hypothesis.
CNS: What is an example of a disadvantageous genotype that is more influential in old age?
Papenberg: The APOE genotype e4 is associated with an increased risk for dementia and cognitive decline, for instance with respect to memory. One study showed that the e4 genotype only affected learning and memory after the age of 40, while younger adults carrying the risk genotype did not differ from non-carriers. Similarly, studies have shown that e4 also affects brain functioning and brain integrity stronger in older age.
The interesting part, however, is that our lifestyles seem to modulate the effects of APOE. Disadvantageous lifestyle choices may intensify and advantageous lifestyle choices may counteract the negative effects of APOE e4 in old age.
CNS: What is the general significance of your findings?
Papenberg: There is strong genetic influence on how we age in terms of brain and cognition. It's important to remember that the effects of single genes are small, but the additive effects of many genes and gene-gene interactions account for a large portion of inter-individual differences. One important take home message, however, is that our lifestyle may intensify or counteract negative genetic effects in old age.
CNS: What's next for this line of work?
Papenberg: We need to understand the epigenetic mechanisms behind the genetic effects and how these play out with aging. For instance, how do external or environmental factors influence gene expression? It is conceivable that individuals with more advantageous genetic predispositions may actively seek a more stimulating environment. Environmental exposure may, in turn, enhance expression of a particular gene via epigenetic mechanisms, thereby increasing inter-individual differences with aging.
By lmunoz Filed Under: featured Tagged With: aging, exercise, genetics
Previous article: How We Map Our Bodies from Infancy
Next article: Devil is in the Details: Specific Planning Leads to Unique Brain Activity


text:
Posted inColumnists, Marc Morial, Op-Ed, Opinion
To Be Equal: Voting is a Fundamental Right, not an 'Entitlement'
by Marc H. Morial April 1, 2013 October 30, 2020
By Marc Morial
NNPA Columnist
"No voting qualification or prerequisite to voting, or standard, practice or procedure shall be imposed or applied by any State or political subdivision to deny or abridge the right of any citizen of the United States to vote on account of race or color."
– Voting Rights Act of 1965
During recent Supreme Court oral arguments in Shelby County v. Holder, Justice Antonin Scalia called a key part of the Voting Rights Act – Section 5 – a "racial entitlement." Section 5 requires that the Justice Department or a federal court "pre-clear" any changes made to voting procedures by covered jurisdictions to ensure they do not "deny or abridge the right to vote on account of race or color."
This act was established to fix a broken system, and it remains relevant today. As long as blatant voter suppression measures such as voter ID laws and district gerrymandering are being used to keep certain groups from the polls, the Voting Rights Act – in its entirety – remains necessary. And to clear up any confusion that Justice Scalia has or anyone who found merit in his argument: Voting "rights" are indeed that – a rightguaranteed to every citizen of the United States. They are not a special privilege. They are not a gift. And they certainly don't constitute a "racial entitlement."
Justice Scalia's comments are a shameful reiteration of a right-wing political interpretation of the Constitution. The Voting Rights Act was a response to an inarguably unjust and unfair system for voting in this country.
Prior to the Voting Rights Act, millions of African Americans, primarily in the South, were forced to run a gauntlet of "voting qualifications or prerequisites," including ludicrous literacy tests, discriminatory poll taxes, and other bureaucratic restrictions. And when those measures failed, Blacks were routinely subjected to intimidation, economic sanctions, beatings and even murder. The 1964 murders of three voting rights activists at the hands of Mississippi Klansmen and the March 7, 1965 Bloody Sunday beating of peaceful voting rights marchers in Selma by Alabama State troopers are horrific examples.
While there has been undeniable progress since 1965, voting rights abuses are still sadly a part of the American electoral landscape. In fact, every presidential election of this new century has been plagued by voting problems – from "hanging chads," to Tea Party-backed campaigns of Election Day intimidation to new voter ID restrictions. Cut backs in early voting even led to a Florida woman, 102-year-old Desiline Victor, having to stand in line for three hours to vote in November's presidential election.
The Voting Rights Act, and specifically its Section 5 preclearance provisions, is still needed to protect against such abuses. While Justice Scalia is either confused or misguided in his characterization of the right to vote as a racial entitlement, Congress upheld this basic right in 2006 by overwhelmingly reauthorizing the Voting Rights Act for another 25 years. House Speaker, John Boehner said at the time, "The Voting Rights Act has been an effective tool in protecting a right that is fundamental to our democracy and renewing this landmark law will ensure that each and every citizen can continue to exercise their right to vote without the threat of intimidation or harassment." We intend to hold Speaker Boehner to those words. If the Supreme Court declares any part of the Voting Rights Act unconstitutional, Congress will have a final chance to keep Section 5 alive.
Marc H. Morial, former mayor of New Orleans, is president and CEO of the National Urban League.
Keep Section 5 of the Voting Rights Act
In "Columnists"
MORIAL: King Family and Justice Organizations Urge: No MLK Day Celebration Without Voting Rights Legislation
In "Marc Morial"
To Be Equal: Civil Rights History Made and Unmade in Washington
Tagged: Black commentary, black press, National Urban League, Op-Ed, supreme court, urban league, voting rights act
Marc H. Morial
As President of the National Urban League since 2003 he has been the primary catalyst for an era of change -- a transformation for the 100 year old civil rights organization. His energetic and skilled... More by Marc H. Morial


text:
The Game of Love () is a 1924 German silent film directed by Guido Parish and starring Marcella Albani, Alfred Abel, and Carl de Vogt.

The film's sets were designed by the art director August Rinaldi.

Cast

References

Bibliography

External links

1924 films
Films of the Weimar Republic
German silent feature films
Films directed by Guido Parish
German black-and-white films
1920s German films

redpajama_set_name: RedPajamaWikipedia


text:
// A '.tsx' file enables JSX support in the TypeScript compiler,
// for more information see the following page on the TypeScript wiki:
// https://github.com/Microsoft/TypeScript/wiki/JSX

import * as React from 'react';
import * as Ubb from './Core';
import {
    BrowserRouter as Router,
    Route,
    Link
} from 'react-router-dom';

export class PmTagHandler extends Ubb.RecursiveTagHandler {
    get supportedTagNames(): string { return 'pm' };

    execCore(innerContent: React.ReactNode, tagData: Ubb.UbbTagData, context: Ubb.UbbCodeContext): React.ReactNode {

        const pmUserName = tagData.value(0);    //要私信的用户昵称
        const url = `/message/message?name=${pmUserName}`;
        return <Link to={url}>{innerContent}</Link>
    }
}

redpajama_set_name: RedPajamaGithub


text:
Q: Java web service error I got this error 'java.lang.ClassNotFoundException: com.hp.hpl.jena.rdf.model.Model' when I run my java web service which implement a jena framework function such as OWL reading function. But it worked as a standalone java application and read the owl file correctly. But when I host it as web service and execute the read method in a .net client or eclipse web service client, it gives this error.
any help would really appreciated.
thx.

A: Well, that suggests you've not got all the jar files you need at execution time. In particular, find the jar file that contains that class, and make sure it's in your WEB-INF/lib directory appropriately (or however else you specify dependencies in your web service contain).


Anti-bacterial two part epoxy coating designed for kennels, catteries and animal shelters.
Antel's Kennel & Cattery Paint is a heavy duty, two-part epoxy resin for coating high traffic areas with animals. Our unique paint is safe for animals, antibacterial, easy to clean and extremely tough wearing and long-lasting.
Kennel & Cattery Paint has been further enhanced by the addition of a highly effective anti-microbial agent that has a 99.999% kill rate against E. Coli and MRSA.
The additive contained will not leach and has no environmental impact.
The antibacterial additive's effectiveness is unaffected by: Scratching or abrasion, UV exposure, salt spray, temperature cycling, cleaning chemicals including chlorine bleach, disinfectants, quaternary ammonium compounds and is effective for the life time of the coating. The active ingredient is effective against most bacteria including Listeria Monocytogenes, Salmonella Enteritidis, Pseudomonas Aeruginosa and Aspergillus Niger and specifically tested against MRSA and E. Coli.
High build—200+ µm per coat.
Great resistance to heavy traffic.
Impermeable to water and other liquids.
Provides a closed hygienic surface.
Do not apply in temperatures below 10 °C/50 °F and ensure there is at least a 4 hour weather window. We do not recommend application late in the day, due to dropping temperatures and increased humidity.
Although Kennel & Cattery Paint will overcoat most other finishes and paints, the best results are achieved when surfaces are clean and free of other finishes/coatings. If applying over an existing coating or to a non-porous surface, mechanically sand the area to create a key.
All surfaces should be dry. Particular attention should be made to degreasing surfaces before application. All voids and surface imperfections must be carefully filled.
Clean the surface you will be applying the Kennel & Cattery Paint to. If there are any leaks, these should be repaired with Antel Waterstop or Antel Epoxy Putty before application. If unsure, please contact us for technical advice.
The pot life is approximately 45 minutes. This is based on a temperature of 20 °C/68 °F. If you are applying the coating in higher temperatures, the pot life may be reduced. The material will become unworkable once outside of this pot life.
Once mixed, it is only possible to apply a single coat. Do not attempt to return to the mix to apply a second coat.
For simplicity we would recommend using separate tins of Kennel & Cattery Paint for each coat, however if you would like to use one set of tins (A & B Pack) for both coats, you will need to accurately divide the A and B packs proportionately using digital scales.
1. Mix the A Pack thoroughly.
2. Mix the B Pack thoroughly.
3. Pour the contents of the B Pack into the larger A Pack.
4. Mix again thoroughly (ideally with a mixer paddle) for a minimum of three minutes, so that the two components are completely mixed.
5. Pour into at least one roller tray to maintain pot life.
1. Apply the first coat by short pile roller or brush.
2. Wait 24 hours before applying the second coat. Reduced time between coats maybe possible, but it's very important to seek technical advice from Antel before attempting this.
3. Within a maximum period of 48 hours, apply the second coat.
Brushes and roller equipment should be cleaned with Antel's Standard Epoxy Cleaning Solvent.
Store in a dry, cool, and frost free place in their original containers.
Over a third of all major injuries reported each year are caused as a result of a slip or trip. Health and Safety.
Executive statistics suggest that there is one serious slip accident every 3 minutes.
Using the TRL Pendulum Slip/ Skid Resistance Tester in accordance with BS 7976-2, Slip/Skid Resistance Testing can be carried out to assess the floor surface slipperiness in workplace and public areas.
Facilities managers, local authorities and building owners are under obligation to ensure the floor or surface of the traffic route is not slippery so there is no risk of injury to any person. This is enforced by the "Workplace (Health, Safety and Welfare) Regulations 1992".
Research has shown that measurement of the RZ parameter allows slipperiness to be predicted for a range of common materials. A roughness reading can be used as supporting evidence with the results of a pendulum test.
The pendulum test value (PTV) should be not less than 35 in situations where ease of cleaning is more critical than slip resistance and/or where all who use or are likely to use the floor will wear specially provided slip resistant boots or shoes. Pendulum test values in the wet of not less than 33 may be deemed acceptable.
Further technical information can be made available on request. Please contact the Antel Technical Department.


text:
Home » Celebrities » Chrissy Teigen's Go-To Holiday Gifts, From Cash to Tom Ford "Man Bags"
Chrissy Teigen's Go-To Holiday Gifts, From Cash to Tom Ford "Man Bags"
When it comes to the holidays, Chrissy Teigen is practically Mrs. Claus.
Seriously, you'd be hard-pressed to find someone who loves the giving season more than the reigning queen of social media. And this year, she and husband John Legend have stepped up their celebration game in some major ways. Just last week, the duo hosted their own festive special, A Legendary Christmas with John and Chrissy, which aired the same night that Legend took to the stage to perform on NBC's Christmas in Rockefeller Center. There's no doubt about it: they're the It couple of the holidays.
Teigen continued to spread some cheer of her own in New York City, where we sat down with the star to chat about her tried-and-true gift-giving strategies — starting with those lucky enough to call her a friend. "Everybody in my life has such different personality types and interests, so my go-to has always been gift cards and cash," she told InStyle at the Chase Ultimate Rewards #OneLessThingHoliday Pop-Up Shop, which celebrated the ways that Chase cardholders can minimize holiday shopping stress by using rewards points and scoring major discounts on gift cards. "It definitely depends on the person, but I truly enjoy being able to get people stuff that they want in the end. Nobody's ever been mad at a gift card."
NBC/Getty Images
Given the hectic Hollywood schedules of those in her inner circle, Teigen often finds creative ways to treat her pals. "For a lot of my friends and I, we work so much all year round that there's no true summer and no true weekends," she said. "So when it comes to the holidays, they tend to take off and go on vacation or something. I love to find out what hotel they booked and maybe pay for a dinner they're having there or send a bottle of wine or something personal."
That personal touch also extends to Teigen's gifts for her husband — although with Legend's birthday landing on Dec. 28, "the poor guy gets rolled into that whole birthday-Christmas thing," Teigen said. Making things even more challenging, Legend is "really tough to shop for," she explained. "He doesn't have any true interests. It's not like he's a sports guy; he's one of those guys who he likes every team; they all deserve to win! He's tough."
RELATED: We Asked John Legend Whether Luna Likes His or Chrissy Teigen's Cooking Better
By now, Teigen has figured out what does rank with Legend. And much like the star himself, it's practical yet stylish. "Every year I get him what we call a computer bag, but that sounds so nerdy," she said. "It's like a man-bag, computer-bag thing, so it's usually some kind of leather tote that he can fit his laptop in with all the cords, the watch box, and his passport. All that travel stuff. That's the only constant in our life, that we're always going to be traveling. So I love getting him that bag. Aside from that, a robe. We're very home-y people. It's either cooking stuff, cozy stuff, or the man-bag."
Designer-wise, Teigen has found a clear winner in the man-bag category: Tom Ford's Buckley briefcase. "It's the one with the chunky zipper, and every year they do it in a different color or a different fabric," she said. "The suede ones are so so beautiful and they last forever and get better with age. The dustier and more scratched they get, the cooler they get. I always appreciate that in a gift. And their backpacks are amazing, too. That's like usually the only thing he gets for his birthday, and then Christmas is a lot of little things. He just loves a crew neck tee. He's simple dude."
The couple's young daughter, Luna, is also easy to please. "She's two and a half, so she's gonna love the bow that something came with," said Teigen, laughing. "She's gonna love the wrapping paper and the box that it came in, too." Packaging aside, Teigen and Legend are careful to avoid spoiling Luna and her brother, six-month-old Miles. "You don't want to give them too much, because honestly, the kids get so much year round," said Teigen. "They get sent random things from different brands all the time, so you want them to really appreciate the things they get. We're not very materialistic people; We love doing art projects with her and giving personalized things to each other — like little hand prints from the kids. That way, we know we [each] spent time with that kid, doing that for each other. That, for us, is way cooler."
A post shared by chrissy teigen (@chrissyteigen) on Nov 4, 2018 at 11:42am PST
That's not to say little Luna will be missing out on presents this year — although she's not quite making a wish list for Santa just yet, either. "Luckily, she's not into commercials or anything yet, so she won't see a commercial and be like, 'I want that,'" said Teigen. "She doesn't really grasp that it's for sale in stores." Luna's current obsession? "She's still so into Sesame Street," said Teigen. "I just filmed an episode and we took her to Sesame Street and they gifted her with this huge gift bag. She's potty-trained now so she has her big-girl underwear, and it's just so adorable. She's into anything Elmo, anything Abby Caddaby, anything fairy princess. I bought myself a giant pair of wings so I could fly around the house with her. She's just like such a girly girl, which is so funny to me, because I thought she would be such a tomboy. But she's a girly girl. It's fun to shop for them at that age. Right now the holidays are all about the kids, so it's really cute."
This year is particularly special for the family, given that it's Miles' first holiday season. The most exciting thing for Teigen? "Oh my gosh, I think dressing him up!" she exclaimed. "Before I had a little boy, I was like, 'Oh nothing could be cuter than little girl clothes.' Girl clothes, they have the tutus and the little leggings and the knee socks and tiny sandals. But boy clothes are so cute. He just looks so great in anything, whether it's a little cap or…I don't know, he wore this fur vest the other day, and I was like, 'If I wore this, I would look insane.' But he's just so adorable in everything."
BEARS!!! ???????
A post shared by chrissy teigen (@chrissyteigen) on Nov 10, 2018 at 4:56pm PST
Other than festive kids' fashion, Teigen is looking forward to capturing Miles' precious moments. "I'm excited to take little pictures with him by the tree," she said. "He's still so young that he just likes to look up at the lights. If we're going for a drive and he's in his car seat, he's still looking around the neighborhood at how beautiful everything is. He just gets these big, wide eyes. But for now, he's just so young. This is the first time Luna is really able to embrace the holiday season, so I'm excited to be able to take her out and get things for Daddy!"
Ever an animal-lover, Teigen can't forget her fur babies: French bulldogs Pippa and Penny, and bulldog Paul. "They have stockings, and usually bones go in them," said Teigen. "Right now, they're also very into water bottles. Just garbage. They crunch on water bottles all day, that's their ultimate. But they're the easiest to shop for. Just one stop at Petco and it's done."
Paul is still getting used to being in front of the camera, but he is a huge fan of my new Christmas album #ALegendaryChristmas – out now! Link in bio.
A post shared by John Legend (@johnlegend) on Oct 26, 2018 at 2:21pm PDT
The best part about gifting the family's pups, according to Teigen? "They don't expect anything, and they get something!"
Tagscelebri Holidays&Occasions
Kim Kardashian Swarmed By Fans During Opening Of KKW Beauty Pop-Up Shop In Mall
Flynn Has Given Mueller 'Substantial Assitance' During Russia Probe


text:
Five takeaways from the U.S. census data drop
The U.S. saw a decline in the number of white people for the first time in its history
Diverse communities are surging
How people self-identify is affecting the census data
California remains dominant
How will the data affect Americans, particularly Californians?
The outlines of America's increasingly diverse population and the data that will be the foundation of the fight for political power in the nation's capital were provided by a report the U.S. Census Bureau released Thursday.
Here are five takeaways on what the changing demographics mean for the nation.
The country has been growing more diverse for decades — since ethnic immigration quotas were dropped in the 1960s — but the 2020 population count is the first since the census began in which the number of white people shrank. White people still make up nearly 58% of the population, the largest racial or ethnic group in the country, but their share dropped 8.6% since 2010.
Nearly 191.7 million people identify as non-Hispanic white, while 235.4 million report being only white or white as well as another racial group.
The U.S. experienced its most sluggish growth since the Great Depression — 7.4% over the last decade. Much of the growth was fueled by people who are Latino, Asian and biracial or multiracial.
The Asian population grew by 36%, and the number of Latinos grew 23%. The nation is increasingly looking like California. Latinos are the second largest group after white people, making up nearly 19% of the population. Among the most intriguing findings was the 276% growth among people who identify as belonging to two or more races, up to nearly 34 million people in 2020.
The census reported that Latinos are the largest ethnic group in California, accounting for nearly 4 in 10 residents. California demographers reported several years ago that Latinos overtook whites in the state.
Much of the increase in all racial groups was driven by the growing number of people who report belonging to multiple races. For example, the number of Latinos who say they belong to more than one racial group increased by nearly 600%, while the number of Latinos who solely identified as being white decreased by nearly 50%.
More people are multiracial, but the increase could also be attributed in part to changing social norms about how people report their backgrounds.
Get our California Politics newsletter
Stay up to date on the election to recall Gov. Gavin Newsom
Although California lost a congressional seat for the first time in its history because it did not grow as fast as other states, the data released Thursday showcased the state's dominance. It grew by nearly 2.3 million residents over the last decade.
California, with nearly 40 million residents, and Los Angeles County, with more than 10 million residents, remain the largest state and county in the nation, respectively.
Three of the nation's 10 most populous cities are in California: Los Angeles, San Diego and San Jose. All 10 gained population, but Los Angeles' 2.8% growth was among the most sluggish. Irvine, which gained more than 95,000 residents, was one of the nation's 10 fastest-growing cities.
The data have practical impacts on all residents' lives, including who represents them in multiple levels of government and the amount of federal funding allocated to their communities.
The census report will kick into high gear the decennial redrawing of congressional and legislative lines that will shape the politics in the nation's capital and statehouses for the next decade.
States have varying procedures for redrawing the lines. California is among several that have an independent, bipartisan commission draw its maps. For the first time in the state's history, it is losing a congressional seat. Because Los Angeles County grew less than other parts of the state, an L.A. County district is likely to be excised.
The panel may decide to reconfigure the 25th Congressional District around Santa Clarita, a swing seat represented by Republican Rep. Mike Garcia. Boundaries in Orange County could also change, such as Democratic Rep. Katie Porter's district, which needs to shrink in order to bring its population in line with other congressional districts.
The numbers will also be used to draw new lines for the state Senate and Assembly, county boards of supervisors, city councils, school district boards of education, water districts and other bodies that affect Californians' day-to-day lives.
Times staff writer Melanie Mason contributed to this report.
Previous Biden, Harris promise vigorous effort to fight Newsom recall
Next Recall gives Reed Hastings chance to mend fences with Newsom


text:
#include "shared.hpp"

#define WIN32_LEAN_AND_MEAN
#include <windows.h>
#include <d3d11_1.h>
#include <d3dcompiler.h>
#include <string.h>
#include <comdef.h>		// TODO: remove used for error checking

static void logHResultData(HRESULT a_hr)
{
	_com_error error(a_hr);
	g_log.debug("HRESULT Message: %s", error.ErrorMessage());
	g_log.debug("HRESULT Description: %s", error.Description());
}

// memory leak detection on windows debug builds
#if defined(_WIN32) && defined(AGN_DEBUG) && defined(AGN_ENABLE_MEMORYLEAK_DETECTION)
#include "mmgr.h"
#endif

#include "device_dx11.hpp"
#include "mesh_dx11.hpp"
#include "texture_dx11.hpp"
#include "shader_dx11.hpp"
#include "shader_pipeline_dx11.hpp"
#include "window_dx11.hpp"
#include "config_manager.hpp"
#include "render_api_dx11.hpp"

#define STB_IMAGE_RESIZE_IMPLEMENTATION
#include "stb/stb_image_resize.h"

using namespace glm;

AGN::DeviceDX11::DeviceDX11()
	: m_window(nullptr)
	, m_d3d11Device(nullptr)
	, m_d3d11DeviceContext(nullptr)
	, m_d3d11SwapChain(nullptr)
	, m_d3dDebug(nullptr)
	, m_debugUDA(nullptr)
	, m_MSAALevel(1)
	, m_MSAAQuality(0)
{

}

AGN::DeviceDX11::~DeviceDX11()
{
	safeRelease(m_d3d11Device);
	safeRelease(m_d3d11DeviceContext);
	safeRelease(m_d3d11SwapChain);

	logLiveObjects();

	safeRelease(m_d3dDebug);
	safeRelease(m_debugUDA);
}

bool AGN::DeviceDX11::init(class WindowDX11* a_window)
{
	m_window = a_window;

	assert(m_window);
	assert(m_window->getWindowHandle());

	// initialize device without AA enabled (so we can query it)
	cleanAndInitializeDevice(1, 0);

	glm::ivec2 maxSampleQuality = getMaxMSAASampleQuality();

	// initialize with AA enabled
	if (maxSampleQuality.x != 1)
	{
		cleanAndInitializeDevice(maxSampleQuality.x, maxSampleQuality.y);
		g_log.debug("MSAA enabled with sample size of %i and a quality of %i", maxSampleQuality.x, maxSampleQuality.y);
	}
	else
	{
		g_log.warning("MSAA not available on this device...");
	}

	// get debug interface
#ifdef AGN_DEBUG

	m_d3dDebug = nullptr;
	if (SUCCEEDED(m_d3d11Device->QueryInterface(__uuidof(ID3D11Debug), (void**)&m_d3dDebug)))
	{
		ID3D11InfoQueue *d3dInfoQueue = nullptr;
		if (SUCCEEDED(m_d3dDebug->QueryInterface(__uuidof(ID3D11InfoQueue), (void**)&d3dInfoQueue)))
		{
			d3dInfoQueue->SetBreakOnSeverity(D3D11_MESSAGE_SEVERITY_CORRUPTION, true);
			d3dInfoQueue->SetBreakOnSeverity(D3D11_MESSAGE_SEVERITY_ERROR, true);

			D3D11_MESSAGE_ID hide[] =
			{
				D3D11_MESSAGE_ID_SETPRIVATEDATA_CHANGINGPARAMS,
				// Add more message IDs here as needed
			};

			D3D11_INFO_QUEUE_FILTER filter;
			memset(&filter, 0, sizeof(filter));
			filter.DenyList.NumIDs = _countof(hide);
			filter.DenyList.pIDList = hide;
			d3dInfoQueue->AddStorageFilterEntries(&filter);
			safeRelease(d3dInfoQueue);
		}
	}

	if (FAILED(m_d3d11DeviceContext->QueryInterface(IID_PPV_ARGS(&m_debugUDA))))
	{
		g_log.error("Failure getting debugUDA");
		assert(false);
		return false;
	}
#endif

	return true;
}

void AGN::DeviceDX11::cleanAndInitializeDevice(int a_MSAALevel, int a_MSAAQuality)
{
	safeRelease(m_d3d11Device);
	safeRelease(m_d3d11DeviceContext);
	safeRelease(m_d3d11SwapChain);

	m_MSAALevel = a_MSAALevel;
	m_MSAAQuality = a_MSAAQuality;

	DXGI_SWAP_CHAIN_DESC swapChainDesc;
	memset(&swapChainDesc, 0, sizeof(DXGI_SWAP_CHAIN_DESC));

	bool vsync = g_configManager.getConfigPropertyAsBool("vsync");

	swapChainDesc.BufferCount = 2;												// the number of buffers in the swap chain
	swapChainDesc.BufferDesc.Width = static_cast<unsigned int>(m_window->getDimensions().x);
	swapChainDesc.BufferDesc.Height = static_cast<unsigned int>(m_window->getDimensions().y);
	swapChainDesc.BufferDesc.Format = DXGI_FORMAT_R8G8B8A8_UNORM;				// pixel format of the display in this case: a 4-component 32-bit unsigned normalized integer format that supports 8 bits per channel including alpha
	swapChainDesc.BufferDesc.RefreshRate = queryRefreshRate(vsync);				// refresh rate in hertz, 0/1 to specify an unbounded refresh rate.
	swapChainDesc.BufferUsage = DXGI_USAGE_RENDER_TARGET_OUTPUT;				// describes the surface usage and CPU access options for the back buffer in this case: Use the surface or resource as an output render target.
	swapChainDesc.OutputWindow = m_window->getWindowHandle();
	swapChainDesc.SampleDesc.Count = a_MSAALevel;
	swapChainDesc.SampleDesc.Quality = a_MSAAQuality;
	swapChainDesc.SwapEffect = DXGI_SWAP_EFFECT_DISCARD;						// describes options for handling the contents of the presentation buffer after presenting a surface
	swapChainDesc.Windowed = TRUE;												// output is in windowed mode.

	UINT createDeviceFlags = 0;
#if AGN_DEBUG
	createDeviceFlags = D3D11_CREATE_DEVICE_DEBUG;
#endif

	// These are the feature levels that we will accept.
	//  The device will be created with the highest feature level (first in array) that is supported by the end-user's hardware.
	D3D_FEATURE_LEVEL featureLevels[] =
	{
		D3D_FEATURE_LEVEL_11_1,
		D3D_FEATURE_LEVEL_11_0,
		D3D_FEATURE_LEVEL_10_1,
		D3D_FEATURE_LEVEL_10_0,
		D3D_FEATURE_LEVEL_9_3,
		D3D_FEATURE_LEVEL_9_2,
		D3D_FEATURE_LEVEL_9_1
	};

	// This will be the feature level that
	// is used to create our device and swap chain.
	D3D_FEATURE_LEVEL featureLevel;

	HRESULT hr = D3D11CreateDeviceAndSwapChain(
		nullptr,					// video adapter to use when creating a device // nullptr == default
		D3D_DRIVER_TYPE_HARDWARE,	// The D3D driver which implements the device.
		nullptr,					// handle to a DLL that implements a software rasterizer
		createDeviceFlags,
		featureLevels,				// determine the order of feature levels to attempt to create.
		_countof(featureLevels),
		D3D11_SDK_VERSION,			// SDK version
		&swapChainDesc,
		&m_d3d11SwapChain,			// swap chain description which was created earlier.
		&m_d3d11Device,				// ID3D11Device object that represents the device created.
		&featureLevel,				// the first element in an array of feature levels supported by the device.
		&m_d3d11DeviceContext);

	// if failed, initialize DX_11_0 instead of DX_11_1
	if (FAILED(hr))
	{
		logHResultData(hr);

		g_log.debug("E_INVALIDARG when creating Device and Swap chain, Lets try that again with a lower API");

		hr = D3D11CreateDeviceAndSwapChain(nullptr, D3D_DRIVER_TYPE_HARDWARE,
			nullptr, createDeviceFlags, &featureLevels[1], _countof(featureLevels) - 1,
			D3D11_SDK_VERSION, &swapChainDesc, &m_d3d11SwapChain, &m_d3d11Device, &featureLevel,
			&m_d3d11DeviceContext);

		// failed again?
		if (FAILED(hr))
		{
			g_log.error("Failed to create D3D11 Device And Swap Chain");
			logHResultData(hr);

			assert(false);
		}
		else
		{
			g_log.info("Created DX11_0 context");
		}
	}
	else
	{
		g_log.info("Created DX11_1 context");
	}

}

glm::ivec2 AGN::DeviceDX11::getMaxMSAASampleQuality()
{
	std::vector<ivec2> levels;
	levels.push_back(ivec2(1, 0)); // NO MSAA

	for (UINT sampleCount = 1; sampleCount <= D3D11_MAX_MULTISAMPLE_SAMPLE_COUNT; sampleCount++)
	{
		UINT maxQualityLevel;
		HRESULT hr = m_d3d11Device->CheckMultisampleQualityLevels(DXGI_FORMAT_R8G8B8A8_UNORM, sampleCount, &maxQualityLevel);

		if (hr != S_OK)
		{
			g_log.debug("CheckMultisampleQualityLevels failure");
			assert(false);
		}

		if (maxQualityLevel > 0)
		{
			g_log.info("MSAA %u supported with %u quality levels", sampleCount, maxQualityLevel);
			levels.push_back(ivec2(sampleCount, maxQualityLevel-1));
		}
		//else
		//{
			//g_log.debug("MSAA %u NOT supported because it has %u quality levels", sampleCount, maxQualityLevel);
		//}

	}

	return levels[levels.size()-1];
}

void AGN::DeviceDX11::onWindowUpdated(glm::ivec2 a_dimensions)
{
	// TODO: investigate if we have to rebuild the whole device including everything!
}

// reference: http://www.rastertek.com/dx11tut03.html
DXGI_RATIONAL AGN::DeviceDX11::queryRefreshRate(bool a_vsync)
{
	DXGI_RATIONAL refreshRate = { 0, 1 };

	if (a_vsync)
	{
		IDXGIFactory* factory;
		IDXGIAdapter* adapter;
		IDXGIOutput* adapterOutput;
		DXGI_MODE_DESC* displayModeList;

		// Create a DirectX graphics interface factory.
		HRESULT hr = CreateDXGIFactory(__uuidof(IDXGIFactory), (void**)&factory);
		if (FAILED(hr))
		{
			m_window->showMessageBox("Query Refresh Rate", "Could not create DXGIFactory instance");
			return refreshRate;
		}

		hr = factory->EnumAdapters(0, &adapter);
		if (FAILED(hr))
		{
			m_window->showMessageBox("Query Refresh Rate", "Failed to enumerate adapters.");
			return refreshRate;
		}

		hr = adapter->EnumOutputs(0, &adapterOutput);
		if (FAILED(hr))
		{
			m_window->showMessageBox("Query Refresh Rate", "Failed to enumerate adapter outputs");
			return refreshRate;
		}

		UINT numDisplayModes;
		hr = adapterOutput->GetDisplayModeList(DXGI_FORMAT_B8G8R8A8_UNORM, DXGI_ENUM_MODES_INTERLACED, &numDisplayModes, nullptr);
		if (FAILED(hr))
		{
			m_window->showMessageBox("Query Refresh Rate", "Failed to query display mode list.");
			return refreshRate;
		}

		displayModeList = new DXGI_MODE_DESC[numDisplayModes];
		assert(displayModeList);

		hr = adapterOutput->GetDisplayModeList(DXGI_FORMAT_B8G8R8A8_UNORM, DXGI_ENUM_MODES_INTERLACED, &numDisplayModes, displayModeList);
		if (FAILED(hr))
		{
			m_window->showMessageBox("Query Refresh Rate", "Failed to query display mode list");
			return refreshRate;
		}

		// Now store the refresh rate of the monitor that matches the width and height of the requested screen.
		for (UINT i = 0; i < numDisplayModes; ++i)
		{
			if (displayModeList[i].Width == m_window->getDimensions().x && displayModeList[i].Height == m_window->getDimensions().y)
			{
				refreshRate = displayModeList[i].RefreshRate;
			}
		}

		delete[] displayModeList;

		safeRelease(adapterOutput);
		safeRelease(adapter);
		safeRelease(factory);
	}

	return refreshRate;
}

AGN::IMesh* AGN::DeviceDX11::createMesh(const uint16_t a_aId, AGN::MeshData* a_meshData)
{
	ID3D11Buffer* d3d11VertexBuffer = nullptr;
	ID3D11Buffer* d3d11IndexBuffer = nullptr;

	const unsigned int numVertices = static_cast<unsigned int>(a_meshData->positions.size());

	// Create vertex buff
	D3D11_BUFFER_DESC vertexPosBufferDesc;
	memset(&vertexPosBufferDesc, 0, sizeof(D3D11_BUFFER_DESC));

	vertexPosBufferDesc.BindFlags = D3D11_BIND_VERTEX_BUFFER; // how the buffer will be bound to the pipeline
	vertexPosBufferDesc.ByteWidth = static_cast<uint32_t>(sizeof(MeshDX11::VertexShaderData) * numVertices);
	vertexPosBufferDesc.CPUAccessFlags = 0;
	vertexPosBufferDesc.Usage = D3D11_USAGE_DEFAULT; // Identify how the buffer is expected to be read from and written to. Frequency of update is a key factor

	D3D11_SUBRESOURCE_DATA resourceDataVertexBuffer;
	memset(&resourceDataVertexBuffer, 0, sizeof(D3D11_SUBRESOURCE_DATA));

	MeshDX11::VertexShaderData* vsDataToUpload = new MeshDX11::VertexShaderData[numVertices];

	for (uint32_t i = 0; i < numVertices; i++)
	{
		vsDataToUpload[i].position = a_meshData->positions[i];
		vsDataToUpload[i].normal = a_meshData->normals[i];
		vsDataToUpload[i].textureCoords = a_meshData->textureCoords[i];
		vsDataToUpload[i].tangent = a_meshData->tangents[i];
		vsDataToUpload[i].biTangent = a_meshData->bitangents[i];
	}

	resourceDataVertexBuffer.pSysMem = vsDataToUpload;

	HRESULT hr = m_d3d11Device->CreateBuffer(&vertexPosBufferDesc, &resourceDataVertexBuffer, &d3d11VertexBuffer);

	delete[] vsDataToUpload;

	if (FAILED(hr))
	{
		g_log.error("failure CreateBuffer vertexBufferDesc");
		return nullptr;
	}

	// Create and initialize the index buffer.
	D3D11_BUFFER_DESC indexBufferDesc;
	memset(&indexBufferDesc, 0, sizeof(D3D11_BUFFER_DESC));

	D3D11_SUBRESOURCE_DATA resourceDataIndexBuffer;
	memset(&resourceDataIndexBuffer, 0, sizeof(D3D11_SUBRESOURCE_DATA));

	indexBufferDesc.ByteWidth = static_cast<uint32_t>(sizeof(uint32_t) * a_meshData->indicies.size());
	indexBufferDesc.BindFlags = D3D11_BIND_INDEX_BUFFER;
	indexBufferDesc.CPUAccessFlags = 0;
	indexBufferDesc.Usage = D3D11_USAGE_DEFAULT;
	resourceDataIndexBuffer.pSysMem = a_meshData->indicies.data();

	hr = m_d3d11Device->CreateBuffer(&indexBufferDesc, &resourceDataIndexBuffer, &d3d11IndexBuffer);
	if (FAILED(hr))
	{
		g_log.error("failure CreateBuffer indexBufferDesc");
		return nullptr;
	}

	// apply debug names
	D3D11_SET_DEBUG_NAME(d3d11VertexBuffer, "Mesh Vertex buffer (" + a_meshData->relativePath + ")");
	D3D11_SET_DEBUG_NAME(d3d11IndexBuffer, "Mesh Index buffer (" + a_meshData->relativePath + ")");

	// create agnostik texture holding the info.
	MeshDX11* mesh = new MeshDX11(a_aId, a_meshData, d3d11VertexBuffer, d3d11IndexBuffer);

	return dynamic_cast<IMesh*>(mesh);
}

AGN::ITexture* AGN::DeviceDX11::createTexture(const uint16_t a_aId, AGN::TextureData* a_textureData)
{
	ID3D11Texture2D* textureHandle = nullptr;
	ID3D11ShaderResourceView* shaderResourceView = nullptr;
	const char* relativePath = a_textureData->relativePath.c_str();

	D3D11_TEXTURE2D_DESC textureDesc;
	memset(&textureDesc, 0, sizeof(D3D11_TEXTURE2D_DESC));

	textureDesc.Width = a_textureData->width;
	textureDesc.Height = a_textureData->height;
	//textureDesc.MipLevels = 1;
	textureDesc.MipLevels = 0;
	textureDesc.ArraySize = 1;
	textureDesc.Format = DXGI_FORMAT_R8G8B8A8_UNORM;			// DXGI_FORMAT_R8G8B8A8_UNORM DXGI_FORMAT_R8G8B8A8_TYPELESS DXGI_FORMAT_R8G8B8A8_UINT
	textureDesc.SampleDesc.Count = 1;
	textureDesc.SampleDesc.Quality = 0;
	textureDesc.Usage = D3D11_USAGE_DEFAULT; //  D3D11_USAGE_DYNAMIC
	textureDesc.BindFlags = D3D11_BIND_SHADER_RESOURCE | D3D11_BIND_RENDER_TARGET;
	textureDesc.CPUAccessFlags = 0; // D3D11_CPU_ACCESS_WRITE;
	textureDesc.MiscFlags = D3D11_RESOURCE_MISC_GENERATE_MIPS;

	std::vector<D3D11_SUBRESOURCE_DATA> resourceDataList;
	// add data for the first mipmap (level 0)
	D3D11_SUBRESOURCE_DATA resourceData;
	memset(&resourceData, 0, sizeof(D3D11_SUBRESOURCE_DATA));
	resourceData.pSysMem = a_textureData->buffer;
	resourceData.SysMemPitch = a_textureData->width * 4;									// pitch in bytes
	resourceData.SysMemSlicePitch = a_textureData->height * resourceData.SysMemPitch;	// pitch * slice (total memsize)
	resourceDataList.push_back(resourceData);

	// generate mipmaps with stb_image
	int currentWidth = a_textureData->width;
	int currentHeight = a_textureData->height;
	int prevWidth = 0;
	int preHeight = 0;
	do
	{
		D3D11_SUBRESOURCE_DATA resourceData;
		memset(&resourceData, 0, sizeof(D3D11_SUBRESOURCE_DATA));

		// resize to new level
		prevWidth = currentWidth;
		preHeight = currentHeight;
		currentWidth = max(currentWidth / 2, 1);
		currentHeight = max(currentHeight / 2, 1);

		// allocate memory for new mipmap
		resourceData.pSysMem = new uint8_t[4 * currentWidth * currentHeight];
		resourceData.SysMemPitch = currentWidth * 4;									// pitch in bytes
		resourceData.SysMemSlicePitch = currentHeight * resourceData.SysMemPitch;	// pitch * slice (total memsize)

		// resize
		unsigned char* prevBuffer = (unsigned char*)resourceDataList[resourceDataList.size() - 1].pSysMem;
		int success = stbir_resize_uint8(prevBuffer, prevWidth, preHeight, 0, (unsigned char*)resourceData.pSysMem, currentWidth, currentHeight, 0, 4);

		if (!success)
		{
			g_log.error("Failed to resize mipmap");
			assert(success);
		}

		resourceDataList.push_back(resourceData);

	} while ((currentWidth > 1) || (currentHeight > 1));

	HRESULT hr = m_d3d11Device->CreateTexture2D(&textureDesc, &resourceDataList[0], &textureHandle);

	if (FAILED(hr))
	{
		g_log.error("Failed to create Texture: %s", relativePath);
		assert(false);
		return nullptr;
	}

	hr = textureHandle->SetPrivateData(WKPDID_D3DDebugObjectName, sizeof(relativePath) - 1, relativePath);

	if (FAILED(hr))
	{
		g_log.error("Failed to set private data: %s", relativePath);
		return nullptr;
	}

	// create shader resource view
	D3D11_SHADER_RESOURCE_VIEW_DESC SRVDesc;
	memset(&SRVDesc, 0, sizeof(D3D11_SHADER_RESOURCE_VIEW_DESC));

	SRVDesc.ViewDimension = D3D_SRV_DIMENSION_TEXTURE2D;
	SRVDesc.Format = DXGI_FORMAT_R8G8B8A8_UNORM;
	SRVDesc.Texture2D.MostDetailedMip = 0;
	SRVDesc.Texture2D.MipLevels = -1;

	hr = m_d3d11Device->CreateShaderResourceView(textureHandle, &SRVDesc, &shaderResourceView);

	if (FAILED(hr))
	{
		g_log.error("Failed to create shader resource view: %s", relativePath);
		return nullptr;
	}

	// give debug names
	D3D11_SET_DEBUG_NAME(textureHandle, "Texture handle (" + a_textureData->relativePath + ")");
	D3D11_SET_DEBUG_NAME(shaderResourceView, "Shader Resource View (" + a_textureData->relativePath + ")");

	// clean mipmap data!
	for (uint32_t i = 1; i < resourceDataList.size(); i++)
	{
		delete[] resourceDataList[i].pSysMem;
	}

	// create agnostik texture holding the data
	TextureDX11* texture = new TextureDX11(a_aId, a_textureData, textureHandle, shaderResourceView);

	return dynamic_cast<ITexture*>(texture);
}

AGN::IShader* AGN::DeviceDX11::createShader(const uint16_t a_aId, const char* a_shaderSource, AGN::EShaderType a_type)
{
	ID3DBlob* shaderBlob = nullptr;
	ID3DBlob* errorBlob = nullptr;

	// use latest profile
	std::string profile = ShaderDX11::getLatestProfile(a_type, m_d3d11Device);

	UINT flags = D3DCOMPILE_ENABLE_STRICTNESS;
#if AGN_DEBUG
	flags |= D3DCOMPILE_DEBUG;
#endif
	HRESULT hr;

	hr = D3DCompile(
		a_shaderSource,							// A pointer to uncompiled shader data; either ASCII HLSL code or a compiled effect.
		strlen(a_shaderSource),					// Length of pSrcData.
		nullptr,								// Optional.You can use this parameter for strings that specify error messages.
		nullptr,								// Optional. An array of NULL-terminated macro definitions (see D3D_SHADER_MACRO).
		D3D_COMPILE_STANDARD_FILE_INCLUDE,		// Optional. A pointer to an ID3DInclude for handling include files
		"Main",									// The name of the shader entry point function where shader execution begins.
		profile.c_str(),						// specifies the shader target or set of shader features to compile against
		flags,									// Shader compile options.
		0,										// Effect compile options.
		&shaderBlob,							// interface that you can use to access the compiled code.
		&errorBlob);							// interface that you can use to access compiler error messages, or NULL if there are no errors.

	if (FAILED(hr))
	{
		if (errorBlob)
		{
			g_log.error("Error during compilation of HLSL Shader...");

			std::string errorMessage = (char*)errorBlob->GetBufferPointer();
			g_log.error(errorMessage.c_str());

			safeRelease(shaderBlob);
			safeRelease(errorBlob);

			assert(false);
		}

		return nullptr;
	}

	ID3D11DeviceChild* d3d11Shader = nullptr;
	ID3D11PixelShader* pixelShader = nullptr;
	ID3D11VertexShader* vertexShader = nullptr;

	switch (a_type)
	{
	case EShaderType::PixelShader:
		hr = m_d3d11Device->CreatePixelShader(shaderBlob->GetBufferPointer(), shaderBlob->GetBufferSize(), nullptr, &pixelShader);
		d3d11Shader = dynamic_cast<ID3D11DeviceChild*>(pixelShader);
		D3D11_SET_DEBUG_NAME(d3d11Shader, "Pixel Shader a_ID(" + std::to_string(a_aId) + ")");
		break;

	case EShaderType::VertexShader:
		hr = m_d3d11Device->CreateVertexShader(shaderBlob->GetBufferPointer(), shaderBlob->GetBufferSize(), nullptr, &vertexShader);
		d3d11Shader = dynamic_cast<ID3D11DeviceChild*>(vertexShader);
		D3D11_SET_DEBUG_NAME(d3d11Shader, "Vertex Shader a_ID(" + std::to_string(a_aId) + ")");
		break;

	default:
		g_log.error("Unsupported Shader type");
		return nullptr;
	}

	if (FAILED(hr))
	{
		g_log.error("Failed to compile shader");
		return nullptr;
	}

	safeRelease(errorBlob);

	ShaderDX11* shader = new ShaderDX11(*this, a_aId, a_type, d3d11Shader, shaderBlob);
	return dynamic_cast<IShader*>(shader);
}

AGN::IShaderPipeline* AGN::DeviceDX11::createShaderPipeline(const uint16_t a_aId, std::vector<AGN::IShader*> a_shaders)
{
	HRESULT hr;

	ShaderPipelineData* shaderPipelineData = new ShaderPipelineData();
	shaderPipelineData->aId = a_aId;

	for (unsigned int i = 0; i < a_shaders.size(); i++)
	{
		ShaderDX11* shaderDX11 = dynamic_cast<ShaderDX11*>(a_shaders[i]);

		switch (shaderDX11->getType())
		{
		case EShaderType::VertexShader:
			shaderPipelineData->vertexShader = a_shaders[i];
			break;

		case EShaderType::PixelShader:
			shaderPipelineData->pixelShader = a_shaders[i];
			break;

		case EShaderType::HullShader:
			shaderPipelineData->hullShader = a_shaders[i];
			break;

		case EShaderType::DomainShader:
			shaderPipelineData->domainShader = a_shaders[i];
			break;

		case EShaderType::GeometryShader:
			shaderPipelineData->geometryShader = a_shaders[i];
			break;

		case EShaderType::ComputeShader:
			shaderPipelineData->computeShader = a_shaders[i];
			break;
		}
	}

	if (shaderPipelineData->vertexShader == nullptr || shaderPipelineData->pixelShader == nullptr)
	{
		g_log.error("Shader pipeline is missing either a vertex shader or a pixel shader?");
		return nullptr;
	}

	ShaderDX11* vertexShaderDX11 = dynamic_cast<ShaderDX11*>(shaderPipelineData->vertexShader);

	// create input layout for vertex shader
	D3D11_INPUT_ELEMENT_DESC* inputLayoutDesc = nullptr;
	int inputLayoutCount = 0;

	vertexShaderDX11->getInputLayoutDesc(inputLayoutDesc, inputLayoutCount);

	ID3D11InputLayout* vertexInputLayout = nullptr;
	hr = m_d3d11Device->CreateInputLayout(
		inputLayoutDesc,												// input-assembler stage input data types
		inputLayoutCount,
		vertexShaderDX11->getBlob()->GetBufferPointer(),				// pointer to the compiled shader
		vertexShaderDX11->getBlob()->GetBufferSize(),
		&vertexInputLayout);

	delete[] inputLayoutDesc;

	if (FAILED(hr))
	{
		g_log.error("Failure CreateInputLayout");
		return nullptr;
	}

	// create sampler layout for pixel shader
	ShaderDX11* pixelShaderDX11 = dynamic_cast<ShaderDX11*>(shaderPipelineData->pixelShader);
	ID3D11SamplerState* samplerState = nullptr;
	D3D11_SAMPLER_DESC* samplerLayoutDesc = nullptr;
	int samplerLayoutCount = 0;
	pixelShaderDX11->getSamplerLayoutDesc(samplerLayoutDesc, samplerLayoutCount);

	// TODO: support more? if not, refactor this code
	if (samplerLayoutCount > 1)
	{
		g_log.warning("More than 1 sampler is not yet supported");
	}

	for (int i = 0; i < 1 /*samplerLayoutCount*/; i++)
	{
		// Create the texture sampler state.
		hr = m_d3d11Device->CreateSamplerState(&samplerLayoutDesc[i], &samplerState);
		if (FAILED(hr))
		{
			g_log.error("Failed to initialize sampler state");
			return nullptr;
		}
	}

	delete[] samplerLayoutDesc;

	// add debug labels
	D3D11_SET_DEBUG_NAME(vertexInputLayout, "Shader Vertex input layout(" + std::to_string(a_aId) + ")");
	D3D11_SET_DEBUG_NAME(samplerState, "Shader sampler state(" + std::to_string(a_aId) + ")");

	ShaderPipelineDX11* shaderPipeline = new ShaderPipelineDX11(shaderPipelineData, vertexInputLayout, samplerState);

	// cleanup objects
	delete shaderPipelineData;

	return dynamic_cast<IShaderPipeline*>(shaderPipeline);
}

void AGN::DeviceDX11::setDebugName(ID3D11DeviceChild* a_child, const std::string& a_name, const uint32_t a_lineNum, const char* a_fileName)
{
#ifdef AGN_DEBUG
	if (a_child != nullptr && a_name.length() > 0)
	{
		std::string label = a_name;
		if (a_lineNum != 0 && strlen(a_fileName) > 0)
		{
			label += " - LineNum: " + std::to_string(a_lineNum) + " - File: " + std::string(a_fileName);
		}

		a_child->SetPrivateData(WKPDID_D3DDebugObjectName, (UINT)label.size(), label.c_str());
	}
#endif
}

void AGN::DeviceDX11::logLiveObjects()
{
#ifdef AGN_DEBUG
	if (m_d3dDebug)	m_d3dDebug->ReportLiveDeviceObjects(D3D11_RLDO_DETAIL);
#endif // AGN_DEBUG
}

// TODO: Document
// Reference: http://seanmiddleditch.com/direct3d-11-debug-api-tricks/
void AGN::DeviceDX11::beginDebugEvent(const std::string& a_eventName)
{
#ifdef AGN_DEBUG
	if (m_debugUDA)
	{
		// annoyingly convert to WideChar (Thanks Microsoft!)
		int wchars_num = MultiByteToWideChar(CP_UTF8, 0, a_eventName.c_str(), -1, NULL, 0);
		wchar_t* wstr = new wchar_t[wchars_num];
		MultiByteToWideChar(CP_UTF8, 0, a_eventName.c_str(), -1, wstr, wchars_num);

		// actually start the actual event
		m_debugUDA->BeginEvent(wstr);
		delete[] wstr;
	}
#endif
}

// TODO: Document
// Reference: http://seanmiddleditch.com/direct3d-11-debug-api-tricks/
void AGN::DeviceDX11::setDebugMarker(const std::string& a_markerName)
{
#ifdef AGN_DEBUG
	if (m_debugUDA)
	{
		// annoyingly convert to WideChar (Thanks Microsoft!)
		int wchars_num = MultiByteToWideChar(CP_UTF8, 0, a_markerName.c_str(), -1, NULL, 0);
		wchar_t* wstr = new wchar_t[wchars_num];
		MultiByteToWideChar(CP_UTF8, 0, a_markerName.c_str(), -1, wstr, wchars_num);

		// set the debug marker
		m_debugUDA->SetMarker(wstr);

		delete[] wstr;
	}
#endif
}

// TODO: Document
// Reference: http://seanmiddleditch.com/direct3d-11-debug-api-tricks/
void AGN::DeviceDX11::endDebugEvent()
{
#ifdef AGN_DEBUG
	if (m_debugUDA) m_debugUDA->EndEvent();
#endif
}