How Do Vehicle Trade-Ins Work?
When you're ready to purchase your next vehicle, you may wonder what to do with your current ride. You could take the time and effort to sell it yourself, finding a willing buyer and handling all the paperwork yourself. You may save yourself the hassle and consider trading your old car into the same dealership that owns your new purchase. With a trade-in, your old car's value will go toward the cost of your new car, defraying the cost of your down payment and possibly lowering the cost of your auto loan and subsequent monthly payments.
Before you trade in your vehicle, do a little research first. You can look up the fair market value of your current car at Kelley Blue Book or Edmunds. These companies take into account factors such as your auto's make, model year, mileage, equipment, and condition. Be realistic about the condition of your car. Very few vehicles will be in "excellent" or "outstanding" shape, especially if you've been driving the car every day for the past few years. Once you've got a price range for the value of your automobile, you'll have a better idea if the dealer's offer is a fair price.
Next, make an appointment with the dealership to have your vehicle appraised. The dealer's appraisers will conduct an assessment of your car and make an offer for what they're willing to pay for it. Not every dealer is going to quote you the same price, so it can be beneficial to shop around and see what other dealers can offer you. Most dealers won't offer as much money for your ride as a private seller might, but trading your vehicle offers freedom from the time and hassle of a private sale.
When you're ready to seal the deal, here's the best part of trade-ins — the dealer will handle all the complicated paperwork from here. And as a bonus, in North Carolina, the value you received from your trade-in isn't subject to sales tax, which will lower the total amount of tax you'll pay on your new car.
Purchasing a vehicle can be a confusing process and AAA is here to help. Call 1-866-710-6226 to learn more about AAA Auto Buying Service, finance, and maintenance plans. You can chat with our experts online or let us know what you are looking for and we will contact you. Whether you're in the market for a new or pre-owned vehicle, AAA Auto Buying makes car buying easy.


text:
Law enforcement professionals and experienced Neighborhood Watch coordinators will tell you that most people don't become actively involved in crime prevention until they become a victim. Then, after overcoming the initial shock, fear and feeling of helplessness, they become obsessed with preventing future crime in their communities and catching the perpetrators.
Art Hanson came home on a Sunday morning in October 2004 and found his family's house ransacked. Thieves had broken out a window and gone through everything. They stole computers, cell phones, cameras – even his son's piggy bank. After calling the police and filing a report he posted a note on the local community bulletin board offering a reward and asking for information about the crime. Over the course of the next few days he discovered that his house was only one of many that had been recently broken into. In fact, there had been a rash of break-ins in the community that had started about 3 months prior. Each victim knew very little but, by working together with other community members, they were able to put all the little pieces together to tell a compelling story. The perpetrators were eventually caught and Art and his family, as well as a few of the other victims, recovered some of their property.
Art has remained obsessed with crime prevention and started first Watch Jefferson County, then Nation of Neighbors, in an effort to help other communities achieve the same success.
Ron Sikerica was in the process of designing an independent website to facilitate resident communication and interaction for his community's Safety Patrol (Shannondale Safety Patrol) when Art contacted him to join the Watch Jefferson County effort.
Ron brings a breadth of both professional and personal experience to Nation of Neighbors. After serving as a Capt. in the U.S. Army, he earned his M.S. in counseling and has worked at a non-profit treatment center for children. He has also been an active member and participant in his community for the past 17 years.
The recognition of proliferating drug and alcohol use as major factors in causing or exacerbating treatment issues in children, along with the realization that most criminal activity was driven by the use of illicit drugs, led him to join the efforts of his community Safety Patrol in trying to make his community safer for residents - especially the younger ones. At the point when Ron joined the Safety Patrol, residential break-ins had surged to almost 100 incidents a year in his community of over 1300 homes. Most of the crimes were committed by chronic drug users or "career criminals" from outside the community.
As a leader of his community Safety Patrol for the past 12 years, he has focused on the integration of training as well as many safety and technology features, including their current communication system..

redpajama_set_name: RedPajamaCommonCrawl


I am itching to play warcraft3 but it stills 20$.....for such old game.Do blizzard ever put them on sale?I never saw them to on sale well at least me.Or is it worth it for the full price?
WC3 rarely goes on sale. You could try a key site to see if they have it cheaper.
Also $20 isn't full price.
Old or not it's still a classic RTS for me and one of the best.
You could try your luck at black friday, Blizzard tend to cut their games prices by half.
$20 isn't bad. I mean what are you expecting, $10? $5?
$20 isn't bad for all the content that is provided. Blizzard is still rolling out updates and public tests. They recently increased the max amount of players to 24, for example.
Good news now you can play remastered version.


Anti-Racism Book Group: 2 p.m. Monday, April 15th, Lee Room. A weekly book group discussing themes of race and racism.
El dia de los ninos; El dia de los libros: 6 p.m., Youth Services April 30th. Join us as we celebrate children and literacy from around the world!
Checkmates: 4 p.m., Youth Services, May 2nd. All ages and experience levels welcome.
LEGO Club: 12-3:15 p.m. May 4th, Martin Room. The program is first come first serve, accommodating up to 10 kids at a time. Children 7 and under must be accompanied by an Adult in the Youth Services Department.
A sign language interpreter is available at an event with one week's notice. For information, call the library's business office at 262-636-9170.


text:
SportSchool Sports
Team Camden's medal count goes up as athletes star at Youth Games
Talented youngsters make borough proud as the London Youth Games, ParaGames and School Games come to a hugely successful climax with a blitz of bronze, silvers and golds
11 July, 2019 — By Steve Barnett
Camden's mixed BMX team earned 12th place in the London Youth Games event, held at Merton BMX Club in Mitcham
THE medal count soared over the weekend as athletes representing Team Camden swam, ran, jumped and threw their way to glory during Europe's largest annual sports celebration.
More than 1,000 youngsters earned the chance to represent the borough during the 42nd edition of the London Youth Games, ParaGames and School Games, which came to a climax at the Crystal Palace National Sports Centre.
The competition had got underway back in November with the cross-country, and since then Camden have gone on to compete in 26 of the 30 sports available to them. Despite dropping down one place from last year, to finish 15th out of the capital's 33 boroughs, Camden's success "continued to climb" as the team amassed 33 medals overall, nine more than in their 2018 campaign.
Camden's archers finished fourth overall for the second year running, with Westley Spurlock (far right) winning an individual bronze medal
Team manager Ben Dorsett, of Camden Council's Sport and Physical Activity Service, said: "Last year we recorded our highest-ever finish when we came 14th, and we were agonisingly close to repeating, if not bettering that, this time around. As it stands, we have again showed good progress. In 2017 we won 16 medals, last year that climbed to 24, and this time we won 33 medals – 10 golds, 15 silvers and eight bronze medals – which is fantastic."
Camden picked up six medals from the indoor rowing events, held at Crystal Palace National Sports Centre
Among the highlights over the weekend was Camden's archery team, who all train with the Hampstead Bowmen. They equalled their best-ever finish at the Games.
Camden Fencing Club boys' team wearing their bronze medals
Swiss Cottage Swimming Club's boys also shone, winning seven medals. Antoine Divet struck gold in the 50m freestyle, and joined club-mates Lucas Bohm, Leo He and Sam Addington, to win a gold medal in the 4x50m freestyle medley and a silver in the 4x50m medley relay.
Camden's boys' swimming team finished third to bag a team bronze
Antoine's older brother Yann also grabbed a gold in the relays after teaming up with Jackson Olin, Alex Rowson and Pavle Stamenkovic to win the 4x50m freestyle race. There were also individual medals for Leo He and Alex Rowson, who won silver medals in their respective 50m butterfly and 50m freestyle events.
Camden girls' judo team earned 16th place, while the boys' team finished in joint-18th
Camden's boys' swimming team finished third to bag a team bronze.
The girls' squash team finished in joint-7th place
Yann also made it back-to-back golds in the aquathlon, in an event that also brought a bronze medal for Annelise O'Connell. And Micheal Cheetan made a splash in the diving with a bronze.
Gold medal winner Courtney Casey with coach Glenn Speirs
Courtney Casey and Omar Bougoffa proved a big hit in the judo as they struck gold, while Arejuna Pflug took a silver.
Camden girls' football team reached the quarter-finals before losing on penalties to Hillingdon
There was also a team bronze in the boys' senior fencing competition, thanks to the squad from Camden Fencing Club.
The indoor rowing also proved fruitful, with Alec Zaimovic winning gold. In the para indoor rowing, Zaki Hemming Young led the charge with a gold medal, while Aseal Biomy and Aman Yusuf both won silver, and Robert White and Sakib Bokth scooped bronze medals.
From the Islington Tribune
Team Islington show 'ability and passion' at London Youth Games
12 July — By Steve Barnett
They're different class! Awards for stars of school sports
Runners show mud and guts on the Heath
10 October — By Steve Barnett
Goalden girls! School's classy display


