text:
Q: Function return type mismatch between header and corresponding source file in C++ I am currently very new to programming, and I am trying to figure out how header files work in C++.
I am trying to create a program that takes two numbers from the user, multiplies them together, and prints them out. However, when I am trying to learn how to include header files to the project, there is something odd that I noticed when I was messing with it. Here are the source files:
main.cpp
#include "computeValue.h"
#include <iostream>

float getUserValue()
{
    float userValue{};

    std::cout << "Enter a number.";
    std::cin >> userValue;

    return userValue;
}

int main()
{
    float userValue1{ getUserValue() };
    float userValue2{ getUserValue() };

    std::cout << computeValue( userValue1, userValue2 );
    return 0;
}

computeValue.cpp
int computeValue( float userValue1, float userValue2 )
{
    return userValue1*userValue2;
}

computeValue.h
float computeValue( float userValue1, float userValue2 );

As you can see, the return type in computeValue.cpp and computeValue.h for the function computeValue() is different. However, to my surprise, this compiles and works perfectly fine! No warnings or errors whatsoever.
I do note that if I switch the return type (making the return type float in computeValue.cpp and int in computeValue.h), it seems to break the program and it instead prints out random-looking long numbers instead, but again, no errors or warnings whatsoever.
Can someone give an explanation as to why this happens? Shouldn't this be a redefinition of the function and the compiler should spit out an error? If this is an expected behavior, then what return type will the function computeValue() have?


Lifting Gloves, Straps & Wraps. Kid's Clothing & Shoes. Men's Sandals & Flip Flops. Women's Sandals & Flip Flops. Elbow, Knee & Ankle Guards.
Punch Mitts, Thai Pads & Shields. Heart Rate Monitors & GPS.
Nose Clips & Ear Plugs. Pull Up & Push Up Bars. Penn SSV4500 Spinfisher V Spinning Fishing Reel. The new Spinfisher V includes several significant upgrades, making this the most advanced addition to your arsenal.
A total of 6 seals (9 seals on the live liner models) are used to create the new Water Tight Design used in the Spinfisher V. Whether you dunk the reel in the surf, or let it ride in the spray all the way home, you don&###x2019;t have to worry about saltwater getting into the gearbox or drag system. No backing needed because the rubber gasket keeps superline from slipping. Line Capacity Rings eliminates the question of how much line you have left when fighting a fish. 5 Shielded stainless steel bearing system.
Friction trip ramp prevents premature bail trip when casting. Attention International Buyers: DHL GlobalMail can take 2 to 6 weeks. This site will track the package until it leaves the United States and then no further updates will be available. Restricted items include but are not limited to undergarments and bathing suits. This listing is currently undergoing maintenance, we apologise for any inconvenience caused.
The item "Penn SSV4500 Spinfisher V Spinning Fishing Reel" is in sale since Sunday, December 17, 2017. This item is in the category "Sporting Goods\Fishing\Reels\Spinning Reels". The seller is "forzasports" and is located in Pen Argyl, Pennsylvania. This item can be shipped worldwide.


Absolutely the best value in the Tuscany community! The one you have waited for! Picture Perfect detached residence in the highly-desired & gated community of Tuscany. Upon entering this charmer,you are greeted by custom floors. The cook's kitchen boasts granite counters w/ a custom back splash, stainless steel appliances, rich cabinets, plenty of counter space & more! Cozy living room. Elegant dining area, perfect for family meals & Holiday gatherings. Travel upstairs to find 2 large bedrooms, including an impressive master suite. Each bedroom has its own private bathroom. The private yard offers custom hardscape, mature landscape & more! 2 car attached garage. Attractive HOA dues. The community of Tuscany offers fantastic amenities such as a sparking & inviting pool/spa area w/ BBQ center. Don't forget about the upscale Vineyards shopping center that everyone is talking about. For an added bonus, this property is located in the award-winning PRCS K-8 school district (per the LAUSD school finder website). Light, bright & oh so right! This is the one for you.


text:
DRC: Over one thousand prisoners escaped after armed group attacked Béni prison
October 21, 2020 Geraldine Boechat Zoom 0
Early this Tuesday morning, October 20, the prison in the town of Béni, in the province of North Kivu, was attacked by elements of the ADF movement, according to some authorities. Hundreds of prisoners were reportedly released.
It is an incursion that was carefully conducted, around 4 a.m. local time. The mayor of the city talks about an operation that was carried out in two stages. Heavily armed, a first group targeted the army position around the prison. A second group attacked directly at the prison complex. The main gates were broken down and the prisoners were taken out. The mayor of the city, quoted by AFP, speaks of 900 people in the wilderness.
There were exchanges of fire between law enforcement and defense forces with these armed assailants, who are, according to authorities, combatants of the Ugandan-origin movement ADF (Allied democratic forces). These ADF fighters had their comrades incarcerated in the prison.
The detainees who were taken hostage by the assailants were taken by the same assailants into the bush," said the acting mayor of Béni Modeste Bakwanamaha. Some managed to escape. They are returning in small numbers. Other detainees taken hostage went as far as Virunga National Park, where the ADF live. In the prison there were ADF detainees. We believe that they have come to free their own and take hostages from the other detainees. The trials were going to begin by the beginning of November and we believe that they wanted to remove their comrades from this activity. And unfortunately, they took other detainees with them to make them hostages. It is a time of desolation».
The details of the operation are not yet known precisely, but according to the authorities two prisoners were killed and several hundred escaped. Other sources speak of casualties among the military as well. In any case, fear has spread throughout the city. But also disappointment. Disappointment at the fact that the alleged ADF who were soon to be tried escaped justice in this way.
The situation is confused around the prison, which has already experienced events of this type. In 2017, at least 900 prisoners also escaped following another attack by armed fighters.
Modeste Bakwanamaha
Ugandan
About Geraldine Boechat	1806 Articles
Senior Editor for Medafrica Times and former journalist for Swiss National Television. former NGO team leader in Burundi and Somalia
Nigeria: Amnesty International reported several deaths as demonstrations are brutally dispersed by police
Nigeria : Eruption of violence throughout the country

redpajama_set_name: RedPajamaCommonCrawl


With a vision to sustain in the competitive market, Paramount Surgimed Limited incepted in 1993, opened its division- Osim India in 2004 have established themselves as a reputed Supplier, Importer and Retailer of high quality lifestyle products. We take pride in facilitating wide range of products which includes Massage Chairs, Foot Massagers, Back Massagers and innovative fitness machines under the brand name OSIM. We procure our products from leading manufacturers who formulate these products by using fine quality material and machines. The company works with the constructs of quality, affordable prices and innovation. Apart from this, by integrating high quality standards, transparent dealings, ethical business policies, customer centric approach, wide distribution network and on-time delivery schedules, we have been flourishing in fulfilling the demands of client consequently not only in India but globally.We have established a spacious warehouse that is equipped with all required facilities. We store the products in a systematic order as per their category and labels. Moreover, our flawless transportation facilities assist us to supply products to clients within the shortest possible time frame. We are assisted by experienced professionals who are experts in their respective areas.
Distribution NetworkOSIM has budgeted huge amounts of money for setting up exclusive outlets across India promoting OSIM brand. OSIM India has already opened exclusive company owned showrooms and multiple point of sales in the country in 14 years. These include exclusive showrooms/point of sales in Delhi, Gurgaon, Noida, Bangalore, Mumbai, Pune, Lucknow, and Gujarat. By the end of next year OSIM plans to expand and set up more exclusive showrooms/outlets. OSIM has offices in Delhi, Bangalore, Pune, Mumbai. OSIM has a dream to be present in every state and district headquarters of this country.OSIM has presence in the Shoppers Stop, Home Stop, and CROMA in various cities across.
Our organization lay special emphasis on the quality of the products, owing to which, we have mustered huge client-base across the national and international market. We are committed to improving the health and well-being of our clients worldwide. To order to ensure quality, these products are manufactured with the help of quality-assured raw materials at our vendors' premises. Further, to match up with the industry set norms and guidelines, these products are checked on various parameters by our team of quality controllers.
Sports events at Clubs, Conferences, and Seminars.
OSIM produces superior designs focusing and following ergonomic guidelines along with quality features. OSIM International Ltd., is fast becoming the global leader in lifestyle and health, related products and is currently operating 111 cities, 24 countries with over 800 outlets. OSIM is Singapore's largest manufacturer of lifestyle and healthcare products.
Our TeamSupported by a team of diligent and dexterous professionals, we have been able to distribute and trade a wide array of products.


