text:
riskmethods Receives World Procurement Award
By Sphera's Editorial Team | July 5, 2022
Leading supply chain risk management company highly commended as provider of procurement technology
MUNICH and BOSTON (July 5, 2022) – riskmethods is proud to announce we are highly commended in the category "Technology Innovation" of the World Procurement Awards held annually by Procurement Leaders. Specifically, riskmethods was recognized for one of our recent innovations, riskmethods Supply Risk Network.
With riskmethods Supply Risk Network, companies collaboratively manage supply chain risks and gain multi-tier transparency via an innovative approach that benefits each of the participants in the network. Winning this award confirms our commitment to supporting our customers on their journey to supply chain resilience.
The World Procurement Awards are a unique opportunity for leading procurement teams to showcase their excellence to internal stakeholders, the world's most influential organizations, and procurement thought leaders.
"We are pleased and honored that our solution portfolio designed for global enterprises has been recognized with this international, iconic award," said Heiko Schwarz, founder and CEO of riskmethods. "With the rapid succession of severe risk events in recent years, I believe that everybody now understands that they have to do something in terms of risk. At riskmethods, we know what to do – and now receiving what you might call the 'Oscar' of the procurement world, confirms and validates our strengths in this area."
Each year, Procurement Leaders invites applications from large and mid-sized enterprises that rely on procurement and supply chain excellence, as well as solutions providers. Entries for this year's awards were judged by a panel of 31 leaders from some of the world's biggest organizations.
In addition to recognition of riskmethods as a technical innovator, Corning, a customer of riskmethods, won the Risk & Resilience Award. "Our customers dominate the discipline, with three wins in the past five years," remarked Bill DeMartino, riskmethods Chief Product Officer and Managing Director of the Americas. "In today's turbulent and challenging environment, supply chain risk management has become a must-have to ensure business continuity. We are proud of this continued recognition of our ability to bring innovative solutions to aid our customers on the journey to supply chain resilience."
The judges of the World Procurement Awards particularly highlighted the comprehensive risk management framework at Corning: "Using a sophisticated suite of technologies and overhauled processes, the company was able to anticipate emerging supply disruptions and respond to them as they developed in real-time."
The COVID pandemic, the war in Ukraine and inflationary pressures are among the most recent challenges having severe impacts on global supply chains. With disruption and turbulence likely to continue, consumers, shareholders, and regulators are changing their focus from profitability to demanding resilience and transparency throughout the supply network. As evidenced by the World Procurement Awards, riskmethods enables our customers to solve pressing and evolving supply chain challenges.
riskmethods is proud to be the recipient of multiple industry awards for its contributions to the disciplines of procurement and supply chain management.
About riskmethods
riskmethods, a Sphera company, empowers businesses with a solution to monitor, identify, assess, and mitigate supply chain risk. By using artificial intelligence, riskmethods helps businesses automate and accelerate threat detection, enabling them to gain competitive advantage with a well-managed approach to meeting customer demands, protecting reputation and reducing total cost of risk.
About Sphera
For more than 30 years, Sphera has served over 6,700 customers and a million-plus users in 80 countries to help companies keep their people safe, their products sustainable and their operations productive. Learn more about Sphera at www.sphera.com. Follow Sphera on LinkedIn.
For media inquiries, please contact:
Denise Jones, Marketing Communications Manager, Sphera, djones@sphera.com
riskmethods was acquired by Sphera in October 2022. This content originally appeared on the riskmethods website and was slightly modified for sphera.com.
ESG at Sphera
Copyright © 2023 Sphera. All rights reserved.


text:
J.Reneé Partners with Fashion Designer Malan Breton at New York Fashion Week
06 Sep J.Reneé Partners with Fashion Designer Malan Breton at New York Fashion Week
Leading women's shoe designer, J.Reneé, is proud to announce they will be the featured shoe sponsor at Malan Breton's spring 2014 shows premiering during New York Fashion Week.
On Saturday September 7th, Breton's models will be wearing new footwear styles from the J.Reneé Eelskin Collection, including the Bezel pump and Solvay knee-high boot. The presentation at the iconic Lincoln Center will feature Malan Breton's Men's and Women's Collections for summer 2014. On Wednesday, September 11th, Breton will present his Malan by Malan Breton spring 2014 collection at the Metropolitan Pavilion. The feature models will be wearing pops of color from the J.Reneé Kinsley shoes, crafted using patent and metallic nappa leather.
"Malan's collections embody everything we love at J.Reneé," says shoe designer Kai Harrison. "His designs are glamorous and parallel the wearing occasions of our ladies which make it delightful to work together."
Malan Breton is the designer and creative director behind Malan Breton Furs, Fantôme and Malan Breton HOMME Collections. Breton has been designing since the age of 11 and is known for his signature detailing and fabrics. His designs have appeared at red carpets around the world in addition to media outlets across the globe.
"I am excited to use this fabulous shoe line in my show during New York Fashion Week because they are fashion forward while still being affordable," says Breton.
Fashion enthusiasts can get the inside scoop on Malan's collection and New York Fashion Week on Twitter @malanbreton. Shoe lovers can shop new arrivals at http://www.jrenee.com.
About J.Reneé:
J.Renee' is the signature brand of Remac, L.L.P., a family-owned business founded in 1974 by husband and wife team Renee' and Micky Harrison. The eponymous J.Renee' brand is passionate about developing vibrant, feminine and innovative products combined with top of the line quality. Our goal is to provide the fashion savvy customer designer looks at affordable prices. The collection features elegant fabrics, trend right prints and bold embellishments. Eric and Kai Harrison shared their parent's vision and took the reins in 2008, creating footwear and accessories to fulfill the company's vision, giving women more opportunities to feel fabulous! Remac L.L.P. is based near Dallas, Texas and distributes product world-wide in department stores, specialty chains and independently owned stores and boutiques.

redpajama_set_name: RedPajamaCommonCrawl


What Type of Fur is Best for You?
Take our short, fun quiz to find out what the best type of fur is for you.
We've compiled a list of frequently asked questions regarding storage, cleaning, and repairs. In this post, you'll find answers to: Why should I store my fur in a cold storage vault?; Can I just store my fur at home in a closet for the summer?; Why is humidity such a big deal with my fur?; Where is Yudofsky Fur and Leather's cold storage vault?; Why should I clean my coat?; and Should I bother with fixing a small rip on my piece?
Your furs need to be stored in a cold storage vault during the summer months to keep it from deteriorating in your home. Continue reading for more information.


text:
import { Component, OnInit } from '@angular/core';
import { KeenService } from '../keen.service';

@Component({
  selector: 'app-first-page',
  templateUrl: './first-page.component.html',
  styleUrls: ['./first-page.component.css']
})
export class FirstPageComponent implements OnInit {
  private uiStack = 'Angular 2+';
  private name = '';
  private submitMessage = '';

  constructor( private keenService: KeenService ) { }

  ngOnInit() {
  }

  private uiStackValueChanged() {
    this.keenService.recordValueSelectedEvent( 'uiStackSurvey', 'uiStack', this.uiStack);
  }

  private onSubmit() {
    this.submitMessage = `Thank you for taking the survey! You (${this.name}) seem to like ${this.uiStack}.`;

    setTimeout(() => {
      this.submitMessage = '';
    }, 5000);
  }

  private onFocus(formField: string) {
    this.keenService.recordOnFocusEvent('uiStackSurvey', formField);
  }
}

redpajama_set_name: RedPajamaGithub


Have you ever wondered how much weight you would gain if you drank 10 cans of Coca-Cola (or Pepsi) every day, for 30 days?
L.A. resident George Prior, a Paleo diet aficionado decided to conduct an experiment - in a "Super Size Me" way - by drinking 10 cans of coke every day for 30 days. So 300 cokes overall. He then documented his results on his website 10cokesaday.com.
The trick to this is that Prior made no other changes to his otherwise healthy diet. He had a very healthy diet already (and a pretty lean, muscular body), so he would just be adding sugary drinks to his daily diet. That means he was putting 350 extra grams of sugar into his body every day.
So what difference do you think that would make? After all, not many people actually drink 10 cokes per day, do they?
Actually a lot of people do drink the equivalent of that.
"That's true, perhaps you're only drinking four Cokes, but if you add in the two glasses of orange juice, the two sweetened coffee drinks from Starbucks, the 16 ounce Odwalla drink, the two 'healthy' brand ice teas, and the $9 fruit smoothie you waited ten minutes in line for, you've made my ten Cokes look like child's play. Maybe it's not all Coke, but they're all sugar drinks, and a big percentage of Americans drink at least the sugar equivalent of my ten Cokes," explains Prior.
So yes, sometimes people do drink that much every day. Or eat the equivalent amount of calories in junk food. A single can of Coca-Cola is 139 calories, so 10 cans is 1,390 calories - approx. 70% of your daily energy needs.
3,500 calories = 1 pound of fat. Thus consuming 41,700 calories in 30 days, we would expect Prior to gain 11.914 lbs of fat in 30 days.
So how much did Prior gain?
At the start of his experiment he weighed in at 168 lbs. 30 days later he weighed 191 lbs, an increase of 23 lbs. How is this possible that the amount consumed led to a larger than expected weight gain?
#1. Prior cheated on his experiment, eating more than he claimed he was. But we will assume he was honest in his experimentation and give him the benefit of the doubt.
#2. The sheer amount of sugar caused him to become temporarily diabetic and also slowed his metabolism. A dramatically slower metabolism would cause him to store more sugar as fat, leading to excessive weight gain.
Anyone who has ever gained 20 lbs during the Christmas Holidays know how option #2 happens.
#3, Prior also gained muscle / bone density during that time period. Since the meat and veggies he was eating wasn't being used for energy due to the abundance of sugar in his system, those materials would have then been used for growing extra muscle and increasing his bone density. Increased bone density is normal for anyone putting on extra muscle / weight, as your bones needs to be able to support the extra weight.
#4. Combination of #2. and #3. But how would we know?
Well, fortunately there is a way to check. We compare his body fat percentages and total body fat weight.
At the start of the experiment Prior had 9.4 percent body fat. Or 15.792 lbs of fat.
By the end of the experiment his body fat was 15.3 percent. Or 29.223 lbs of fat.
So in reality he only gained 13.431 lbs of fat.
So that isn't so far off from the 11.914 lbs we would have expected him to gain.
So what about that extra 1.517 lbs of fat?
Well, lets look at Prior's blood pressure. At the beginning of the experiment his blood pressure was 129/77. By the end of the experiment it had increased to 143/96. An increase of 16%.
Blood pressure and metabolism has an inverse effect. The person becomes resistant to insulin (diabetic); Insulin regulates the absorption of sugar, the storing of sugar as fat tissue and plays an important role in weight gain. An increase in blood pressure, a reduction in metabolism and a rise in resistance to insulin would result in extra weight gain.
For Prior this meant only a difference of 1.517 lbs of fat, but it is important we keep track of what was happening in his body.
Note - All the math calculations on this page are done by me, using a calculator and only the raw before and after data. I have not relied on George Prior's website for any of my calculations.
Yes, eating lots of sugary drinks (or sugary food) will cause you to gain a lot of weight in a hurry. That part is a no brainer. So if you are eating a lot during the upcoming Christmas Holiday Season and then weigh about 20 lbs more than usual by the time January comes around, now you will know why. All those snacks, cookies, wine, beer, chocolate, turkey, stuffing, potatoes, etc went straight to your waistline. The holiday season is amazingly effective at causing people to gain weight in a hurry.
Oddly enough not all of it will be fat. A chunk of it will also be muscle and bone density, but the added fat gain is going to be tricky to get rid of.
So Merry Christmas. You will need to go on a diet / exercise routine come January.
If you need a personal trainer in January, shoot me an email. We can start by measuring your weight, figure out how much you want to lose, and then we can determine what kind of diet and exercise program you will need to reach your desired weight.
In the meantime have a Happy Holidays and try to eat healthier this year!