Who wouldn't want to read letters with Peppa Pig, or a The Book of Bacteria, written by Steve Mould!!!
And would you look at this sweet magic… Winnie the Pooh for the win… I just love this!!!
Can I just say that there has never been an Usborne Book that I haven't loved and adored… really never!!!
So many wonderful bookish treats in there… and we definitely need to meet Ermine, and would you look at the fantastic cover art illustrations… lots to love and look forward to.
A lovely addition to the Read, Colour and Keep Series by Sally MacLarty and Struik Nature. These books are perfect for young eco-warriors and outdoor enthusiasts. Just enough facts to peek their interest and satisfy their initial curiosity. A beautiful illustration to colour on each page and a centre spread for those young scientists that want to create an accurate nature journal with their colouring book.
We have been waiting for a flower and fynbos book for youngsters for the longest time, and this is definitely it. Twenty-four pages of beautiful local flowers to learn about… strong paper that would be suitable for pencils crayons, crayons, watercolour paints and markers. Already I have been able to answer, "What flower is that?" Questions a couple of times since we got this book… it is indeed a winner.
This is a fun read for little people who may never have come across a pangolin… Two young children are playing and discover a mystery all rolled up in a ball… a scaled ball.
They set off across the African Plains, asking plenty of more familiar animals, exactly what it is. They gather clues as they go, and eventually discover what their discovery is.
It is a sweet, brightly illustrated book, written in rhyme… a fun story, with a conservation message for young eco-warriors. At the back there are a couple of pangolin information pages, for curious young readers and their parents, as well as a collection of photographs of the author and her children, and pangolins, taken at the Tikki Hywood Trust in Zimbabwe.
Ricky of the River Pride by Lindsay Sherratt and illustrated by Astrid Castle: This is a lovely, African animal themed story about a little boy called Ricky who goes to sleep surrounded by his collection of soft toy animals that represent animals of the African plains. As he nods of to sleep he is woken by his wild animal friends, who have dashed to call him because their little friend the lion cub, who is the only son of the Ruler of the River Pride, is in terrible danger.
Ricky has to be terribly brave to rescue the little lion cub and then the cubs parents arrive on the scene… this could get a little dangerous really quickly, but all the animals quickly mention that it was Ricky that rescued their little one. They are all very grateful to Ricky for his rescue… and Ricky wakes up in his bed the next morning and wonders if it was all a dream. Or was it?
Roald Dahl's James and the Giant Peach Sticker Activity Book: This has been pure Winter Holiday fun and a great reward for reading the actual James and The Giant Peach.
Bright and colourful pages in true Roald Dahl production style, it includes a peachy word search, codes, a crossword and a couple of pages to fill in, as well as stickers… plenty of stickers… because you all know: Stickers make the world go round!!!
Marvel Collection Thor & Hulk: Well I never expected this to be a book that would resonate with my kids and how absolutely wrong I was. This was in our goodie bag, from the event, and I popped it on the coffee table along with our pile of review books and this is the one book that was picked up by every single kid in the family. Clearly Marvel characters have infiltrated our environment. Hood 8 reports that: This is the story of how Thor needs to be able to lift an incredibly heavy hammer to prove his worth. But then Thor starts to boast about his achievements, his father gets annoyed with him and throws the hammer at Midgaurd… and tosses Thor after it. Thor thinks he is a person, one day when he is on vacation, he gets trapped in a cave by a fallen boulder. But then he finds a stick and tries with all his might to move the boulder, and it won't budge… he gets so annoyed he hits the ground two times with the stick and realises that it is the hammer in disguise and it ends with him regaining his hero status. The second story in this book is about Bruce Banner, aka the Hulk, who starts off as a shy kid that loves science and when he becomes older he starts working for the army as a scientist. There is a very dangerous chemical that he is working with, but he doesn't want to hurt anyone so he does his testing far away in the desert. A kid drives into the danger area, he rushes to the kid and shoves him into a safe house as the test bomb explodes. He felt like he was trapped and now his true self emerges as the Hulk.
The Magic Misfits by Neil Patrick Harris: This is a magical new series to look out for… seriously magic. Its a fun and in places funny read that we read together over our holiday… the best thing about this book is that there are real live actual magic tricks and How to Do Them, if you just follow the illustrated steps and practice, practice, practice… These tricks are scattered throughout the book.
The story begins with a rather sceptical Carter, his parents vanished without a trace and he is being raised by his criminal uncle, who is the ultimate… Bill Sykes, from Oliver Twist. Uncle Sly teaches Carter all his tricks in the hopes that Carter will fall into his wicked ways, but Carter has a very strict sense of right and wrong and is not interested in bowing to his Uncle's whims. He runs away and discovers a side show type circus, full of word and wonderful characters, out of the frying pan into the fire so to speak. Carter and an accumulated group of friends find themselves outwitting a number of "obstacles" that come their way.
This book is about friendship and sticking together, no matter what… a collection of Misfits it turns out make a fine team. As you can expect from the latest themes in kids reads there is a lot of diversity represented here: kids of different cultures, abilities or disabilities, a kid with two dads and so on. This is the norm for kids reads right now, they all have a not so subtle message that everyone is getting on marvellously and everything is fantastic, whether this is the case in real life or not, your kids are going to discover this in every recently published book that they read. Just a heads up, and I see it as an opportunity to talk about topics with them that they might not have encountered in their everyday life aleady.
Middle School Escape to Australia by James Patterson and Martin Chatterton: Another fun read in the series… that might seem somewhat endless, but I have to say that Hood 5 inhales these and has honestly loved them all. These are your typical school stories, funny if you are a middle grader, less so if you aren't. That being said, when one of my kids finds a series that they love then I let them read all of it, and if they want to read it again, then just carry on!!! In this instalment, Rafe is the hero and wins a school art competition, which takes him off to Australia on a winning adventure. Australia, it turns out is not all surfing and sunshine… it is full of weird and wild creatures and hotter than hot… A prize that turns out to be a rather challenging challenge.
In the Mouth of the Wolf by Michael Morpugo and illustrated by Barroux:I often think that I will never have read enough Michael Morpugo Books. This is the true story of his Uncles, set at the start of World War II. Honestly if your children are learning about the World Wars or even if they are slightly interested in them… these are the books to read, they capture the true and essential spirit of the time: bravery, commitment and loyalty again and again and again. These books will teach you about being n adult in a world where you would much rather not have to be… in a time when young men would rather have been out with their friends they were called to fight in a war, leave the loves of their lives and go, not knowing if they would ever be back. I read this book in a sitting, and I am save it to read outloud to my kids. Two brothers… one is called up to fight and the other is a peaceful objector and works on a farm, when the brother in the airforce is in an accident, the conscientious objector is compelled to enter the war… as a spy. This is a peek into his love, what he left behind, and his daily struggles. The combination of Michael Morpurgo's writing and the poignant pen and ink illustrations from Barroux, makes a very giftable book and one that will be read more than once. A beautiful coming of age story, in a time when life demanded much more than most of us would want to give. I absolutely loved the personal touch, the memory filled feel of the book from the author's own life, and the section of family photographs at the end of the book make it an absolute keeper.
The Girl Who Smiled Beads by Clemantine Wamariya: I have read so many books on the plight of refugees, and the horrors of war and the associated atrocities and I am so glad that they are being written… people need to tell their stories, people need to take the time to remember those that were lost. This book has touched my heart, it resonates with me… Clemantine doesn't just write about her stolen childhood and the disruption to all that she held true… for the sake of a war that she might never understand, but in this book she shares her story and explains why there cannot be a "happily ever after" moment… famous for appearing on the Oprah Winfrey show, where Oprah reconnected her with her parents and family after twelve years of fleeing, somehow being alongside each other could not heal the rift created by time and horror… the loss and the grief could not close the chasm that opened up between here and her family. This book is a tragedy, that represents so many more tragedies. Read it… this book is a harrowing read and needs to be read, will change you. You can meet Clemantine on her website here.
Can I just say my kids love Chris Bradford, they are huge fans, since they met him… and not only that, but he gave us a fantastic interview. So this is book 6 in the Bodyguard Series, and apparently the last of the fast-paced, action-packed series… Conner Reeves finds himself hurtling around Shanghai, China. His fellow teenage "BuddyGuards" have been abducted and there is a price on his life. His only way out is to go on the attack against his enemy… Old enemies and new enemies line up against him and he has to rely on new friends and alliances to survive… there are many surprising twists in this tale and it is more than a little difficult to believe that this is actually the grand finale to the series that it claims to be.
You can meet Chris Bradford on his website… And learn more about the books on their dedicated website, right here.
The Trials of Apollo: The Burning Maze by Rick Riordan: Book three in the Trials of Apollo series and of course it is gripping. Apollo has been punished by Zeus, and has been cast down to earth as a mortal teenager, called Lester. Lester has to restore five Oracles, without any of his usual powers. Three Roman Emperors are on a personal quest to stop Lester from completing his task, meanwhile danger looms on every front. Lots of Rick Riordan drama and you really should go back and read the first two books in the series, if you haven't already… Begin at the beginning if you want to enjoy these to the max.
Encounters by Jason Wallace: This book is unsettling, really quite dark and a challenging read, and that puts it straight into the Young Adult group of reads. The thing about this book is that it is based on true events… actual factual events that were witnessed way back in the early nineties. Six children at a school in Zimbabwe are interviewed about an event that happened at the school, and each of the witnesses builds on the story of an alien visit. But is their visitor really an alien, or perhaps the alien is someone much closer to home? This book is a little creepy, and as the story builds and the events are pieced together so one goes from: this is impossible, to this could really have happened, and then back again. The point is, you really don't have to like a character to believe them and in this book there are a lot of unlikeable characters. Well worth a read if you don't mind being more than a little unsettled.
Forever and a Day by Anthony Horowitz: The Prequel to every James Bond book ever written, this is in fact the "Bond begins book." Find out the back story to this world renowned spy. Of course we are huge fans of Anthony Horowitz and of course you can expect fast and furious non-stop action all the way. This is the book about just how, and why Bond, James Bond, got his licence to kill. Set on the French Rivera, you can expect syndicates, gang triads and such like, more important you will discover exactly where James Bond gets his signature drink from… "shaken not stirred." This is true Anthony Horowitz and James Bond, an unputdownable race against time… a fantastic read with all the twists and turns will leave you somewhat like his martini… "shaken not stirred." Fantastic action packed read and highly recommended.
I totally judged this book by the cover… totally. The prettiest suitcase ever and filled with letters, honestly I wanted to read this book because I wanted to know what was inside those letters. This is the story of Tess, who is in a pretty predictable relationship, and the time seems right for them to settle down and follow the "happily ever after path"… only he thinks he has big news to tell her, he has been after a job in New York and thinking she would jump at the chance of a Trans-Atlantic venture and a fresh start. He is somewhat surprised when she is hesitant. Tess on the other hand, who is responsible for a grandmother who suffers from dementia and wouldn't dream of leaving her in England, also has an unexpected surprise to share, only the longer she waits to tell him about his impending fatherhood, the harder it is to share. This is a book about finding true friendship, enduring and endearing friendship… not to mention life is full of lots of surprises. Even the people you know and love may stun you with stories that you never could have imagined… the truth is you can't ever really know anyone. I love the letters that Tess writes to her baby week after week… they are sweet and memorable. There is a loveliness to this book, reading it feels like visiting a good friend for tea.
All these books were given to us for review purposes by Penguin Random House South Africa and Struik Nature. This is not a sponsored post and opinions expressed are entirely our own.