text:
Home / Primal Nature
Primal Nature
By Monique Singleton
Genre: Dystopian and Futuristic, Fantasy, Paranormal, Suspense Thrillers, Urban Fantasy
Get free chapters of Primal Nature
For Fans Of
Patricia Briggs c.n. crawford justin Sloan J.A Capriano Jeaniene Frost Nalini Singh Kresley Cole Kim harrison Darynda Jones Chloe Neill Laurell K Hamilton Kelly Armstrong Ilona Andrews Sherrilyn Kenyon Charlaine Harris Larissa Ione Gena Showalter Thea Harrison Richelle Mead Lara Adrian Deborah Harkness Jim Butcher Anne Bishop Karen Chance Rachel Vincent Stacia Kane Carrie Vaughn Robin McKinley Molly Harper Christine Feehan Dianne Duvall Eileen Wilks J.D. Robb Kia Carrington-Russel Faith Hunter Becca Fitzpatrick Charles de Lint Veronica Roth Suzanne Collins James Dashner Lauen Oliver Devyn Jayse Holly Evans Lisa Smeaton K.R. Thompson Sara C. Roethle Blaise Corvin Michelle Madow Laura Thalassa Steve McHugh Kel Kade Tansey Morgan Stephen King Tessa Dawn Lincoln cole Izzy Shows McKenzie Hunter Bianca Scardoni Bella Forest Glenna Sinclair Erin Bedford Rowan Casey
How would you like to be immortal?
Sounds like a dream. But what if immortality is submerged in blood and murder? What if it's a never-ending nightmare.
Known simply as "subject 366", she was the unwilling object of sinister and brutal experiments designed to reproduce her enormous strength, healing powers, and apparent immortality.
It didn't work out that way.
After years of abuse, the scientists unintentionally released her primal nature. The extent of her new talents manifested itself in an all-out massacre, resulting in their demise and her escape.
From the sweltering heat of the former Mexican desert, her journey leads her through the jungles of Middle America to the Amazon region of Colombia.
Against the backdrop of global war, she fights her own grueling battle to find out what she has become. A killer. A monster. or maybe even worse: Evil incarnate.
Immortality comes with a hefty price tag: her sanity.
Primal Nature is the first book in the Primal series. It is available at Smashwords, Kobo, Apple and Barnes&Noble.
ISBN number: 9781310226786
please visit my website at www.moniquesingleton.com for more information.
Monique writes compelling stories that mix fantasy with realistic psychological suspense and unique insights into the mind of the main characters.
Her style conveys a sense of irony and understatement that provides a counterpoint to the fantastic events of the story. She doesn't overwrite or linger on description. Her prose is unadorned, lean, supple and muscular. the story moves and gathers a great deal of power.
Monique's characters practically leap off the page.
Outcast Trilogy, Book 3: Rule Changer By Patricia Bernard
What A Day To End The World
Raven Song (Book One of Inoki's Game)
Monique Singleton's Books
Nature of the Beast
Into The Lion's Den
The Prophecy
Assassin's Choice: The Prophecy Series, Book 1
Monique Singleton writes compelling stories that mix fantasy with realistic psychological suspense and unique insights into the mind of the main characters.
Her style conveys a sense of irony and understatement that provides a counterpoint to the fantastic events of the story. She doesn't overwrite, or linger on description. Her prose is unadorned, lean, supple, and muscular. It is not the usual feminine fiction. The story moves and gathers a great deal of power.
Monique's characters practically leap off the page. The main character, especially, has a tremendous amount of personality that comes through marvelously well. She is sardonic, cynical, and chillingly frank, but she has real personality, and although she hates humans, there is something engaging about her. Despite her prickly personality, readers will identify with her. She is a person—well, she isn't human, or claims not to be, but she's still a person, for all that she changes in a super-fierce feline creature—who is treated unjustly and defies authority, telling the powers that be to go to hell, and anyone who does that can't be all bad.
Immortality is forced on her in the Primal series. She never asked for it and doesn't want it. Now she must come to terms with what is basically an eternal life sentence.
For most of us, immortality would seem like a dream come true. Nothing could be further than the truth. Her Immortality was the ultimate nightmare. And that was even before she found out about the bloody price she has to pay for eternity.
To stay sane she must uncover the secret behind her immortality. Set against the background of world war three and four, she seeks not only clarity and a purpose in life but also a way that she can hang on to her fragile sanity.
Primal Series.
The Primal series follows a number of story lines that interact to form a greater whole. 2017 will see the launch of at least four books in the Primal series. Primal Nature and a perma-free novella Warmonger form the first acts of the story in February, followed by Nature of the Beast in April and The Beast inside in June. After that who knows. They story is not finished so there will be more to come.
If you would like to know more about this Indie author and the Primal books, you might want to check her website: moniquesingleton.com.
Personal background.
As the daughter of a British soldier and his Dutch wife, Monique was born in an English military hospital in Germany. The family toured the world where she was exposed to many cultures and countries. Finally settling down in the Netherlands she pursued a career in Art and later in ICT.
About six years ago Monique started putting the scenes she had running around in her head, down to paper.
Scenes led to a story, the story to a book, and the first book to a series.
In addition to her writing, Monique still holds down a full-time job as a business consultant. She lives in a beautiful old farmhouse in the south of Holland with her two soppy monster dogs, some horses, and a cat.
The cat is the boss.


Double Fold Brochure Template double fold brochure template free bi fold brochure templates examples free templates printable. double fold brochure template moenia bi fold brochure template brochure templates pixeden. double fold brochure template corporate bi fold brochure template brochure templates pixeden free. Double Fold Brochure Template double fold brochure template 32 beautiful examples of bi fold brochures to inspire you free download. double fold brochure template 33 bi fold brochure templates free word pdf psd eps indesign printable. double fold brochure template bi fold brochure template free 33 bi fold brochure templates free free. Double Fold Brochure Template double fold brochure template 33 bi fold brochure templates free word pdf psd eps indesign template.
Double Fold Brochure Template double fold brochure template moenia bi fold brochure template brochure templates pixeden. double fold brochure template corporate bi fold brochure template brochure templates pixeden free. double fold brochure template 32 beautiful examples of bi fold brochures to inspire you free download. double fold brochure template 33 bi fold brochure templates free word pdf psd eps indesign printable. double fold brochure template bi fold brochure template free 33 bi fold brochure templates free free.


Cut to Size Foam - Call Us Today for your QUOTE!
As a hobbyist, getting supplies for a project is sometimes a challenge, especially when you need items sold in the wholesale market. I have built and restored heirloom furniture for 20 plus years. Recently I took on a project to restore a 30 year old recliner. One of sentimental value, I purchased just after finishing college. I've spent quite a large amount of time inquiring to local people and internet searches for a company that would sell professional grade upholstery supplies to the general public. Every local company and internet site it seemed wholesale only. I was to the point of walking away from the project. By chance, I discovered your company during an internet search. Your website was very helpful and allowed easy review of the items needed. I was delighted to learn, you sell online and to individuals. I took a chance, not knowing anything about Genco other than the Christian icon, and ordered just over $500.00 in supplies for my project at 6pm on Wednesday. The package arrived Friday afternoon of the same week. The shipment was perfect, everything in order. I started the restoration project on Saturday. Thank you for your faithfulness, accuracy and product offering. I will be sure to pass on your company name to those who like I have had difficulty finding upholstery supplies.
" Genco Supplies has been great to work with over the years. They always try to help if you have any problems locating products for the upholstery trade. "
" For many years, our family business has depended on Genco for most of our supplies and materials. Their excellent pricing, support, and personal attention has been irreplaceable! "
" Shannon Upholstery has been with Genco Supplies since the first day they went into business. They go out of their way for you. If they don't have it, they will find it. Prices are competitive. Other companies have came and gone, Genco Supplies will always be there. "
" Genco has any supplies you could ever need for upholstering. They totally supply our stores upholstery department. They are a wonderful group of people to work with. "
" I have been doing business with Genco since they opened their doors. Everyone there goes out of their way to help me in all aspects of my business. I really appreciate the fact that David delivers my supplies to me regularly, so that I am not charged with the freight. You couldn't ask for a better gruop of professional people. "
" We have been customers of Genco's for over 25 years. We have always received excellent service and prompt delivery. They have always been a great family business to deal with. "
I have been dealing with Genco for the better part of 30 years. They have always gone out of their way to help my business. You cannot beat their delivery time with 2 locations and their traveling salesman. If you need it, they will do their best to get it. Thanks to Gene and the whole gang at Genco for everything!
~ Danny Aye Buggs Island Upholstery - Chase City, VA.
" We have done business with Genco for over 20 years. They are friendly, professional, and efficient. We love our sales reps, they have taken care of us. Even better, we love the fact that Genco sends a truck loaded with goodies every 6 weeks for us to look forward to shopping from, along with our normal orders to bring so we have no shipping costs. If they donot have what we are looking for, I can rest easy in the knowledge that they will find it for me. They go out of their way to please their clients. Genco is a great company to work with. "


text:
Alice Kohli
Alice Kohli works as a researcher for the Swiss NGO Public Eye, investigating human rights abuses and social injustice. Previously, she worked as a data journalist for the Swiss daily newspaper Neue Zürcher Zeitung, where she also participated in the project The Migrants' Files. The project shed light on the number of refugees who died or went missing on their journey to Europe. It won the Data Journalism Awards in 2014 and the European Press Prize in 2015.
Alice Kohli won the 2015 European Press Prize Innovation Award with 'The Migrants' Files: Surveying migrants' deaths at Europe's door'
Zürich 14.112.2015 - Mitarbeiter Erklärung von Bern (EvB). Photo: Marion Nitsch


text:
In our retail store, our commitment to customer service is second to none. You need to learn how your camera uses the flash with each setting or scene mode that it has. Include beauty face, landscape, action freeze, waterfall, silhouette, sunset, night, fireworks and more to optimize camera settings for various environments. The wide f/1.7 aperture lens might not be any wider than the Galaxy S7's, but it lets enough light through to create that lovely shallow-depth-of-field look. In fact, Panasonic has also entered into an alliance with German camera maker, Leica to develop still digital cameras. To see a live display of the image being detected by the camera you selected, click the Video Preview area.
The early camera that first became a phenomenon was a little more than a pinhole camera and can be traced back to 1558. Masing-masing produsen dan jenis camera emang memanfaatkan bagian ini untuk …
Article About Technology (2)
This page includes information about articles that are considered to be most influential in the field of educational technology and/or related fields. Indeed, until recently, it was believed that the development of technology was restricted only to human beings, but recent scientific studies indicate that other primates and certain dolphin communities have developed simple tools and learned to pass their knowledge to other generations.Technology can be viewed as an activity that forms or changes culture.11 Additionally, technology is the application of math, science, and the arts for the benefit of life as it is known.
In the case of businesses that have companies located in different parts of the world, technology has helped cut down costs that would be incurred travelling for meetings and other obligations. Sleep Better: Switching off your phone and any device that might wake you up in the middle of the night would be ideal, however …
10 MCQ's Related To Science & Technology For Month Of May
It is difficult to stay up on all the current events in world affairs, as there is always some conflict going on or some negotiation between nations. To sum up the change in media and how it has changed is that as technology has moved on over the years it has affected the way things are being presented and how it can get to any information within minutes, for example September 11th was on our televisions just minutes after the first plane had crashed into the first tower, and how it came on our TV as 'breaking news' and that they had a news correspondent there live in New York.
The 2017 product showcase held at Apple Park, the company's new spaceship" headquarters in Cupertino, CA, included an upgraded Apple Watch, 4K Apple TV, as well as the next generation iPhones – 8 and 8S. Just as the presentation appeared …
List Of Emerging Technologies
From lightbulbs to thermostats and from doorbells to refrigerators, household electronics are getting smarter. The future of battery technology will include carbon-breathing batteries that turn CO2 into generate electricity, as well as diamond-based nuclear batteries" that run off of nuclear waste. The patents are heavily technical, discussing the process for incorporating the technology into devices, but indicate that the company is at least thinking about incorporating Liquidmetal into several products, including smartphones, tablets, and digital displays. From 2009-2011, she served as a senior policy advisor on emerging technology issues in the Office of the Commissioner at the U.S. Food & Drug Administration.
Ramesh Raskar is an associate professor at the Massachusetts Institute of Technology (MIT) Media Lab. A regular sight when perceived through our smartphone infused with the AR technology will be enhanced through the use of computer-generated sensory input such as sound, video, graphics and GPS data. At a …
The Future Of Satellite Television
Satelite de San Juan is an authorized DISH Satellite television retailer in San Juan, PR. Specializing in Satellite television and Internet service, Satelite de San Juan is your local choice for DISH service. Not only does this system provide you with the chance to watch satellite TV from a remote place whilst you are moving around, it also allows you to use it as an additional tuner in your own home. Another good thing about satellite mobile phones is that they are equipped with voicemail with indicators and incoming phone number so users will still know if they have calls waiting for them on an area with low signal strength. This satellite will greatly improve the competitiveness of satellite in this field.
Dish Network, first of all offers no hidden fees in their pricing-They lay it all on the table for you. C band digunakan untuk fixed satellite dan tidak …
Georgia Tech Student Scout Schultz, Who Was Killed By Police, Made Call About Suspicious Man,
Tech packs are important to give the right information to factories about how they should proceed with garment development and production. Our Startup Ecosystem programs help underrepresented founders and teams in EdTech, FinTech, HealthTech, Frontier Tech and PeopleTech to build world changing businesses. Wireless Technology today, are robust, easy to use, and are portable as there are no cables involved. News for instance can be filtered with use of lot of categories according to interest wise in and words that the news need to contain. Facebook is adding new standards that will keep advertising off fake news videos and objectionable content.
Sometimes, dedicated tech media bring out news on business management software and database management system. If most of the business these days is mainly about moving bits around data bases, it's pretty clear that the big tech companies are going to have more expertise than banks that don't see …
Innovation And Modern Technology
In this time the technology offers us a big number of services that facilitate in a monumental way our lives, its go from phone services, internet, automatic teller, the use of satellites for the search of objects or people, these technological services help us for make our life a little more pleasant and easier to take but the same as their advantages these technology possess a great quantity of disadvantages which affect the development of the work life, the family environment, the social relationships and they affect the health of people that don't have a rational use of the technology. Many of us that enjoy taking advantage of the latest communications technologies to become available on the public marketplace find it difficult to get such an inspiring and tantalizing technology as 4G mobile off our minds. This is a modern technology currently dazzling the world with its amazing features. While …
Information Technology Degree (2)
In order to be relevant in the workplace, you need skills that are relevant to the demands of today's technology driven world. The Bachelor of Information Technology (BIT) offers four distinct programs: Information Resource Management (IRM), Interactive Multimedia and Design (IMD), Network Technology (NET) and Photonics and Laser Technology (PLT). Receiving any type of advanced training or a degree in information technology will set a job seeker up with an exceptionally valuable skill set. These jobs are still very generic and each of them has many specialization options.
The information technology profession is extremely diverse: IT workers can specialize in fields like software development, application management, hardware – desktop support, server or storage administrator – and network architecture. Oregon Tech's Enterprise Technology and Cybersecurity Lab (ETC) provides students with hands on access to a $1.5 million real world data center environment, equivalent to that found at any major organization. We …
The Tech Talent Charter (TTC) is a commitment by organisations to a set of undertakings that aim to deliver greater diversity in the tech workforce of the UK, one that better reflects the make-up of the population. First reason is the gross lack of understanding of the scientific and technical aspects of our day-to-day technology. Louisiana Tech is the highest ranked university in Louisiana in both average starting salary and average mid-career salaries for graduates ( 2014-2015 College Salary Report). Church tech should encourage and enhance, but not replace, the human part of the church experience.
I look forward to working together with everyone in finding more effective ways and actionable solutions to increasing diversity and inclusion in tech. Ltd Have came up with one of the Worlds most advanced and Robust E-Commerce Application of Urban Purple would enable the New and Upcoming Apparel Brands a cutting edge technology that …
Latest Technology Gadgets
The history of the modern computer begins with two separate technologies—automated calculation and programmability—but no single device can be identified as the earliest computer, partly because of the inconsistent application of that term. One of my go-to curation technology partners has been Mass Relevance One of our large and currently in-market programs AT&T's #BeTheFan program leverages the Mass Relevance API to pull in hashtagged #BeTheFan cross channel entries for the program. For now, many people prefer to adopt a silent" position with regard to innovations, enjoying the latest developments while worrying for the future. Even with the latest PTF technology, light hair may still require more treatments than dark hair.
The technology would allow drivers to have their cars take control on what he called major roads" like highways. I recently met with the Samba TV team (Formerly Flingo) and was impressed by its offering. But DARPA has a history …


text:
Eriksson beats stress factor
Sven-Goran Eriksson likened the pressure on managers to a constant "hammer" as he insisted the key to survival is learning to switch off.
Concerns over the stress levels on managers have increased following Gerard Houllier's heart operation, while Sir Alex Ferguson believes the pressure is greater than ever before.
Eriksson, however, has always displayed an ice cool image even when he was struggling at Lazio just before he joined England.
The secret for the Swede is following the Rudyard Kipling philosophy of treating victory and defeat in much the same manner.
He also believes that failing to switch off would drive any boss "crazy" because it is "dangerous" to think about football for 24 hours a day.
Eriksson declared: "The difference as England manager is that the pressure is enormous. But it is now and then - after this game against Sweden on Saturday we have three months before our next friendly.
"A club manager deals with a little bit less pressure from my experience, but they have it every day. It's like a hammer.
"You can't go on thinking about football for 24 hours a day. You have to resolve any problems and then sleep properly - or you would go crazy.
"Whatever the problem is, you must try to resolve it and not lie there thinking about it all night. That's dangerous." * Under-21 captain David Dunn will lead England into tonight's European championship play-off with Holland eternally grateful to his greatest critic and biggest fan.
He will run out thanking his grandfather - also named David - who ferried him around as a youngster and still helps to keep his feet on the ground.
"If you ask any of the young players now, you've got to be dedicated and committed to what you want to be," he said.
"When your mates were going out on a Friday and Saturday night you had to stay in.
"It's a little bit frustrating - but it's worked out for the best.
"My grandad put all the time and effort in taking me to different things, so I think that, if at 14 or 15, I'd turned round to him and said I didn't want to do it he'd have been a bit upset with me."


text:
//  (C) Copyright Jeremy Siek 1999. Permission to copy, use, modify,
//  sell and distribute this software is granted provided this
//  copyright notice appears in all copies. This software is provided
//  "as is" without express or implied warranty, and with no claim as
//  to its suitability for any purpose.

#ifndef BOOST_INT_ITERATOR_H
#define BOOST_INT_ITERATOR_H

#include <boost/iterator.hpp>
#if !defined BOOST_MSVC
#include <boost/operators.hpp>
#endif
#include <iostream>
//using namespace std;

#ifndef BOOST_NO_OPERATORS_IN_NAMESPACE
namespace boost {
#endif

// this should use random_access_iterator_helper but I've had
// VC++ portablility problems with that. -JGS
template <class IntT>
class int_iterator
{
  typedef int_iterator self;
public:
  typedef std::random_access_iterator_tag iterator_category;
  typedef IntT value_type;
  typedef IntT& reference;
  typedef IntT* pointer;
  typedef std::ptrdiff_t difference_type;

  inline int_iterator() : _i(0) { }
  inline int_iterator(IntT i) : _i(i) { }
  inline int_iterator(const self& x) : _i(x._i) { }
  inline self& operator=(const self& x) { _i = x._i; return *this; }
  inline IntT operator*() { return _i; }
  inline IntT operator[](IntT n) { return _i + n; }
  inline self& operator++() { ++_i; return *this; }
  inline self operator++(int) { self t = *this; ++_i; return t; }
  inline self& operator+=(IntT n) { _i += n; return *this; }
  inline self operator+(IntT n) { self t = *this; t += n; return t; }
  inline self& operator--() { --_i; return *this; }
  inline self operator--(int) { self t = *this; --_i; return t; }
  inline self& operator-=(IntT n) { _i -= n; return *this; }
  inline IntT operator-(const self& x) const { return _i - x._i; }
  inline bool operator==(const self& x) const { return _i == x._i; }
  // vc++ had a problem finding != in random_access_iterator_helper
  // need to look into this... for now implementing everything here -JGS
  inline bool operator!=(const self& x) const { return _i != x._i; }
  inline bool operator<(const self& x) const { return _i < x._i; }
  inline bool operator<=(const self& x) const { return _i <= x._i; }
  inline bool operator>(const self& x) const { return _i > x._i; }
  inline bool operator>=(const self& x) const { return _i >= x._i; }
protected:
  IntT _i;
};

template <class IntT>
inline int_iterator<IntT>
operator+(IntT n, int_iterator<IntT> t) { t += n; return t; }

#ifndef BOOST_NO_OPERATORS_IN_NAMESPACE
} /* namespace boost */
#endif

#ifdef BOOST_NO_OPERATORS_IN_NAMESPACE
namespace boost {
  using ::int_iterator;
}
#endif

#endif /* BOOST_INT_ITERATOR_H */

redpajama_set_name: RedPajamaGithub


text:
Q: Can I create a long lasting anonymous user in Firebase I didn't get this from reading the guide or docs. Can I use anonymous authentication to create a user session that will be functional for a long period of time (say 10 years)?

A: Sure. Just set the session length in the Login & Auth tab of your app's dashboard and don't call unauth().

redpajama_set_name: RedPajamaStackExchange


Heidi brings an extensive background in state education agency leadership, policy development, engagement and communications. She helps local, state and national education leaders, foundations and advocacy organizations to make smart decisions, strengthen policies and ensure key stakeholders are engaged along the way. Her past and current portfolio includes the Bill and Melinda Gates Foundation, By All Means through Harvard's Education Redesign Lab, the Council of Chief State School Officers and the Salem, MA, public schools.
Heidi is the child of public school teachers and grew up in a community where college wasn't a choice—it was a given. She has spent her professional career working toward building that culture in communities around the country. Heidi previously served as chief of staff and communications director for the Massachusetts Department of Elementary and Secondary Education. Earlier in her career she spent a decade covering national, state and local education news for The Associated Press in Boston and for several regional newspapers in eastern Massachusetts.
Originally from Rhode Island, Heidi attended Emerson College in Boston, where she studied professional writing and first caught the journalism bug. She currently lives in Salem, MA, with her husband and two school-aged sons, and on sunny days she is known to do conference calls while walking her chocolate lab, Jedi.
Retreating with my family each summer to Cape Cod to unplug, swim and play mini golf.
I read this article and found it very interesting, thought it might be something for you. The article is called Heidi Guarino and is located at https://education-first.com/who-we-are/people/heidi-guarino/.


Pentair | Wayzata, MN | Empirehouse, Inc.
Expertly crafted and installed glass-enclosed conference room in the newly renovated Pentair offices.
Empirehouse manufacturing capabilities and expertise perfectly combine to bring the design elements of a modern break-room together with the practicality and utility of a glass backsplash in the newly renovated Pentair offices.


Everybody likes animation. When done properly it looks beautiful, adds uniqueness, makes things more expressive. It can do wonders regarding driving traffic and boosting your website's popularity. Better yet, it is still not particularly widely used in web design – probably as a hold-over from the times of small bandwidths and non-optimized animation methods. For you, it is an opportunity to get ahead of your more conservative competitors – and you don't even have to hire a professional animation studio like Spiel Creative to create promotional animation videos.
If you aren't particularly tech-savvy or just want something that will work right out of the box, without much tinkering, Animate It! is a choice for you. It is well-optimized, offers a user-friendly interface and more than fifty animations that can be applied to actions like a scroll, hover and click. Selecting Animate It! Means you won't have to waste any time analyzing comparative advantages of animation sets offered by several plugins – it covers an impressive mix that is more than enough to start out.
Social Media Flying Icons perform two functions: on the one hand, they add movement to your website, making it look alive and active. On the other hand, they guarantee that your social media buttons are going to be noticed by the visitor, and you won't lose your precious likes and follows. As usual, the simplest solution is the best one – you won't have to create any complicated animations, as this plugin comes with smart-looking floating movement.
Enliven 'em is a port of a jQuery plugin which purpose is to animate any vector graphic in SVG format. It offers an impressive library of animations that begin playing as the image becomes visible in browser's viewport (which is a clever method of demonstrating animation on non-hover devices). The animation may be set to repeat if the user taps or clicks it.
One of the most popular WordPress slider plugins, MetaSlider allows for the creation of four different types of SEO-oriented slideshows. These can be further customized with a variety of options – you will find anything from a lightweight variant aimed at maximum effect alongside with minimal bandwidth use to one with 16 transition effects and a number of other features.
If you want the animation to accompany the visitor all the time he browses your website, why not prettify transitions from one page to another? Page Animations and Transitions offer nine animation effects (Fade, Rotate, Flip, etc.) that can be customized and tweaked to meet your requirements.
When you need to attract additional attention to a particular element of your website, there are few things more effective than adding hover effects to them. These will play an animation when the visitor scrolls over different options, making them stand out and encouraging the user to click them. There are many other similar plugins, but Image Hover Effects is unbeatable in terms of simplicity and ease of use. It offers more than 40 hover effects and a full-fledged set of admin options.
This simple yet powerful plugin displays a loading bar (shaped and colored according to your preferences) as the visitor opens your website. As different elements of your website are loaded, the progress bar will fill in, and when it fills up completely, the visitor is shown your website. There are two reasons to use this plugin: first, it assures the visitor that the website started loading. Second, it prevents the visitor from seeing your website as a mishmash of broken, half-loaded images while it gets loaded.
Animation plugins are a simple but effective way to liven up your website and direct the visitor's attention the way you want. Just don't overdo the things: too much animation is just as bad as no animation at all.


text:
using System;
using System.Collections.Generic;
using System.Diagnostics;
using System.Linq;
using Microsoft.Msagl.Core.DataStructures;
using Microsoft.Msagl.Core.Geometry;
using Microsoft.Msagl.Core.Geometry.Curves;
#if DEBUG
using Microsoft.Msagl.Core.Layout;
using Microsoft.Msagl.DebugHelpers;
#endif
using Microsoft.Msagl.Routing.Visibility;

namespace Microsoft.Msagl.Routing.Spline.ConeSpanner {
    /// <summary>
    /// sweeps a given direction of cones and adds discovered edges to the graph
    /// </summary>
    internal class LineSweeper : LineSweeperBase, IConeSweeper {
        public Point ConeRightSideDirection { get; set; }
        public Point ConeLeftSideDirection { get; set; }

        readonly ConeSideComparer coneSideComparer;
        readonly VisibilityGraph visibilityGraph;

        readonly RbTree<ConeSide> rightConeSides;
        readonly RbTree<ConeSide> leftConeSides;
        VisibilityGraph portEdgesGraph;
        internal Func<VisibilityVertex, VisibilityVertex, VisibilityEdge> PortEdgesCreator { get; set; }

        LineSweeper(IEnumerable<Polyline> obstacles, Point direction, Point coneRsDir, Point coneLsDir,
                    VisibilityGraph visibilityGraph, Set<Point> ports, Polyline borderPolyline)
            : base(obstacles, direction) {
            this.visibilityGraph = visibilityGraph;
            ConeRightSideDirection = coneRsDir;
            ConeLeftSideDirection = coneLsDir;
            coneSideComparer = new ConeSideComparer(this);
            leftConeSides = new RbTree<ConeSide>(coneSideComparer);
            rightConeSides = new RbTree<ConeSide>(coneSideComparer);
            Ports = ports;
            BorderPolyline = borderPolyline;
            PortEdgesCreator = (a, b) => new TollFreeVisibilityEdge(a, b);
        }

        Polyline BorderPolyline { get; set; }

        internal static void Sweep(
            IEnumerable<Polyline> obstacles,
            Point direction,
            double coneAngle,
            VisibilityGraph visibilityGraph,
            Set<Point> ports,
            Polyline borderPolyline) {

            var cs = new LineSweeper(obstacles, direction, direction.Rotate(-coneAngle/2),
                                     direction.Rotate(coneAngle/2), visibilityGraph, ports,
                                     borderPolyline);
            cs.Calculate();
        }

        void Calculate() {
            InitQueueOfEvents();
            while (EventQueue.Count > 0)
                ProcessEvent(EventQueue.Dequeue());
            if (BorderPolyline != null)
                CloseRemainingCones();
            CreatePortEdges();

        }

        void CreatePortEdges() {
            if (portEdgesGraph != null)
                foreach (var edge in portEdgesGraph.Edges) {
                    visibilityGraph.AddEdge(edge.SourcePoint, edge.TargetPoint, PortEdgesCreator);
                }
        }

        void CloseRemainingCones() {
            if (leftConeSides.Count == 0)
                return;
            Debug.Assert(leftConeSides.Count == rightConeSides.Count);

            PolylinePoint p = BorderPolyline.StartPoint;
            var steps=leftConeSides.Count; //we cannot make more than leftConeSides.Count if the data is correct
            //because at each step we remove at least one cone
            do {
                var cone = leftConeSides.TreeMinimum().Item.Cone;
                p = FindPolylineSideIntersectingConeRightSide(p, cone);
                p = GetPolylinePointInsideOfConeAndRemoveCones(p, cone);
                steps--;
            } while (leftConeSides.Count > 0 && steps>0);
        }

        PolylinePoint GetPolylinePointInsideOfConeAndRemoveCones(PolylinePoint p, Cone cone) {
            var pn = p.NextOnPolyline;
            Point insidePoint = FindInsidePoint(p.Point, pn.Point, cone);

            if (ApproximateComparer.Close(insidePoint, p.Point)) {
                AddEdgeAndRemoveCone(cone, p.Point);
                AddEdgesAndRemoveRemainingConesByPoint(p.Point);
                //we don't move p forward here. In the next iteration we just cross [p,pn] with the new leftmost cone right side
            } else if (ApproximateComparer.Close(insidePoint, pn.Point)) {
                AddEdgeAndRemoveCone(cone, pn.Point);
                AddEdgesAndRemoveRemainingConesByPoint(pn.Point);
                p = pn;
            } else {
                p = InsertPointIntoPolylineAfter(BorderPolyline, p, insidePoint);
                AddEdgeAndRemoveCone(cone, p.Point);
                AddEdgesAndRemoveRemainingConesByPoint(p.Point);
            }
            return p;
        }

        static Point FindInsidePoint(Point leftPoint, Point rightPoint, Cone cone) {
            //            if (debug)
            //                LayoutAlgorithmSettings.Show(CurveFactory.CreateCircle(3, leftPoint),
            //                                             CurveFactory.CreateDiamond(3, 3, rightPoint),
            //                                             BorderPolyline, ExtendSegmentToZ(cone.LeftSide),
            //                                             ExtendSegmentToZ(cone.RightSide));
            return FindInsidePointBool(leftPoint, rightPoint, cone.Apex, cone.Apex + cone.LeftSideDirection,
                                       cone.Apex + cone.RightSideDirection);
        }

        static Point FindInsidePointBool(Point leftPoint, Point rightPoint, Point apex, Point leftSideConePoint,
                                         Point rightSideConePoint) {
            if (ApproximateComparer.Close(leftPoint, rightPoint))
                return leftPoint; //does not matter which one to return
            if (Point.PointIsInsideCone(leftPoint, apex, leftSideConePoint, rightSideConePoint))
                return leftPoint;

            if (Point.PointIsInsideCone(rightPoint, apex, leftSideConePoint, rightSideConePoint))
                return rightPoint;

            var m = 0.5 * (leftPoint + rightPoint);

            if (Point.PointToTheLeftOfLine(m, apex, leftSideConePoint))
                return FindInsidePointBool(m, rightPoint, apex, leftSideConePoint, rightSideConePoint);

            return FindInsidePointBool(leftPoint, m, apex, leftSideConePoint, rightSideConePoint);
        }

        void AddEdgesAndRemoveRemainingConesByPoint(Point point) {
            var conesToRemove = new List<Cone>();
            foreach (var leftConeSide in leftConeSides) {
                if (Point.PointToTheRightOfLineOrOnLine(point, leftConeSide.Start,
                                                        leftConeSide.Start + leftConeSide.Direction))
                    conesToRemove.Add(leftConeSide.Cone);
                else
                    break;
            }
            foreach (var cone in conesToRemove) {
                AddEdgeAndRemoveCone(cone, point);
            }
        }

        PolylinePoint FindPolylineSideIntersectingConeRightSide(PolylinePoint p, Cone cone) {
            var startPoint = p;
            var a = cone.Apex;
            var b = cone.Apex + ConeRightSideDirection;
            var pSign = GetSign(p, a, b);
            do {
                var pn = p.NextOnPolyline;
                var pnSigh = GetSign(pn, a, b);
                if (pnSigh - pSign > 0)
                    return p;
                p = pn;
                pSign = pnSigh;
                if (p == startPoint)
                    throw new InvalidOperationException();
            } while (true);
            /*
                        throw new InvalidOleVariantTypeException();
            */
        }

        static int GetSign(PolylinePoint p, Point a, Point b) {
            var d = Point.SignedDoubledTriangleArea(a, b, p.Point);
            if (d < 0)
                return 1;
            return d > 0 ? -1 : 0;
        }

#if DEBUG && TEST_MSAGL
        [System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode")]
        void Showside(PolylinePoint p, Point a, Point b, PolylinePoint pn) {
            ShowBothTrees(new DebugCurve(100, 1, "brown", BorderPolyline), new DebugCurve(100, 2, "blue",
                                                                                new LineSegment(a, b)),
                          new DebugCurve(100, 2, "green",
                                         new LineSegment(
                                             pn.Point, p.Point)
                              ));
        }
#endif

        //        void CheckThatPolylineIsLegal()
        //        {
        //            var p = BorderPolyline.StartPoint;
        //            do
        //            {
        //                var pn = p.NextOnPolyline;
        //                Debug.Assert(!ApproximateComparer.Close(p.Point, pn.Point));
        //                Debug.Assert((pn.Point - p.Point)*(pn.NextOnPolyline.Point - pn.Point) > -ApproximateComparer.Tolerance);
        //                p = pn;
        //            } while (p != BorderPolyline.StartPoint);
        //        }

#if TEST_MSAGL
        [System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode")]
        void ShowBoundaryPolyline() {
            LayoutAlgorithmSettings.ShowDebugCurvesEnumeration(CreateBoundaryPolyDebugCurves());
        }

        [System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode")]
        IEnumerable<DebugCurve> CreateBoundaryPolyDebugCurves() {
            int i = 0;
            for (var p = BorderPolyline.StartPoint; p != null; p = p.Next) {
                yield return new DebugCurve(new Ellipse(1, 1, p.Point), i++);
            }
        }
#endif

        void AddEdgeAndRemoveCone(Cone cone, Point p) {
            if (Ports != null && Ports.Contains(cone.Apex))
                CreatePortEdge(cone, p);
            else
                visibilityGraph.AddEdge(cone.Apex, p);
            RemoveCone(cone);
        }

        /*********************
            A complication arises when we have overlaps. Loose obstacles become large enough to contain several
            ports. We need to avoid a situation when a port has degree more than one.
            To avoid this situation we redirect to p every edge incoming into cone.Apex.
            Notice that we create a new graph to keep port edges for ever
            direction of the sweep and the above procedure just alignes the edges better.
            In the resulting graph, which contains the sum of the graphs passed to AddDirection, of course
            a port can have an incoming and outcoming edge at the same time
            *******************/

        void CreatePortEdge(Cone cone, Point p) {
            if (portEdgesGraph == null) portEdgesGraph = new VisibilityGraph();
            var coneApexVert = portEdgesGraph.FindVertex(cone.Apex);
            //all previous edges adjacent to cone.Apex
            var edgesToFix = (coneApexVert != null)
                                 ? coneApexVert.InEdges.Concat(coneApexVert.OutEdges).ToArray()
                                 : null;
            if (edgesToFix != null)
                foreach (var edge in edgesToFix) {
                    var otherPort = (edge.Target == coneApexVert ? edge.Source : edge.Target).Point;
                    VisibilityGraph.RemoveEdge(edge);
                    portEdgesGraph.AddEdge(otherPort, p);
                }
            portEdgesGraph.AddEdge(cone.Apex, p);
        }

        internal static PolylinePoint InsertPointIntoPolylineAfter(Polyline borderPolyline, PolylinePoint insertAfter,
                                                                   Point pointToInsert) {
            PolylinePoint np;
            if (insertAfter.Next != null) {
                np = new PolylinePoint(pointToInsert) { Prev = insertAfter, Next = insertAfter.Next, Polyline = borderPolyline };
                insertAfter.Next.Prev = np;
                insertAfter.Next = np;
            } else {
                np = new PolylinePoint(pointToInsert) { Prev = insertAfter, Polyline = borderPolyline };
                insertAfter.Next = np;
                borderPolyline.EndPoint = np;
            }

            Debug.Assert(
                !(ApproximateComparer.Close(np.Point, np.PrevOnPolyline.Point) ||
                  ApproximateComparer.Close(np.Point, np.NextOnPolyline.Point)));

            borderPolyline.RequireInit();
            return np;
        }

        void ProcessEvent(SweepEvent p) {
//            if(debug && (p.Site-new Point(-313.122 ,-170.6)).Length<1)
//               Show( EllipseOnVert(p));
            var vertexEvent = p as VertexEvent;
            if (vertexEvent != null)
                ProcessVertexEvent(vertexEvent);
            else {
                var rightIntersectionEvent = p as RightIntersectionEvent;
                if (rightIntersectionEvent != null)
                    ProcessRightIntersectionEvent(rightIntersectionEvent);
                else {
                    var leftIntersectionEvent = p as LeftIntersectionEvent;
                    if (leftIntersectionEvent != null)
                        ProcessLeftIntersectionEvent(leftIntersectionEvent);
                    else {
                        var coneClosure = p as ConeClosureEvent;
                        if (coneClosure != null) {
                            if (!coneClosure.ConeToClose.Removed)
                                RemoveCone(coneClosure.ConeToClose);
                        } else
                            ProcessPortObstacleEvent((PortObstacleEvent)p);
                        Z = GetZ(p);
                    }
                }
            }
            //Debug.Assert(TreesAreCorrect());
        }
#if TEST_MSAGL
//        protected override bool TreesAreCorrect() {
//            return TreeIsCorrect(leftConeSides) && TreeIsCorrect(rightConeSides);
//        }
//
//        bool TreeIsCorrect(RbTree<ConeSide> tree) {
//            var y = double.NegativeInfinity;
//            foreach (var t in tree) {
//                var x = coneSideComparer.IntersectionOfSegmentAndSweepLine(t);
//                var yp = x*DirectionPerp;
//                if (yp < y - ApproximateComparer.DistanceEpsilon)
//                    return false;
//                y = yp;
//            }
//            return true;
//        }
#endif
        void ProcessPortObstacleEvent(PortObstacleEvent portObstacleEvent) {
            Z = GetZ(portObstacleEvent);
            GoOverConesSeeingVertexEvent(portObstacleEvent);
            CreateConeOnVertex(portObstacleEvent);
        }

        void ProcessLeftIntersectionEvent(LeftIntersectionEvent leftIntersectionEvent) {
            if (leftIntersectionEvent.coneLeftSide.Removed == false) {
                if (Math.Abs((leftIntersectionEvent.EndVertex.Point - leftIntersectionEvent.Site) * SweepDirection) <
                    ApproximateComparer.DistanceEpsilon) {
                    //the cone is totally covered by a horizontal segment
                    RemoveCone(leftIntersectionEvent.coneLeftSide.Cone);
                } else {
                    RemoveSegFromLeftTree(leftIntersectionEvent.coneLeftSide);
                    Z = SweepDirection * leftIntersectionEvent.Site; //it is safe now to restore the order
                    var leftSide = new BrokenConeSide(
                        leftIntersectionEvent.Site,
                        leftIntersectionEvent.EndVertex, leftIntersectionEvent.coneLeftSide);
                    InsertToTree(leftConeSides, leftSide);
                    leftIntersectionEvent.coneLeftSide.Cone.LeftSide = leftSide;
                    LookForIntersectionOfObstacleSideAndLeftConeSide(leftIntersectionEvent.Site,
                                                                     leftIntersectionEvent.EndVertex);
                    TryCreateConeClosureForLeftSide(leftSide);
                }
            } else
                Z = SweepDirection * leftIntersectionEvent.Site;
        }

        void TryCreateConeClosureForLeftSide(BrokenConeSide leftSide) {
            var coneRightSide = leftSide.Cone.RightSide as ConeRightSide;
            if (coneRightSide != null)
                if (
                    Point.GetTriangleOrientation(coneRightSide.Start, coneRightSide.Start + coneRightSide.Direction,
                                                 leftSide.EndVertex.Point) == TriangleOrientation.Clockwise)
                    CreateConeClosureEvent(leftSide, coneRightSide);
        }

        void CreateConeClosureEvent(BrokenConeSide brokenConeSide, ConeSide otherSide) {
            Point x;
#if DEBUG && TEST_MSAGL
            var r =
#endif
 Point.RayIntersectsRayInteriors(brokenConeSide.start, brokenConeSide.Direction, otherSide.Start,
                                                otherSide.Direction, out x);
#if DEBUG && TEST_MSAGL
            if (!r)
                LayoutAlgorithmSettings.ShowDebugCurves(
                    new DebugCurve(100, 0.1, "red",new LineSegment(brokenConeSide.Start, brokenConeSide.start + brokenConeSide.Direction)),
                    new DebugCurve(100,0.1, "black", new Ellipse(0.1,0.1, brokenConeSide.Start)),
                    new DebugCurve(100, 0.1, "blue",new LineSegment(otherSide.Start, otherSide.Start + otherSide.Direction)));
            Debug.Assert(r);
#endif
            EnqueueEvent(new ConeClosureEvent(x, brokenConeSide.Cone));
        }

        void ProcessRightIntersectionEvent(RightIntersectionEvent rightIntersectionEvent) {
            //restore Z for the time being
            // Z = PreviousZ;
            if (rightIntersectionEvent.coneRightSide.Removed == false) {
                //it can happen that the cone side participating in the intersection is gone;
                //obstracted by another obstacle or because of a vertex found inside of the cone
                //PrintOutRightSegTree();
                RemoveSegFromRightTree(rightIntersectionEvent.coneRightSide);
                Z = SweepDirection * rightIntersectionEvent.Site;
                var rightSide = new BrokenConeSide(
                    rightIntersectionEvent.Site,
                    rightIntersectionEvent.EndVertex, rightIntersectionEvent.coneRightSide);
                InsertToTree(rightConeSides, rightSide);
                rightIntersectionEvent.coneRightSide.Cone.RightSide = rightSide;
                LookForIntersectionOfObstacleSideAndRightConeSide(rightIntersectionEvent.Site,
                                                                  rightIntersectionEvent.EndVertex);

                TryCreateConeClosureForRightSide(rightSide);
            } else
                Z = SweepDirection * rightIntersectionEvent.Site;
        }

        void TryCreateConeClosureForRightSide(BrokenConeSide rightSide) {
            var coneLeftSide = rightSide.Cone.LeftSide as ConeLeftSide;
            if (coneLeftSide != null)
                if (
                    Point.GetTriangleOrientation(coneLeftSide.Start, coneLeftSide.Start + coneLeftSide.Direction,
                                                 rightSide.EndVertex.Point) == TriangleOrientation.Counterclockwise)
                    CreateConeClosureEvent(rightSide, coneLeftSide);
        }

        void RemoveConesClosedBySegment(Point leftPoint, Point rightPoint) {
            CloseConesCoveredBySegment(leftPoint, rightPoint,
                                       SweepDirection * leftPoint > SweepDirection * rightPoint
                                           ? leftConeSides
                                           : rightConeSides);
        }

        void CloseConesCoveredBySegment(Point leftPoint, Point rightPoint, RbTree<ConeSide> tree) {
            var node = tree.FindFirst(
                s => Point.GetTriangleOrientation(s.Start, s.Start + s.Direction, leftPoint) ==
                     TriangleOrientation.Counterclockwise);

            Point x;
            if (node == null || !Point.IntervalIntersectsRay(leftPoint, rightPoint,
                                                             node.Item.Start, node.Item.Direction, out x))
                return;
            var conesToRemove = new List<Cone>();
            do {
                conesToRemove.Add(node.Item.Cone);
                node = tree.Next(node);
            } while (node != null && Point.IntervalIntersectsRay(leftPoint, rightPoint,
                                                                 node.Item.Start, node.Item.Direction, out x));

            foreach (var cone in conesToRemove)
                RemoveCone(cone);
        }

        void ProcessVertexEvent(VertexEvent vertexEvent) {
//            if (count == 872 && (vertexEvent.Site - new Point(-130.7368, -305.908)).Length < 1)
//                Show(EllipseOnVert(vertexEvent));

            Z = GetZ(vertexEvent);
            //PrintOutLeftSegTree();
            //PrintOutRightSegTree();
            GoOverConesSeeingVertexEvent(vertexEvent);
            AddConeAndEnqueueEvents(vertexEvent);
        }

#if TEST_MSAGL
        // ReSharper disable UnusedMember.Local
        [System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode")]
        static Ellipse EllipseOnVert(SweepEvent vertexEvent) {
            // ReSharper restore UnusedMember.Local
            return new Ellipse(5, 5, vertexEvent.Site);
        }

        // ReSharper disable UnusedMember.Local
        [System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode")]
        static Ellipse EllipseOnPolylinePoint(PolylinePoint pp) {
            // ReSharper restore UnusedMember.Local
            return EllipseOnPolylinePoint(pp, 5);
        }
        // ReSharper disable UnusedMember.Local
        [System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode")]
        static Ellipse EllipseOnPolylinePoint(PolylinePoint pp, double i)
            // ReSharper restore UnusedMember.Local
        {
            return new Ellipse(i, i, pp.Point);
        }

        static ICurve Diamond(Point p) {
            return CurveFactory.CreateDiamond(2, 2, p);
        }

        // ReSharper disable UnusedMember.Local
        [System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Globalization",
            "CA1303:Do not pass literals as localized parameters", MessageId = "System.Console.WriteLine(System.String)"
            ),
         System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode")]
        void CheckConsistency() {
            // ReSharper restore UnusedMember.Local
            foreach (var s in rightConeSides) {
                coneSideComparer. SetOperand(s);
                if (!leftConeSides.Contains(s.Cone.LeftSide))
                    Console.WriteLine("bug");
            }
            foreach (var s in leftConeSides) {
                coneSideComparer.SetOperand(s);
                if (!rightConeSides.Contains(s.Cone.RightSide)) {
                    Console.WriteLine("bug");
                    PrintOutRightSegTree();
                    PrintOutLeftSegTree();

                    ShowLeftTree();
                    ShowRightTree();
                }
            }
        }

        [System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode")]
        void ShowRightTree(params ICurve[] curves) {
            var l = Obstacles.Select(p => new DebugCurve(100, 5, "green", p)).ToList();
            l.AddRange(rightConeSides.Select(s => new DebugCurve(100, 5, "blue",ExtendSegmentToZ(s))));

            //            foreach (VisibilityEdge edge in visibilityGraph.Edges)
            //                l.Add(BezierOnEdge(edge));

            l.AddRange(curves.Select(c => new DebugCurve(100, 5, "brown", c)));
            LayoutAlgorithmSettings.ShowDebugCurvesEnumeration(l);
        }

        [System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Usage", "CA1801:ReviewUnusedParameters", MessageId = "curves"), System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode")]
        void ShowBothTrees(params DebugCurve[] curves) {
            var l = Obstacles.Select(p => new DebugCurve(100, 5, "green", p)).ToList();
            l.AddRange(leftConeSides.Select(s => new DebugCurve(ExtendSegmentToZ(s))));
            l .AddRange(rightConeSides.Select(s => new DebugCurve(ExtendSegmentToZ(s))));

            //            foreach (VisibilityEdge edge in visibilityGraph.Edges)
            //                l.Add(BezierOnEdge(edge));

            LayoutAlgorithmSettings.ShowDebugCurvesEnumeration(l);
        }

        void ShowLeftTree(params ICurve[] curves) {
            var l = Obstacles.Select(p => new DebugCurve(100, 0.01,"green", p)).ToList();
            var range = new RealNumberSpan();
            var ellipseSize = 0.01;

            foreach (var s in leftConeSides) {
                var curve = ExtendSegmentToZ(s);
                range.AddValue(curve.Start*DirectionPerp);
                range.AddValue(curve.End * DirectionPerp);
                l.Add(new DebugCurve(100, 0.1, "red", curve));
                l.Add(new DebugCurve(200,0.1, "black", new Ellipse(ellipseSize,ellipseSize, curve.End)));
                ellipseSize += 2;
            }
            l.Add(DebugSweepLine(range));

            //            foreach (VisibilityEdge edge in visibilityGraph.Edges)
            //                l.Add(BezierOnEdge(edge));

            l.AddRange(curves.Select(c => new DebugCurve(100, 0.5, "brown", c)));
            LayoutAlgorithmSettings.ShowDebugCurvesEnumeration(l);
        }

        DebugCurve DebugSweepLine(RealNumberSpan range) {
            var ls = new LineSegment(Z * SweepDirection + DirectionPerp * range.Min, Z * SweepDirection + DirectionPerp * range.Max);
            return new DebugCurve(100,0.1,"magenta", ls);
        }
#endif

        void AddConeAndEnqueueEvents(VertexEvent vertexEvent) {
            var leftVertexEvent = vertexEvent as LeftVertexEvent;
            if (leftVertexEvent != null) {
                PolylinePoint nextPoint = vertexEvent.Vertex.NextOnPolyline;
                CloseConesAddConeAtLeftVertex(leftVertexEvent, nextPoint);
            } else {
                var rightVertexEvent = vertexEvent as RightVertexEvent;
                if (rightVertexEvent != null) {
                    PolylinePoint nextPoint = vertexEvent.Vertex.PrevOnPolyline;
                    CloseConesAddConeAtRightVertex(rightVertexEvent, nextPoint);
                } else {
                    CloseConesAddConeAtLeftVertex(vertexEvent, vertexEvent.Vertex.NextOnPolyline);
                    CloseConesAddConeAtRightVertex(vertexEvent, vertexEvent.Vertex.PrevOnPolyline);
                }
            }
        }

        void CloseConesAddConeAtRightVertex(VertexEvent rightVertexEvent,
                                            PolylinePoint nextVertex) {
            var prevSite = rightVertexEvent.Vertex.NextOnPolyline.Point;
            var prevZ = prevSite*SweepDirection;
            if (ApproximateComparer.Close(prevZ, Z))
                RemoveConesClosedBySegment(prevSite, rightVertexEvent.Vertex.Point);

            var site = rightVertexEvent.Site;
            var coneLp = site + ConeLeftSideDirection;
            var coneRp = site + ConeRightSideDirection;
            var nextSite = nextVertex.Point;
            //SugiyamaLayoutSettings.Show(new LineSegment(site, coneLP), new LineSegment(site, coneRP), new LineSegment(site, nextSite));
            //try to remove the right side
            if ((site - prevSite)*SweepDirection > ApproximateComparer.DistanceEpsilon)
                RemoveRightSide(new RightObstacleSide(rightVertexEvent.Vertex.NextOnPolyline));
            if ((site - nextVertex.Point) * SweepDirection > ApproximateComparer.DistanceEpsilon)
                RemoveLeftSide(new LeftObstacleSide(nextVertex));

            if (GetZ(nextSite) + ApproximateComparer.DistanceEpsilon < GetZ(rightVertexEvent))
                  CreateConeOnVertex(rightVertexEvent);
            if (!Point.PointToTheRightOfLineOrOnLine(nextSite, site, coneLp)) {
                //if (angle <= -coneAngle / 2) {
                CreateConeOnVertex(rightVertexEvent);
                if (Point.PointToTheLeftOfLineOrOnLine(nextSite + DirectionPerp, nextSite, site))
                    EnqueueEvent(new RightVertexEvent(nextVertex));
                //  TryEnqueueRighVertexEvent(nextVertex);
            } else if (Point.PointToTheLeftOfLineOrOnLine(nextSite, site, coneRp))
                //if (angle < coneAngle / 2) {
                CaseToTheLeftOfLineOrOnLineConeRp(rightVertexEvent, nextVertex);
            else {
                if ((nextSite - site)*SweepDirection > ApproximateComparer.DistanceEpsilon) {
                    LookForIntersectionOfObstacleSideAndLeftConeSide(rightVertexEvent.Site, nextVertex);
                    InsertRightSide(new RightObstacleSide(rightVertexEvent.Vertex));
                }
                EnqueueEvent(new RightVertexEvent(nextVertex));
            }
        }

        void CaseToTheLeftOfLineOrOnLineConeRp(VertexEvent rightVertexEvent, PolylinePoint nextVertex) {
            EnqueueEvent(new RightVertexEvent(nextVertex));
            //the obstacle side is inside of the cone
            //we need to create an obstacle left side segment instead of the left cone side
            var cone = new Cone(rightVertexEvent.Vertex.Point, this);
            var obstacleSideSeg = new BrokenConeSide(cone.Apex, nextVertex, new ConeLeftSide(cone));
            cone.LeftSide = obstacleSideSeg;
            cone.RightSide = new ConeRightSide(cone);
            var rnode = InsertToTree(rightConeSides, cone.RightSide);
            LookForIntersectionWithConeRightSide(rnode);
            var lnode = InsertToTree(leftConeSides, cone.LeftSide);
            FixConeLeftSideIntersections(obstacleSideSeg, lnode);
            if ((nextVertex.Point - rightVertexEvent.Site) * SweepDirection > ApproximateComparer.DistanceEpsilon)
                InsertRightSide(new RightObstacleSide(rightVertexEvent.Vertex));
        }

        void LookForIntersectionOfObstacleSideAndRightConeSide(Point obstacleSideStart,
                                                               PolylinePoint obstacleSideVertex) {
            RBNode<ConeSide> node = GetLastNodeToTheLeftOfPointInRightSegmentTree(obstacleSideStart);

            if (node != null) {
                var coneRightSide = node.Item as ConeRightSide;
                if (coneRightSide != null) {
                    Point intersection;
                    if (Point.IntervalIntersectsRay(obstacleSideStart, obstacleSideVertex.Point,
                                                    coneRightSide.Start, ConeRightSideDirection, out intersection) &&
                        SegmentIsNotHorizontal(intersection, obstacleSideVertex.Point)) {
                        EnqueueEvent(CreateRightIntersectionEvent(coneRightSide, intersection, obstacleSideVertex));
                        //                   Console.WriteLine("right intersection");
                        //    Show(new Ellipse(3, 3, intersection));
                    }
                }
            }
        }

        [System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Performance", "CA1822:MarkMembersAsStatic")]
        RightIntersectionEvent CreateRightIntersectionEvent(ConeRightSide coneRightSide, Point intersection,
                                                            PolylinePoint obstacleSideVertex) {
            Debug.Assert(Math.Abs((obstacleSideVertex.Point - intersection) * SweepDirection) > 0);
            return new RightIntersectionEvent(coneRightSide,
                                              intersection, obstacleSideVertex);
        }

        RBNode<ConeSide> GetLastNodeToTheLeftOfPointInRightSegmentTree(Point obstacleSideStart) {
            return rightConeSides.FindLast(
                s => PointIsToTheRightOfSegment(obstacleSideStart, s));
        }

        void LookForIntersectionOfObstacleSideAndLeftConeSide(Point obstacleSideStart,
                                                              PolylinePoint obstacleSideVertex) {
            var node = GetFirstNodeToTheRightOfPoint(obstacleSideStart);
            //          ShowLeftTree(Box(obstacleSideStart));
            if (node == null) return;
            var coneLeftSide = node.Item as ConeLeftSide;
            if (coneLeftSide == null) return;
            Point intersection;
            if (Point.IntervalIntersectsRay(obstacleSideStart, obstacleSideVertex.Point, coneLeftSide.Start,
                                            ConeLeftSideDirection, out intersection)) {
                EnqueueEvent(new LeftIntersectionEvent(coneLeftSide, intersection, obstacleSideVertex));
            }
        }

        RBNode<ConeSide> GetFirstNodeToTheRightOfPoint(Point p) {
            return leftConeSides.FindFirst(s => PointIsToTheLeftOfSegment(p, s));
        }

#if TEST_MSAGL
        // ReSharper disable UnusedMember.Local
        [System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode")]
        static ICurve Box(Point p) {
            // ReSharper restore UnusedMember.Local
            return CurveFactory.CreateRectangle(2, 2, p);
        }

        [System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Globalization",
            "CA1303:Do not pass literals as localized parameters", MessageId = "System.Console.WriteLine(System.String)"
            )]
        void PrintOutRightSegTree() {
            Console.WriteLine("right segment tree");
            foreach (var t in rightConeSides)
                Console.WriteLine(t);
            Console.WriteLine("end of right segments");
        }
#endif

        static bool PointIsToTheLeftOfSegment(Point p, ConeSide seg) {
            return (Point.GetTriangleOrientation(seg.Start, seg.Start + seg.Direction, p) ==
                    TriangleOrientation.Counterclockwise);
        }

        static bool PointIsToTheRightOfSegment(Point p, ConeSide seg) {
            return (Point.GetTriangleOrientation(seg.Start, seg.Start + seg.Direction, p) ==
                    TriangleOrientation.Clockwise);
        }

        void FixConeLeftSideIntersections(BrokenConeSide leftSide, RBNode<ConeSide> rbNode) {
            //the first intersection can happen only with succesors of leftSide
            Debug.Assert(rbNode != null);
            do { //this loop usually works only once
                rbNode = leftConeSides.Next(rbNode);
            } while (rbNode != null &&  Point.PointToTheRightOfLineOrOnLine(leftSide.Start, rbNode.Item.Start, rbNode.Item.Start+rbNode.Item.Direction));

            if (rbNode != null) {
                Point intersection;
                var seg = rbNode.Item as ConeLeftSide;
                if (seg != null &&
                    Point.IntervalIntersectsRay(leftSide.Start, leftSide.End, seg.Start, seg.Direction, out intersection)) {
                    EnqueueEvent(new LeftIntersectionEvent(seg, intersection, leftSide.EndVertex));
                    //Show(CurveFactory.CreateDiamond(3, 3, intersection));
                }
            }
        }

        RBNode<ConeSide> InsertToTree(RbTree<ConeSide> tree, ConeSide coneSide) {
            Debug.Assert(coneSide.Direction * SweepDirection > 0);
            coneSideComparer.SetOperand(coneSide);
            return tree.Insert(coneSide);
        }

        void CloseConesAddConeAtLeftVertex(VertexEvent leftVertexEvent, PolylinePoint nextVertex) {
            //close segments first
            Point prevSite = leftVertexEvent.Vertex.PrevOnPolyline.Point;
            double prevZ = prevSite * SweepDirection;
            if (ApproximateComparer.Close(prevZ, Z) && (prevSite - leftVertexEvent.Site) * DirectionPerp > 0) {
                //Show(
                //    new Ellipse(1, 1, prevSite),
                //    CurveFactory.CreateBox(2, 2, leftVertexEvent.Vertex.Point));
                RemoveConesClosedBySegment(leftVertexEvent.Vertex.Point, prevSite);
            }

            var site = leftVertexEvent.Site;
            var coneLp = site + ConeLeftSideDirection;
            var coneRp = site + ConeRightSideDirection;
            var nextSite = nextVertex.Point;
            // SugiyamaLayoutSettings.Show(new LineSegment(site, coneLP), new LineSegment(site, coneRP), new LineSegment(site, nextSite));

            if ((site - prevSite) * SweepDirection > ApproximateComparer.DistanceEpsilon)
                RemoveLeftSide(new LeftObstacleSide(leftVertexEvent.Vertex.PrevOnPolyline));

            var nextDelZ = GetZ(nextSite) - Z;
            if(nextDelZ<-ApproximateComparer.DistanceEpsilon)
                RemoveRightSide(new RightObstacleSide(nextVertex));

            if (nextDelZ < -ApproximateComparer.DistanceEpsilon ||
                ApproximateComparer.Close(nextDelZ, 0) && (nextSite - leftVertexEvent.Site) * DirectionPerp > 0) {
                //if (angle > Math.PI / 2)
                CreateConeOnVertex(leftVertexEvent); //it is the last left vertex on this obstacle

            } else if (!Point.PointToTheLeftOfLineOrOnLine(nextSite, site, coneRp)) {
                //if (angle >= coneAngle / 2) {
                CreateConeOnVertex(leftVertexEvent);
                EnqueueEvent(new LeftVertexEvent(nextVertex));
                //we schedule LeftVertexEvent for a vertex with horizontal segment to the left on the top of the obstace
            } else if (!Point.PointToTheLeftOfLineOrOnLine(nextSite, site, coneLp)) {
                //if (angle >= -coneAngle / 2) {
                //we cannot completely obscure the cone here
                EnqueueEvent(new LeftVertexEvent(nextVertex));
                //the obstacle side is inside of the cone
                //we need to create an obstacle right side segment instead of the cone side
                var cone = new Cone(leftVertexEvent.Vertex.Point, this);
                var rightSide = new BrokenConeSide(leftVertexEvent.Vertex.Point, nextVertex,
                                                   new ConeRightSide(cone));
                cone.RightSide = rightSide;
                cone.LeftSide = new ConeLeftSide(cone);
                LookForIntersectionWithConeLeftSide(InsertToTree(leftConeSides, cone.LeftSide));
                var rbNode = InsertToTree(rightConeSides, rightSide);
                FixConeRightSideIntersections(rightSide, rbNode);
                if ((nextVertex.Point - leftVertexEvent.Site) * SweepDirection > ApproximateComparer.DistanceEpsilon)
                    InsertLeftSide(new LeftObstacleSide(leftVertexEvent.Vertex));
            } else {
                EnqueueEvent(new LeftVertexEvent(nextVertex));
                if ((nextVertex.Point - leftVertexEvent.Site) * SweepDirection > ApproximateComparer.DistanceEpsilon) {
                    //if( angle >- Pi/2
                    // Debug.Assert(angle > -Math.PI / 2);
                    LookForIntersectionOfObstacleSideAndRightConeSide(leftVertexEvent.Site, nextVertex);
                    InsertLeftSide(new LeftObstacleSide(leftVertexEvent.Vertex));
                }
            }
        }

        void RemoveCone(Cone cone)
        {
            // the following should not happen if the containment hierarchy is correct.
            // If containment is not correct it still should not result in a fatal error, just a funny looking route.
            // Debug.Assert(cone.Removed == false);
            cone.Removed = true;
            RemoveSegFromLeftTree(cone.LeftSide);
            RemoveSegFromRightTree(cone.RightSide);
        }

        void RemoveSegFromRightTree(ConeSide coneSide) {
            //   ShowRightTree();
            Debug.Assert(coneSide.Removed == false);
            coneSideComparer.SetOperand(coneSide);
            var b = rightConeSides.Remove(coneSide);
            coneSide.Removed = true;
            if (b == null) {
                var tmpZ = Z;
                Z = Math.Max(GetZ(coneSide.Start), Z - 0.01);
                //we need to return to the past a little bit when the order was still correc
                coneSideComparer.SetOperand(coneSide);
                b = rightConeSides.Remove(coneSide);
                Z = tmpZ;

#if TEST_MSAGL
                if (b == null) {
                    PrintOutRightSegTree();
                    Console.WriteLine(coneSide);
                   // ShowBothTrees(new DebugCurve("red", CurveFactory.CreateDiamond(3, 4, coneSide.Start)));
                    // GeometryGraph gg = CreateGraphFromObstacles(Obstacles);
                    //gg.Save("c:\\tmp\\bug1");
                }
#endif
            }
            // the following should not happen if the containment hierarchy is correct.
            // If containment is not correct it still should not result in a fatal error, just a funny looking route.
            // Debug.Assert(b != null);
        }

        void RemoveSegFromLeftTree(ConeSide coneSide) {
            Debug.Assert(coneSide.Removed == false);
            coneSide.Removed = true;
            coneSideComparer.SetOperand(coneSide);
            var b = leftConeSides.Remove(coneSide);

            if (b == null) {
                var tmpZ = Z;
                Z = Math.Max(GetZ(coneSide.Start), Z - 0.01);
                coneSideComparer.SetOperand(coneSide);
#if TEST_MSAGL
                b =
#endif
 leftConeSides.Remove(coneSide);
                Z = tmpZ;
#if TEST_MSAGL
                if (b == null) {
                    PrintOutLeftSegTree();
                    Console.WriteLine(coneSide);
                    ShowLeftTree(new Ellipse(2, 2, coneSide.Start));
                }
#endif
            }

            Debug.Assert(b != null);
        }

        /// <summary>
        ///
        /// </summary>
        /// <param name="rightSide"></param>
        /// <param name="rbNode">represents a node of the right cone side</param>
        void FixConeRightSideIntersections(BrokenConeSide rightSide, RBNode<ConeSide> rbNode) {
            //the first intersection can happen only with predecessors of rightSide
            Debug.Assert(rbNode != null);
            do { //this loop usually works only once
                rbNode = rightConeSides.Previous(rbNode);
            } while (rbNode != null && Point.PointToTheLeftOfLineOrOnLine(rightSide.Start, rbNode.Item.Start, rbNode.Item.Start + rbNode.Item.Direction));
            if (rbNode != null) {
                Point intersection;
                var seg = rbNode.Item as ConeRightSide;
                if (seg != null &&
                    Point.IntervalIntersectsRay(rightSide.Start, rightSide.End, seg.Start, seg.Direction,
                                                out intersection)) {
                    EnqueueEvent(CreateRightIntersectionEvent(seg, intersection, rightSide.EndVertex));
                    // Show(CurveFactory.CreateDiamond(3, 3, intersection));
                }
            }
        }

        void CreateConeOnVertex(SweepEvent sweepEvent) {
            var cone = new Cone(sweepEvent.Site, this);
#if SHARPKIT //http://code.google.com/p/sharpkit/issues/detail?id=368
            //SharpKit/Colin - property assignment values not retained
            cone.LeftSide = new ConeLeftSide(cone);
            cone.RightSide = new ConeRightSide(cone);

            var leftNode = InsertToTree(leftConeSides, cone.LeftSide);
            var rightNode = InsertToTree(rightConeSides, cone.RightSide);
#else
            var leftNode = InsertToTree(leftConeSides, cone.LeftSide = new ConeLeftSide(cone));
            var rightNode = InsertToTree(rightConeSides, cone.RightSide = new ConeRightSide(cone));
#endif
            LookForIntersectionWithConeRightSide(rightNode);
            LookForIntersectionWithConeLeftSide(leftNode);
        }

        void LookForIntersectionWithConeLeftSide(RBNode<ConeSide> leftNode) {
            //Show(new Ellipse(1, 1, leftNode.item.Start));

            var coneLeftSide = leftNode.Item as ConeLeftSide;
            if (coneLeftSide != null) {
                //leftNode = leftSegmentTree.TreePredecessor(leftNode);
                //if (leftNode != null) {
                //    var seg = leftNode.item as ObstacleSideSegment;
                //    if (seg != null)
                //        TryIntersectionOfConeLeftSideAndObstacleConeSide(coneLeftSide, seg);
                //}

                RightObstacleSide rightObstacleSide = FindFirstObstacleSideToTheLeftOfPoint(coneLeftSide.Start);
                if (rightObstacleSide != null)
                    TryIntersectionOfConeLeftSideAndObstacleSide(coneLeftSide, rightObstacleSide);
            } else {
                var seg = (BrokenConeSide)leftNode.Item;
                leftNode = leftConeSides.Next(leftNode);
                if (leftNode != null) {
                    coneLeftSide = leftNode.Item as ConeLeftSide;
                    if (coneLeftSide != null)
                        TryIntersectionOfConeLeftSideAndObstacleConeSide(coneLeftSide, seg);
                }
            }
        }

        void LookForIntersectionWithConeRightSide(RBNode<ConeSide> rightNode) {
            //Show(new Ellipse(10, 5, rightNode.item.Start));
            var coneRightSide = rightNode.Item as ConeRightSide;
            if (coneRightSide != null) {
                //rightNode = rightSegmentTree.TreeSuccessor(rightNode);
                //if (rightNode != null) {
                //    var seg = rightNode.item as ObstacleSideSegment;
                //    if (seg != null)
                //        TryIntersectionOfConeRightSideAndObstacleConeSide(coneRightSide, seg);
                //}

                LeftObstacleSide leftObstacleSide = FindFirstObstacleSideToToTheRightOfPoint(coneRightSide.Start);
                if (leftObstacleSide != null)
                    TryIntersectionOfConeRightSideAndObstacleSide(coneRightSide, leftObstacleSide);
            } else {
                var seg = (BrokenConeSide)rightNode.Item;
                rightNode = rightConeSides.Previous(rightNode);
                if (rightNode != null) {
                    coneRightSide = rightNode.Item as ConeRightSide;
                    if (coneRightSide != null)
                        TryIntersectionOfConeRightSideAndObstacleConeSide(coneRightSide, seg);
                }
            }
        }

        void TryIntersectionOfConeRightSideAndObstacleConeSide(ConeRightSide coneRightSide,
                                                               BrokenConeSide seg) {
            Point x;
            if (Point.IntervalIntersectsRay(seg.Start, seg.End, coneRightSide.Start,
                                            coneRightSide.Direction, out x)) {
                EnqueueEvent(CreateRightIntersectionEvent(coneRightSide, x, seg.EndVertex));
                //Show(CurveFactory.CreateDiamond(3, 3, x));
            }
        }

        void TryIntersectionOfConeRightSideAndObstacleSide(ConeRightSide coneRightSide, ObstacleSide side) {
            Point x;
            if (Point.IntervalIntersectsRay(side.Start, side.End, coneRightSide.Start,
                                            coneRightSide.Direction, out x)) {
                EnqueueEvent(CreateRightIntersectionEvent(coneRightSide, x, side.EndVertex));
                //Show(CurveFactory.CreateDiamond(3, 3, x));
            }
        }

        void TryIntersectionOfConeLeftSideAndObstacleConeSide(ConeLeftSide coneLeftSide, BrokenConeSide seg) {
            Point x;
            if (Point.IntervalIntersectsRay(seg.Start, seg.End, coneLeftSide.Start, coneLeftSide.Direction, out x)) {
                EnqueueEvent(new LeftIntersectionEvent(coneLeftSide, x, seg.EndVertex));
                //Show(CurveFactory.CreateDiamond(3, 3, x));
            }
        }

        void TryIntersectionOfConeLeftSideAndObstacleSide(ConeLeftSide coneLeftSide, ObstacleSide side) {
            Point x;
            if (Point.IntervalIntersectsRay(side.Start, side.End, coneLeftSide.Start, coneLeftSide.Direction, out x)) {
                EnqueueEvent(new LeftIntersectionEvent(coneLeftSide, x, side.EndVertex));
                //    Show(CurveFactory.CreateDiamond(3, 3, x));
            }
        }

#if TEST_MSAGL
        internal void Show(params ICurve[] curves) {
            var l = Obstacles.Select(o => new DebugCurve(100, 0.1, "blue", o)).ToList();

            foreach (var s in rightConeSides) {
                l.Add(new DebugCurve(0.5, "brown", ExtendSegmentToZ(s)));
                if (s is BrokenConeSide)
                    l.Add(new DebugCurve("brown", Diamond(s.Start)));
                l.Add(new DebugCurve(0.5, "green",
                                     ExtendSegmentToZ(s.Cone.LeftSide)));
                if (s.Cone.LeftSide is BrokenConeSide)
                    l.Add(new DebugCurve("green", Diamond(s.Cone.LeftSide.Start)));
            }

//            l.AddRange(
//                visibilityGraph.Edges.Select(
//                    edge => new DebugCurve(0.2, "maroon", new LineSegment(edge.SourcePoint, edge.TargetPoint))));

            l.AddRange(curves.Select(c => new DebugCurve("red", c)));
            LayoutAlgorithmSettings.ShowDebugCurvesEnumeration(l);
        }

        [System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode")]
        static CubicBezierSegment BezierOnEdge(VisibilityEdge edge) {
            return new CubicBezierSegment(edge.SourcePoint, 2.0 / 3.0 * edge.SourcePoint + 1.0 / 3.0 * edge.TargetPoint,
                                          1.0 / 3.0 * edge.SourcePoint + 2.0 / 3.0 * edge.TargetPoint, edge.TargetPoint);
        }

        internal ICurve ExtendSegmentToZ(ConeSide segment) {
            double den = segment.Direction * SweepDirection;
            Debug.Assert(Math.Abs(den) > ApproximateComparer.DistanceEpsilon);
            double t = (Z + 40 - segment.Start * SweepDirection) / den;
            return new LineSegment(segment.Start, segment.Start + segment.Direction * t);
        }

        internal ICurve ExtendSegmentToZPlus1(ConeSide segment) {
            double den = segment.Direction * SweepDirection;
            Debug.Assert(Math.Abs(den) > ApproximateComparer.DistanceEpsilon);
            double t = (Z + 1 - segment.Start * SweepDirection) / den;

            return new LineSegment(segment.Start, segment.Start + segment.Direction * t);
        }
#endif

        //        static int count;
        void GoOverConesSeeingVertexEvent(SweepEvent vertexEvent) {
            var rbNode = FindFirstSegmentInTheRightTreeNotToTheLeftOfVertex(vertexEvent);

            if (rbNode == null) return;
            var coneRightSide = rbNode.Item;
            var cone = coneRightSide.Cone;
            var leftConeSide = cone.LeftSide;
            if (VertexIsToTheLeftOfSegment(vertexEvent, leftConeSide)) return;
            var visibleCones = new List<Cone> { cone };
            coneSideComparer.SetOperand(leftConeSide);
            rbNode = leftConeSides.Find(leftConeSide);

            if (rbNode == null) {
                var tmpZ = Z;
                Z = Math.Max(GetZ(leftConeSide.Start), PreviousZ);
                //we need to return to the past a little bit when the order was still correct
                coneSideComparer.SetOperand(leftConeSide);
                rbNode = leftConeSides.Find(leftConeSide);
                Z = tmpZ;
#if TEST_MSAGL
//                if (rbNode == null) {
                    //GeometryGraph gg = CreateGraphFromObstacles();
                    //gg.Save("c:\\tmp\\bug");
//                    PrintOutLeftSegTree();
//                    Console.WriteLine(leftConeSide);
//                    ShowLeftTree(new Ellipse(3, 3, vertexEvent.Site));
//                    ShowRightTree(new Ellipse(3, 3, vertexEvent.Site));
//                }
#endif
            }
            // the following should not happen if the containment hierarchy is correct.
            // If containment is not correct it still should not result in a fatal error, just a funny looking route.
            // Debug.Assert(rbNode!=null);

            if (rbNode == null) {//it is an emergency measure and should not happen
                rbNode = GetRbNodeEmergency(rbNode, leftConeSide);
            }

            if (rbNode == null)
                return; // the cone is not there! and it is a bug

            rbNode = leftConeSides.Next(rbNode);
            while (rbNode != null && !VertexIsToTheLeftOfSegment(vertexEvent, rbNode.Item)) {
                visibleCones.Add(rbNode.Item.Cone);
                rbNode = leftConeSides.Next(rbNode);
            }

            //Show(new Ellipse(1, 1, vertexEvent.Site));
            foreach (var visCone in visibleCones)
                AddEdgeAndRemoveCone(visCone, vertexEvent.Site);
        }

        RBNode<ConeSide> GetRbNodeEmergency(RBNode<ConeSide> rbNode, ConeSide leftConeSide) {
            for (var node = leftConeSides.TreeMinimum(); node != null; node = leftConeSides.Next(node))
                if (node.Item == leftConeSide) {
                    rbNode = node;
                    break;
                }
            return rbNode;
        }

#if TEST_MSAGL
        [System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Globalization", "CA1305:SpecifyIFormatProvider",
            MessageId = "System.Int32.ToString")]
        internal static GeometryGraph CreateGraphFromObstacles(IEnumerable<Polyline> obstacles) {
            var gg = new GeometryGraph();
            foreach (var ob in obstacles) {
                gg.Nodes.Add(new Node(ob.ToCurve()));
            }
            return gg;
        }

        [System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Globalization", "CA1303:Do not pass literals as localized parameters", MessageId = "System.Console.WriteLine(System.String,System.Object,System.Object)"), System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Globalization",
            "CA1303:Do not pass literals as localized parameters", MessageId = "System.Console.WriteLine(System.String)"
            )]
        void PrintOutLeftSegTree() {
            Console.WriteLine("Left cone segments########");
            foreach (var t in leftConeSides) {
                var x = coneSideComparer.IntersectionOfSegmentAndSweepLine(t);

                Console.WriteLine("{0} x={1}", t, x*DirectionPerp );
            }
            Console.WriteLine("##########end of left cone segments");
        }
#endif

        static bool VertexIsToTheLeftOfSegment(SweepEvent vertexEvent, ConeSide seg) {
            return (Point.GetTriangleOrientation(seg.Start, seg.Start + seg.Direction,
                                                 vertexEvent.Site) == TriangleOrientation.Counterclockwise);
        }

        static bool VertexIsToTheRightOfSegment(SweepEvent vertexEvent, ConeSide seg) {
            return (Point.GetTriangleOrientation(seg.Start, seg.Start + seg.Direction,
                                                 vertexEvent.Site) == TriangleOrientation.Clockwise);
        }

        RBNode<ConeSide> FindFirstSegmentInTheRightTreeNotToTheLeftOfVertex(SweepEvent vertexEvent) {
            return rightConeSides.FindFirst(
                s => !VertexIsToTheRightOfSegment(vertexEvent, s)
                );
        }

        void EnqueueEvent(RightVertexEvent vertexEvent) {
            if (SweepDirection * (vertexEvent.Site - vertexEvent.Vertex.PrevOnPolyline.Point) > ApproximateComparer.Tolerance)
                return;//otherwise we enqueue the vertex twice; once as a LeftVertexEvent and once as a RightVertexEvent
            base.EnqueueEvent(vertexEvent);
        }

    }
}


At LuxuryProperty.com we offer a bespoke property finder service for all your real estate needs for Jumeirah Golf Estates villas. We are not just property advisors we pride ourselves on our friendly and professional approach making your next property move an easy one.
I am interested in property Ref: LP0019. Please contact me with more information.