This book focuses on green networking, which is an important topic for the scientific community composed of engineers, academics, researchers and industrialists working in the networking field. Reducing the environmental impact of the communications infrastructure has become essential with the ever increasing cost of energy and the need for reducing global CO2 emissions to protect our environment. Recent advances and future directions in green networking are presented in this book, including energy efficient networks (wired networks, wireless networks, mobile networks), adaptive networks (cognitive radio networks, green autonomic networking), green terminals, and industrial research into green networking (smart city, etc.).
My contribution to this book lies in the chapter 6, called "Autonomic Green Networks", where I talk about self-protection.
A Step Towards Energy-efficient Wired Networks, Aruna Prem Bianzino, Claude Chaudet, Dario Rossi and Jean-Louis Rougier.
A Step Towards Green Mobile Networks, Sami Tabbane.
Cognitive Radio in the Service of Green Communication and Networking, Hicham Khalifé.
Autonomic Green Networks, Francine Krief, Maïssa Mbaye and Martin Peres.
Schemes for Putting Base Stations in Sleep Mode in Mobile Networks: Presentation and Evaluation, Louai Saker, Salah Eddine Elayoubi and Tijani Chahed.
Industrial Application of Green Networking: Smarter Cities, Vincent Gay, Paolo Medagliani, Florian Broekaert, Jérémie Leguay and Mario Lopez Ramos.
The original book has been written in French, under the title Le green networking : Vers des réseaux efficaces en consommation énergétique. It has then been translated to English.


text:
La  (en ) est la gare ferroviaire principale de Vienne, capitale de l'Autriche. L'édifice est situé près de la Gürtel dans le  arrondissement (Favoriten), sur le site de l'ancienne gare du Sud.

Son inauguration effective s'est faite en plusieurs étapes à partir du . Depuis la mise en service complète le , tous les trains grandes lignes des Chemins de fer fédéraux autrichiens (ÖBB) traversant la capitale se rendent à la gare centrale. C'est la première fois dans l'histoire des chemins de fer autrichiens que Vienne a une gare principale regroupant toutes les lignes aboutissant à la ville.

Situation ferroviaire

Établie à  d'altitude, la gare centrale de Vienne est située aux points kilométriques  des lignes du Sud (Südbahn), de l'Est et de la ligne de l'Est de Laa, ainsi que  de la Stammstrecke empruntée par les trains du S-Bahn de Vienne reliant la ligne du Nord.

Elle dispose de douze voies dont dix, numérotés de 3 à 10, encadrant cinq quais centraux en hauteur, et deux situées dans la gare souterraine annexe de Südtiroler Platz-Hauptbahnhof encadrées par deux quais latéraux numérotés 1 et 2 (voir plan ci-contre).

Histoire

Services ferroviaires

Accueil
Gare des ÖBB, elle est dotée d'un bâtiment voyageurs offrant un point d'information des voyageurs, un guichet de vente de titres de transport ainsi que des distributeur automatique de titres de transport.

La gare est accessible aux personnes à mobilité réduite.

Desserte

Intermodalité

Notes et références

Voir aussi

Articles connexes
 Transport ferroviaire en Autriche
 Ligne de l'Ouest

Lien externe
 .

Gare à Vienne (Autriche)
Vienne (Autriche)
Gare mise en service en 2012

redpajama_set_name: RedPajamaWikipedia