text:
Putting abandoned animals up instead of down
Even the staunchest of window shoppers can be taken in by pet store puppies' wagging tales. But impulse buys don't make for good pet owners, according to Lee Hyung-ju, campaigner for The Korean Animal Welfare Association. "An animal should not be something you just pick up with your groceries," she said, warning against buying pets in big supermarkets."The animals are often kept in very poor condi
By Kirsty Taylor
Updated : Jun 8, 2011 - 14:53
Even the staunchest of window shoppers can be taken in by pet store puppies' wagging tales. But impulse buys don't make for good pet owners, according to Lee Hyung-ju, campaigner for The Korean Animal Welfare Association.
"An animal should not be something you just pick up with your groceries," she said, warning against buying pets in big supermarkets.
"The animals are often kept in very poor conditions and in terms of education, it really gives the wrong message. To kids, that means you can just go to the market and buy animals for scarily cheap prices. They need to think about what keeping a pet means first."
That's why the some 60 abandoned animals at the charity's Seoul office are not so easily scooped from the shelves. The four-stage adoption process involves online, telephone and face-to-face interviews followed by an assessment of each potential pet-owner's home by a KAWA officer.
"It is really tricky," said Lee. "We need to have strict restrictions on who can adopt because we want to make sure that these animals, which have already suffered or been abandoned, can go to good homes."
Her protective stance is understandable ― the charity receives phone calls reporting animal abuse horror stories every day.
Recently, a kindergarten teacher rang from northern Seoul to report that some pensioners were preparing to cook a dog and eat it.
"The woman said she had seen a group of old men in their 80s beating a four-month-old puppy. They were smashing his head to kill it to cook it. They broke his skull and jaws.
"Our director went with a male coworker to rescue the puppy. When she spoke to the men they didn't see anything wrong with what they were doing."
The puppy, whom the KAWA team named Bok-nam ―- wishing him the future happiness that the Chinese character "Bok" represents ― has now been nursed back to health, though he still cannot eat solid meals.
Bok-nam is one of Seoul's luckier abandoned animals. KAWA's no-kill policy means that he will never be put down, even if he is not adopted. Strays picked up by the government's animal unit are routinely euthanized after ten days. KAWA says this policy applies to all animals who are not quickly adopted ― even if they are in good health.
"For a lot of animals, they just end up spending the rest of their lives with us," said Lee.
"There are so many animals in Korea that need our help, that's why we want to open the new non-kill shelter."
A non-kill shelter is a refuge where animals are euthanized only if they are too sick to be treated. The planned 4,600-square-meter shelter will hold more than 300 animals at a time.
"Right now the shelter here at our office is a home for 36 dogs, eight cats and one hamster, but we get new animals all the time," added Lee.
"We are raising funds to build the shelter and actively searching for the site. We are trying to find a spot that's not too far from Seoul so that our workers and people wanting to adopt pets can get there easily. We hope to start the construction by next year."
The charity has already raised almost 233 million won ($217,000) from private donations towards its 570 million won funding target.
In the meantime, KAWA's Haengdang-dong office is bursting at the seams with rescued animals. No matter how crowded it gets, the charity, funded completely by private sponsors, will always seek careful owners.
"KAWA has pioneered the idea of animal adoption in Korea since we started in 2000 and we are very proud of that. When we have the new shelter we hope we'll be able to find a lot more animals new homes."
Those wishing to adopt a pet, donate or volunteer at the charity can email animal@animals.or.kr or visit www.animals.or.kr for more information.
By Kirsty Taylor (sharing@heraldcorp.com)


Last Wednesday, Kitty Sun, Jia Dua and Karan Kalsi along with coach Mr. Halligan, won their Semi- Final debate against Dio's best Junior Premier team. It was nail-bitingly close, but in a surprise 5-0 decision, they secured a very prestigious spot in the finals.
This is a significant win, as the team made it all the way to the semi-finals in the Junior Open last year, and all the way to the semi-final in the Impromptu Cup this year (a far more difficult achievement), but they have never been able to get past the semis in what are always very hotly contested debates.
This Wednesday at 6.45 pm, they will debate for the title against Sacred Heart. This is the very first time either school has reached the finals of the Auckland Schools' Debating Junior Premier Open, which are the very best teams from Years 9-11 in the Auckland Region.
Lynfield will host the event, which will take place in the Library.This is a free event and any Lynfield College student and their families are welcome to attend. The moot is announced at 6 pm and the debate will start at 6.45pm. The winner will be announced at 8:15.
We wish Kitty, Jia and Karan all the best in the upcoming final! They have really lifted the profile of Lynfield College- one of the very few public schools that take part in competitive debating in Auckland.
Adam and Elysha have each won a scholarship to travel to Germany. Adam will be travelling to Germany at the end of 2015 to spend 2 months in a host family going to school and being immersed in the German culture. Elysha has been selected to represent New Zealand in the German Olympiad in Berlin in 2016 where the top students from all over the world come together to participate in different language competitions.
"When Frau Zimmer told us there was an opportunity to receive a scholarship to Germany, I thought: okay, why not give it a shot. All I had to do was speak in German to an interviewer for ten minutes. How hard could it be? A few days later when I received an email saying that not only myself, but my fellow class mate Elysha, had been accepted for a second interview in Wellington I was thrilled.
On the 27th of July the other students from Auckland along with Elysha and myself, caught a flight down to Wellington where we met our fellow finalists. Once we had been shown, where we were staying, and had become acquainted with each other, we were allowed to explore the city. Having only visited Wellington when I was much younger, I was lucky to get a guided tour from the local Wellington students. As it happened the day we were in Wellington, was the day that the Te Papa museum had a free open day, which we all took full advantage of.
For dinner we went to an Italian restaurant, which I thought was a little strange, as we were on a German language trip! It was only when we were ordering our food and the waitress answered me in German that I understood why we had gone there for dinner.
The next morning after our final interviews, it was time to say goodbye. Although we were only there for two days, we had made some good friends and had some experiences that we wouldn't forget.
The photos are of the 14 finalists from around New Zealand when they went to Wellington for the final interviews.
On Friday 21 August the Travelwise and SADD groups combined to hold a Travel Expo at lunchtime. It showcased our road safety programmes in a fun, safe way and it was also great to have music performed during the show by The Flock.
Slow bike races, beer goggles walks, a distraction game and a smoothie bike were some of the excellent activities available for students to try.
A strong contingent from Auckland Transport came along to help and provide resources.
Mrs Wagner and Mrs Wiggins took three Junior Debating Teams to the Auckland Schools Debating Junior Championships on Saturday 22nd of August. The purpose of the competition is to give Year 9 and 10 debaters the opportunity to work with law students from the University of Auckland to improve their debating skills.
As part of the recent Arts week the various music ensembles celebrated with an evening of great musical variety in the college hall. We are fortunate to have permanent and itinerant staff who year after year bring out the best in the considerable musical talent amongst our students.
With KBB competitions looming this was an excellent opportunity to practise and present to a large audience.
ps.....KBB Festival has brought successes again this year. Details to follow!
The Lynfield Collage Board of Trustees has agreed to a Ministry of Education request for Mr Bovaird to spend much of the rest of this year at Papakura High School, assisting that school whilst a new Principal is appointed.
Mr Bovaird will continue to be back at Lynfield at certain times most weeks, to help with planning for next year and to undertake existing commitments.
We wish him all the best in this undertaking, knowing that our school is in the good hands of the Acting Principal Ms Lexie Ridling.
Lynfield College Principal Steve Bovaird reports on his return from a term's absence as a Woolf Fisher Fellow..
I have now been back at Lynfield for 4 weeks and my time away on my Woolf Fisher Fellowship is fast becoming a memory. I have come back to a school that has carried on exceptionally well while I was away. Special thanks to Lexie Ridling who was Acting Principal, for her excellent work in my absence. The rest of the senior leaders were also a great support to her.
Attending the ISTE (International Society for Technology in Education) conference, held annually in the USA . Around 15,000 educators attend to learn and understand how technology is being used in classrooms and to find out about the latest developments in technology. This also confirmed that the path Lynfield College is on with BYOD is valid and similar to the path many other schools around the world have embarked on.
Attending the "Leadership; An evolving vision" summer school at the Harvard Graduate School of Education, was a great honour. I have come back with a number of new ideas that I believe could further enhance learning at Lynfield College. Attending this course was an amazing opportunity. To spend time in such a unique environment with top class educational specialists and 160 participants from around the USA and the world was an experience I will never forget. Each morning started with a 3 hour presentation on an aspect of leadership, ie. School Culture, Strategic planning, Impact of technology, Organisational Change, Staff supervision etc. There was then an afternoon presentation. Between 4-6.30pm each day we worked in small groups (8) going ever the material.
Completing a high ropes course was a real achievement for me as it was totally new for me!
The concept that Sir Woolf Fisher had back in the 1960's, of establishing a trust to support educators, was a far sighted initiative. As the second* Lynfield College principal to receive such an honour, I was truly grateful.
The annual Lynfield College/Mt Maunganui College sports exchange took place at Mt Maunganui on Thursday 13 August – fortunately a fine, sunny day!
This exchange has been a highlight on the sporting calendars of both schools for 56 years. The top teams in 7 codes competed for the overall trophy based on the number of games won and lost.
This year Mt Maunganui showed its dominance and the advantage of being the 'home' team. Congratulations to our students for their fantastic sportsmanship. They were in every sense one big Lynfield team who had an awesome sports day they will remember for many years.
A special thanks to the Maori focus Group, Mr Tonks, and all of the staff and students who helped out with our Maori language celebrations.
We started the week with a powhiri for the visiting Shinagawa (Japan) students. After the ceremony, kai was shared and the haka was taught to our Japanese friends.
Staff Haka practice was a success - this took place at interval with Mrs Leauga.
A performance at Green Valley Lodge Resthome in Glenfield from our akonga was a great way to share our language with our elderly through waiata and haka.
Students are focussed and engaged in their 2015 learning and assessment and gaining a good idea of where their interests, strengths and future pathways lie. Their next step is to consider the academic programme they wish to pursue in 2016.
August is Course Selection month for Years 9 through to 12 and course information has been distributed to all students.
It is expected parents/caregivers will involve themselves in the students' decision-making, and the college provides ongoing support through subject teachers, Deans and Careers Counsellors.
Course selections can be entered for each student through the Parent Portal of the website (link at top of the Home Page). Course selection forms for students currently in Years 10-12 need to be returned to form teachers by Monday 17 August. For students now in Year 9 their Year 10 Course Selection Forms are due to form teachers on 24 August. The courses entered through the Portal will be checked against the teachers' recommendations.
The Courses section of this website contains all relevant information, including course information booklets and course selection forms.


text:
CryptoBlox to Acquire Digital Mining Infrastructure Company
Home News CryptoBlox to Acquire Digital Mining Infrastructure Company
byTaryn Stemp in posted onJanuary 21, 2023
CryptoTherm designs, manufactures and sells one of the world's most advanced crypto mining systems based on immersion cooling and thermal heat exchange technology
Vancouver, B.C, January 20, 2023 – CryptoBlox Technologies Inc. (the "Company" or "CryptoBlox") (CSE: BLOX) is pleased to announce that it has entered into an arm's length definitive share purchase agreement (the "Agreement"), dated January 17, 2023, with CryptoTherm (defined herein) and 1289048 B.C. Ltd. (the "Vendor") to acquire (the "Acquisition") from the Vendor 100% of the outstanding shares of CryptoTherm Manufacturing Inc. ("CryptoTherm").
About CryptoTherm
CryptoTherm specializes in designing and building liquid-cooled data centers and advanced heat recapture products. These data centers are specifically designed for cryptocurrency mining, allowing for maximum efficiency and cost-effectiveness.
CryptoTherm's advanced heat recapture products are innovative solutions that capture and reuse the heat generated during the mining process. This helps to reduce energy costs and minimize the environmental impact of mining operations.
CryptoTherm's team has a deep understanding of the challenges and opportunities in the digital currency industry and is dedicated to helping its customers succeed. In this, CryptoTherm's products and services are designed to minimize clients' start-up costs, downtime and operational expenses.
Integration into CryptoBlox
The Company will use CryptoTherm's industry leading immersion cooling and thermal heat exchange technology as it grows its digital currency blockchain division. The Company will also allocate resources to grow CryptoTherm's business of selling immersion pods, ASIC miners, cryptovaults and cooling immersion fluids.
This strategic acquisition is a continuation of the Company's focus on its digital currency division and follows other strategic investments such as the Company's investment in Optimal CP, Inc. The Company's goal is to become a significant player in the digital currency space and further solidify its position in the industry.
"I am thrilled with this agreement with CryptoBlox," stated Austin Bank, CEO of CryptoTherm. "This acquisition will allow us to join forces and leverage our complementary strengths to achieve even greater success. I am confident that together, we will be able to explore new opportunities and unlock the full potential of our combined expertise and resources. I am excited for the future possibilities that this acquisition brings and look forward to working with the talented team at CryptoBlox to drive innovation and growth in the digital currency industry," added Mr. Bank.
The Acquisition will involve the issuance of 400 million common shares of the Company (the "Consideration Shares") at a deemed price of $0.05 per common share to the Vendor in exchange for all of the outstanding common shares of CryptoTherm, for a deemed transaction value of $20,000,000. 320 million of the Consideration Shares will be subject to restrictions (the "Restrictions") on trading expiring as follows: 10% 12 months from closing; 10% 24 months from closing; 20% 36 months from closing; 20% 48 months from closing; and 40% 60 months from closing. The Consideration Shares will be issued pursuant to s. 2.16 (take-over bid and issuer bid) of National Instrument 45-106 Prospectus Exemptions. The Company does not consider that the Acquisition will be considered a Fundamental Change of the Company (as defined in Policy 8 Fundamental Changes & Changes of Business of the Canadian Securities Exchange (the "CSE")). Upon completion of the Acquisition, the principal of the Vendor is expected to become a reporting insider (as defined in National Instrument 55-104 Insider Reporting Requirements and Exemptions) of the Company.
"This is one of our most exciting investments and our most strategic acquisition to date," stated Bryson Goodwin, CEO of CryptoBlox.
"We highlight the following:
given CryptoTherm is an operating business, the Acquisition is expected to immediately add revenue to CryptoBlox;
the deemed share value of $0.05 highlights CryptoTherm's confidence in the fundamental value of CryptoBlox;
CryptoTherm's immersion cooling technology will strengthen our intellectual property position within the digital currency market; and
the conservative and long-term Restrictions reflect the intention of CryptoTherm's team, who will become significant shareholders of CryptoBlox, to build long-term value at CryptoBlox.
We believe the Acquisition will allow us to significantly grow our digital currency blockchain division and unlock the incredible value of CryptoTherm," concluded Mr. Goodwin.
Completion of the Acquisition is subject to customary conditions precedent, including completion of a formal valuation respecting CryptoTherm, board approvals and approval of the CSE.
For further information about the Company, please visit https://www.cryptoblox.ca
For Investor Inquiries, please contact (236) 259-0279 or email info@cryptoblox.ca
The information in this news release includes certain information and statements about management's view of future events, expectations, plans and prospects that constitute forward-looking statements. These statements are based upon assumptions that are subject to risks and uncertainties. Forward-looking statements in this news release include, but are not limited to, statements respecting: completion of the Acquisition; and the expected benefits to the Company and CryptoTherm from the Acquisition. Although the Company believes that the expectations reflected in forward-looking statements are reasonable, it can give no assurances that the expectations of any forward-looking statement will prove to be correct. Except as required by law, the Company disclaims any intention and assumes no obligation to update or revise any forward-looking statements to reflect actual results, whether as a result of new information, future events, changes in assumptions, changes in factors affecting such forward-looking statements or otherwise.
CryptoBlox Announces Results of Annual General and Special Meeting


The Denton County Spartans Hockey Club is a non-profit, 501(c)(3) organization dedicated to the development of our high school hockey players through athletic and academic excellence. The mission of the Denton County Spartans and Board of Directors is to provide a highly competitive hockey program at the Varsity and Junior Varsity level for students currently attending school districts within Denton County.
Competitive Ice hockey demands teamwork, commitment and self-discipline while emphasizing sportsmanship, skill development and community citizenship. We strive to challenge and inspire our players to reach for their full potential on and off the ice. The goal for our Junior Varsity Program is to play competitive hockey but more importantly, to offer players the opportunity to develop into the caliber of player that is prepared to earn a position to play on our Spartan's Varsity hockey team. The focus for our JV players is to demonstrate the desire, tenacity and abilities necessary to advance to the Varsity level. We seek to create an enriching high school hockey experience for all our players and parents. As an organization, we are committed to our players development, our coaches success and to our community.
Advocate USA Hockey's core values of sportsmanship, respect for individuals, integrity, the pursuit of excellence, enjoyment, loyalty and teamwork.
Emphasize that honesty, integrity and fair play go hand in hand with developing playing skills, winning and having fun.
Provide a fun, safe and rewarding experience for all participants, their high school or local hockey association, and their families.
Provide the best practice and game facilities reasonably available to the league participants within their respective communities.
Develop and promote positive relationships with all parties providing those facilities.
Develop and maintain a positive reputation for the AT&T High School Hockey League by requiring all participants - players, coaches, parents and administrators - to exhibit sportsmanship and behavior that is beyond reproach at all times.
©2019 Denton County Spartans / SportsEngine. All Rights Reserved.


Professional Classroom or Boardroom Space Available!
Our facilities offer customized classroom configuration and in-house administrative and hospitality staff. Each room is equipped with a state-of-the-art sound system, LCD projectors and a high-speed internet connection. We can provide the presentation tools necessary to conduct your meeting, including dry erase boards, podiums and microphones.
Anyone may reserve rooms. Members of the DeKalb Association of REALTORS® will receive discounts on rates available to the public. Members may be able to reserve space for certain events at no charge. For more information, please contact Ronda Ensor, Education and Administrative Coordinator, at 770-493-6100.
What time frame is the space available?
Rates are for events held on normal business days between 9:00 am and 4:30 pm.
What amenities or services are included?
Our building has WIFI available. Our classrooms have projectors/screens, microphones and podiums. There is an additional fee for coffee service. Users are expected to leave the space clean, neat and free of trash and will be responsible for any damages to the space.
You may not post any signage outside of the space you rent. This includes directional signs and signage within the building.
Approved catering is permitted. Alcoholic beverages may be permitted, however only with advance permission and is subject to the discretion of an authorized representative of DAR. Alcoholic beverages may not be sold on the premises.
SMOKING IS NOT PERMITTED IN THE BUILDING. SMOKING IS ALLOWED IN DESIGNATED AREAS OUTSIDE ONLY.
You may not admit to the room a number of persons in excess of the maximum occupancy.


four car garage car garage near me for sale.
liftmaster car garage opener app for rent in newark nj plans 4 house with apartment above,car garage for rent in queens 4 plan house plans and more opener not working ideas pictures,car garage near me for sale 4 modern other 3 ideas,car garage for sale manchester this is why four so famous opener wont program rent in queens,car garage lift residential price ideas opener not working 4 with apartment attractive com charming,car garage tent price wow house has full rec room heated 4 opener programming ideas pictures,4 car garage plans tent for sale with floor lift rental,two car garage for rent near me tent with floor x 4 at,car garage lift price for rent nj tent philippines drawings of mansion,car garage for rent near me 4 plans style four plan design in newark nj paterson.
car garage near me for sale 4 modern other 3 ideas,two car garage for rent near me tent with floor x 4 at,car garage for sale manchester this is why four so famous opener wont program rent in queens,car garage for rent near me 4 plans style four plan design in newark nj paterson,4 car garage plans tent for sale with floor lift rental,car garage lift price for rent nj tent philippines drawings of mansion,liftmaster car garage opener app for rent in newark nj plans 4 house with apartment above,car garage tent price wow house has full rec room heated 4 opener programming ideas pictures,car garage lift residential price ideas opener not working 4 with apartment attractive com charming,car garage for rent in queens 4 plan house plans and more opener not working ideas pictures.


text:
What Is Surgical Technology as a Job?
What is surgical technology?
What are the duties of a surgical technologist?
What are the educational requirements for surgical technologists?
What are the job prospects for surgical technologists?
What is the average salary for surgical technologists?
What are the benefits of being a surgical technologist?
What are the drawbacks of being a surgical technologist?
What are the career advancement opportunities for surgical technologists?
What are the challenges faced by surgical technologists?
What advice would you give to someone considering a career in surgical technology?
Surgical technology is a field that is growing in popularity. If you are considering a career in this field, you may be wondering what it is all about. Here is a brief overview of what surgical technology is and what it entails.
Surgical technology is a field of healthcare that focuses on the preparation and management of surgical instruments and supplies. Surgical technologists work closely with surgeons and other surgical team members to ensure that all materials are ready and available when needed. They also play a vital role in maintaining sterile conditions during surgery.
Surgical technologists typically complete a one-year certificate or two-year associate's degree program in surgical technology. Some states require certification for employment. With experience, surgical technologists may advance to lead or supervisory positions, or may choose to pursue additional training to become a certified registered nurse first assistant (CRNFA) or a certified surgical first assistant (CSFA).
The surgical technologist, also called a scrub tech, is a member of the operating room team. The team also includes the surgeon, anesthesiologist, circulating nurse and other nurses. The surgical technologist's job is to help set up the operating room, make sure that all the instruments are sterilized and ready to use, and help care for the patient before, during and after surgery.
During surgery, the surgical technologist hands instruments and supplies to the surgeon and assists in preparing tissue for surgery. He or she also may apply dressings and close incisions. After surgery, the surgical technologist may help apply plaster casts or splints.
There are many ways to become a surgical technologist. Some people get on-the-job training, while others attend a two-year accredited surgical technologist program. To be eligible to sit for the national certification exam, you must have successfully completed an accredited program. Certification is not required in all states, but many employers prefer or require it.
Job prospects for surgical technologists are good. Most surgical technologists work in hospitals, but many also work in outpatient surgery centers, physicians' offices, and dental offices. Employment of surgical technologists is projected to grow 11 percent from 2019 to 2029, much faster than the average for all occupations.
The average salary for surgical technologists in the United States is $47,000 per year.
There are many benefits to being a surgical technologist. One of the most obvious is the salary. The median salary for a surgical technologist is $47,300 per year, which is much higher than the median salary for other occupations. In addition, surgical technologists enjoy good job security and opportunities for advancement.
Surgical technologists also have the satisfaction of knowing that they are playing a vital role in the operating room team. They are responsible for sterilizing and preparing instruments and supplies, as well as assisting surgeons during procedures. This important work helps to ensure that surgery is performed safely and effectively.
Like all jobs, being a surgical technologist has its challenges. As you can imagine, working in an operating room can be stressful. You need to be able to handle the sight of blood and other bodily fluids, and be able to handle the stress of working in a fast-paced environment. In addition, you may have to work long hours, including nights and weekends.
Surgical technologists typically enter the workforce with a postsecondary certificate or associate degree from an accredited surgical technology program. Many technologists then choose to pursue professional certification, which may be required for some job positions. Some technologists may also choose to advance their career by pursuing a bachelor's or master's degree in surgical technology or a related field.
While many surgical technologists find entry-level positions in hospitals, some may choose to work in other medical settings, such as outpatient surgery centers, doctors' offices, or research laboratories. Others may choose to advance their career by moving into management positions or becoming teaching faculty at accredited surgical technology programs. With experience and additional training, some technologists may also choose to specialize in a particular area of surgery, such as cardiac surgery or neurosurgery.
The field of surgical technology is facing a number of challenges in the coming years. One of the biggest challenges is the aging population of surgical technologists. Many of the current generation of surgical technologists are nearing retirement age, and there is a concern that there may not be enough qualified replacements to fill their shoes.
Another challenge facing surgical technologists is the increasing complexity of surgeries. As medical technology advances, so too do the procedures that surgical technologists must be able to assist with. This means that surgical technologists must be constantly updating their skills and knowledge in order to keep up with the latest changes in surgery.
Finally, another challenge facing surgical technologists is the increasing demand for their services. As the population continues to grow and people live longer, healthier lives, there is an increasing demand for surgeries and other medical procedures. This means that surgical technologists must be able to work long hours and handle large workloads.
If you're thinking about a career in surgical technology, here's some advice to help you make the decision. Firstly, it's important to make sure that you have the right skills and qualifications for the job. You'll need to be good with your hands, have excellent manual dexterity, and be able to work quickly and accurately under pressure. Secondly, you'll need to be able to cope with blood and gore. This isn't a job for the faint-hearted!
If you think you've got what it takes, then a career in surgical technology could be very rewarding. It's a fast-paced and challenging role, but it's also hugely satisfying knowing that you're playing a vital role in helping patients receive life-saving treatment.
What Are the 3 Types of Technology?
How Has Technology Helped the Deaf Community?
What Is Vr Technology Used for?


This is a spiritual creature that you need to make on offering to of uncooked rice. A one time offering is all that is needed. This creature which although is called a rabbit is actually a Asian beauty queen. This lady is said to travel between the Moon and Earth bringing and capturing all wealth spells which generally surround the moon. Many spells and rituals for money do need the moon to work,some are even done on a full moon. I'm not saying all but the more powerful ones sure do use it. What this lady of luck does is collect and compound all the wealth magic in spells and in rituals and uses that to bring you wealth along with happiness. These ladies of luck are born and live in the Jade house until they are called.


This is always a tricky question, since every family is different. I'm assuming that by "small" souvenir, you mean something that costs $20 or less. That certainly won't get you a t-shirt, but you can get an autograph book, small toy, light up souvenir for that price. I think $20 per park is manageable for small children. In some parks you'll probably spend a bit less, and in some parks you might spend a bit more. A pair of Mickey ears will cost you about $18.
As far as dining goes, are you planning on eating 3 meals per day? I would say that an average counter service meal for adults costs about $12 per person and $6 per person for children. So $36 per meal x 3 is a little over $100. I would go ahead and factor in 3 meals per day.
If it were my family, I would budget about $175 per day.


text:
<?php

namespace AppBundle\Repository;
use Doctrine\ORM\EntityRepository;

/**
 * LocationImageRepository
 *
 */
class LocationImageRepository extends EntityRepository
{
}

redpajama_set_name: RedPajamaGithub


text:
The Case for Investing in Black-led Organizations
Creating an Equitable Future
And So We Press On
Improving Life for Black Washingtonians
Client Story: Kathleen
April 30, 2017 (February 16, 2021) by centerstone_admin
Kathleen was born in 1946 and raised in West Seattle. She has lived around the city but has always loved the West Seattle area where she grew up. Kathleen worked for Boeing, then transitioned to an independent contractor role. After the 2008 recession hit her income dropped by at least 45%. Then she was injured on the job and was unable to continue working. She makes a small income selling items on E-Bay and living off her pension. However, she began to struggle to keep up with her expenses on a fixed income and went into debt.
Kathleen found her way to Byrd Barr Place after a referral from a Seattle City Light (SCL) representative. She receives a monthly senior discount from SCL and was looking for help with her PSE gas bill. After doing some research on the web for help she made an appointment at Byrd Barr Place, but was told she didn't qualify for our program due to her income level. Fortunately, Byrd Barr Place was still able to help her through a Bridge the Gap grant. Kathleen was beyond thankful!
She mentioned she has always been the one to help others. She has donated to those who were in need in the past and never expected to be in this type of position but it happened so fast. Fearful of getting her heat turned off in freezing conditions she says she was "rejuvenated" and "full of hope" after receiving our help. Kathleen is working on a budget and plans on selling her home to pay back her debt to friends and family, then hopes to transition into senior living or an apartment in the area.
Client Story: KatherineClient Story: Patrice
Advocacy and Insights
Newsletters and Annual Reports
Our historic firehouse, built in 1909, is undergoing a major interior renovation.
Juneteenth Newsletter 2020 >
Spring Newsletter 2020 >
Autumn Newsletter 2019 >
Summer Newsletter 2019 >
Starting March 30, our food bank will be temporarily relocated to 420 E. Pike St., and will be open Tue. 11 am – 4 pm, Wed. 12 pm – 4 pm and Thu. 10 am – 2 pm.
You can continue to access other essential services on our website or by calling 206-812-4940. We are committed to serving our growing community throughout this renovation.
Click for map and directions.
Join our email for news, insights and opportunities.
Email sign up in footer
Copyright ©2022 Byrd Barr Place. All Rights Reserved. | Privacy Policy | Site Map


Ensure high search engine rankings for your sites in Norway from the start by registering a .NO domain name. All popular search engines (Yahoo, Google, etc.) will give your site a higher local search engine ranking and it will attract a lot more individuals who reside in Norway. Registering a .NO domain is a sure way to expand your brand's influence in Norway and to further advance your online presence.
Order a .NO domain name from Million Dollar Hosting for only $13.50 a year!
Million Dollar Hosting provides an extremely effective domain management tool that's both easy to use and fully featured - our Domain Manager. It is included by default with every new domain name registration and it's the perfect location from where it is possible to manage your .NO domain names. You will get immediate access to all the DNS and WHOIS options available for your domains. You will also set up URL forwarding with just a mouse-click and to take advantage of unlimited domain parking options. The Domain Manager interface offers multiple domain name management options.
If you have a web hosting account here, managing web sites and domain names at the same time will be more than easy, since the Domain Manager is in fact a part of the Web Hosting Control Panel.


text:
// Copyright 2020 Proyectos y Sistemas de Mantenimiento SL (eProsima).
//
// 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.

#include "BlackboxTests.hpp"

#include "PubSubReader.hpp"
#include "PubSubWriter.hpp"
#include <fastrtps/xmlparser/XMLProfileManager.h>

#include <fastdds/dds/core/condition/StatusCondition.hpp>
#include <fastdds/dds/core/condition/GuardCondition.hpp>
#include <fastdds/dds/core/condition/WaitSet.hpp>

#include <gtest/gtest.h>

using namespace eprosima::fastrtps;
using namespace eprosima::fastrtps::rtps;

#define INCOMPATIBLE_TEST_TOPIC_NAME std::string( \
        std::string("incompatible_") + TEST_TOPIC_NAME)

enum communication_type
{
    TRANSPORT,
    INTRAPROCESS,
    DATASHARING
};

class DDSStatus : public testing::TestWithParam<communication_type>
{
public:

    void SetUp() override
    {
        LibrarySettingsAttributes library_settings;
        switch (GetParam())
        {
            case INTRAPROCESS:
                library_settings.intraprocess_delivery = IntraprocessDeliveryType::INTRAPROCESS_FULL;
                xmlparser::XMLProfileManager::library_settings(library_settings);
                break;
            case DATASHARING:
                enable_datasharing = true;
                break;
            case TRANSPORT:
            default:
                break;
        }
    }

    void TearDown() override
    {
        LibrarySettingsAttributes library_settings;
        switch (GetParam())
        {
            case INTRAPROCESS:
                library_settings.intraprocess_delivery = IntraprocessDeliveryType::INTRAPROCESS_OFF;
                xmlparser::XMLProfileManager::library_settings(library_settings);
                break;
            case DATASHARING:
                enable_datasharing = false;
                break;
            case TRANSPORT:
            default:
                break;
        }
    }

};

/* This test also serves as check for the publication_matched and subscription_matched conditions,
 * as all the status conditions are processed through waitsets and we are checking if there is a match
 */
TEST_P(DDSStatus, IncompatibleQosConditions)
{
    PubSubWriterWithWaitsets<HelloWorldType> writer(TEST_TOPIC_NAME);
    writer.reliability(eprosima::fastrtps::BEST_EFFORT_RELIABILITY_QOS)
            .durability_kind(eprosima::fastrtps::VOLATILE_DURABILITY_QOS)
            .init();
    ASSERT_TRUE(writer.isInitialized());

    // A Reader on the same Topic but with incompatible QoS
    // Should not match and trigger incompatible QoS conditions on both Writer and Reader
    PubSubReaderWithWaitsets<HelloWorldType> incompatible_reliability_reader(TEST_TOPIC_NAME);
    incompatible_reliability_reader.reliability(eprosima::fastrtps::RELIABLE_RELIABILITY_QOS)
            .init();
    ASSERT_TRUE(incompatible_reliability_reader.isInitialized());

    writer.wait_incompatible_qos(1);
    incompatible_reliability_reader.wait_incompatible_qos(1);

    EXPECT_EQ(writer.times_incompatible_qos(), 1u);
    EXPECT_EQ(writer.last_incompatible_qos(), eprosima::fastdds::dds::RELIABILITY_QOS_POLICY_ID);
    EXPECT_FALSE(writer.is_matched());

    EXPECT_EQ(incompatible_reliability_reader.times_incompatible_qos(), 1u);
    EXPECT_EQ(incompatible_reliability_reader.last_incompatible_qos(),
            eprosima::fastdds::dds::RELIABILITY_QOS_POLICY_ID);
    EXPECT_FALSE(incompatible_reliability_reader.is_matched());

    // Another Reader on the same Topic but with incompatible QoS
    // Should not match and trigger incompatible QoS condition on both Writer and Reader
    // Total count of incompatible QoS occurrences in Writer increments, and updates the latest incompatible QoS ID,
    // but old Reader stays the same
    PubSubReaderWithWaitsets<HelloWorldType> incompatible_durability_reader(TEST_TOPIC_NAME);
    incompatible_durability_reader.reliability(eprosima::fastrtps::BEST_EFFORT_RELIABILITY_QOS)
            .durability_kind(eprosima::fastrtps::TRANSIENT_LOCAL_DURABILITY_QOS)
            .init();
    ASSERT_TRUE(incompatible_durability_reader.isInitialized());

    writer.wait_incompatible_qos(2);
    incompatible_durability_reader.wait_incompatible_qos(1);

    EXPECT_EQ(writer.times_incompatible_qos(), 2u);
    EXPECT_EQ(writer.last_incompatible_qos(), eprosima::fastdds::dds::DURABILITY_QOS_POLICY_ID);
    EXPECT_FALSE(writer.is_matched());

    EXPECT_EQ(incompatible_reliability_reader.times_incompatible_qos(), 1u);
    EXPECT_EQ(incompatible_reliability_reader.last_incompatible_qos(),
            eprosima::fastdds::dds::RELIABILITY_QOS_POLICY_ID);
    EXPECT_FALSE(incompatible_reliability_reader.is_matched());

    EXPECT_EQ(incompatible_durability_reader.times_incompatible_qos(), 1u);
    EXPECT_EQ(incompatible_durability_reader.last_incompatible_qos(), eprosima::fastdds::dds::DURABILITY_QOS_POLICY_ID);
    EXPECT_FALSE(incompatible_durability_reader.is_matched());

    // Create another two writers equal to the first one.
    // Incompatible readers increase incompatible QoS occurrences by two
    PubSubWriterWithWaitsets<HelloWorldType> writer2(TEST_TOPIC_NAME);
    writer2.reliability(eprosima::fastrtps::BEST_EFFORT_RELIABILITY_QOS)
            .durability_kind(eprosima::fastrtps::VOLATILE_DURABILITY_QOS)
            .init();
    ASSERT_TRUE(writer2.isInitialized());

    PubSubWriterWithWaitsets<HelloWorldType> writer3(TEST_TOPIC_NAME);
    writer3.reliability(eprosima::fastrtps::BEST_EFFORT_RELIABILITY_QOS)
            .durability_kind(eprosima::fastrtps::VOLATILE_DURABILITY_QOS)
            .init();
    ASSERT_TRUE(writer3.isInitialized());

    // A compatible Reader on another Topic
    // Should not match but never trigger incompatible QoS conditions
    // Total count of incompatible QoS occurrences and latest incompatible QoS ID stay the same
    PubSubReaderWithWaitsets<HelloWorldType> compatible_reader(INCOMPATIBLE_TEST_TOPIC_NAME);
    compatible_reader.reliability(eprosima::fastrtps::BEST_EFFORT_RELIABILITY_QOS)
            .durability_kind(eprosima::fastrtps::VOLATILE_DURABILITY_QOS)
            .deactivate_status_listener(eprosima::fastdds::dds::StatusMask::requested_incompatible_qos())
            .init();
    ASSERT_TRUE(compatible_reader.isInitialized());

    writer2.wait_incompatible_qos(2);
    writer3.wait_incompatible_qos(2);
    incompatible_reliability_reader.wait_incompatible_qos(3);
    incompatible_durability_reader.wait_incompatible_qos(3);

    EXPECT_EQ(writer.times_incompatible_qos(), 2u);
    EXPECT_EQ(writer.last_incompatible_qos(), eprosima::fastdds::dds::DURABILITY_QOS_POLICY_ID);
    EXPECT_FALSE(writer.is_matched());

    EXPECT_EQ(writer2.times_incompatible_qos(), 2u);
    EXPECT_FALSE(writer2.is_matched());

    EXPECT_EQ(writer3.times_incompatible_qos(), 2u);
    EXPECT_FALSE(writer3.is_matched());

    EXPECT_EQ(incompatible_reliability_reader.times_incompatible_qos(), 3u);
    EXPECT_EQ(incompatible_reliability_reader.last_incompatible_qos(),
            eprosima::fastdds::dds::RELIABILITY_QOS_POLICY_ID);
    EXPECT_FALSE(incompatible_reliability_reader.is_matched());

    EXPECT_EQ(incompatible_durability_reader.times_incompatible_qos(), 3u);
    EXPECT_EQ(incompatible_durability_reader.last_incompatible_qos(), eprosima::fastdds::dds::DURABILITY_QOS_POLICY_ID);
    EXPECT_FALSE(incompatible_durability_reader.is_matched());

    EXPECT_EQ(compatible_reader.times_incompatible_qos(), 0u);
    EXPECT_EQ(compatible_reader.last_incompatible_qos(), eprosima::fastdds::dds::INVALID_QOS_POLICY_ID);
    EXPECT_FALSE(compatible_reader.is_matched());
}

TEST_P(DDSStatus, IncompatibleQosListeners)
{
    PubSubWriter<HelloWorldType> writer(TEST_TOPIC_NAME);
    writer.reliability(eprosima::fastrtps::BEST_EFFORT_RELIABILITY_QOS)
            .durability_kind(eprosima::fastrtps::VOLATILE_DURABILITY_QOS).init();
    ASSERT_TRUE(writer.isInitialized());

    // A Reader on the same Topic but with incompatible QoS
    // Should not match and call incompatible QoS callback on both Writer and Reader
    PubSubReader<HelloWorldType> incompatible_reliability_reader(TEST_TOPIC_NAME);
    incompatible_reliability_reader.reliability(eprosima::fastrtps::RELIABLE_RELIABILITY_QOS).init();
    ASSERT_TRUE(incompatible_reliability_reader.isInitialized());

    writer.wait_incompatible_qos(1);
    incompatible_reliability_reader.wait_incompatible_qos(1);

    EXPECT_EQ(writer.times_incompatible_qos(), 1u);
    EXPECT_EQ(writer.last_incompatible_qos(), eprosima::fastdds::dds::RELIABILITY_QOS_POLICY_ID);
    EXPECT_FALSE(writer.is_matched());

    EXPECT_EQ(incompatible_reliability_reader.times_incompatible_qos(), 1u);
    EXPECT_EQ(incompatible_reliability_reader.last_incompatible_qos(),
            eprosima::fastdds::dds::RELIABILITY_QOS_POLICY_ID);
    EXPECT_FALSE(incompatible_reliability_reader.is_matched());

    // Another Reader on the same Topic but with incompatible QoS
    // Should not match and call incompatible QoS callback on both Writer and Reader
    // Total count of incompatible QoS occurrences in Writer increments, and updates the latest incompatible QoS ID,
    // but old Reader stays the same
    PubSubReader<HelloWorldType> incompatible_durability_reader(TEST_TOPIC_NAME);
    incompatible_durability_reader.reliability(eprosima::fastrtps::BEST_EFFORT_RELIABILITY_QOS)
            .durability_kind(eprosima::fastrtps::TRANSIENT_LOCAL_DURABILITY_QOS).init();
    ASSERT_TRUE(incompatible_durability_reader.isInitialized());

    writer.wait_incompatible_qos(2);
    incompatible_durability_reader.wait_incompatible_qos(1);

    EXPECT_EQ(writer.times_incompatible_qos(), 2u);
    EXPECT_EQ(writer.last_incompatible_qos(), eprosima::fastdds::dds::DURABILITY_QOS_POLICY_ID);
    EXPECT_FALSE(writer.is_matched());

    EXPECT_EQ(incompatible_reliability_reader.times_incompatible_qos(), 1u);
    EXPECT_EQ(incompatible_reliability_reader.last_incompatible_qos(),
            eprosima::fastdds::dds::RELIABILITY_QOS_POLICY_ID);
    EXPECT_FALSE(incompatible_reliability_reader.is_matched());

    EXPECT_EQ(incompatible_durability_reader.times_incompatible_qos(), 1u);
    EXPECT_EQ(incompatible_durability_reader.last_incompatible_qos(), eprosima::fastdds::dds::DURABILITY_QOS_POLICY_ID);
    EXPECT_FALSE(incompatible_durability_reader.is_matched());

    // Create another two writers equal to the first one.
    // Incompatible readers increase incompatible QoS occurrences by two
    PubSubWriter<HelloWorldType> writer2(TEST_TOPIC_NAME);
    writer2.reliability(eprosima::fastrtps::BEST_EFFORT_RELIABILITY_QOS)
            .durability_kind(eprosima::fastrtps::VOLATILE_DURABILITY_QOS).init();
    ASSERT_TRUE(writer2.isInitialized());

    PubSubWriter<HelloWorldType> writer3(TEST_TOPIC_NAME);
    writer3.reliability(eprosima::fastrtps::BEST_EFFORT_RELIABILITY_QOS)
            .durability_kind(eprosima::fastrtps::VOLATILE_DURABILITY_QOS).init();
    ASSERT_TRUE(writer3.isInitialized());

    // A compatible Reader on another Topic
    // Should not match but never call incompatible QoS callbacks
    // Total count of incompatible QoS occurrences and latest incompatible QoS ID stay the same
    PubSubReader<HelloWorldType> compatible_reader(INCOMPATIBLE_TEST_TOPIC_NAME);
    compatible_reader.reliability(eprosima::fastrtps::BEST_EFFORT_RELIABILITY_QOS)
            .durability_kind(eprosima::fastrtps::VOLATILE_DURABILITY_QOS).init();
    ASSERT_TRUE(compatible_reader.isInitialized());

    writer2.wait_incompatible_qos(2);
    writer3.wait_incompatible_qos(2);
    incompatible_reliability_reader.wait_incompatible_qos(3);
    incompatible_durability_reader.wait_incompatible_qos(3);

    EXPECT_EQ(writer.times_incompatible_qos(), 2u);
    EXPECT_EQ(writer.last_incompatible_qos(), eprosima::fastdds::dds::DURABILITY_QOS_POLICY_ID);
    EXPECT_FALSE(writer.is_matched());

    EXPECT_EQ(writer2.times_incompatible_qos(), 2u);
    EXPECT_FALSE(writer2.is_matched());

    EXPECT_EQ(writer2.times_incompatible_qos(), 2u);
    EXPECT_FALSE(writer2.is_matched());

    EXPECT_EQ(incompatible_reliability_reader.times_incompatible_qos(), 3u);
    EXPECT_EQ(incompatible_reliability_reader.last_incompatible_qos(),
            eprosima::fastdds::dds::RELIABILITY_QOS_POLICY_ID);
    EXPECT_FALSE(incompatible_reliability_reader.is_matched());

    EXPECT_EQ(incompatible_durability_reader.times_incompatible_qos(), 3u);
    EXPECT_EQ(incompatible_durability_reader.last_incompatible_qos(), eprosima::fastdds::dds::DURABILITY_QOS_POLICY_ID);
    EXPECT_FALSE(incompatible_durability_reader.is_matched());

    EXPECT_EQ(compatible_reader.times_incompatible_qos(), 0u);
    EXPECT_EQ(compatible_reader.last_incompatible_qos(), eprosima::fastdds::dds::INVALID_QOS_POLICY_ID);
    EXPECT_FALSE(compatible_reader.is_matched());

    // Information on the inner status must match the one above
    eprosima::fastdds::dds::RequestedIncompatibleQosStatus wstatus;
    eprosima::fastdds::dds::RequestedIncompatibleQosStatus rstatus;

    wstatus = writer.get_incompatible_qos_status();
    EXPECT_EQ(writer.times_incompatible_qos(), wstatus.total_count);
    EXPECT_EQ(writer.last_incompatible_qos(), wstatus.last_policy_id);

    wstatus = writer2.get_incompatible_qos_status();
    EXPECT_EQ(writer2.times_incompatible_qos(), wstatus.total_count);
    EXPECT_EQ(writer2.last_incompatible_qos(), wstatus.last_policy_id);

    wstatus = writer3.get_incompatible_qos_status();
    EXPECT_EQ(writer3.times_incompatible_qos(), wstatus.total_count);
    EXPECT_EQ(writer3.last_incompatible_qos(), wstatus.last_policy_id);

    rstatus = incompatible_reliability_reader.get_incompatible_qos_status();
    EXPECT_EQ(incompatible_reliability_reader.times_incompatible_qos(), rstatus.total_count);
    EXPECT_EQ(incompatible_reliability_reader.last_incompatible_qos(), rstatus.last_policy_id);

    rstatus = incompatible_durability_reader.get_incompatible_qos_status();
    EXPECT_EQ(incompatible_durability_reader.times_incompatible_qos(), rstatus.total_count);
    EXPECT_EQ(incompatible_durability_reader.last_incompatible_qos(), rstatus.last_policy_id);

    rstatus = compatible_reader.get_incompatible_qos_status();
    EXPECT_EQ(compatible_reader.times_incompatible_qos(), rstatus.total_count);
    EXPECT_EQ(compatible_reader.last_incompatible_qos(), rstatus.last_policy_id);
}

TEST_P(DDSStatus, IncompatibleQosGetters)
{
    eprosima::fastdds::dds::RequestedIncompatibleQosStatus wstatus;
    eprosima::fastdds::dds::RequestedIncompatibleQosStatus rstatus;

    PubSubWriter<HelloWorldType> writer(TEST_TOPIC_NAME);
    writer.reliability(eprosima::fastrtps::BEST_EFFORT_RELIABILITY_QOS)
            .durability_kind(eprosima::fastrtps::VOLATILE_DURABILITY_QOS)
            .deactivate_status_listener(eprosima::fastdds::dds::StatusMask::offered_incompatible_qos()).init();
    ASSERT_TRUE(writer.isInitialized());

    // A Reader on the same Topic but with incompatible QoS
    // Should not match and increase the incompatible QoS occurrences on both Writer and Reader
    PubSubReader<HelloWorldType> incompatible_reliability_reader(TEST_TOPIC_NAME);
    incompatible_reliability_reader.reliability(eprosima::fastrtps::RELIABLE_RELIABILITY_QOS)
            .deactivate_status_listener(eprosima::fastdds::dds::StatusMask::requested_incompatible_qos()).init();
    ASSERT_TRUE(incompatible_reliability_reader.isInitialized());

    std::this_thread::sleep_for(std::chrono::seconds(2));

    EXPECT_FALSE(writer.is_matched());
    EXPECT_FALSE(incompatible_reliability_reader.is_matched());

    wstatus = writer.get_incompatible_qos_status();
    EXPECT_EQ(wstatus.total_count, 1u);
    EXPECT_EQ(wstatus.total_count_change, 1u);
    EXPECT_EQ(wstatus.last_policy_id, eprosima::fastdds::dds::RELIABILITY_QOS_POLICY_ID);

    //No listeners were called
    EXPECT_EQ(writer.times_incompatible_qos(), 0u);
    EXPECT_EQ(writer.last_incompatible_qos(), eprosima::fastdds::dds::INVALID_QOS_POLICY_ID);

    rstatus = incompatible_reliability_reader.get_incompatible_qos_status();
    EXPECT_EQ(rstatus.total_count, 1u);
    EXPECT_EQ(rstatus.total_count_change, 1u);
    EXPECT_EQ(rstatus.last_policy_id, eprosima::fastdds::dds::RELIABILITY_QOS_POLICY_ID);

    //No listeners were called
    EXPECT_EQ(incompatible_reliability_reader.times_incompatible_qos(), 0u);
    EXPECT_EQ(incompatible_reliability_reader.last_incompatible_qos(), eprosima::fastdds::dds::INVALID_QOS_POLICY_ID);

    // Another Reader on the same Topic but with incompatible QoS
    // Should not match and increase incompatible QoS occurrences on both Writer and Reader
    // Total count of incompatible QoS occurrences in Writer increments, and updates the latest incompatible QoS ID,
    // but old Reader stays the same
    PubSubReader<HelloWorldType> incompatible_durability_reader(TEST_TOPIC_NAME);
    incompatible_durability_reader.reliability(eprosima::fastrtps::BEST_EFFORT_RELIABILITY_QOS)
            .durability_kind(eprosima::fastrtps::TRANSIENT_LOCAL_DURABILITY_QOS)
            .deactivate_status_listener(eprosima::fastdds::dds::StatusMask::requested_incompatible_qos()).init();
    ASSERT_TRUE(incompatible_durability_reader.isInitialized());

    std::this_thread::sleep_for(std::chrono::seconds(2));

    EXPECT_FALSE(writer.is_matched());
    EXPECT_FALSE(incompatible_reliability_reader.is_matched());
    EXPECT_FALSE(incompatible_durability_reader.is_matched());

    wstatus = writer.get_incompatible_qos_status();
    EXPECT_EQ(wstatus.total_count, 2u);
    EXPECT_EQ(wstatus.total_count_change, 1u);
    EXPECT_EQ(wstatus.last_policy_id, eprosima::fastdds::dds::DURABILITY_QOS_POLICY_ID);

    //No listeners were called
    EXPECT_EQ(writer.times_incompatible_qos(), 0u);
    EXPECT_EQ(writer.last_incompatible_qos(), eprosima::fastdds::dds::INVALID_QOS_POLICY_ID);

    rstatus = incompatible_reliability_reader.get_incompatible_qos_status();
    EXPECT_EQ(rstatus.total_count, 1u);
    //total_count_change was reset on previous call to get_incompatible_qos_status
    EXPECT_EQ(rstatus.total_count_change, 0u);
    EXPECT_EQ(rstatus.last_policy_id, eprosima::fastdds::dds::RELIABILITY_QOS_POLICY_ID);

    //No listeners were called
    EXPECT_EQ(incompatible_reliability_reader.times_incompatible_qos(), 0u);
    EXPECT_EQ(incompatible_reliability_reader.last_incompatible_qos(), eprosima::fastdds::dds::INVALID_QOS_POLICY_ID);

    rstatus = incompatible_durability_reader.get_incompatible_qos_status();
    EXPECT_EQ(rstatus.total_count, 1u);
    EXPECT_EQ(rstatus.total_count_change, 1u);
    EXPECT_EQ(rstatus.last_policy_id, eprosima::fastdds::dds::DURABILITY_QOS_POLICY_ID);

    //No listeners were called
    EXPECT_EQ(incompatible_durability_reader.times_incompatible_qos(), 0u);
    EXPECT_EQ(incompatible_durability_reader.last_incompatible_qos(), eprosima::fastdds::dds::INVALID_QOS_POLICY_ID);

    // Create another two writers equal to the first one.
    // Incompatible readers increase incompatible QoS occurrences by two
    PubSubWriter<HelloWorldType> writer2(TEST_TOPIC_NAME);
    writer2.reliability(eprosima::fastrtps::BEST_EFFORT_RELIABILITY_QOS)
            .durability_kind(eprosima::fastrtps::VOLATILE_DURABILITY_QOS)
            .deactivate_status_listener(eprosima::fastdds::dds::StatusMask::offered_incompatible_qos()).init();
    ASSERT_TRUE(writer2.isInitialized());

    PubSubWriter<HelloWorldType> writer3(TEST_TOPIC_NAME);
    writer3.reliability(eprosima::fastrtps::BEST_EFFORT_RELIABILITY_QOS)
            .durability_kind(eprosima::fastrtps::VOLATILE_DURABILITY_QOS)
            .deactivate_status_listener(eprosima::fastdds::dds::StatusMask::offered_incompatible_qos()).init();
    ASSERT_TRUE(writer3.isInitialized());

    // A compatible Reader on another Topic
    // Should not match but never increase incompatible QoS occurrences
    PubSubReader<HelloWorldType> compatible_reader(INCOMPATIBLE_TEST_TOPIC_NAME);
    compatible_reader.reliability(eprosima::fastrtps::BEST_EFFORT_RELIABILITY_QOS)
            .durability_kind(eprosima::fastrtps::VOLATILE_DURABILITY_QOS)
            .deactivate_status_listener(eprosima::fastdds::dds::StatusMask::requested_incompatible_qos()).init();
    ASSERT_TRUE(compatible_reader.isInitialized());

    std::this_thread::sleep_for(std::chrono::seconds(2));

    EXPECT_FALSE(writer.is_matched());
    EXPECT_FALSE(incompatible_reliability_reader.is_matched());
    EXPECT_FALSE(incompatible_durability_reader.is_matched());
    EXPECT_FALSE(compatible_reader.is_matched());

    wstatus = writer.get_incompatible_qos_status();
    EXPECT_EQ(wstatus.total_count, 2u);
    //total_count_change was reset on previous call to get_incompatible_qos_status
    EXPECT_EQ(wstatus.total_count_change, 0u);
    EXPECT_EQ(wstatus.last_policy_id, eprosima::fastdds::dds::DURABILITY_QOS_POLICY_ID);

    //No listeners were called
    EXPECT_EQ(writer.times_incompatible_qos(), 0u);
    EXPECT_EQ(writer.last_incompatible_qos(), eprosima::fastdds::dds::INVALID_QOS_POLICY_ID);

    wstatus = writer2.get_incompatible_qos_status();
    EXPECT_EQ(wstatus.total_count, 2u);
    //This is the fist time we call to get_incompatible_qos_status on this writer
    EXPECT_EQ(wstatus.total_count_change, 2u);

    //No listeners were called
    EXPECT_EQ(writer2.times_incompatible_qos(), 0u);
    EXPECT_EQ(writer2.last_incompatible_qos(), eprosima::fastdds::dds::INVALID_QOS_POLICY_ID);

    wstatus = writer3.get_incompatible_qos_status();
    EXPECT_EQ(wstatus.total_count, 2u);
    //This is the fist time we call to get_incompatible_qos_status on this writer
    EXPECT_EQ(wstatus.total_count_change, 2u);

    //No listeners were called
    EXPECT_EQ(writer3.times_incompatible_qos(), 0u);
    EXPECT_EQ(writer3.last_incompatible_qos(), eprosima::fastdds::dds::INVALID_QOS_POLICY_ID);

    rstatus = incompatible_reliability_reader.get_incompatible_qos_status();
    EXPECT_EQ(rstatus.total_count, 3u);
    //total_count_change was reset on previous call to get_incompatible_qos_status
    EXPECT_EQ(rstatus.total_count_change, 2u);
    EXPECT_EQ(rstatus.last_policy_id, eprosima::fastdds::dds::RELIABILITY_QOS_POLICY_ID);

    //No listeners were called
    EXPECT_EQ(incompatible_reliability_reader.times_incompatible_qos(), 0u);
    EXPECT_EQ(incompatible_reliability_reader.last_incompatible_qos(), eprosima::fastdds::dds::INVALID_QOS_POLICY_ID);

    rstatus = incompatible_durability_reader.get_incompatible_qos_status();
    EXPECT_EQ(rstatus.total_count, 3u);
    //total_count_change was reset on previous call to get_incompatible_qos_status
    EXPECT_EQ(rstatus.total_count_change, 2u);
    EXPECT_EQ(rstatus.last_policy_id, eprosima::fastdds::dds::DURABILITY_QOS_POLICY_ID);

    //No listeners were called
    EXPECT_EQ(incompatible_durability_reader.times_incompatible_qos(), 0u);
    EXPECT_EQ(incompatible_durability_reader.last_incompatible_qos(), eprosima::fastdds::dds::INVALID_QOS_POLICY_ID);

    rstatus = compatible_reader.get_incompatible_qos_status();
    EXPECT_EQ(rstatus.total_count, 0u);
    EXPECT_EQ(rstatus.total_count_change, 0u);
    EXPECT_EQ(rstatus.last_policy_id, eprosima::fastdds::dds::INVALID_QOS_POLICY_ID);

    //No listeners were called
    EXPECT_EQ(compatible_reader.times_incompatible_qos(), 0u);
    EXPECT_EQ(compatible_reader.last_incompatible_qos(), eprosima::fastdds::dds::INVALID_QOS_POLICY_ID);
}

TEST_P(DDSStatus, LivelinessConditions)
{
    PubSubReaderWithWaitsets<HelloWorldType> reader(TEST_TOPIC_NAME);
    PubSubWriterWithWaitsets<HelloWorldType> writer(TEST_TOPIC_NAME);

    constexpr unsigned int participant_announcement_period_ms = 50000;

    writer.lease_duration(
        participant_announcement_period_ms * 3e-3, participant_announcement_period_ms * 1e-3);
    reader.lease_duration(
        participant_announcement_period_ms * 3e-3, participant_announcement_period_ms * 1e-3);

    // Number of samples to write
    unsigned int num_samples = 2;

    // Lease duration, announcement period, and sleep time, in milliseconds
    unsigned int sleep_ms = 10;
    unsigned int lease_duration_ms = 1000;
    unsigned int announcement_period_ms = 1;

    reader.reliability(RELIABLE_RELIABILITY_QOS)
            .liveliness_kind(MANUAL_BY_PARTICIPANT_LIVELINESS_QOS)
            .liveliness_lease_duration(lease_duration_ms * 1e-3)
            .init();
    writer.reliability(RELIABLE_RELIABILITY_QOS)
            .liveliness_kind(MANUAL_BY_PARTICIPANT_LIVELINESS_QOS)
            .liveliness_announcement_period(announcement_period_ms * 1e-3)
            .liveliness_lease_duration(lease_duration_ms * 1e-3)
            .init();

    ASSERT_TRUE(reader.isInitialized());
    ASSERT_TRUE(writer.isInitialized());

    // Wait for discovery.
    writer.wait_discovery();
    reader.wait_discovery();

    auto data = default_helloworld_data_generator(num_samples);
    reader.startReception(data);

    size_t count = 0;
    for (auto data_sample : data)
    {
        ++count;
        writer.send_sample(data_sample);
        reader.block_for_at_least(count);
        reader.wait_liveliness_recovered();
        std::this_thread::sleep_for(std::chrono::milliseconds(sleep_ms));
    }
    for (count = 0; count < num_samples; count++)
    {
        writer.assert_liveliness();
        std::this_thread::sleep_for(std::chrono::milliseconds(sleep_ms));
    }

    // Liveliness shouldn't have been lost
    EXPECT_EQ(writer.times_liveliness_lost(), 0u);
    EXPECT_EQ(reader.times_liveliness_lost(), 0u);
    EXPECT_EQ(reader.times_liveliness_recovered(), 1u);

    // Remove and re-create publisher, test liveliness on subscriber and the new publisher.
    writer.removePublisher();
    ASSERT_FALSE(writer.isInitialized());
    reader.wait_writer_undiscovery();
    writer.createPublisher();
    ASSERT_TRUE(writer.isInitialized());

    writer.wait_discovery();
    reader.wait_discovery();

    for (count = 0; count < num_samples; count++)
    {
        writer.assert_liveliness();
        std::this_thread::sleep_for(std::chrono::milliseconds(sleep_ms));
    }

    // Liveliness shouldn't have been lost
    EXPECT_EQ(writer.times_liveliness_lost(), 0u);
    EXPECT_EQ(reader.times_liveliness_lost(), 0u);
    EXPECT_EQ(reader.times_liveliness_recovered(), 2u);
}

TEST_P(DDSStatus, DeadlineConditions)
{
    // This test sets a short deadline (short compared to the write rate),
    // makes the writer send a few samples and checks that the deadline was missed every time
    // Uses a topic with no key

    PubSubReaderWithWaitsets<HelloWorldType> reader(TEST_TOPIC_NAME);
    PubSubWriterWithWaitsets<HelloWorldType> writer(TEST_TOPIC_NAME);

    // Write rate in milliseconds
    uint32_t writer_sleep_ms = 1000;
    // Number of samples written by writer
    uint32_t writer_samples = 3;
    // Deadline period in milliseconds
    uint32_t deadline_period_ms = 10;

    reader.deadline_period(deadline_period_ms * 1e-3).init();
    writer.deadline_period(deadline_period_ms * 1e-3).init();

    ASSERT_TRUE(reader.isInitialized());
    ASSERT_TRUE(writer.isInitialized());

    // Wait for discovery.
    writer.wait_discovery();
    reader.wait_discovery();

    auto data = default_helloworld_data_generator(writer_samples);

    reader.startReception(data);

    size_t count = 0;
    for (auto data_sample : data)
    {
        // Send data
        writer.send_sample(data_sample);
        ++count;
        reader.block_for_at_least(count);
        std::this_thread::sleep_for(std::chrono::milliseconds(writer_sleep_ms));
    }

    // All samples should have missed the deadline
    EXPECT_GE(writer.missed_deadlines(), writer_samples);
    EXPECT_GE(reader.missed_deadlines(), writer_samples);
}

TEST_P(DDSStatus, DataAvailableConditions)
{
    PubSubReaderWithWaitsets<HelloWorldType> reader(TEST_TOPIC_NAME);
    PubSubWriterWithWaitsets<HelloWorldType> writer(TEST_TOPIC_NAME);
    PubSubReaderWithWaitsets<HelloWorldType> subscriber_reader(TEST_TOPIC_NAME);

    // Waitset timeout in seconds
    uint32_t timeout_s = 2;

    // This reader will receive the data notification on the reader
    reader.history_depth(100).
            reliability(eprosima::fastrtps::RELIABLE_RELIABILITY_QOS).
            deactivate_status_listener(eprosima::fastdds::dds::StatusMask::data_on_readers());
    reader.waitset_timeout(timeout_s).init();
    ASSERT_TRUE(reader.isInitialized());

    writer.history_depth(100).init();
    ASSERT_TRUE(writer.isInitialized());

    // This reader will receive the data notification on the subscriber
    subscriber_reader.history_depth(100).
            reliability(eprosima::fastrtps::RELIABLE_RELIABILITY_QOS).
            deactivate_status_listener(eprosima::fastdds::dds::StatusMask::data_available());
    subscriber_reader.waitset_timeout(timeout_s).init();
    ASSERT_TRUE(reader.isInitialized());

    // Because its volatile the durability
    // Wait for discovery.
    writer.wait_discovery(2);
    reader.wait_discovery();
    subscriber_reader.wait_discovery();

    auto data = default_helloworld_data_generator();

    reader.startReception(data);
    subscriber_reader.startReception(data);

    // Send data
    writer.send(data);
    // In this test all data should be sent.
    ASSERT_TRUE(data.empty());
    // Block reader until reception finished or timeout.
    reader.block_for_all();
    subscriber_reader.block_for_all();

    // No timeouts until this point
    ASSERT_EQ(0u, reader.times_waitset_timeout());
    ASSERT_EQ(0u, subscriber_reader.times_waitset_timeout());

    // Now wait until at least one timeout occurs
    reader.wait_waitset_timeout();
    subscriber_reader.wait_waitset_timeout();
}

#ifdef INSTANTIATE_TEST_SUITE_P
#define GTEST_INSTANTIATE_TEST_MACRO(x, y, z, w) INSTANTIATE_TEST_SUITE_P(x, y, z, w)
#else
#define GTEST_INSTANTIATE_TEST_MACRO(x, y, z, w) INSTANTIATE_TEST_CASE_P(x, y, z, w)
#endif // ifdef INSTANTIATE_TEST_SUITE_P

GTEST_INSTANTIATE_TEST_MACRO(DDSStatus,
        DDSStatus,
        testing::Values(TRANSPORT, INTRAPROCESS, DATASHARING),
        [](const testing::TestParamInfo<DDSStatus::ParamType>& info)
        {
            switch (info.param)
            {
                case INTRAPROCESS:
                    return "Intraprocess";
                    break;
                case DATASHARING:
                    return "Datasharing";
                    break;
                case TRANSPORT:
                default:
                    return "Transport";
            }

        });