In the southeast corner of the North Coast American Viticultural Area (AVA), the boundary lines of area extend just a few miles beyond Napa County to include about 30,000 acres of Solano County. Here you will find two AVAs—the Solano County Green Valley AVA and the Suisun Valley AVA—literally feet away and across a political boundary from the esteemed Napa Valley AVA. That has to be a bit like being the awkward little sister of a beauty queen, or the geeky big brother of a star football player. However you want to describe it, it has to be tough being Napa's neighbor.
Suisun Valley AVA: The Suisun Valley AVA, located just to the south of Napa County, lies between the southern edge of the Vaca Mountains (to the east) and the Howell Mountains (also known as the St. George Mountains [to the west]). The AVA is about 8 miles long and three miles wide, covering about 15,000 acres—of which about 3,000 acres are planted to vine.
The Suisun Valley enjoys a relatively cool climate (it is classified as "Region III" under the Winkler Scale), but is significantly warmer at its northern edge. The southern end of the valley, adjacent to Suisun Bay, can be cooler by as many as 14 degrees (F) during the heat of the day. Suisun Bay itself forms the beginning of the Sacramento-San Joaquin River Delta, and is connected via the Carquinez Strait to San Pablo Bay (to the west).
The Suisun Valley was first recognized for the quality of its red wines, particularly Cabernet Sauvignon and Petite Sirah (Durif). These grapes are still widely grown in the area, which is now planted to more than 20 other grapes as well. These include Chardonnay, Sauvignon Blanc, Zinfandel, Pinot Gris, Gamay, and Chenin Blanc.
There are just over a dozen wineries producing wine within the confines of the Suisun Valley AVA, and several dozen more that produce wine under the Suisun Valley appellation while located in adjacent counties. Sunset Cellars, the Vezér Family Vineyard, and Wooden Valley Winery are among the standouts. The Vezér Family Vineyard calls the Suisun Valley "the Petite Sirah Capital of the World"— who can resist that?
Solano County Green Valley AVA: The Solano County Green Valley AVA (not to be confused with Sonoma's Green Valley—the Green Valley of Russian River Valley AVA) is smaller and cooler than the Suisun Valley. Solano's Green Valley AVA measures just about four miles long by one mile wide and has about 800 acres planted to vine.
Solano's Green Valley AVA is located just to the south/south east of Napa, and enjoys a maritime climate due to its proximity to Suisun Bay. At last count, the area has just a few wineries—including GV Cellars and Rock Creek Vineyard—and just over a dozen independent grape growers. The area is known for red varieties such as Cabernet Sauvignon, Sangiovese, Dolcetto, Zinfandel, and Petite Sirah, but a handful of other grapes (including Chenin Blanc and Pinot Gris) are grown here as well.
Wine production in Solano County has a well-documented history. We know that an Australian by the name of John Volypka planted vines in the area as early as 1858 and was making wine by 1863. Others followed—Harry Schultz soon had a large winery, and by 1879 S.F. Jones had 90 acres of vines and produced 50,000 gallons of wine a year.
In 1952, Ben Volkhardt Jr. bought 80 acres of land in Green Valley. He planted peaches, pears, and grapes, but soon the business focused on grapes and wine. His son—Ben Volkhardt III—joined the business in 1974 and the two formed the Chateau de Leu winery—which survives to this day as GV Cellars (under different ownership).
Based on petitions filed by the Volkhardts, both the Suisun Valley and Solano Green Valley were awarded their AVA status in 1982, making them among the first wave of AVAs approved in California. The first AVA declared in California—in January of 1981—was their neighbor-to-the-north, the Napa Valley. Perhaps you've heard of it?
I am a huge fan of everything about New Zealand, in particular New Zealand wines. I've been a fan of New Zealand wines since the release of Cloudy Bay Vineyards' first Marlborough Sauvignon Blanc back in the 1980s. I've grown to be an even bigger fan over the years as I've been able to experience the rise of Central Otago Pinot Noir, red blends from Hawke's Bay, serious Méthode Marlborough sparkling wines, and even "carbonated" Sauvignon Brut (delicious).
The Waitaki River: The Waitaki is a river that begins with several small streams that flow from the Southern Alps (somewhat in the central portion of New Zealand's South Island) towards Lakes Ohau, Pukaki, and Tekapo. Once past the lakes, the streams weave together to form the Waitaki. The Waitaki River, named for the Maori term for "weeping waters," then travels eastward for about 130 miles (210 km) until it meets the Pacific Ocean near the town of Glenavy on the island's east coast. The Waitaki River is a braided river, meaning that it consists of a series of river channels connected and separated by small (and sometimes temporary) islands.
Lake Waitaki: The Waitaki River is also home to one of the largest hydroelectric power projects in New Zealand, and is home of several large dams that create several man-made lakes—such as Lake Benmore, Lake Aviemore and Lake Waitaki—along its path. Lake Waitaki is the smallest and the furthest downstream of the three lakes on the Waitaki River.
The Waitaki District: Here's where it gets interesting—the Waitaki River served as a traditional—and now political—boundary between the large political regions of Canterbury (to the north) and Otago (to the south). With the hydroelectric plants and other developments along and on either side of the river, it was decided that it would be best to include the entire catchment of the river within one political district. The Waitaki District, with approximately 60% of its area in the Canterbury Region and 40% in the Otago Region, is the only district on New Zealand's South Island that is split between two political regions.
The Waitaki Valley of Canterbury: This area is listed on the website of Wines of New Zealand as a sub-region of the Canterbury GI. (Canterbury has applied for official status as a new Geographical Indication.) However, the Waitaki Valley of Canterbury has not applied for GI status—as of today (November 4, 2017)—so for now it joins a long list of New Zealand wine areas that will be considered "unofficial." As such, the Waitaki Valley area to the north of the river is considered to be an unofficial sub-region of the Canterbury GI.
The Waitaki Valley viticultural areas (on either side of the river) follow the course of the Waitaki River for 46 miles (75 km). The area has unique limestone-based soils—a reminder of its ancient past, when it was covered by the sea—as well as loess and alluvial deposits. The Waitaki Valley(s) are remote, cool-climate areas that are planted mainly to Pinot Noir, Riesling, Pinot Gris, and Chardonnay.
Porto Santo is a Portuguese island located in the Atlantic Ocean, 27 miles (43 km) northeast of the island of Madeira. It forms the Madeira Archipelago along with the island of Madeira and a small string of islands known as las Ilhas Desertas (literally "the Deserted Islands"). Porto Santo is a small island, measuring 9 miles (14 km) long and just 5 miles (7.7 km) across.
The earliest record of the history of Porto Santa dates from 1418, when a group of Portuguese ships were (accidently) blown into its sheltered harbor. The ships were in the service of Infante Henrique of Portugal, and had been blown off-course by an intense storm. They named the island Porto Santo ("Holy Harbor"), as their arrival in a sheltered bay during the storm was seen as the result of divine intervention. .
Geologically, the island is divided into two parts—the mountainous northeast, and a relatively flat coastal plain in the southwest, which includes a 4.5 mile-long (7 km) golden sand beach. Laid-back tourism is one of the main industries, and visitors can enjoy hiking, biking, motorbiking, off-roading, windmills, forts, or golf; and may choose to take a two-hour boat ride to Madeira aboard the ferry Lobo Marinh. Waterfront wining and dining may be found in Vila Baleira, the one and only "city" on the island.
History buffs can pay a visit to the Christopher Columbus House Museum and learn that Christopher Colombus was once married to a Portuguese woman and that they lived on Porto Santo for a period of time. Colombus' wife, Filipa Moniz, unfortunately passed away during childbirth just a few years after their marriage.
In the 1420s, the Portuguese King sent a group under the command of Captain Bartolomeu Perestrelo to colonize the island. The group planted grapevines and sugar cane, and introduced rabbits to the island. The introduction of rabbits turned out to be not such a good idea, as they rampaged their way across the island and soon dominated the local environment. In a matter of a few (rabbit) generations, they basically ate everything else up.
Another not-so-smart move by these early settlers involved the local Dragon Trees. The valuable sap of the trees, known as "dragon's blood" is a type of resin used for medicine and dyes. The colony chopped down the trees and literally bled the trees dry to the point that they became extinct on the island. As such, the island lost its original wind protection—and with the help of the ravaging wild rabbits—the area was left rather rugged, wind-blown, and barren. While it certainly has its own style of natural beauty, the island has never recovered to its original lush state.
Despite the challenges, there is some viticulture on the island of Porto Santo. As Porto Santo is included in the geographic territory of the Madeira DOC, the Madeirense DOC and the VR Terras Madeirenses, these wines may be produced on the island of Porto Santo. Despite the limitations, grapes are a pretty big deal here—agriculture is limited on the island, making grapes, melons, and rabbit the three biggest commodities.
Grapes or wine from Porto Santo may also be sent to the island of Madeira for use in the wines bottled there. There are some obvious logistical challenges to such a project, however—it has been known to happen. For instance, the Madeira Vintners used Listrão and Caraco grapes from Porto Santo in their 2013 vintage. That same year, Porto Santo grower J. Santos produced a sweet white wine from locally grown Listrão as well as an off-dry white wine from the Porto Santo-grown Caracol grapes. You can read reviews of both of these wines on Niklas Jörgensen's Mad about Madiera blog.
Christopher Merrett (1614–1695) is something of a hero to wine lovers, as we know him to be the first person to figure out that you could add sugar to a bottle of wine, cause it to re-ferment, and make bubbles! Put in more technical terms, he is acknowledged as the first person to deliberately create a sparkling wine via the addition of sugar.
So, cheers to Christopher Merrett, on that merit alone! However, as is generally the case with these scientists of yore, he accomplished much more than just bottling bubbles: he was, in fact, a member of the Fellowship of the Royal Society and studied metallurgy, glass making, plants, birds, and butterflies.
Merrett was a keen scientific observer of the natural world and became quite famous for publishing one of the earliest taxonomies of the plants, animals, and minerals of the British Isles. Published in 1666, this work—Pinax Rerum Naturalium Britannicarum—is now acknowledged as the earliest work to contain a complete list of the birds and butterflies of England. He also had an interest in glass making and translated Antonio Neri's L'Arte Vetraria ("The Art of Glassmaking"—written in 1612) from Italian to English, while adding 147 pages of his own.
A few things going on in the scientific community as well as English society helped to lead Merrett to his discovery. For one, the English glass-making industry had become quite adept at producing hard, durable glass through the use of coal (which burns hotter) rather than wood for fires. English-produced bottled were thus sturdier—and less likely to burst—than French bottles. In addition, the English imported cork from Portugal to seal their bottles while the French were still using wooden stoppers and cloth. Finally, the English had already acquired a taste for apple cider, which was sweet and flavorful—more so than the wine imported from France.
As such, English people became accustomed to adding molasses and sugar to their imported French wines. Soon enough, Christopher Merrett—a keen observer of the natural world if ever there was one—noted that if you added sugar or molasses to French wine, and stored it in a sturdy, coal-fired English glass bottle stoppered with a tight-sealing Portuguese Cork, you ended up with a lively, flavorful, bubbly wine that was a tasty as English cider. That was an "a-ha" moment if ever there was one!
In 1662, Merrett delivered an eight-page paper to the Royal Society detailing the use of sugar or molasses to give wine or cider a bit of fizz. In the words of Merrett, this was "to make them brisk and sparkling." Keep in mind that this paper was delivered in 1662, several decades before Dom Perignon's famous "Come quickly, I am drinking stars!" moment, alleged to have occurred in 1697.
Merrett was only mildly interested in wine, and soon returned to his observations on the rest on the natural world. In addition to his studies of birds and butterflies, he went on to present several more papers on many topics to the Royal Society. These included papers on such diverse topics as fruit trees, tin mining, and coastal geography. His interests, it seems, knew no bounds.
Note: Much of the information about Christopher Merrett and sparkling wine came to light courtesy of the British wine writer Tom Stevenson.


text:
\section{Introduction}

Knowledge distillation~(KD)~\citep{Hinton2015Distilling,romero2014fitnets} is a classic framework for model compression, which trains a compact student model by utilizing the learned knowledge in a large teacher PLM via teacher-student prediction alignments.
Various alignment strategies have been proposed, like internal representation matching~\citep{Sun2019PatientKD,Sanh2019DistilBERT,Jiao2019TinyBERT} and attention heatmap consistency~\citep{wang2020MiniLM}, and obtain promising efficiency-performance trade-off.
However, previous KD studies for PLMs mostly align the student to the teacher model in a point-to-point manner, neglecting an important knowledge source, i.e., the gradient of the teacher.

Viewing a model as a function mapping the input to the label space, the gradients thus can depict the curve of the function, capturing the model activation changes according to the input perturbation, which we assume can be beneficial for the student model.
Besides, as gradients are closely related to interpretation, gradient alignment is likely to improve interpretation consistency.

Motivated by this, we explore incorporating gradient alignment in knowledge distillation.
However, introducing gradient alignment to KD for PLMS is challenging due to the following two reasons.
First, the inherent discreteness of natural language makes directly computing the deviations w.r.t. the input sentences intractable.
To remedy this, we instead align the gradient w.r.t the input embedding, and initialize the embedding of the student with that of the teacher and freeze it during training.
Second, our theoretical analysis shows that the commonly adopted Dropout regularization~\citep{Srivastava2014DropoutAS} will disturb the gradient alignment, so we deactivate dropout while conducting distillation.
Further analysis and experiments can be found in Section~\ref{sec:gkd} and Table~\ref{mainresults}.
Experiments on large-scale datasets in the GLUE benchmark~\citep{wang-etal-2018-glue} demonstrate that gradient knowledge improves the student's performance and behavior consistency with the teacher model.
Besides, our analysis of word saliency~\citep{Ding2019SaliencydrivenWA} shows that the alignments on gradients can benefit the behavior consistency in word saliency level.

\begin{figure}[t!]
 \begin{center}

    \includegraphics[width=0.8\textwidth]{GKD-figures.pdf}
      \caption{Comparison between traditional KD and our gradient KD. Gradient KD introduces an extra gradient alignment objective to better inform the student of the model behavior of the teacher.

  }
  \end{center}
\end{figure}

\section{Related Work}
Knowledge distillation has been widely used in computer vision~(CV)~\citep{kdcv,videokd}, natural language process~(NLP)~\citep{Sanh2019DistilBERT,textgenkd} and multimodal field~\citep{multimodalkd,multimodalkd2}.
In the NLP field, knowledge distillation methods can be roughly classified into one-stage methods and two-stage ones. One-stage methods perform distillation at the fine-tuning stage. BiLSTM$_\textrm{SOFT}$~\citep{Tang2019DistillingTK} performs knowledge distillation with the teacher's logits on an augmented dataset, BERT-PKD~\citep{Sun2019PatientKD} performs knowledge distillation with the teacher's logits and hidden states, and PD~\citep{turc2019well} uses a small pre-trained masked language model as a student to enhance the effect of distillation. Two-stage methods perform distillation at both the pre-training stage and the fine-tuning stage. DistilBERT~\citep{Sanh2019DistilBERT} and MobileBERT~\citep{Sun2020MobileBERTAC} focus on the pre-training stage, aiming to get a task-agnostic model that can be fine-tuned or distilled on downstream tasks. TinyBERT~\citep{Jiao2019TinyBERT} first distills a task-agnostic model during pre-training and then performs task-specific distillation on an augmented dataset to further improve performance.

Besides, in the computer vision field, aligning gradients~\citep{Jacobian} or using gradients as a weighting factor~\citep{SCKD} have been explored before. But there is little exploration for PLMs. \citeauthor{NewsBERT} incorporates gradients via a momentum distillation method which is similar to the momentum mechanism~\citep{momentum}, but as far as we know, direct gradient alignment has not been explored in the context of KD for PLMs.

\section{Gradient Knowledge Distillation For PLMs}
\paragraph{Backgrounds: KD for PLMs}
Formally, for a classification task, we denote $\mathcal{D} = \{\mathbf{x}_i,\mathbf{y}_i\}_{i=1}^N$ as the training dataset with $N$ instances, where $\mathbf{x}_i$ is the input sentence and $\mathbf{y}_i$ is the label.
Without loss of generality, we take BERT as the representative of PLM model, which transforms the sentence $\mathbf{x}_i$ to a contextualized representation $\mathbf{h}_{i} = \text{BERT}(\mathbf{x}_i)$.
A softmax layer with a learnable parameter $\mathbf{W}$ is appended for producing probability vector $ \mathbf{p}_i=\operatorname{softmax} (\mathbf{W}\mathbf{h}_{i})$ over the label set.
We denote $\mathbf{p}^T_i$ and $\mathbf{p}^S_i$ as the probability vector generated by the teacher $T$ and the student $S$ for the $i$th input, respectively.
KD aims to transform the large teacher's knowledge into a smaller student model. Vanilla KD~\citep{Hinton2015Distilling} achieves it by utilizing the soft targets produced by the teacher:
\begin{align}
\small
    \mathcal{L}_{\text{KD}} &=(1-\alpha)\mathcal{L}_{\text{CE}}+\alpha \mathcal{L}_{\text{Soft-CE}} \\
    \mathcal{L}_{\text{Soft-CE}} &={\tau^2}\sum\limits_{i=1}^N D_{\mathrm{KL}}\left(\mathbf{p}^T_{i,\tau}\| \mathbf{p}^S_{i,\tau}\right),

\end{align}
where $\mathcal{L}_{\text{CE}}$ is the cross-entropy objective for classification tasks, $\mathbf{p}_{i,\tau} =\operatorname{softmax} (\mathbf{W}\mathbf{h}_{i}/\tau)$, $\alpha$ is a hyper-parameter and $\tau$ is the temperature hyper-parameter.
Further explorations introduce alignments on hidden states~\citep{Sun2019PatientKD,Sanh2019DistilBERT} or attention heatmap~\citep{wang2020MiniLM}, and explore dynamic learning schedule~\citep{li-etal-2021-dynamic}.

\paragraph{Improving KD with Gradient Alignments}
\label{sec:gkd}

Different from previous KD studies which consider aligning the teacher and the student in a point-wise manner, we propose to align the change of the model around the inputs by introducing an extra objective on gradient consistency between the student and the teacher.
In this way, the student can better understand how the output should change when the input changes, which is helpful for the student to behave similarly to the teacher. However, we find that the discreteness of the text and the dropout regularization hinder the alignment of the gradients.
First, as the input sentence tokens are discrete, it is intractable to get the derivative w.r.t the original input sentence.
To remedy this, we instead take the derivative w.r.t the input embeddings.
Besides, to make sure that the input spaces of the student and the teacher are aligned for calculating the gradient, we initialize the student embedding with that of the teacher, which is a commonly adopted practice in previous KD studies~\citep{Sun2019PatientKD,Jiao2019TinyBERT}, and fix the student embedding layer during the training.
 Denote $p_{m,i}^S$ and $p_{m,i}^T$ as the maximum probability in the obtained class probability distribution from the student and the teacher for an input sentence $\mathbf{x}_i$, the gradient alignment is defined as a mean-square error objective between two normalized deviations:
\begin{equation}
    \mathcal{L}_{\text{GKD}} = \sum\limits_{i=1}^N \sum\limits_{j=1}^{L_i} \Vert \frac{\frac{\partial p_{m,i}^S}{\partial \mathbf{E}^S_{i,j}}}{\Vert \frac{\partial p_{m,i}^S}{\partial \mathbf{E}^S_{i,j}}\Vert_2}
    -
    \frac{\frac{\partial  p_{m,i}^T}{\partial \mathbf{E}^T_{i,j}}}{\Vert \frac{\partial  p_{m,i}^T}{\partial \mathbf{E}^T_{i,j}}\Vert_2}
    \Vert_2^2 \ ,
\end{equation}
where $L_i$ denotes the length of the $i$th tokenized sentence and $\mathbf{E}_{i,j}$ denotes the input embedding vector corresponding to the $j$th token of the $i$th sentence.
As the gradient computation will take all the weights of the model into consideration, the objective encourages the weight updates towards making the student produce consistent gradients with the teacher model.

Second, we find the commonly adopted Dropout~\citep{Srivastava2014DropoutAS} will cause a biased gradient estimation. We provide a mathematical analysis in Theorem~\ref{thm:drop}. Without loss of generality, in Theorem~\ref{thm:drop}, we derive the gradient when inputs are applied with a dropout mask once.

\begin{theorem}
\label{thm:drop}
Consider a function $f$ whose input $\mathbf{x_0}\odot \boldsymbol{\xi}$ comes from a dropout layer, where each component of  $\boldsymbol{\xi}\in\{0,\frac{1}{1-\delta}\}^d$ is drawn independently from a scaled Bernoulli($1-\delta$) random variable. Suppose $f$ can be estimated by its second-order Taylor expansion around $\mathbf x_0$, then
\begin{equation}
    \mathbf{E}_{\boldsymbol \xi}[\nabla f(\mathbf x_0\odot\boldsymbol \xi)] = \nabla f(\mathbf x_0) + \frac{\delta}{1-\delta} \operatorname{diag}( \nabla^2 f(\mathbf x_0))\mathbf x_0 \ .
\end{equation}
\end{theorem}

As the dropout in the teacher model is deactivated, we will align $\nabla T(\mathbf x_0)$ with $\nabla S(\mathbf x_0) + \frac{\delta}{1-\delta} \operatorname{diag}( \nabla^2 S(\mathbf x_0))\mathbf x_0$ when conducting distillation with dropout activated in the student model.
Besides, this bias accumulates when the model goes deeper and leads to more deviated gradients for shallow layers, which is verified in Appendix~\ref{apx:drop}. To remedy this, we deactivate the dropout in the student model for a consistent gradient calculation.

With the deactivated dropout and the gradient alignment objective, our gradient knowledge distillation~(GKD) is achieved by minimizing the combined objectives ($\alpha$ and $\beta$ are hyper-parameters):
\begin{equation}
    \mathcal L = (1-\alpha) \mathcal L_\textrm{CE}+\alpha \mathcal L_\textrm{soft-CE} + \beta \mathcal L_\textrm{GKD}\ ,
\end{equation}

Furthermore, we apply the gradient alignment on the \texttt{[CLS]} vector to enhance the effect, as \texttt{[CLS]} vectors are usually adopted as the sentence representation for sentence-level prediction:
\begin{equation}
 \mathcal L_\textrm{GKD-CLS} =
    \sum\limits_{i=1}^N \sum\limits_{j=1}^{m} \Vert \frac{\frac{\partial p_{m,i}^S}{\partial \mathbf{h}^s_{i,S_{j},\textrm{CLS}}}}{\Vert \frac{\partial p_{m,i}^S}{\partial \mathbf{h}^s_{i,S_{j},\textrm{CLS}}}\Vert_2}
    -
    \frac{\frac{\partial  p_{m,i}^T}{\partial \mathbf{h}^T_{i,T_{j},\textrm{CLS}}}}{\Vert \frac{\partial  p_{m,i}^T}{\partial \mathbf{h}^T_{i,T_{j},\textrm{CLS}}}\Vert_2}
    \Vert_2^2 \ ,
\end{equation}
where $\mathbf{h}^t_{i,k,\text{CLS}}$ denotes to the hidden state of the \texttt{[CLS]} token for the $i$th example in the $k$th layer.
The Skip layer mapping strategy is adopted for $S_{j}$ and $T_{j}$.\footnote{For a 6-layer student, $S_{j}$ takes value $\{1,2,3,4,5\}$, $T_{j}$ takes value $\{2,4,6,8,10\}$ and $m=5$.}
As the \texttt{[CLS]} representations in the student and the teacher can be different, which may hinder gradient alignment, we incorporate an extra loss to align them:
\begin{equation}
     \mathcal L_\textrm{PKD} = \sum\limits_{i=1}^N \sum\limits_{j=1}^{m} \Vert \frac{\mathbf{h}^S_{i,S_{j},\textrm{CLS}}}{\Vert \mathbf{h}^S_{i,S_{j},\textrm{CLS}}\Vert_2}
    -
    \frac{ \mathbf{h}^T_{i,T_{j},\textrm{CLS}}}{\Vert  \mathbf{h}^T_{i,T_{j},\textrm{CLS}}\Vert_2}
    \Vert_2^2  \ .
\end{equation}
Therefore, the objective of the enhanced version GKD-CLS is ($\alpha$, $\beta$ and $\gamma$ are hyperparameters)
\begin{equation}
      \mathcal L = (1-\alpha)\mathcal  \mathcal L_\textrm{CE}+\alpha \mathcal L_\textrm{soft-CE} +\beta \mathcal L_\textrm{PKD} + \gamma  (\mathcal L_\textrm{GKD} + \mathcal L_\textrm{GKD-CLS}).
\end{equation}

\section{Experiments}

In this section, we compare our method with other methods from several aspects. We mainly focus on applying our distillation method in the fine-tuning stage due to the limited computational resources. Still, we do experiments to combine our method with Distilbert~\citep{Sanh2019DistilBERT}, to demonstrate that our method can improve the performance of the models distilled in the pre-training stage (\S~\ref{sec:analysis}).

\subsection{Experimental Settings}
\label{sec:experimental_settings}

\paragraph{Datasets}
As fine-tuning the BERT model on small datasets like RTE~\citep{bentivogli2009rte} and MRPC~\citep{dolan2005mrpc} can be quite unstable~\citep{RevisitingFew-sampleBERTFine-tuning,OntheStabilityofFine-tuningBERT},
we select four large-scale sentiment classification and natural language inference datasets from the GLUE benchmark~\citep{wang-etal-2018-glue} for more stable evaluation, including \linebreak Stanford Sentiment Treebank~(SST-2)~\citep{socher2013sst}, Quora Question Pairs~(QQP), \linebreak Multi-Genre Natural Language  Inference~(MNLI)~\citep{williams2018mnli} and Question-answering NLI~(QNLI)~\citep{rajpurkar2016squad}.

\paragraph{Baselines}
We compare our method with direct fine-tuning and two task-specific KD methods.
Vanilla KD~\citep{Hinton2015Distilling} aligns the logits of the student and the teacher.
BERT-PKD~\citep{Sun2019PatientKD} utilizes the hidden states of the \texttt{[CLS]} token as well as the logits. Besides, in the first part of Section~\ref{sec:analysis}, we combine our method with DistilBERT~\citep{Sanh2019DistilBERT}, which performs distillation during pre-training.

\paragraph{Training Details}
We use a 12-layer BERT-base-uncased model as the teacher, and the students have the same architecture as the teacher but with $6$ layers. We fine-tune the teacher on specific tasks to get the task-specific teacher.
We conduct a hyper-parameter search for the baseline methods and our method in a way similar to~\citet{Sun2019PatientKD}. Appendix~\ref{apx:hyperparameter} gives detailed experimental settings.

\subsection{Main Results}

\begin{table}[t!]
\centering
\caption{
Results from the GLUE evaluation server with the best scores in bold.
The metric for QQP is F1 score and others are accuracy.
Avg. denotes the average score over SST-2, QQP, MNLI-m, MNLI-mm and QNLI.
}

\begin{tabular}{@{}l|cccccc@{}}
\toprule
\textbf{Model} & \textbf{SST-2} &  \textbf{QQP} & \textbf{MNLI-m~/~mm} & \textbf{QNLI} & \textbf{Avg.} \\
\midrule
BERT$_{\text{BASE}}$ & 93.7  & 71.5 & 84.8 / 83.8 & 91.3 & 85.0\\
\midrule
Fine-tuning & 91.0 &  69.6 & 81.3 / 79.5 & 87.3 & 81.7\\
Vanilla KD & 92.0 & 71.0 & 82.2 / 81.2 & 88.9 & 83.1 \\
BERT-PKD & 91.8 & 71.0 & 82.4 / 81.8 & 89.1 & 83.2\\
\midrule
GKD & 92.0 & 71.5 & \textbf{82.9} / 81.7 & 89.3 & 83.5 \\
GKD-CLS &  \textbf{93.0} &  \textbf{71.6} & 82.6 / \textbf{81.9} & \textbf{89.5} & \textbf{83.7} \\
 \ w/ Dropout &  91.8 & 71.0 & 82.3 / 81.6  & 89.1 & 83.2\\
\bottomrule
\end{tabular}
\label{mainresults}
\end{table}

\begin{table}[t!]
\centering
 \caption{
Results obtained by fine-tuning or distilling DistilBERT model on specific tasks.
$^\dag$ denotes the results taken from~\citet{Jiao2019TinyBERT}.
  Detailed experimental settings can be found in Appendix~\ref{apx:sub_hyperparameter}.
}
\begin{tabular}{@{}l|cccccc@{}}
\toprule
\textbf{Model} & \textbf{SST-2} &  \textbf{QQP} & \textbf{MNLI-m/mm} & \textbf{QNLI} & \textbf{Avg.} \\
\midrule
BERT$_{\text{BASE}}$ & 93.7  & 71.5 & 84.8 / 83.8 & 91.3 & 85.0\\
\midrule
DistilBERT$^\dag$ & 92.5 & 70.1 & 82.6 / 81.3 & 88.9 & 83.1 \\
\ \ + Vanilla KD & 92.8 &  70.4 & 83.1 / 81.8 & 90.0 & 83.6\\
\ \ + BERT-PKD & 92.9 & \textbf{71.3} & 83.6 / \textbf{82.8} & 90.1 & 84.1\\
\ \ + GKD-CLS &  \textbf{93.7} &  \textbf{71.3} & \textbf{83.7} / \textbf{82.8} & \textbf{90.2} & \textbf{84.3}\\
\bottomrule
\end{tabular}
\label{distilbert_ret}
\end{table}

Table~\ref{mainresults} presents the test results obtained from the GLUE evaluation server. We find that
(1) Methods with gradient alignment objectives achieve the best performance, verifying our assumption that gradient information benefits the student model.
(2) Introducing gradient alignment on \texttt{[CLS]}~(GKD-CLS) further boosts the performance, since \texttt{[CLS]} representations play a significant role in classification.
(3) De-activating dropout is important. Activating Dropout in GKD-CLS leads to inferior results, which is consistent with our analysis~(Section~\ref{sec:gkd}) that dropout will bias the gradient estimation, thus harming the performance.

\subsection{Analysis}
\label{sec:analysis}
\paragraph{GKD Benefits DistilBERT}
\label{gkddistilbert}
Recently, many knowledge distillation methods~\citep{Sanh2019DistilBERT,Sun2020MobileBERTAC,Jiao2019TinyBERT} have explored knowledge distillation during the pre-training stage to build a task-agnostic model or improve task-specific performance. In these works, knowledge distillation can be performed in two stages---the pre-training stage and fine-tuning stage. Since we lack enough computational resources to perform knowledge distillation at the pre-training stage, we instead utilize the $6$-layer DisilBERT model~\citep{Sanh2019DistilBERT}, which is already distilled at the pre-training stage, to perform further GKD distillation at the fine-tuning stage. Here, as the input embeddings of DistilBERT and BERT-base-uncased do not match, we only align the gradients w.r.t. the [CLS] tokens in the gradient alignment objective of GKD-CLS and do not fix the student input embeddings as the teacher input embedding.
The experimental results are shown in Table~\ref{distilbert_ret}, and the detailed experimental settings can be found in Section~\ref{apx:sub_hyperparameter} in Appendix. The results demonstrate that our GKD method can be integrated into the two-stage distillation procedure and can bring more benefits than other methods.

\paragraph{GKD Improves Output and Interpretation Consistency}
Traditional metrics like accuracy cannot reflect how alike the teacher
and the student behave, which is of great significance in deployments~\citep{xu-etal-2021-beyond}.
To measure the output consistency, we adopt \textbf{Label Loyalty~(LL)} and \textbf{Probability Loyalty~(PL)} following \citet{xu-etal-2021-beyond}.
LL measures the faithfulness between the student predictions and the teacher predictions.
PL measures the distance between the student predictions and the teacher predictions at the distribution level.

Besides, we are interested in whether GKD benefits the consistency of model interpretability, since model interpretation plays an important role in fields like medicine and finance, and a student loyal to the teacher in interpretation is useful. For this purpose, we propose \textbf{Saliency Loyalty~(SL)}.
Specifically, we calculate the teacher's and the student's word saliency distribution using the Grad method~\citep{Ding2019SaliencydrivenWA}, and the SL is defined as the Pearson correlation coefficient between them.

We evaluate different methods using these metrics on SST-2 test set. Results are shown in Table~\ref{tab:sst2_loyalty}.\footnote{Results on MNLI can be found in Table~\ref{tab:mnli_loyalty} in Appendix.}
We observe that incorporating gradient into KD improves the behavior consistency regarding all the metrics, especially in SL, i.e. interpretation consistency.
We also provide a case study of the saliency scores in Figure~\ref{new_case_study_2}, which shows that the saliency scores can vary when all the methods predict the same, and that our methods show the best interpretation consistency, further verifying our motivation.

\begin{table}[t!]
\centering
\caption{Behavior consistency on SST-2 test set. Our GKD methods achieve the best performance on all loyalty metrics, especially on saliency loyalty.
}

\begin{tabular}{@{}l|ccc@{}}
    \toprule
     \textbf{Model} &  \textbf{PL} & \textbf{LL} & \textbf{SL}\\
      \midrule
    BERT$_{\text{BASE}}$ & 100.0 & 100.0 & 100.0\\
\midrule
    Vanilla KD & 93.7 & 93.7 & 31.2 \\

    BERT-PKD & 93.6 & 93.7 & 31.6 \\

    \midrule
    GKD & 93.9 & 94.3 & 49.7 \\
    GKD-CLS & \textbf{94.9} & \textbf{94.9} & \textbf{53.5} \\
     \bottomrule
    \end{tabular}
\label{tab:sst2_loyalty}
\end{table}

\begin{figure}
\begin{center}

\centerline{\includegraphics[width=1.02\linewidth]{new_case_study_2.pdf}}
\caption{Saliency score visualization on SST-2 test set. Words with positive scores are marked green while negative ones red. While all methods predict the sentence as negative, the word saliency distributions vary. Our method achieves the best consistency with the teacher.}
\label{new_case_study_2}
\end{center}

\end{figure}

\section{Conclusion}
In this paper, we propose gradient knowledge distillation~(GKD) by matching the unbiased gradient of the student to that of the teacher.
As the gradient contains higher-order information, the alignment helps the student act more similarly to the teacher.
Experiments show that GKD outperforms baseline methods regarding distillation performance and behavior consistency.
For future work, we intend to integrate our method with different distillation frameworks to further examine its effectiveness.

redpajama_set_name: RedPajamaArXiv


Before children can begin reading, they must develop strong phonemic awareness. If you ask your child, "what is the first sound you hear in hat?" You want them to answer /h/. If you ask your child, "what is the last sound you hear in hat?" You want them to answer /t/. Children need this skill before they can learn to read. Phonemic awareness skills are the basis for reading and without this important skill, potential reading difficulties might occur in the early reading stage. A child who has strong and solid phonemic awareness skills will have a strong reading foundation to develop with. Lets play a fun phonemic awareness game.
On today's post, I am going to share with you a really great movement game that will help your child listen for beginning and ending sounds in words. Your kiddos will really love this fun movement game that helps build phonemic awareness. So… let's get started with Sit or Stand: A fun phonemic awareness game.
You will say two words to your child. The child will stand up if the words begin with the same sound. The child will sit down if the beginning sounds do not match.
You will say two words to your child. The child will stand up if the words end with the same sound. The child will sit down if the ending sounds do not match.
I hope you enjoy this activity. You might also enjoy looking into The PRIDE Reading Program!
This Orton-Gillingham program is easy to follow, heavily scripted out affordable and homeschooling parents teachers and tutors use it with success. The PRIDE Reading Program really helps to improve reading skills in kids.


text:
/*
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 * http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */
package com.addthis.hydra.job.spawn;

import java.util.concurrent.TimeUnit;

import com.addthis.hydra.util.SettableGauge;

import com.yammer.metrics.Metrics;
import com.yammer.metrics.core.Counter;
import com.yammer.metrics.core.Meter;

import static com.addthis.hydra.util.SettableGauge.newSettableGauge;

public final class SpawnMetrics {
    static final SettableGauge<Integer> processingTaskCount = newSettableGauge(Spawn.class, "processingTasks", 0);
    static final SettableGauge<Integer> replicatingTaskCount = newSettableGauge(Spawn.class, "replicatingTasks", 0);
    static final SettableGauge<Integer> backingUpTaskCount = newSettableGauge(Spawn.class, "backingUpTasks", 0);
    static final SettableGauge<Integer> runningTaskCount = newSettableGauge(Spawn.class, "runningTasks", 0);
    static final SettableGauge<Integer> queuedTaskCount = newSettableGauge(Spawn.class, "queuedTasks", 0);
    static final SettableGauge<Integer> queuedTaskNoSlotCount = newSettableGauge(Spawn.class, "queuedTasksNoSlot", 0);
    static final SettableGauge<Integer> failTaskCount = newSettableGauge(Spawn.class, "failedTasks", 0);
    static final SettableGauge<Integer> rebalancingTaskCount = newSettableGauge(Spawn.class, "rebalancingTasks", 0);
    static final SettableGauge<Integer> totalTaskCount = newSettableGauge(Spawn.class, "totalTasks", 0);
    static final SettableGauge<Integer> runningJobCount = newSettableGauge(Spawn.class, "runningJobs", 0);
    static final SettableGauge<Integer> queuedJobCount = newSettableGauge(Spawn.class, "queuedJobs", 0);
    static final SettableGauge<Integer> failJobCount = newSettableGauge(Spawn.class, "failedJobs", 0);
    static final SettableGauge<Integer> hungJobCount = newSettableGauge(Spawn.class, "hungJobs", 0);
    static final SettableGauge<Integer> totalJobCount = newSettableGauge(Spawn.class, "totalJobs", 0);
    static final SettableGauge<Float> diskAvailablePercent = newSettableGauge(Spawn.class, "diskAvailable", 0.0f);

    static final Meter tasksStartedPerHour =
            Metrics.newMeter(Spawn.class, "tasksStartedPerHour", "tasksStartedPerHour", TimeUnit.HOURS);
    static final Meter tasksCompletedPerHour =
            Metrics.newMeter(Spawn.class, "tasksCompletedPerHour", "tasksCompletedPerHour", TimeUnit.HOURS);
    static final Meter jobsStartedPerHour =
            Metrics.newMeter(Spawn.class, "jobsStartedPerHour", "jobsStartedPerHour", TimeUnit.HOURS);
    static final Meter jobsCompletedPerHour =
            Metrics.newMeter(Spawn.class, "jobsCompletedPerHour", "jobsCompletedPerHour", TimeUnit.HOURS);
    static final Meter jobTaskUpdateHeartbeatSuccessMeter =
            Metrics.newMeter(Spawn.class, "jobTaskUpdateHeartbeatSuccess",
                             "jobTaskUpdateHeartbeatSuccess", TimeUnit.MINUTES);

    static final Counter quiesceCount = Metrics.newCounter(Spawn.class, "quiesced");
    static final Counter nonConsumingClientDropCounter = Metrics.newCounter(Spawn.class, "clientDrops");
    static final Counter nonHostTaskMessageCounter = Metrics.newCounter(Spawn.class, "nonHostTaskMessage");
    static final Counter jobTaskUpdateHeartbeatFailureCounter =
            Metrics.newCounter(Spawn.class, "jobTaskUpdateHeartbeatFailure");

    private SpawnMetrics() {}
}


text:
Q: Highcharts column tooltip - always on top + fit the container I have a highchart graph with tooltips. This is how I want to render tooltips every time.

When the tootlip doesn't fit the svg container, highcharts swaps the position of tooltip like this.

I know how to fix this but when I do this.
positioner: function(boxWidth, boxHeight, point) {
    return {
        x: point.plotX,
        y: point.plotY - boxHeight
    };
},

Tooltip is correctly always on top, but overflows to the right(image_1). I would like to have the tooltip always on top + fit the container from the sides. (image_2)

Is there any easy way to achieve this?
Thanks (http://jsfiddle.net/4xomw3aj/)

A: Ok I just found out how to 'not swap'. In Tooltip.getPosition()
firstDimension = function (dim, outerSize, innerSize, point) {
    ret[dim] = point - distance - innerSize;
},

redpajama_set_name: RedPajamaStackExchange


In John, Dr. Sproul confesses that he attained a new depth of understanding of the Gospel when he preached through the book. Nevertheless, he came to the Gospel after much study of it, and that familiarity is readily apparent from the first chapter on the Prologue of John's Gospel to the final chapter on Peter's restoration.
John includes fifty-seven chapters, each of which began as a St. Andrew's sermon. Dr. Sproul deals with major themes as he moves through the book passage by passage. Though the book is an "expositional commentary" that is, it does not deal with each and every verse, it unpacks major themes in Dr. Sproul's easily understandable style. Readers will find invaluable insights into the goals John had in writing his Gospel, the background for Jesus' time, and the meanings of some of John's most difficult passages.
John is an easily readable introduction to this unique record of Jesus' life, packed with insights and exhortations that will draw the reader closer to the Savior and encourage him or her to a greater depth of love and devotion to Him.
Let me just say that you can still download and read this book on your computer, even if you don't have a Kindle (yet). You can learn about reading these books on your computer here.


text:
Two Western Lowland Gorillas AT MCZ will Relocate to New Home
Mother Shalia and youngster Sulaiman (Sully), October 2018
We're happy to report that Shalia and Sully transferred safely to the Columbus Zoo and Aquarium on Sept. 3.
After several weeks of acclimating to their new surroundings and introductions to the new troop, we'll post updates here, and on our social media platforms.
Sully is 4 ½ years old
The Milwaukee County Zoo's 17-year-old female western lowland gorilla, Shalia, and her offspring, 4 ½ -year-old male, Sulaiman (Sully), will soon transfer to a gorilla family unit at the Columbus Zoo and Aquarium.
Sadly, Sully's father, Cassius, passed away unexpectedly in April 2018, as did adult female, Naku. Shalia, Sully, and Cassius and Naku's offspring, female Zahra, were the remaining gorillas in the family group. After participating in several months of human-assisted rearing, Zahra (Sully's half-sister), who was 9 months old at the time, transferred to the Columbus Zoo and Aquarium in June 2018, per the recommendation of the Western Lowland Gorilla Species Survival Plan® (SSP). She joined a stable family unit with a female gorilla to act as a surrogate mother, and an accepting silverback male.
Sully will reunite with half-sister Zahra at the Columbus Zoo
With Shalia and Sully as the remaining family group, MCZ consulted with the Gorilla SSP and it was decided that the best environment for mother and youngster was to be placed at the Columbus Zoo within a social gorilla situation which included a silverback adult male gorilla, other females and juveniles of varying ages.
"It's important for Sully's social development and long-term welfare, to have bonding opportunities with other young males and have an adult male provide stability," says Apes/Primates Curator Trish Khan.
The Columbus Zoo will offer Shalia and Sully a suitable family unit, in joining with a silverback, Mac, and his family. Mac has a history of accepting offspring other than his own, and his family group consists of several adult females and their offspring, as well as Zahra.
Zahra, April 2018
"While this relocation is bittersweet for MCZ staff and visitors, we know it affords the best opportunity for Shalia and Sully to thrive and interact with other gorillas of differing ages, including a silverback male who acts as a group leader and will teach Sully "etiquette" as well as his role within the group," says Zoo Director Chuck Wikenhauser. "It's also a wonderful opportunity for Zahra to be reunited with both gorillas."
The Milwaukee County Zoo's lead gorilla keeper will accompany Shalia and Sully, to make the transition as smooth as possible. Shalia and Sully will be transferred within the next few weeks, and MCZ will announce when they have arrived at their new home at the Columbus Zoo.
The Columbus Zoo is a location close enough for the Milwaukee County Zoo's gorilla team to assist with the transition and visit often.
The remaining western lowland gorillas at the Zoo include two males, half-brothers Maji (28 years old) and Hodari, (24 years old). Both have spent most of their lives here together. They will remain at MCZ, and bachelor groups like Maji and Hodari are necessary in zoo populations to provide for the social needs of other non-breeding males. The Zoo will work with the SSP for future recommendations of additional gorillas at MCZ in the coming months.
For more information, please contact the Zoo's Marketing and Communications Department at (414) 256-5411.


A biography of one of the Chicago's greatest mayors. See him on the campaign trail to victory. Includes quotes from local celebrities.
African American in our society. Uplifting and inspiring.
"…Love can sometimes be overwhelming, emotional and even painful. But true love can always stand the test of time. The pleasure of being in love, and the pleasure of being loved by someone, brings about a feeling of ecstasy, wholeness and contentment." – Re-live the feeling and share this book with someone special.


Mrs. Bremer's Class: Choosing Your Next Read Aloud- Class Voting!
Choosing Your Next Read Aloud- Class Voting!
My students always LOVE read aloud time, and it is such an important time of the day!
Students learn to listen, visualize, and predict what will happen in the story. They are exposed to the modeling of fluent reading and expression. And it's fun to see where the author takes us each day!
I always let the class vote on what book we should read next. I give them a selection of three choices. Students write their name on the sticky note of the story of their choosing. The one with the most votes wins!
In my next post, I will be sharing what books my second graders liked the best...and which ones they did not enjoy at all!
I appreciate your blog. It is great and very helpful. I would like to ask if you can tell me where you get this hand from.
I would be very thankful if you would kindly let me know where you get this hand from. Thank you in advance.


Description: Includes an appointed Chair and Vice-Chair. This Committee is responsible for obtaining sponsors as well as administering the various financial opportunities for our sponsors. The Committee will work with the sponsors to ensure that the sponsors' and Chapter's needs are being met.


text:
Labour won't win UK election, says senior member in leaked recording
Senior member of opposition Labour Party doesn't see Jeremy Corbyn becoming prime minister. (AP pic)
LONDON: A senior member of Britain's opposition Labour Party has dismissed the chances of the party winning power in Thursday's general election, speaking in a private conversation leaked to the Guido Fawkes news website.
The Labour Party are trailing Prime Minister Boris Johnson's Conservative Party in opinion polls ahead of the election which will decide the fate of Brexit and the ideology that underpins the world's fifth-largest economy.
Labour's health spokesman Jon Ashworth said in the recordings that the situation in seats outside cities was "abysmal", blaming the party's Brexit policy and voters' perception of leader Jeremy Corbyn.
"I just can't see it happening," Ashworth said when asked how to prepare for Corbyn becoming prime minister. The recording appears to have been made before last week's visit by US President Donald Trump.
"Outside of the city seats, if you're in small-town Midlands and the North, it's abysmal out there. They don't like Johnson, but they can't stand Corbyn and they think Labour's blocked Brexit."
Guido Fawkes is a website critical of Corbyn which says its aim is to campaign against political sleaze, corruption and hypocrisy.
Ashworth did not contest the contents of the recording but responded by saying the conversation was "banter" with an old friend who worked as an activist for the Conservative Party.
"We're going to win this general election," he said in a BBC interview. "I was having a bit of banter with a Tory (Conservative) friend of mine – at least I thought he was a friend."
Previous articleSabah DCM upset pleas ignored after death of another pygmy elephant
Next articleMangsa banjir Beaufort, Membakut naik 206 orang
China deal is Trump's hedge against impeachment damage
UK's Johnson plans to relocate House of Lords up north


How many do you want printed?
This Deluxe Bottle Opener Keyring is the perfect practical, classy and quality wedding favour!
These keyrings can be printed with a dome sticker to include your names and wedding date or artwork.
New and improved 4 Him Multi Tool Keyring! An ideal gift for the gents at your function.
These DIY wedding mini rustic fabric sweet bags are quick and easy to fill for a cheap wedding favour.
This useful wedding favour is the perfect way to thank your special guests. A practical and cheap wedding favour!
The `Love' Heart keyring is a useful and affordable gift with optional personalisation.
Make sure your guests always remember your magical day with the perfect keepsake!
©Copyright 2018 by Sugarbird Weddings. Website designed by Latitude Zero Designs. All Rights Reserved.


You've probably already seen the trailers for Pixar's next movie, Ratatouille. I'm a big Pixar fan, going back to the Luxo Jr. days.
So, have you heard about the Pixar movie coming out in 2008? It's called WALL-E, and you can view a preview trailer here.
Joe Ranft, died yesterday. He was the head of Pixar's story department, the voice of "Wheezy" in the Toy Story movies, "Heimlich" in "A Bug's Life" and worked on many other animation projects before joining Pixar.


Another shell script that came from a customer request. The customer had 500+ gateways that they needed to replace a log server on each (remove old and add new) Customer is an MDS shop but I added SMS scripts as well to perform the same functions.
The script is setup to run on the Mgmt station itself and uses the 'mgmt_cli -r true' function. The script will list all servers with the logging blade enabled to ensure spelling is correct when used. The output file is already executable and ready to run to complete changes.
This version will output the replace script for all gateways of a given Domain. It will allow you to remove one log server and add one, all in one script.
This version will output the add script for all gateways of a given Domain. It will allow you to add one log server to all gateways at once.
This version will output the remove script for all gateways of a given Domain. It will allow you to remove one log server from all gateways at once.
This version will output the replace script for all gateways of a given Managment Server. It will allow you to remove one log server and add one, all in one script.
This version will output the add script for all gateways of a given Managment Server. It will allow you to add one log server to all gateways at once.
This version will output the remove script for all gateways of a given Managment Server. It will allow you to remove one log server from all gateways at once.
Feedback welcome this was a simple project that came out of a client request.
I suggest that you pack all of your usefull utility scripts (from the past too) into a one big library package, running each script with parameters, API wise.


text:
El marquesado de San Millán es un título nobiliario español creado por el rey Carlos II con real decreto del 23 de abril de 1688 y real despacho del 11 de julio de 1689 a favor de Miguel de Oquendo y San Millán, en memoria de su abuelo paterno, el almirante Antonio de Oquendo, caballero de la Orden de Santiago.

Marqueses de San Millán
 Miguel Carlos de Oquendo y San Millán (m. Lasarte, 1693) I marqués de San Millán, general de la Armada y de la Escuadra del Cantábrico. Era hijo de Miguel de Oquendo y Molina, caballero de la Orden de Santiago —hijo ilegítimo del almirante Antonio de Oquendo y de Ana de Molina—, y de Teresa de San Millán y Oquendo.
 Le sucedió su hermana:

Micaela de Oquendo y San Millán (San Sebastián, 19 de abril de 1655-11 de septiembre de 1738), II marquesa de San Millán.
 Casó el 4 de junio de 1673 en Lasarte con José de Aguirre y Zavala (también llamado José de Aguirre Engómez y Zavala) (San Sebastián, 7 de octubre de 1643-1701). Le sucedió su hijo:

José Antonio de Aguirre y Oquendo (11 de septiembre de 1683-6 de noviembre de 1720), III marqués de San Millán, sucesor de las casas y mayorazgos de Oquendo, San Millán, Engómez, etc. Diputado general de Guipúzcoa y alcalde de San Sebastián.
 Casó en primeras nupcias el 18 de abril de 1728 con Fausta de Sarría e Iñara (2 de julio de 1690-1711). Contrajo un segundo matrimonio el 2 de mayo de 1714 con Inés de Aizaga y Uriarte, con sucesión. Le sucedió su hijo del primer matrimonio:

Francisco de Aguirre y Sarriá (m. 17 de agosto de 1739), IV marqués de San Millán, diputado general de Guipúzcoa, señor de las casas y mayorazgos de Oquendo, San Millán, Aguirre, Zavala, etc.
 Casó con María Teresa Porcel y Manrique de Arana (Granada, 1711/1714-4 de enero de 1794), hija de Juan Fernando Porcel y Porcel y de su esposa Atanasia Bárbara Manrique de Arana y Zaldívar, III marquesa de Villa Alegre, hija de José Manrique de Arana e Iraola, I marqués de Villa Alegre Le sucedió su hijo:

Joaquín de Aguirre y Porcel (San Sebastián, 1729-7 de julio de 1817), V marqués de San Millán, caballero Guardia Marinas, recibido el 16 de mayo de 1746, maestrante de Granada, recibido el 24 de mayo de 1743,
Casó en primeras nupcias con María Joaquina Vicuña y Oyarbide. Le sucedió su bisnieto:

Luciano Porcel y Valdivia (Beasáin, 8 de enero de 1813-5 de febrero de 1873), VI marqués de San Millán, sucediendo a su bisabuelo paterno materno, el V marqués, y VI marqués de Villa Alegre, sucediendo a su abuelo paterno, Juan Bautista Porcel y Cañaveral. Fue senador en la legislatura de 1871-1872 por la provincia de Guipúzcoa, hijo de Trinidad Antonio de la Santísima Trinidad Porcel y Aguirre, caballero de la Maestrante de Granada —hijo de Juan Bautista Porcel, natural de Granada, y de Brígida de Aguirre—, y de su esposa Rafaela de Valdivia y Bravo.
 Casó en primeras nupcias en San Sebastián el 22 de diciembre de 1856 con Asunción de Guirior y Azcona (m. 15 de marzo de 1860) y en segundas con Javiera de Guirior y Azcona, hermana de su primera esposa. Le sucedió su hija del primer matrimonio:

Basilia María de la Blanca Porcel y Guirior (1859-11 de febrero de 1940), VII marquesa de San Millán y VII marquesa de Villa Alegre.
 Casó con Ramón de Altarriba y Villanueva, XXIV barón de Sangarrén. De este matrimonio nacieron dos hijos, Ramón, fallecido joven sin descendencia, y Jaime de Altarriba y Porcel que fue el XII conde de Robres y XXV barón de Sangarrén.

María de la Concepción Zavala Cincunegui, VIII marquesa de San Millán desde 1943, título convalidado en 1950, sexta nieta de la II marquesa de San Millán.
 Casó con Francisco Javier Ureta Irigoyen. Le sucedió su hijo:

José Luis Ureta Zabala (m. Vigo, 12 de diciembre de 1967), IX marqués de San Millán.
 Le sucedió su hermano:

Ignacio Miguel Ureta Zabala, X marqués de San Millán
Le sucedió su hijo:

Francisco Javier Ureta Gómez de Tejada, XI marqués de San Millán
 Le sucedió su hijo:

Ignacio Javier Ureta y Mayans, XII marqués de San Millán.

Notas

Referencias

Bibliografía

San Millán
San Millán
España en 1688
España en 1689


Volunteers on dedication day at the 2018 Millard Fuller Legacy Build in Americus on April 20, 2018.
photos from each day of the build here.
you would like to share with other volunteers?
special Volunteer Photos Submissions gallery.


text:
Грета Лоран (; ) — итальянская лыжница, участница Олимпийских игр 2014 и 2018 годов. Специализируется в спринтерских гонках.

Карьера
В Кубке мира Лоран дебютировала 3 декабря 2011 года, на следующий день первый раз попала в тридцатку лучших на этапе Кубка мира, в командном спринте. Всего на сегодняшний момент имеет 15 попаданий в тридцатку лучших на этапах Кубка мира, 7 в командном спринте и 8 в личном. Лучшим достижением Лоран в общем итоговом зачёте Кубка мира является 104-е место в сезоне 2012-13.

На Олимпийских играх 2014 года в Сочи заняла 26-е место в спринте.

За свою карьеру принимала участие в одном чемпионате мира, на чемпионате мира 2011 года была 31-й в спринте.

Использует лыжи и ботинки производства фирмы Rossignol.

Личная жизнь
Жена лыжника Федерико Пеллегрино.

Примечания

Лыжники Италии
Лыжники на зимних Олимпийских играх 2014 года
Лыжники на зимних Олимпийских играх 2018 года


In graduate school, the relationship between the graduate student and his or her adviser is crucial to the student's development. Graduate students rely on their advisers to mentor them through all aspects of their career development: choosing and developing a dissertation topic, networking, presenting material at conferences, preparing work for publication, and venturing onto the job market. The AHA recognizes the importance of mentoring through its Nancy Lyman Roelker Mentorship Award. Since 1992, the award has recognized graduate, undergraduate, and high school teachers for excellence in mentoring. Yet the profession does not offer much instruction to graduate mentors as to what they are expected to do, nor are all graduate students completely aware of what they can reasonably expect from their advisers.
With the hope of better understanding the nature of graduate advising, the AHA's Committee for Graduate Students sponsored a panel at the 2007 meeting of the Association: "Graduate Mentoring: Issues and Perspectives." Four skilled mentors of graduate students—John French (Duke Univ.), Elizabeth Lunbeck (Vanderbilt Univ.), Terry Seip (Univ. of Southern California), and Ronald Walters (Johns Hopkins Univ.)—spoke at a roundtable about their own experiences mentoring students. Three of these speakers have made their comments available for Perspectives. John French gives us an overview of graduate mentoring, identifying and assessing the different models that professors have adopted. Terry Seip provides a detailed look at one critical component of mentoring: training graduate students to become teachers. Ronald Walters offers some conclusions on mentoring students with diverse needs and working styles.
The CGS thanks all of the panelists for making their thoughts available in Atlanta and here in Perspectives, and hopes that students and advisers will use these essays as a starting point for their own considerations of this important relationship.
—Aaron Marrs, a member of the Perspectives editorial advisory board, is a historian in the Office of the Historian at the U.S. Department of State. The views expressed by the author in this essay are solely those of the author and are not necessarily the official view of the Office of the Historian, the U.S. Department of State, or the U.S. government.


text:
using System;
using System.Collections.Generic;
using System.Diagnostics;
using System.IO;
using System.Text;
using System.Threading;
using System.Threading.Tasks;

using Microsoft.Extensions.Hosting;
using Microsoft.Extensions.Logging;

using Serilog;

using murrayju.ProcessExtensions;

using GreenInstall;
using DigitalPlatform;
using DigitalPlatform.MessageClient;

namespace dp2Commander
{
    public class Worker // : BackgroundService
    {
        // private readonly ILogger<Worker> _logger;
        P2PConnection _connection = new P2PConnection();
        string _userName = "";

#if OLD
        public Worker(ILogger<Worker> logger)
        {
            _logger = logger;
        }

        protected override async Task ExecuteAsync(CancellationToken stoppingToken)
        {
            _connection.AddMessage += _connection_AddMessage;
            /*
            Test();
            await Task.Delay(TimeSpan.FromSeconds(10), stoppingToken);
            ExitProcess("dp2SSL");
            */

            while (!stoppingToken.IsCancellationRequested)
            {
                Console.WriteLine("running ...");
                await EnsureConnectMessageServerAsync();
                // _logger.LogInformation("Worker running at: {time}", DateTimeOffset.Now);
                await Task.Delay(TimeSpan.FromSeconds(10), stoppingToken);
            }

            _connection?.CloseConnection();
        }
#endif

        #region TOPSHELF

        private string[] args;

        public Worker(string[] vs)
        {
            args = vs;
        }

        // 检查网络连接的间隔时间
        static TimeSpan _idleLength = TimeSpan.FromMinutes(5);   // 5 // TimeSpan.FromSeconds(10);

        public async Task ExecuteAsync(CancellationToken stoppingToken)
        {
            Log.Information("Enter ExecuteAsync -----");

            /*
            EventLog logListener = new EventLog("Security");
            logListener.EntryWritten += LogListener_EntryWritten;
            logListener.EnableRaisingEvents = true;
            */

            WriteInfoLog("开始工作");
            _connection.AddMessage += _connection_AddMessage;
            /*
            Test();
            await Task.Delay(TimeSpan.FromSeconds(10), stoppingToken);
            ExitProcess("dp2SSL");
            */

            try
            {
                while (!stoppingToken.IsCancellationRequested)
                {
                    Console.WriteLine("running ...");
                    await EnsureConnectMessageServerAsync();
                    // _logger.LogInformation("Worker running at: {time}", DateTimeOffset.Now);

                    await Task.Delay(_idleLength, stoppingToken);
                }
            }
            catch (TaskCanceledException)
            {

            }
            catch (Exception ex)
            {
                WriteErrorLog($"ExecuteAsync() 内循环体出现异常: {ExceptionUtil.GetDebugText(ex)}"); ;
            }

            _connection.AddMessage -= _connection_AddMessage;
            _connection?.CloseConnection();
            WriteInfoLog("结束工作");
        }

        private void LogListener_EntryWritten(object sender, EntryWrittenEventArgs e)
        {
            //4624: An account was successfully logged on.
            //4625: An account failed to log on.
            //4648: A logon was attempted using explicit credentials.
            //4675: SIDs were filtered.
            var events = new int[] { 4624, 4625, 4648, 4675 };
            if (Array.IndexOf(events, e.Entry.EventID) != -1)
                WriteInfoLog($"event message: EventID:{e.Entry.EventID},InstanceID:{e.Entry.InstanceId}, TimeGenerated:{e.Entry.TimeGenerated}, Message:{e.Entry.Message}");

            // WriteInfoLog($"event message: EventID:{e.Entry.EventID},InstanceID:{e.Entry.InstanceId}, Message:{e.Entry.Message}");
        }

        CancellationTokenSource _cancel = new CancellationTokenSource();

        public void Start()
        {
            WriteInfoLog("Service Start");

            _cancel?.Cancel();
            _cancel = new CancellationTokenSource();

            Task.Factory.StartNew(
                async () =>
                {
                    await ExecuteAsync(_cancel.Token);
                },
                _cancel.Token,
                TaskCreationOptions.LongRunning,
                TaskScheduler.Default);
        }

        public void Stop()
        {
            WriteInfoLog("Service Stop");

            _cancel?.Cancel();
        }

        #endregion

        private void _connection_AddMessage(object sender,
            DigitalPlatform.MessageClient.AddMessageEventArgs e)
        {
            if (e.Records != null)
            {
                foreach (var record in e.Records)
                {
                    Console.WriteLine($"message sender:{record.creator}, userName:{record.userName}, groups:{string.Join(",", record.groups)}, data:{record.data}");
                }

                if (e.Action == "create")   // 2020/11/30
                {
                    Task.Run(async () =>
                    {
                        await ProcessAndReply(e.Records);
                    });
                }
            }
        }

        async Task ProcessAndReply(List<MessageRecord> records)
        {
            try
            {
                List<MessageRecord> new_messages = new List<MessageRecord>();
                foreach (var record in records)
                {
                    var result_text = ProcessCommand(record.data);
                    if (result_text == null)
                        continue;

                    WriteInfoLog($"响应文字 '{result_text}'");
                    new_messages.Add(new MessageRecord
                    {
                        groups = record.groups,
                        data = result_text
                    });
                }

                if (new_messages.Count > 0)
                {
                    SetMessageRequest param = new SetMessageRequest("create",
            "dontNotifyMe",
            new_messages);

                    var result = await _connection.SetMessageAsyncLite(param);
                    if (result.Value == -1)
                    {
                        WriteErrorLog($"reply message error: {result.ErrorInfo}");
                    }
                }
            }
            catch (Exception ex)
            {
                WriteErrorLog($"ProcessAndReply() 出现异常: {ExceptionUtil.GetDebugText(ex)}");
            }
        }

        string ProcessCommand(string text)
        {
            if (text.StartsWith($"@{_userName}") == false)
                return null;

            string command = text.Substring($"@{_userName}".Length).Trim();

            WriteInfoLog($"收到命令 {text}");

            if (command.StartsWith("hello"))
            {
                return "hello!";
            }

            if (command.StartsWith("version"))
            {
                return Program.Version;
            }

            /*
            if (command.StartsWith("test"))
            {
                //bool existence = Directory.Exists("c:\\用户\\xietao\\dp2ssl");
                //return $"OK={existence}";
                DirectoryInfo di = new DirectoryInfo("c:\\Users");
                var fis = di.GetFiles();
                StringBuilder temp = new StringBuilder();
                foreach (var fi in fis)
                {
                    temp.AppendLine(fi.FullName);
                }
                return temp.ToString();
            }
            */

            // 重启电脑,或者重启 dp2ssl
            if (command.StartsWith("restart"))
            {
                return ProcessRestart(command);
            }

            return $"未知的命令 '{command}'";
        }

        string ProcessRestart(string command)
        {
            // 子参数
            string param = command.Substring("restart".Length).Trim().ToLower();
            if ( // string.IsNullOrEmpty(param)
                param == "computer")
            {
                // 重启电脑
                Task.Run(async () =>
                {
                    try
                    {
                        // 为 dp2ssl 开机后自动重启预先设定好 cmdlineparam.txt 文件
                        WriteParameterFile();

                        await Task.Delay(1000);
                        // https://stackoverflow.com/questions/4286354/restart-computer-from-winforms-app
                        ProcessStartInfo proc = new ProcessStartInfo();
                        proc.WindowStyle = ProcessWindowStyle.Hidden;
                        proc.FileName = "cmd";
                        proc.Arguments = "/C shutdown -f -r";
                        Process.Start(proc);
                    }
                    catch
                    {

                    }
                });
                return "服务器将在一秒后重新启动";
            }
            if (param != null && param.StartsWith("dp2ssl"))
            {
                // 子参数。默认 silently
                bool silently = true;
                {
                    string arg = param.Substring("dp2ssl".Length).Trim();
                    if (arg != null && arg.StartsWith("interact"))
                        silently = false;
                }

                // 重启 dp2ssl
                ExitProcess("dp2SSL", false);
                Thread.Sleep(5000);
                if (HasModuleStarted(MutexName) == true)
                {
                    ExitProcess("dp2SSL", true);
                }

                try
                {
                    bool needReboot = false;

                    // 启动
                    // StartModule(ShortcutPath, "");
                    // Process.Start("c:\\dp2ssl\\dp2ssl.exe");
                    string exe_path1 = "c:\\dp2ssl\\greensetup.exe";
                    string exe_path2 = "c:\\dp2ssl\\dp2ssl.exe";
                    if (File.Exists(exe_path1))
                    {
                        // 注意命令行参数第一个字符应该是空格
                        ProcessExtensions.StartProcessAsCurrentUser(exe_path1,
                            silently ? " silently" : "");
                    }
                    else if (File.Exists(exe_path2))
                    {
                        // 启动之前,检查 .zip 是否已经展开
                        {
                            string binDir = "c:\\dp2ssl";
                            // *** 检查状态文件
                            // result.Value
                            //      -1  出错
                            //      0   不存在状态文件
                            //      1   正在下载 .zip 过程中。.zip 不完整
                            //      2   当前 .zip 和 .exe 已经一样新
                            //      3   当前 .zip 比 .exe 要新。需要展开 .zip 进行更新安装
                            //      4   下载 .zip 失败。.zip 不完整
                            //      5   当前 .zip 比 .exe 要新,需要重启计算机以便展开的文件生效
                            var check_result = GreenInstaller.CheckStateFile(binDir);
                            // 展开
                            if (check_result.Value == 3)
                            {
                                // return:
                                //      -1  出错
                                //      0   成功。不需要 reboot
                                //      2   成功,但需要立即重新启动计算机才能让复制的文件生效
                                var extract_result = GreenInstaller.ExtractFiles(binDir);
                                if (extract_result.Value == -1)
                                {
                                    // TODO: 写入错误日志
                                    WriteErrorLog($"展开压缩文件时出错: {extract_result.ErrorInfo}");
                                }
                                else if (extract_result.Value == 2)
                                {
                                    needReboot = true;
                                }
                            }
                            else if (check_result.Value == 5)
                                needReboot = true;
                        }

                        // 注意命令行参数第一个字符应该是空格
                        ProcessExtensions.StartProcessAsCurrentUser(exe_path2,
                            silently ? " silently" : "");
                    }
                    else
                        return $"{exe_path1} 和 {exe_path2} 均未找到,无法启动";

                    if (needReboot)
                        return "dp2SSL 已经重新启动。请注意部分文件未能立即更新,需要重新启动 Windows";
                    return "dp2SSL 已经重新启动";
                }
                catch (Exception ex)
                {
                    return $"启动过程出现异常: {ExceptionUtil.GetDebugText(ex)}";
                }
            }

            return $"命令 '{command}' 未知的子参数 '{param}'";
        }

        // 准备命令行参数文件
        static bool WriteParameterFile()
        {
            try
            {
                string binDir = "c:\\dp2ssl";
                if (Directory.Exists(binDir))
                {
                    string fileName = System.IO.Path.Combine(binDir, "cmdlineparam.txt");
                    File.WriteAllText(fileName, "silently");
                    return true;
                }
                return false;
            }
            catch (Exception ex)
            {
                WriteErrorLog($"准备命令行参数文件时出现异常: {ExceptionUtil.GetDebugText(ex)}");
                return false;
            }
        }

        static bool _warning = false;

        // 确保连接到消息服务器
        public async Task EnsureConnectMessageServerAsync()
        {
            try
            {
                var account_result = Program.GetMessageAccount();

                if (string.IsNullOrEmpty(account_result.Url) == true)
                {
                    if (_warning == false)
                    {
                        WriteInfoLog("警告: 尚未设置 dp2mserver 服务器 url 和其他参数");
                        _warning = true;
                    }
                    return;
                }

                if (string.IsNullOrEmpty(account_result.Url) == false
                    && _connection.IsDisconnected)
                {
                    var connect_result = await _connection.ConnectAsync(account_result.Url,
                        account_result.UserName,
                        account_result.Password,
                        "");
                    if (connect_result.Value == -1)
                        WriteErrorLog($"连接消息服务器失败: {connect_result.ErrorInfo}。url={account_result.Url},userName={account_result.UserName},errorCode={connect_result.ErrorCode}");
                    else
                        WriteInfoLog($"连接消息服务器 {account_result.Url} 成功");

                    _userName = account_result.UserName;

                    /*
                    if (connect_result.Value == -1)
                        WpfClientInfo.WriteErrorLog($"连接消息服务器失败: {result.ErrorInfo}。url={messageServerUrl},userName={messageUserName},errorCode={result.ErrorCode}");
                    else
                    {
                    }
                    */
                }
            }
            catch (Exception ex)
            {
                WriteErrorLog($"EnsureConnectMessageServerAsync() 出现异常: {ExceptionUtil.GetDebugText(ex)}");
            }
        }

        static string ShortcutPath = "DigitalPlatform/dp2 V3/dp2SSL-自助借还";
        static string MutexName = "{75BAF3F0-FF7F-46BB-9ACD-8FE7429BF291}";

        static bool Test()
        {
            if (HasModuleStarted(MutexName) == true)
                return false;

            // 启动
            StartModule(ShortcutPath, "minimize");
            return true;
        }

        public static bool HasModuleStarted(string mutex_name)
        {
            bool createdNew = true;
            // mutex name need contains windows account name. or us programes file path, hashed
            using (Mutex mutex = new Mutex(true,
                mutex_name, // "dp2libraryXE V3",
                out createdNew))
            {
                if (createdNew)
                    return false;
                else
                    return true;
            }
        }

        public static bool StartModule(
            string shortcut_path,
            string arguments)
        {
            string strShortcutFilePath = GetShortcutFilePath(
                    shortcut_path
                    // "DigitalPlatform/dp2 V3/dp2Library XE V3"
                    );

            if (File.Exists(strShortcutFilePath) == false)
                return false;

            // https://stackoverflow.com/questions/558344/clickonce-appref-ms-argument
            // Process.Start(strShortcutFilePath, arguments);

            // https://stackoverflow.com/questions/46808315/net-core-2-0-process-start-throws-the-specified-executable-is-not-a-valid-appl
            var p = new Process();
            p.StartInfo = new ProcessStartInfo(strShortcutFilePath)
            {
                UseShellExecute = true,
                Arguments = arguments,
            };
            p.Start();
            return true;
        }

        // get clickonce shortcut filename
        // parameters:
        //      strApplicationName  "DigitalPlatform/dp2 V3/dp2内务 V3"
        public static string GetShortcutFilePath(string strApplicationName)
        {
            // string publisherName = "Publisher Name";
            // string applicationName = "Application Name";
            return Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.Programs), strApplicationName) + ".appref-ms";
        }

        // https://stackoverflow.com/questions/3411982/gracefully-killing-a-process
        public static bool ExitProcess(string processName, bool kill)
        {
            int count = 0;
            foreach (var process in Process.GetProcessesByName(processName))
            {
                // 返回结果:
                //     true if the close message was successfully sent; false if the associated process
                //     does not have a main window or if the main window is disabled (for example if
                //     a modal dialog is being shown).
                //
                // 异常:
                //   T:System.InvalidOperationException:
                //     The process has already exited. -or- No process is associated with this System.Diagnostics.Process
                //     object.
                if (kill == true || process.CloseMainWindow() == false)
                {
                    process.Kill(true);
                }
                count++;
            }

            return count != 0;
        }

        static void WriteErrorLog(string text)
        {
            // Log.Logger.Write(LogEventLevel.Error, text);

            // Program.WriteErrorLog("[ERROR] " + text);
            Log.Error(text);

            // Console.WriteLine(text);
        }

        static void WriteInfoLog(string text)
        {
            //Log.Logger.Write(LogEventLevel.Error, text);

            // Program.WriteErrorLog("[INFO] " + text);
            Log.Information(text);

            // Console.WriteLine(text);
        }
    }

}


text:
This course combines the study of language and literature. You will consider how language works; how it has changed over time; how it is spoken by people, both in real contexts and in books, films, and plays; and how writers use different styles according to different genres and purposes. You will look at many forms of writing: novels, poetry, newspaper and magazine articles, transcripts, short stories, plays and television dramas, and consider why language is used in a certain way and assess its effects.
You will learn to adapt your own writing style for different genres, audiences, and purposes, for example, a radio play, travel writing, teenage magazine articles or even an episode of your favourite TV series. As well as learning aspects of grammar and developing an understanding of appropriate terminology, you will focus on how language and social attitudes have changed over time.
How language works
How it is spoken by people in real life and in books, films, and plays
How to adapt your writing for different genres, audiences, and purposes
How language and social attitudes have changed over time
Qualification Type: A Levels
Study Location: Attlee A Level Academy
Grade 6 or above in GCSE English, You must have at least 5 GCSEs grades 9-4 including English and Maths producing an average point score of 42 and at least one grade 6 in a written subject.
University to study Media, Journalism, Marketing and Advertising
Who is the course available for: 16-18
Other courses available: