text:
CALENDAR: Big holiday entertainment week ahead!
GET YOUR FAIR ON Has all this heat left you with a hankerin' for a nice, refreshing fried Twinkie? Well if so you're in luck, because the 95th annual LA County Fair returns to Pomona Fairplex today from noon to midnight. Adult admission this year is $20 for weekends and $14 for weekdays. Kids ages 6-12 are $12 and $8, respectively, seniors age 60-plus are $15 and $10 and children 5 and under are free. A season pass is $30. Discounts are available at groupon.com, O'Reilly Auto Parts and Sprint stores. Additional discounts can be found by clicking on "Special Offers" at lacountyfair.com. Regular folks parking is $15; VIPs will pay $25 and valet service is $30. Alternatively, Metrolink is offering special weekend service for fair goers with additional savings on admission. Train riders can beat traffic and skip parking fees with a $10 weekend day pass on Saturdays or Sundays. A free shuttle will pick up Metrolink riders at the Fairplex station and take them to the yellow gate entrance. For details visit metrolinktrains.com/lacountyfair. Oh, and on a side note, if you want to see some weird fried food items from fairs around this great country of ours, check out mentalfloss.com and search "fair food." You're welcome.
ALL WE NEED IS MUSIC, SWEET MUSIC Claremont's ongoing free summer/fall music series, Friday Nights Live, continues tonight with Silverados Unplugged at Laemmle plaza; Mohave Beach Band at the chamber of commerce; US 99 at Shelton Park; and Jack McCoy at city hall; Friday Nights Live runs from 6 to 9 p.m. through October 27. More info, including future lineups, is at claremontchamber.org.
MORE FREE MUSIC The Claremont Community School of Music's Sunset Saturdays, a free and open to the public concert series, continues from 7 to 8:30 p.m. at 951 W. Foothill Blvd., Claremont. DuselForty58 will perform a program of Gershwin and original music by Winston Raval for saxophone, strings and jazz trio. Email nicholascasillas@gmail.com for more info.
SUNNY SUNDAY It's going to be hot, hot, hot! If you're like me and you'll be spending the day indoors worshiping the great Willis Carrier, inventor of air conditioning, then you can stop reading now. If you're cut from heartier stock and will be venturing outside, then I can recommend starting early at Claremont's Artisans and Farmers Market, which takes place from 8 a.m. to 1 p.m. on Second Street, between Indian Hill and Yale. This weekly event features musicians, fruit and vegetable sellers, juice hawkers, cheese makers, booksellers, jewelry designers, booksellers and plant and flower farmers selling their wares. If you're still feeling adventurous (and hydrated), stroll over to the Claremont Museum of Art at the Claremont Depot, 200 W. First St., for Free Family Day. The museum opens at noon and closes at 4 p.m. Part of the fun today will be ARTStation, which features high school students in CMA's Project ARTstART leading visitors in creating folk-inspired art projects related to the museum's current exhibition, "Dee Marcellus Cole and Carnival Seekers." Go to claremontmuseum.org for more information.
Monday, September 4
MONDAY CONCERTS CONCLUDE Claremont's Monday evening Concerts in the Park series ends for the season tonight with The Answer at Memorial Park band shell, 840 N. Indian Hill Blvd. The free concert begins at 7 p.m. Come early to stake out a spot on the lawn and don't forget to bring a blanket or a low lawn chair and a picnic, or avail yourself to the food for sale from the Kiwanis Club of Claremont. Dogs and alcohol are prohibited. The series is co-sponsored by The City of Claremont and Kiwanis Club of Claremont with support from Claremont Lincoln University. Next year's concert schedule will be announced in the spring. More information is at ci.claremont.ca.us.
UNIVERSITY CLUB TO DISCUSS NAPIER INITIATIVE The University Club of Claremont hosts a lunch and discussion at 11:30 a.m. with Joyce Yarborough and Dick Johnson, who will present a program on Pilgrim Place's Napier Initiative Program. Now in its seventh year, the Napier Initiative has developed unique team-taught classes at the Claremont Colleges, enrolling college students and elders from the community to explore topics of social concern. The program also grants fellowships for students to pursue a variety of projects of their own invention that improve the lives of others. Ms. Yarborough and Mr. Johnson will share stories of the achievements of students in the Napier Initiative. Ms. Yarborough joined Pilgrim Place in 2006, where she is now vice president in charge of advancement. She is a graduate of Moray House College in Edinburgh, Scotland. She began her career as an ESL teacher for the British Voluntary Service Overseas, working in northern Nigeria and Zimbabwe. Mr. Johnson arrived at Pomona College in 1962 and since that time has rarely left Claremont. He earned a PhD from Claremont Graduate School in 1971, and is an emeritus professor of American History at Cal Poly Pomona. The event starts at 11:30 a.m. at Hughes Community Center, 1700 Danbury Rd. A $15 meeting fee includes a buffet lunch. More information is available at universityclubofclaremont.org.
GUNS IN AMERICA EXHIBIT OPENS The University of La Verne opens a group art exhibition examining historical and social issues surrounding the availability, use and impact of guns in America. The show opens at noon in the university's Campus Center, 2000 Second St. "Unloaded" includes Mel Chin's "Cross of the Unforgiven," consisting of eight AK-47 assault rifles configured in the shape of a Maltese cross, and Lauren Adams' "Granny Smith and Wesson," an upholstered stool with the pattern of handguns on its fabric. An artist lecture is set for 6 p.m. Thursday, September 14 with a reception to follow. The events are free and open to the public, but donations are encouraged. More info is at laverne.edu/lyceum.
JOURNALISTS EXPLORE CONSPIRACY THEORIES Claremont's Pitzer College is back in business for the new school year, hosting the first of what promises to be many interesting, free and open to the public lectures. Today's talk is Contemporary and Classic Conspiracy Theories: a Journalistic Perspective, with journalists Nick Schou and Ben Collins. The talk takes place from 4:15 to 5:30 p.m. at George Benson Auditorium, 1050 N. Mills Ave., and will focus on conspiracy theory and conspiracy fact and understanding this perplexing social phenomenon. More info is at collegescalendar.org/index or (909) 607-7756.
Wednesday, September 6
CLAREMONT ART LECTURE Pitzer College and Claremont Heritage host a free lecture from 7 to 9 p.m., Design for Modern Living: Millard Sheets and the Claremont Art Community, 1935-1975. The talk takes place at Avery Hall, Benson Auditorium, 1050 N. Mills Ave., and is hosted by Paul Bockhorst. In the years following World War II, Claremont emerged as an important center of art and craft activity and architectural experimentation. "Led by artist and educator Millard Sheets, painters, sculptors, muralists, ceramists, woodworkers, enamel and mosaic artists devoted themselves to their creative pursuits with great imagination and energy, creating works that express the spirit and character of Midcentury Modernism in California," a press release stated. This show chronicles the story of that artistic community. Several artists who were active in Claremont in the postwar period will share their memories of that time and place, including Betty Davenport Ford (ceramic sculptor), John Svenson (sculptor), James Strombotne (painter), Paul Darrow (collage artist), Harrison McIntosh (ceramic artist), Barbara Beretich (painter and sculptor) and Martha Longenecker (potter). More info is at claremontheritage.org.
SEEING OROZCO THROUGH ASTROLOGY, PALMISTRY Pomona College hosts a Gallery Talk with artist Isa Carrillo and catalog essayist and art historian Mary Coffey from 7 to 9 p.m. at its Museum of Art, 330 N. College Ave. The pair will discuss Ms. Carrillo's explorations of Orozco's identity through the esoteric methods of astrology and palmistry. Ms. Carrillo will also offer private palm reading sessions. More info is at pomona.edu/museum or (909) 621-8283.
LEVITT ON THE LAWN RETURNS Scripps College's super cool and super free concert series Levitt on the Lawn returns for the 2017-18 season with La Misa Negra at 6:30 p.m. at Bowling Green, 1030 Columbia Ave. Claremont. "With an electrifying blend of 1950s- and '60s-style cumbia and high-energy, Afro-Colombian dance music, this Oakland-based Latinx octet's performances are suffused with horns, accordion and percussive panache," a press release stated. "'La Misa Negra' has been upending the Latin music genre, infusing tradition with outside musical influences and contemporary subject matter," wrote the San Francisco Chronicle. The concert is part of an ongoing series supported by Levitt Foundation and Elizabeth Levitt Hirsch '74. Go to scrippscollege.edu/scrippspresents or call (909) 607-1870 for more info.
MINGLE, MUNCH Claremonters 50 and over are invited to join the Mingle and Munch social group as it celebrates the beginning of its third season with a live music from local country/bluegrass treasures Squeekin' Wheels. The event also features adult beverages, appetizers and dessert and runs from 6 to 8:30 p.m. at The Garner House in Memorial Park, 840 N. Indian Hill Blvd. Admission is $15 (cash only) at the door. "Come help Claremont go country for the evening," a press release stated. "Just listen or get up and dance. Having a good time is what we do!" Attendance is open to individuals and couples. RSVPs are required by noon, September 6 at (909) 399-5488 or claremontrec.com.
THERE'LL BE MUSIC EVERYWHERE Claremont's free music series, Friday Nights Live, rolls on tonight with Dynamite Dawson at Laemmle plaza; Mario Rojas and Saturday Night Pink—who have a new record that is about to be released—at the chamber of commerce; the always stellar Blues Highway at Shelton Park; and Tin and Wire at city hall. Friday Nights Live runs from 6 to 9 p.m. through October 27. More info, including future lineups, is at claremontchamber.org.
WALKING IN LA The Claremont Library hosts a free 10:30 a.m. book chat and lecture, Loving LA the Low Carbon Way. Inspired by their own excursions and concerns for the environment, in 2015 Grace Moremen and Jacqueline Chase published Loving LA the Low Carbon Way: 24 Adventures in the City of Angels Via Public Transportation, a book chronicling the pair's exploration of the City of Angeles sans car. They will talk about their adventures getting to and enjoying such iconic landmarks as the Watts Towers, La Brea Tar Pits, parks, museums and more. The library is at 208 N. Harvard Ave. For more information call (909) 621-4902 or go to colapublib.org.
PONCE DE LEÓN, OROZCO, PROMETHEUS ON TAP Pomona College Museum of Art hosts a free and open to the public Gallery Talk with artist Rita Ponce de León and catalog essayist and scholar Daniel Garza Usabiaga from 4 to 5 p.m. The gallery is at 330 N. College Ave., Claremont. The pair will discuss Ms. Ponce de León's new artwork, which engages José Clemente Orozco's "Prometheus" mural through collective work sessions with Pomona College students. The event is followed from 5 to 7 p.m. by an opening reception for "Prometheus 2017: Four Artists from Mexico Revisit Orozco" 5 to 7 p.m. The show showcases Orozco's mural "Prometheus" (1930) on the Pomona College campus and examines the multiple ways Orozco's vision resonates with four artists working in Mexico today. Isa Carrillo, Adela Goldbard, Naomi Rincón-Gallardo and Ms. Ponce de León share Orozco's interest in the relationships among history, justice, power, social protest and storytelling, yet approach these topics from their own 21-century sensibilities, according to a press release. More information on both events is at pomona.edu/museum or (909) 621-8283.
REVOLUTION AND RITUAL AT SCRIPPS Claremont's Scripps College's Williamson Gallery is the site for today's opening reception for the exhibition, "Revolution and Ritual: The Photographs of Sara Castrejon, Graciela Iturbide and Tatiana Parcero" from 7 to 9 p.m. The gallery is located at 11th Street and Columbia Avenue. War, indigenous cultures and inner transformation ferment in this exhibition focusing on the works of three female Mexican photographers who explore and transform notions of Mexican identity in images that range from the documentary to the poetic. The event is preceded by a writers' panel discussion from 1 to 2 p.m. at the college's Humanities Auditorium; a tea from 2 to 3 p.m. at Scripps' Margaret Fowler Garden, and an artists' panel discussion back at the Humanities Auditorium from 3 to 4 p.m. Revolution and Ritual is part of Pacific Standard Time: LA/LA, a far-reaching and ambitious exploration of Latin American and Latino art in dialogue with Los Angeles. The exhibition runs through Jan. 7, 2018. More information is at rcwg.scrippscollege.edu or (909) 607-3397.


The Takeover! Ensemble is the brainchild of Mihalj "MIKI" Kekenj, a German-born violinist, composer, and arranger with Hungarian roots. He best describes his relationship with classical and other types of music, such as hip-hop and R&B, with a quote from Goethe's Faust: "Two souls, alas, are dwelling in my chest, and each is fain to leave its brother". The Takeover! Ensemble is a flexible collection of MIKI's colleagues and friends who have similar sensibilities toward music . All members of Takeover! have advanced degrees in music performance, and are equally dedicated to the idea that music doesn't necessarily have to be a one-dimensional, singular concept. Having collaborated with artists such as Aloe Blacc, Erykah Badu, Axel Bosse, Cassandra Steen, Max Mutzke, and the DJ team Moonbootica, the Ensemble has made a name for itself on the European stage as a crossover-ensemble that introduces mainstream music in a classical setting. Their goal is to "take-over" traditional spaces by eliminating stylistic boundaries for just one special night.
We are offering Takeover! as a string quintet with the phenomenal German singer, Max Mutzke, who rose to fame in Europe while still in high school after a successful appearance on the Eurovision Song Contest and by winning the prestigious "SSDSGPS" competition on the popular German late-night show, "TV total" . His soulful and completely engaging interpretations of MIKI's arrangements are perfect for clubs or concert halls. Performing in German and English, the Takeover! Ensemble creates an unforgettable experience blending cultures, languages, and genres in an elegant presentation.
"I envision Takeover! as an overarching concept for classical concert halls. Without alienating the listener, my idea is to have the audience take a journey into an unfamiliar musical space and still be connected to the music at hand. This format is not limited to concert halls....It is my intention that through this unique format, we can show people of different musical tastes that classical and pop need not always be mutually exclusive."
Click here to watch and listen to Takover! and Max Mutzke perform MIKI's arrangement of Radiohead's Creep.


text:
We Tried Asking Couples About Who's In Charge Of Birth Control — But There Was Only 1 Answer
By Amanda Chatel
According to a 2018 Bustle Trends Group survey of 226 women ages 18 to 34 of different sexual orientations, when it comes to pregnancy and STI prevention, 57% of women felt like they're the ones actively involved in preventative measure, while only 39% could report that the sharing of birth control responsibility was equal. But these numbers shouldn't be surprising. In a culture where those without uteruses are first in line to dictate what those with uteruses should do with their bodies, the topic of who is in charge of birth control in male-female relationships has always been one of controversy and debate.
"Our shared responsibility [for birth control] is me having an IUD and painful periods, and [my partner] Dave coming all over the place," Alicia, 21, tells Bustle. Getting an IUD "was my decision and I got it before Dave," but she adds that true, egalitarian sharing of birth control responsibilities feels "impossible with the current technologies. When the male [birth control] pill will be widely commercialized and popular, then the sharing of responsibility will be a legitimate question."
"The fact that so many women bear the responsibility for sexual health is a conundrum," Xanet Pailet, a sex and intimacy coach, tells Bustle. "Part of me feels that it's related to the patriarchal society that we still live in and the fact that at least with respect to birth control, only women can get pregnant. I strongly suspect that if men could experience abortions and childbirth, we'd be having a completely different conversation. I could also argue that it is our primary responsibility to take care of our own bodies so it make[s] sense that women are more concerned about birth control issues than men."
Although the male birth control pill was declared safe in March 2019, it's speculated it won't hit the market for at least another 10 years. But then what? According to a 2017 study by School of Social Sciences and Law at the University of Teesside in Middlesbrough, UK, people with penises are less than enthused about the male birth control pill. While people with uteruses were quite positive about the potential option, the study found that they also had "less trust that men would use the male pill effectively." The research also found that people with penises who were not in stable, long-term relationships weren't as interested in using a birth control pill.
Josep Suria/Shutterstock
Another study, about sterilization in the U.S., found 27% of people with uteruses rely on sterilization for birth control compared to only 9.2% of them relying on their partner's sterilization. While a vasectomy is a far less complicated and overall easier procedure than a hysterectomy, people with penises still want their partners to accept the brunt of the responsibility, according to the 2008 study. Based on these examples, it might be safe to say that people with penises aren't as concerned about sharing this responsibility of birth control as they should be.
Dr. Susan Edelman, MD, a board-certified psychiatrist and author of Be Your Own Brand of Sexy, echoes this sentiment. Women wanted control over their fertility and got it — though, depending on your level of reproductive access, the reality of women having that control doesn't mean the same thing everywhere — and so it makes sense that it would be "our primary responsibility," especially for people having casual sex or short-lived flings.
"When women got the pill, they wanted and got control of their fertility," Dr. Edelman says. "They had access to abortion, they felt they no longer needed to rely on men, and reproductive clinics were geared toward women, too. Men got the message that they weren't required to be involved. Now, although men know they should be responsible for birth control, they've gotten used to the woman being in charge."
But while this works for casual relationships, when it comes to serious and long-term relationships where there should be an equal partnership, then it's another story.
"Why do partners not share the responsibility for birth control? The answer to this question is both straightforward and complex," Daniel Sher, a registered clinical psychologist and consultant for the Between Us Clinic, tells Bustle. "The simple answer is that this situation is a reflection of the power differential that exists between men and women in society at large. More specifically, we know that the burden of birth control is a big one. As a result, women are expected to take the responsibility and front the expense. They are also expected to put up with a host of inconvenient and unpleasant side effects."
BDG Media, Inc.
Expected. As Sher points out, condoms are a safe and effective method of birth control that allows the responsibility to be shared between partners, but as anyone who's had sex with someone who has a penis will tell you, they're not big fans of condoms.
"Shared?" Jennifer, 37, asks. "It's more like he asks if I've taken my pill before he comes inside me. I don't think that counts as a shared responsibility. I'm on the Pill specifically so we don't have to use condoms."
Which brings up an entirely different and more aggravating conversation: some partners value their sexual pleasure over the potential side effects that come with birth control use by their partners. But not all them.
"When my partner of 6.5 years and I were first together, we used condoms for birth control and for STI protection," Emma, 32, says. When Emma and her partner were using condoms, it was her partner's responsibility to buy them and make sure they were always in the apartment. But these days, the couple uses condoms rarely, mostly relying on a family planning method and a diaphragm.
Men [need] to start playing their part by accepting a greater degree of responsibility for birth control
"I track my cycle pretty closely, so I know when I'm definitely not fertile and when we have sex during the fertile periods, I just put the diaphragm in," Emma says. "So, currently, I guess you'd say that I'm 100% responsible for our birth control. But historically, I'd say it's been pretty even."
Sher points out that in this day and age where reproductive health and autonomy are under attack, it's imperative that men get more involved. "Men [need] to start playing their part by accepting a greater degree of responsibility for birth control," Sher says.
We can start turning the table in this regard if we talk to our partners about birth control use and explicitly say that we wanted them involved, if that's the case. Some people with uteruses prefer to handle the whole thing themselves. As for people with penises, they can step up to their plate on their own after considering what it means for their partner to be the only person in the relationship worrying about birth control.
"At this point, the practical means by which men can take a greater degree of control are somewhat restricted," Sher says. "However, I believe that the process should begin with a) men practicing some self-reflection in a non-defensive way so that they can begin to comprehend the power differential that exists and why this places an extra burden on women; and b) initiating an open conversation with their partners so that the couple can communicate about these responsibilities and create space for the responsibility to be shared a little bit more equally."
If people with penises don't want to want use condoms, that's their issue, but one partner doesn't get to subtract themselves from the entire birth control equation. While the issue is complicated and is likely to remain so, if it takes two tango, as they say, it should take two to be involved in birth control.

redpajama_set_name: RedPajamaCommonCrawl


We insist on the principle of development of 'High quality, Efficiency, Sincerity and Down-to-earth working approach' to deliver you with great provider of processing for 8 Inch Slip On Flange Dimensions , Slip On Flange Dimensions Jis , 42 Blind Flange Dimensions , We warmly welcome customers from all around the environment for any style of cooperation with us to make a mutual advantage long run. We are devoting ourselves wholeheartedly to supply consumers the best service.
Persisting in "High quality, Prompt Delivery, Aggressive Price", now we have established long-term cooperation with consumers from equally overseas and domestically and get new and old clients' large comments for 8 Inch Slip On Flange Dimensions , Slip On Flange Dimensions Jis , 42 Blind Flange Dimensions , In addition we would properly guide the customers about the application techniques to adopt our products and the way to select appropriate materials.


text:
Share this Story: How to hit on a university basketball coach
How to hit on a university basketball coach
Stu Cowan • Montreal Gazette
How to hit on a university basketball coach Back to video
University of Louisville basketball coach Rick Pitino (above) is yet another prominent sports figure to get himself in trouble with his extramarital sexual activity.
Pitino – a married father of five – got himself in trouble in an empty Italian restaurant in July 2003 after apparently having sex with a woman he had just met on a table. The woman, Karen Cunagin Sypher , demanded millions from the coach and was later charged with extortion.
In a Louisville court on July 28, Pitino explained to a jury just how easy it was for Sypher to attract his attention. After buying her a drink and engaging in small talk after the restaurant closed, Pitono said Sypher whispered something to him, opened his pants and that the two then had sex "very briefly."
"Unfortunate things happen," Pitino said.
Talk about setting a great example for his young university players.
It will be interesting to see how this one turns out.
(Photo by Jeff Haynes/Reuters)
[View:http://www.youtube.com/watch?v=DJspH0Lc-O8]


Decorating With A Brown Sofa Enchanting Living Room Brown Couch Model is an astounding picture that can use for personal and non-commercial purpose since all trademarks referenced thus are the properties of their respective owners.
Please share this Decorating With A Brown Sofa Enchanting Living Room Brown Couch Model to your social media to share information about Decorating With A Brown Sofa Enchanting Living Room Brown Couch Model to your friends and to keep this website growing. In the event that you want to view an image in the larger size just hit an image in the following gallery and the image will be displayed at the top of this page.


text:
The New Zealand roughy (Aulotrachichthys novaezelandicus) is a slimehead found in the Southwest Pacific off the coasts Australia and New Zealand between depths of . It feeds on crustaceans, squid, and other fish.

References

External links

New Zealand roughy
Marine fish of Eastern Australia
Marine fish of New Zealand
New Zealand roughy

redpajama_set_name: RedPajamaWikipedia


KEE KLAMP type M50, Male single swivel socket member. One part of a combination fitting. This can also be used for attaching flat panels to tubular structures.
Sizing refers to the size of pipe onto which the fittings can be applied. We show sizing for both Nominal Bore (NB) - the internal pipe diameter, and Outside Diameter (OD) - the diamater of the pipe measured accross its total width.
Please note the medium galvanised steel pipe available elsewhere on this site is sized exclusively by its Nominal Bore.


But, we all know that humans are most inquisitive when they are kids. A child of 5 year is most curious about things around him, and usually everything said, shown, is followed by an ask "why?" A youth is happier in a comfort zone – and usually it is friends and peers.
You would find that most of time a youth retorts with – why not? So what??


VILE EIGHT (UK), a custom ear plug fashion manufacturer has released a limited edition set of plugs featuring one of my illustrations—comes with signed and numbered limited edition mini-print.
CD cover illustration for GORGOSAUR (Sweden), scheduled to be released this year courtesy of Memento Mori Records (Spain).
My band, MACABRA, just released our complete discography on cassette format (plus a bonus track). Over an hour of underground death metal in truest form. In addition, MACABRA old school T-Shirts are available as well as last copies of our split 7″ EP with FATHER BEFOULED (bone-colored vinyl).
Inked T-Shirt illustration for SOLOTHUS (Finland).
If you reside in the Boston area, I encourage you to visit the "Path of Dissent" exhibit on display at Eridanos Tattoo/Gallery through the end of February. The opening night is this Saturday and features originals by myself, Dan Seagrave, Matt "Putrid" Carr, Justin Bartlett, Mark Richards, and more!


text:
Wines & Shop
Wineblog
office@hiedler.at · +43 2734 2468
First Growth
Kittmannsberg
Schenkenbichl
Kogelberg
Heiligenstein
Which wine are you looking for?
Where our wine grows.
It's the vineyard.
We know our vineyard-sites and all their peculiarities. There is an age-old wisdom amongst vintners that there are vineyards which, when carefully tended each year, consistently yield exceptional wines. The knowledge of these outstanding pieces of land has been passed on and deepened over countless generations. The vineyard classification that is currently carried out is the logical consequence of our centuries old wine-history. Together with six like-minded colleagues from the region, we are the proud founders of the Association Österreichische Traditionsweingüter (Traditional Austrian Wineries), established in 1992. Our declared goal is to classify the most significant vineyards in the Danube region. Today we count 62 members and have been working on this vision for over 25 years. Work in progress.
Find out more: www.traditionsweingueter.at
Thal, an old heritage (Altes Erbe). The historical Thal vineyard has a special meaning to us. A few parcels have been owned by our family since the beginning of the winery's history. Here, Josef and Anna Hiedler cultivated their first vines in 1856. The gently sloping hillside, just south of the winery, is formed from a powerful rise of loess that is marked throughout by large terraces. The vines grow on very calcareous loess and local quartz-sands, creating a water-permeable soil. It is also here, where Ludwig I. planted one of the first pure Veltliner vineyards of the Kamptal in 1936. These 80-year-old vines date back to a time, when yield was not the prime concern of wine producers: middle-sized fruit, rather loose-berried, with a distinct herbal and very 'down-to-earth' taste. We continue to select those authentic vine genetics to this day for planting new vineyards.
Vine age 15-80 years
Altitude 230-270 m
Gradient 6°
Orientation S-SSW
Total size 30,9 ha (entire site)
Village Langenlois
Coordinates 48°27'45.0"N 15°40'19.7"E
Classification -
Grüner Veltliner Ried Thal
Kittmannsberg is one of the highest elevated vineyard sites in the Kamptal, located just west of Langenlois. It's first mention can be traced back to the year 1353 under the name 'Chotmannsperig', probably named after the original owner of the vineyard. It is shaped like a wide bowl and opens towards the southeast into the Langenlois basin. It reaches about 345 m above sea level at its highest point, 280 m at its lowest point. The characteristic basin-shaped topographic depression is responsible for its autonomous microclimate and, especially in the higher lying terraces, enables extended ripening periods. Here our vines stand on fine-grained loam soils with a high content of clay. It can be quite chalky in some places.
Orientation SO-OSO
Total size 74 ha (entire site)
Classification Erste Lage
Grüner Veltliner Ried Kittmannsberg
Schenkenbichl is facing Langenlois and covers the north of the town. The name first appeared in 1402 and has remained unchanged ever since. Its origin is believed in an old tavern (Schenke) at the foot of the hill (Bühel) in Langenlois. The slope is characterized by small and somewhat larger terraces which in our case, are located at the highest point at around 315 m above sea level. Here our Veltliner grows on metamorphic rock, mostly dark amphibolite. The amphibolite bedrock is overlain by a cambisol formed from mica-rich silicates. Towards the lower end, reaching the town of Langenlois, more and more loess, interspersed with many rocks, can be found. The bottom of the slope is home to the oldest Weissburgunder (Pinot Blanc) of the Danube area planted by Dr. Bruno Hiedler in 1955. Here we find the geological remains of the old Loisbachtal (Lois Creek Valley). The gnarly vines root on gravel with calcareous loess running through it.
Orientation SSO
Grüner Veltliner Ried Schenkenbichl
The steepest of Kamptal's slopes was already well known in 1394 as 'Stainhaws'. This name was most likely derived from the small stone cottages which served as shelters and whose remains are still scattered along the vineyards today. The slope is characterized by small and partly narrow terraces. Gneisses and dark amphibolites, interspersed with quartz and feldspar veins, form the base for the vines. Due to the steepness the humic topsoil is only a few centimeters thin. As the rugged, dark ground heats up in the sun, there is a warm-cold contrast between ground and air temperatures, especially in the early hours of the night. A microclimate that, in combination with the meager rocksoil, creates great tension in the Rieslings.
Gradient 20°
Orientation S
Overall size 24,1 ha (entire site)
Riesling Ried Steinhaus
With its milder microclimate, the Gaisberg is one of the historically most relevant vineyards in the Kamptal. It is this slope where the Pannonian air current arrives earliest. A first written record of the site can be found as early as 1341 under the name 'Gaizperch'. Most likely the terraced slope was originally grazed by goats (Geissen). The vineyard extends up to 335 m above sea level, occupying a steep slope that runs down towards the Strass-valley in the east and gently declines towards the southern village of Kammern. In the highest third of Gaisberg our vines dig their roots into a rocky soil of marble and paragneiss. Granites and amphibolite lenses can also be found in some places. Another, smaller plot is located on the southern foot of the slope, where one encounters calcareous Chernozem from loess over gravel and crystalline debris.
Vine age 30 years
Orientation S-SW
Villages Strass, Kammern, Zöbing
Riesling Ried Gaisberg
It is the northernmost as "Erste Lage" classified vineyard in Kamptal (and in Austria). Kogelberg lies on a broad north-south spur of the high Waldviertel plateau and sits right at the point where the narrow valley situation of the Kamptal opens towards the Langenlois basin. The slope is cooled by cold air currents which originate from the shady and densely wooded upper reaches of the Kamp river. Due to its particular geographic location the vineyard is characterized by a noticeably cooler microclimate, marked by substantial temperature variations between day and night. The soil on which the vines root is purely crystalline and dominated by bronze-colored mica schist in which dark amphibolites can be found scattered over a large area.
Overall size 35 ha (entire site)
Village Zöbing
Riesling Ried Kogelberg
This is one of the most famed Riesling vineyards in Austria, whose authentic wines enjoy international attention. The history of the hillside vineyard can be traced back to 1314. In 1280 we find a first written mention as Hellenstein (Hell Stone), which seems logical as it is a south facing slope on which the sun "burns like hell". According to the document of 1314 the name could also originate from the meaning "am glatten Stein" (on the smooth stone). The vernacular eventually transformed it to 'Heiligenstein' (Stone of Saints) which sounds similar in dialect. The Heiligenstein is a unique geological formation - a geological island - within Europe. The sediments, referred to as "Perm of Zöbing", sunk into the deep some 248-290 million years ago, before it broke through the earth's crust again. The mighty layers, consisting of sandstone, brittle sedimentary rock and conglomerate, were exposed to desert climates and volcanic activity. The outcropping bedrock consists of reddish-brown sandstone with a high feldspar content, coarse conglomerates and minor siltstone. Residues of fossilized plants and boulders of volcanic quartz porphyries can be found; hundreds of elements which the vines absorb in different micro-doses.
Orientation SSW
Riesling Ried Heiligenstein
Am Rosenhügel 13 · 3550 Langenlois · Österreich
+43 2734 / 2468 · office@hiedler.at
For Saturday make an appointment
Mit Ihrer Anmeldung zum Newsletter willigen Sie ein, aktuelle Informationen aus dem Weingut Hiedler zu erhalten. Diese Einwilligung kann jederzeit widerrufen werden. Sie stimmen den Datenschutzbestimmungen zu.
© Weingut Hiedler GmbH. All rights reserved.
A website by Vorwärts Webdesign and David Stöckl.
Our website does not support the outdated Microsoft Internet Explorer. Please use a modern Browser like Microsoft Edge (Windows 10 default browser), Google Chrome, Mozilla Firefox or Opera.
Am Rosenhügel 13
F +43 2734 2468 5
E office@hiedler.at
This website is using cookies in order to provide the best possible website experience (learn more) Ok


Dr. François Forget is a senior scientist of Centre National de la Recherche Scientifique (CNRS) at LMD with more than 20 years of experience in Mars climate studies combining observation analysis and climate modeling. He has been leading the development of the LMD Mars General Circulation model which can be used to simulate the Martian 3D atmospheric circulation, photochemistry, the dust, CO2 and water cycles. The model is extended into the thermosphere and has been adapted to create a mesoscale/microscale model of the Martian atmosphere. It is also employed to produce the Mars Climate Database125 used by more than 150 teams around the world to prepare and exploit most Mars space missions. F. Forget is also the Interdisciplinary Scientist on the ESA Mars Express mission in charge of the atmospheric and climate observations is a co-I on ACS on the ExoMars Trace Gas Orbiter and co-PI on the Amelia experiments related to the analysis of the descent observations obtained by the ExoMars 2016 Lander. He is the recipient of several awards, including the 2014 David Bates Medal from the European Geophysical Union for exceptional contributions to planetary and solar system sciences.
He manages WP1 dedicated to Mars water and cloud cycles. He also is involved in WP1 (data assimilation) and coordinate T8.2, and contribute to WP7.
Dr. Franck Montmessin is a senior scientist of Centre National de la Recherche Scientifique (CNRS) in LATMOS, FM has more than 15 years of experience in the Mars, Venus and Earth atmosphere exploration, through his efforts as a leader in space instrumentation, the modelling study of the Martian atmosphere, as well as the analysis of remote sensing data (UV, IR).FM is the PI, since 2009, of the dual ultraviolet-near-infrared spectrometer SPICAM onboard the ESA Mars Express mission. FM is also the lead scientist of the Micro-ARES ESA facility instrument for the ESA/ExoMars 2016 mission. He is Co-I of OMEGA on Mars Express, SPICAV on Venus Express, and of the IUVS instrument on the NASA/MAVEN mission. FM also serves as the Deputy-PI of the Atmospheric Chemistry Suite on the orbital platform of the ExoMars mission.
He manages WP1 related to the new retrieval tools applied to existing Mars observation datasets. He also contributes to WP4 dedicated to the water cycle.
Dr. Franck Lefèvre is a senior scientist of CNRS in LATMOS with more than 20 years of experience in photochemical modeling of the atmosphere of the Earth, Mars, and Venus. He is a recognized specialist of Mars atmospheric chemistry and has written several papers on the chemistry and climatology of ozone on Mars. F. Lefèvre is co-PI of SPICAM on board Mars Express, co-I of SPICAV on board Venus Express, and Collaborator of IUVS on MAVEN. F. Lefèvre has built and is in charge of the development of the photochemical module implemented in the LMD general circulation model.
He uses this model in WP6 to analyze space-borne observations of Mars photochemistry.
Dr. Anni Määttänen has 10 years of experience in studying the Martian atmosphere and since 2009 has worked as a junior research scientist at the CNRS. She has experience in several aspects of the Martian atmosphere, ranging from boundary layer to mesospheric clouds. Her main expertise is aerosols and clouds on Mars and on Venus, both from observational and theoretical/modelling aspects. She is co-I of SPICAM and has ongoing collaborations with several other instrument teams.
She participates in WP6 using her experience of solar occultation retrievals on Mars.
Dr. Jean-Yves Chaufray is a planetary scientist, specialized in the study of planetary upper atmospheres and the theory of radiative transfer of resonant lines. His interests include the upper atmosphere/exosphere and escape processes on Mars, Venus and Mercury. He has published several papers in refereed journals regarding the exosphere of Mars. Mission activities include Co-I on Mars Express SPICAM, Venus Express SPICAV, and Bepi-Colombo PHEBUS. He is unfunded collaborator of IUVS/MAVEN. He is also working on the modeling of the Martian ionosphere and thermosphere.
In this project, he compares the simulated H Lyman-a emission from GCMExosphere- Radiative transfer coupling with the Mars Express observations to study the variability of the hydrogen escape rates.
Dr. Ehouarn Millour is a CNRS Research Engineer at LMD, E. Millour has a 15 years of experience in Computational fluid dynamics and 10 years of experience in Numerical Mars Climate Modelling. He has served as project manager on the LMD Mars Climate Model and Mars Climate Database projects.
He is directly involved in WP8 (data assimilation) and also contribute to WP7, WP4 and in particular water cycle modelling (T4.3).
Alizée Pottier is a PhD student currently working in the LATMOS laboratory. Her research is focused on the Martian water cycle using data from orbiters and also a numeric model developed in the laboratoire de météorologie dynamique.
Using that model, the goal is to reproduce the atmosphere of Mars to better understand the main water reservoirs; to study the winds and the clouds.


The new TooJay's in Pembroke Pines rolls sauerkraut and corned beef into its Reuben sandwich and finishes it with Swiss cheese and home-style Russian dressing.
This New York-style deli chain, based in West Palm Beach, has opened its 28th location in Florida — and its fourth in Broward County.
Highlights include matzo ball soup ($4.99, $5.99), mini potato pancakes ($6.99), strawberry citrus salad ($9.99), Reuben sandwich ($12.29), pastrami burger ($13.49), shepherd's pie ($13.49) and chicken Capri ($15.99).
Bakery goodies include mini black-and-white cookies (three for $1.99) and cheese blintzes ($7.99). A signature dessert is the Banana Dream cake ($6.29, slice; $24.99, whole).
Warm earth tones and dark wood emulate a vintage New York deli, with subway tiles in the deli and bakery areas, white-and-black penny tiles on the entrance floor, and globe lights and black-and-white photos of New York City. The front patio is covered.
Hours are from 8 a.m. to 9 p.m. daily.
Up next: locations in Fort Lauderdale and Dania Beach in 2019.
The New York-style deli chain revitalizes its look.


text:
Apr 30, 2021 12:00:00 AM
Simplifying Trade Processing with DAML (Part 2) Introducing Daml Connect Simplifying Trade Processing with DAML The Demex Group Explains Why Daml and Sextant Provide the Necessary Technology Foundation for a Successful Climate Resiliency Platform How to Optimize the Complex Workflows Across the Insurance Value Chain with Daml and Blockchain
Digital Asset Open Sources Daml Code for CBDC Interoperability
By Digital Asset. Apr 30, 2021 12:00:00 AM
Over the past year, CBDCs have emerged as the holy grail of cross-border payments, making payments faster and more cost-effective for wholesale and retail markets. While CBDCs promise to deliver significant value, there are several hurdles central banks need to clear. Top of mind is which technology to use – DLT, centralized database, or existing rails and with that comes the question of interoperability across platforms. Last November, Digital Asset announced its plans to open source its example of a CBDC implementation highlighting some potential features around programmable money and interoperability built using Daml. Today, Darko Pilav, Head of Switzerland and Customer Experience Engineering Team at Digital Asset, shares details about the work, which is now open source and available for public consumption.
Let's talk about CBDCs – what are they and how do they differ from cash, and bank deposits that we use today?
CBDCs are a combination of the bank deposits you hold at your commercial bank, and physical cash. With CBDC you get the benefits of the ease of use of deposits for any kind of payment, with the additional benefits of physical cash being backed directly by the central bank instead of by an intermediary (i.e. commercial bank). Effectively you can see a CBDC implementation as the extension of the central bank ledger to a broader audience. Compared to physical cash, you gain the flexibility of doing instantaneous payments to any eligible recipient – you don't have to physically move bills and coins.
The difference to bank deposits is in its risk profile. Given that CBDC are issued and backed by the central bank itself, there is no risk of defaulting. Today your money on your bank account is not directly backed by the central bank. It is rather a liability of your commercial bank, which also means that if the commercial Bank goes bankrupt, your assets are at risk. To combat that, a number of countries are providing government guarantees up to a certain amount, i.e. the government will step in and ensure owners of the deposits will not lose their money. But this is a complicated process, the covered amount is typically limited, and it effectively tries to emulate properties that you would get with CBDC out of the box.
Darko Pilav
Can you tell us about the CBDC implementation work you have been doing?
The CBDC implementation is an example of interoperability, the possible capabilities of CBDC, and how central banks can use Daml, an application platform created by Digital Asset, to integrate CBDCs across different blockchain and database platforms. It is a simplified design, which was purposely done so that we could focus on the important properties of interoperability without having to cover all the intricate details of a production solution. We have built this example using Daml to showcase all of the above, and have made it open source and available for public use.
What does a successful CBDC implementation look like?
From our perspective, we believe seamless, built-in interoperability is the only way for CBDC's to reach their full potential. Of course, a great follow on question is what do we mean by interoperability? For Digital Asset, true interoperability includes four key components: multi-ledger technology, cross-ledger atomicity, data privacy, and composable extensibility.
Multi-ledger technology: The ability to deploy and connect digital currency systems across disparate networks regardless of the underlying IT infrastructure. Top among the challenges is deciding which technology to use – DLT, centralized database, or existing payment rails. On the back of that is the compatibility with other CBDCs. There is not going to be one ledger to rule them all. Some might not even use DLT. Ensuring that CBDCs are compatible with other CBDCs is an imperative first step, else, the CBDC runs a great risk of hitting a dead end at the start.
Cross-ledger atomicity: If one leg of a transaction fails, all sides fail. By ensuring atomicity, systems can achieve payment versus payment and delivery versus payment without the risk of handing over the goods when the payment leg fails and without the need for a central authority acting as an escrow. The counterparty risk or delivery risk are eliminated.
Data privacy: Almost all non-Daml blockchains lack crucial properties of privacy, leaking significant transaction information to the world. Some infrastructures have addressed some of the privacy concerns but lack the ability to guarantee their privacy mechanisms when transacting across chains. Any CBDC solution must feature the highest need-to-know level of privacy independent of the infrastructure that it is transacted on..
Yuval Rooz Interoperability Demo at OECD Global Blockchain Policy Forum
Composable extensibility: This means the ability to dynamically add new applications and connect to other networks on the fly. Imagine after a government introduces CBDC, an e-commerce company wants to tie them into their existing workflows by allowing payments to be done with CBDC. In order to maintain all the crucial properties mentioned above (atomicity, privacy, etc.) the e-commerce company can not rely on standard APIs. It must rather compose their payment process with the CBDC transfer functionality. With Daml, this is trivial to do. Furthermore, using non-Daml technology, the only way to achieve this would be to run both the CBDC solution as well as the e-commerce solution on the same platform. This is of course not practical, as a central Bank would not and should not agree to run a number of 3rd party solutions on their platform. Daml's interoperability eliminates this problem as well. The e-commerce company operates its solution on their own infrastructure and it simply interoperates with the CBDS solution of the Central Bank.
One additional remark that I would like to add is that historically the entity managing an account is also the same entity that provides services for said account. Hence the question comes up whether this means that in a retail CBDC scenario, the central bank will have to provide all the services of a bank account to the broad population. The answer is that if you are using the right technology, and you design the CBDC solution correctly, the concern of account management and provision of services can be disentangled. This would give the opportunity for commercial banks that already have the customer relationship, and have a lot of knowledge and experience in the provision of these services to continue to do so, while the central bank is simply the maintainer of the account.
How does Daml fit into the CBDC ecosystem?
Daml provides a number of crucial properties right out of the box. A few examples would be true cross technology interoperability, extensibility, and incredibly high levels of privacy. To the best of our knowledge, no other technology is capable of providing all of the above to such a high level as Daml. Our technology stack works with the major enterprise blockchains as well as centralized databases and other systems. In our opinion these are crucial properties, for a large number of different use cases and particularly for CBDC.
Why did Digital Asset open source the code?
CBDCs have great potential to transform cross-border and domestic payments in both wholesale and retail markets. Given its importance to markets worldwide, we want to make sure everyone involved in building a CBDC solution has access to the components that will make it successful. It's a great starting point for anyone needing to build applications that will eventually need to integrate with CBDCs.
Secondly, we also want to show how straight forward it is to implement various features of CBDC and make it interoperable across technologies when using Daml. Our technology stack is best known in the blockchain space, but it goes beyond blockchain and can be used across database and cloud technologies. The Daml code used for the demo runs across blockchain and database platforms, which is a very realistic scenario given central banks will not use the same platform to build and deploy their digital currencies.
Finally, we would like to make sure that when people are thinking about what a CBDC solution should look like, its functionality and how it should behave, they have the best technology in mind. Our technology stack is solving a few very hard problems, and this can influence the design and requirements of the CBDC solution
What other technology can achieve this interoperable state for CBDCs?
APIs could be used to connect the various CBDCs using existing message-based technology. This approach will get the job done to some extent, but it lacks a few key components, atomicity and extensibility. In this scenario, how would you connect central bank digital currency into capital markets, into insurance, or supply chain? If you don't tie in the system that handles the delivery part of the delivery versus payment process, then just having the payment part on the system doesn't give you all that much. Let's look at an equity transaction using CBDCs. In this example, neither the seller nor the buyer wants to start the settlement process first. The seller doesn't want to give you the equity and wait for you to send the cash. Nor, do you want to front the cash and get the equity later. You both want the transaction to settle at the same time. In order to do this you have to be able to connect to the system that manages the positions of the equity, e.g., a central depository system, with the central bank system that manages the CBDC, and do this atomically across two different systems.
Is this interoperability example only applicable to CBDCs? If no, what other use cases could benefit?
This particular use case is specific to CBDCs, but it is only one example that showcases the power of Daml. The purpose of the demo and our example of an implementation is to show how an external application can interface with a CBDC. And, to clarify, we have not implemented any new Daml functionality to create the CBDC use case. This is just one use case where we are applying our technology as it stands today. This demo functionality can apply to any scenario where multiple parties and complex workflow across disparate systems exist. We picked CBDC because it's a relevant topic and very timely as central banks are evaluating their technology options and building roadmaps for their potential CBDC launches.
On the topic of technology evaluations, there are a number of key points central banks need to consider when choosing a technology to support CBDCs. We recently published a whitepaper explaining these key points in greater detail.
What do central banks or enterprises need to build this functionality in-house?
To get the most out of the open source code we recommend using developers that have some experience writing applications in Daml or willing to learn the language. We offer some tutorials and tips in our forum, called Daml Discuss or as part of the Daml Developer Certification exams.
When and where will the code be available?
It's available today. Visit Github – https://github.com/digital-asset/ex-cbdc – to download an example of a Daml powered CBDC network.
What do you hope market participants will take away from this use case?
My hope is that anyone working with CBDCs or building applications that need to interact with CBDCs, can use this functionality as a starting point to build their solutions. For Digital Asset, we also wanted to clearly demonstrate what a CBDC implementation requires to be successful. We believe with the interoperability properties we identified, CBDCs will realize their full potential. Without it, they could hit a dead end at the start. For us, CBDCs are a great use case to show the power of the technology and how it can streamline complex multi-party workflows across disparate systems.
For more information about the technical ingredients behind a successful CBDC implementation, please download a copy of our latest whitepaper "Central Bank Digital Currency: Principles for Technical Implementation", published in collaboration with Darrell Duffie, Graduate School of Business, Stanford University.
Simplifying Trade Processing with DAML (Part 2)
Introducing Daml Connect
Simplifying Trade Processing with DAML
The Demex Group Explains Why Daml and Sextant Provide the Necessary Technology Foundation for a Successful Climate Resiliency Platform


text:
The Role of Horizontal Directional Drilling in Breaking Ground
by Nicole | Business, Finance, Tech
Various kinds of drilling techniques have been developed over the years and classified according to their applicability at present, namely: mechanical, thermal, hydraulic, sonic, chemical, electrical, seismic and nuclear. For almost a century, directional drilling...
The Many Benefits of Glass Railing Systems
by Nicole | Home & Garden, Investments, Tech
Whether you are a homeowner, designer, builder or architect, there are many benefits to choosing glass railing systems. Keep reading to find out why you may want to choose glass railings for your next project. There are various styles to choose from when it comes to...
A DIY 4G Wireless Cell Phone Signal Booster
by Nicole | Tech
Sometimes, cell phone signals can be unpredictable; one moment you are enjoying a strong phone connection, then another minute your phone calls get dropped due to weak or no signal at all leaving you hopeless. You can take control of your phone connections at home by...
Tatiana Regan – Building an Instagram Following
Tatiana Regan started a food-related Instagram page around 4 years ago with the intention of simply creating a community around her love of Mediterranean food. Over the years her following has grown an incredible amount and she is now making a living from her...
The Keys To Eva Lovia's Online Success
by Nicole | Business, Tech
We live in a world where it seems that everyone wants to be a super star Instagrammer or social media celeb, but very few actually reach those heights. One person who most certainly has is Eva Lovia, a social media influencer and lifestyle blogger who has a huge...
Lindsey's SMARTLINE VS Static Ratings
SMARTLINE is quickly becoming a standard in the power distribution industry and it is really easy to understand why. Lindsey Manufacturing Company managed to create a system that forecasts transmission capacity based on actual measured data as opposed to what is used...
Why You Should Think About Moving to the Midwest When You Retire
Ways To Find Success In Online Poker
Tackling Debt: Here's What You Need To Know
What Is Stump Grinding Service
Why Does Anyone Use Payday Lenders?
© 2018 In Good Cents | Privacy Policy | Contact


text:
package libnetwork

//go:generate protoc -I.:Godeps/_workspace/src/github.com/gogo/protobuf  --gogo_out=import_path=github.com/docker/libnetwork,Mgogoproto/gogo.proto=github.com/gogo/protobuf/gogoproto:. agent.proto

import (
	"encoding/json"
	"fmt"
	"net"
	"sort"
	"sync"

	"github.com/docker/go-events"
	"github.com/docker/libnetwork/cluster"
	"github.com/docker/libnetwork/datastore"
	"github.com/docker/libnetwork/discoverapi"
	"github.com/docker/libnetwork/driverapi"
	"github.com/docker/libnetwork/networkdb"
	"github.com/docker/libnetwork/types"
	"github.com/gogo/protobuf/proto"
	"github.com/sirupsen/logrus"
)

const (
	subsysGossip = "networking:gossip"
	subsysIPSec  = "networking:ipsec"
	keyringSize  = 3
)

// ByTime implements sort.Interface for []*types.EncryptionKey based on
// the LamportTime field.
type ByTime []*types.EncryptionKey

func (b ByTime) Len() int           { return len(b) }
func (b ByTime) Swap(i, j int)      { b[i], b[j] = b[j], b[i] }
func (b ByTime) Less(i, j int) bool { return b[i].LamportTime < b[j].LamportTime }

type agent struct {
	networkDB         *networkdb.NetworkDB
	bindAddr          string
	advertiseAddr     string
	dataPathAddr      string
	coreCancelFuncs   []func()
	driverCancelFuncs map[string][]func()
	sync.Mutex
}

func (a *agent) dataPathAddress() string {
	a.Lock()
	defer a.Unlock()
	if a.dataPathAddr != "" {
		return a.dataPathAddr
	}
	return a.advertiseAddr
}

const libnetworkEPTable = "endpoint_table"

func getBindAddr(ifaceName string) (string, error) {
	iface, err := net.InterfaceByName(ifaceName)
	if err != nil {
		return "", fmt.Errorf("failed to find interface %s: %v", ifaceName, err)
	}

	addrs, err := iface.Addrs()
	if err != nil {
		return "", fmt.Errorf("failed to get interface addresses: %v", err)
	}

	for _, a := range addrs {
		addr, ok := a.(*net.IPNet)
		if !ok {
			continue
		}
		addrIP := addr.IP

		if addrIP.IsLinkLocalUnicast() {
			continue
		}

		return addrIP.String(), nil
	}

	return "", fmt.Errorf("failed to get bind address")
}

func resolveAddr(addrOrInterface string) (string, error) {
	// Try and see if this is a valid IP address
	if net.ParseIP(addrOrInterface) != nil {
		return addrOrInterface, nil
	}

	addr, err := net.ResolveIPAddr("ip", addrOrInterface)
	if err != nil {
		// If not a valid IP address, it should be a valid interface
		return getBindAddr(addrOrInterface)
	}
	return addr.String(), nil
}

func (c *controller) handleKeyChange(keys []*types.EncryptionKey) error {
	drvEnc := discoverapi.DriverEncryptionUpdate{}

	a := c.getAgent()
	if a == nil {
		logrus.Debug("Skipping key change as agent is nil")
		return nil
	}

	// Find the deleted key. If the deleted key was the primary key,
	// a new primary key should be set before removing if from keyring.
	c.Lock()
	added := []byte{}
	deleted := []byte{}
	j := len(c.keys)
	for i := 0; i < j; {
		same := false
		for _, key := range keys {
			if same = key.LamportTime == c.keys[i].LamportTime; same {
				break
			}
		}
		if !same {
			cKey := c.keys[i]
			if cKey.Subsystem == subsysGossip {
				deleted = cKey.Key
			}

			if cKey.Subsystem == subsysIPSec {
				drvEnc.Prune = cKey.Key
				drvEnc.PruneTag = cKey.LamportTime
			}
			c.keys[i], c.keys[j-1] = c.keys[j-1], c.keys[i]
			c.keys[j-1] = nil
			j--
		}
		i++
	}
	c.keys = c.keys[:j]

	// Find the new key and add it to the key ring
	for _, key := range keys {
		same := false
		for _, cKey := range c.keys {
			if same = cKey.LamportTime == key.LamportTime; same {
				break
			}
		}
		if !same {
			c.keys = append(c.keys, key)
			if key.Subsystem == subsysGossip {
				added = key.Key
			}

			if key.Subsystem == subsysIPSec {
				drvEnc.Key = key.Key
				drvEnc.Tag = key.LamportTime
			}
		}
	}
	c.Unlock()

	if len(added) > 0 {
		a.networkDB.SetKey(added)
	}

	key, _, err := c.getPrimaryKeyTag(subsysGossip)
	if err != nil {
		return err
	}
	a.networkDB.SetPrimaryKey(key)

	key, tag, err := c.getPrimaryKeyTag(subsysIPSec)
	if err != nil {
		return err
	}
	drvEnc.Primary = key
	drvEnc.PrimaryTag = tag

	if len(deleted) > 0 {
		a.networkDB.RemoveKey(deleted)
	}

	c.drvRegistry.WalkDrivers(func(name string, driver driverapi.Driver, capability driverapi.Capability) bool {
		err := driver.DiscoverNew(discoverapi.EncryptionKeysUpdate, drvEnc)
		if err != nil {
			logrus.Warnf("Failed to update datapath keys in driver %s: %v", name, err)
		}
		return false
	})

	return nil
}

func (c *controller) agentSetup(clusterProvider cluster.Provider) error {
	agent := c.getAgent()

	// If the agent is already present there is no need to try to initilize it again
	if agent != nil {
		return nil
	}

	bindAddr := clusterProvider.GetLocalAddress()
	advAddr := clusterProvider.GetAdvertiseAddress()
	dataAddr := clusterProvider.GetDataPathAddress()
	remoteList := clusterProvider.GetRemoteAddressList()
	remoteAddrList := make([]string, 0, len(remoteList))
	for _, remote := range remoteList {
		addr, _, _ := net.SplitHostPort(remote)
		remoteAddrList = append(remoteAddrList, addr)
	}

	listen := clusterProvider.GetListenAddress()
	listenAddr, _, _ := net.SplitHostPort(listen)

	logrus.Infof("Initializing Libnetwork Agent Listen-Addr=%s Local-addr=%s Adv-addr=%s Data-addr=%s Remote-addr-list=%v MTU=%d",
		listenAddr, bindAddr, advAddr, dataAddr, remoteAddrList, c.Config().Daemon.NetworkControlPlaneMTU)
	if advAddr != "" && agent == nil {
		if err := c.agentInit(listenAddr, bindAddr, advAddr, dataAddr); err != nil {
			logrus.Errorf("error in agentInit: %v", err)
			return err
		}
		c.drvRegistry.WalkDrivers(func(name string, driver driverapi.Driver, capability driverapi.Capability) bool {
			if capability.ConnectivityScope == datastore.GlobalScope {
				c.agentDriverNotify(driver)
			}
			return false
		})
	}

	if len(remoteAddrList) > 0 {
		if err := c.agentJoin(remoteAddrList); err != nil {
			logrus.Errorf("Error in joining gossip cluster : %v(join will be retried in background)", err)
		}
	}

	return nil
}

// For a given subsystem getKeys sorts the keys by lamport time and returns
// slice of keys and lamport time which can used as a unique tag for the keys
func (c *controller) getKeys(subsys string) ([][]byte, []uint64) {
	c.Lock()
	defer c.Unlock()

	sort.Sort(ByTime(c.keys))

	keys := [][]byte{}
	tags := []uint64{}
	for _, key := range c.keys {
		if key.Subsystem == subsys {
			keys = append(keys, key.Key)
			tags = append(tags, key.LamportTime)
		}
	}

	keys[0], keys[1] = keys[1], keys[0]
	tags[0], tags[1] = tags[1], tags[0]
	return keys, tags
}

// getPrimaryKeyTag returns the primary key for a given subsystem from the
// list of sorted key and the associated tag
func (c *controller) getPrimaryKeyTag(subsys string) ([]byte, uint64, error) {
	c.Lock()
	defer c.Unlock()
	sort.Sort(ByTime(c.keys))
	keys := []*types.EncryptionKey{}
	for _, key := range c.keys {
		if key.Subsystem == subsys {
			keys = append(keys, key)
		}
	}
	return keys[1].Key, keys[1].LamportTime, nil
}

func (c *controller) agentInit(listenAddr, bindAddrOrInterface, advertiseAddr, dataPathAddr string) error {
	bindAddr, err := resolveAddr(bindAddrOrInterface)
	if err != nil {
		return err
	}

	keys, _ := c.getKeys(subsysGossip)

	netDBConf := networkdb.DefaultConfig()
	netDBConf.BindAddr = listenAddr
	netDBConf.AdvertiseAddr = advertiseAddr
	netDBConf.Keys = keys
	if c.Config().Daemon.NetworkControlPlaneMTU != 0 {
		// Consider the MTU remove the IP hdr (IPv4 or IPv6) and the TCP/UDP hdr.
		// To be on the safe side let's cut 100 bytes
		netDBConf.PacketBufferSize = (c.Config().Daemon.NetworkControlPlaneMTU - 100)
		logrus.Debugf("Control plane MTU: %d will initialize NetworkDB with: %d",
			c.Config().Daemon.NetworkControlPlaneMTU, netDBConf.PacketBufferSize)
	}
	nDB, err := networkdb.New(netDBConf)

	if err != nil {
		return err
	}

	var cancelList []func()
	ch, cancel := nDB.Watch(libnetworkEPTable, "", "")
	cancelList = append(cancelList, cancel)
	nodeCh, cancel := nDB.Watch(networkdb.NodeTable, "", "")
	cancelList = append(cancelList, cancel)

	c.Lock()
	c.agent = &agent{
		networkDB:         nDB,
		bindAddr:          bindAddr,
		advertiseAddr:     advertiseAddr,
		dataPathAddr:      dataPathAddr,
		coreCancelFuncs:   cancelList,
		driverCancelFuncs: make(map[string][]func()),
	}
	c.Unlock()

	go c.handleTableEvents(ch, c.handleEpTableEvent)
	go c.handleTableEvents(nodeCh, c.handleNodeTableEvent)

	drvEnc := discoverapi.DriverEncryptionConfig{}
	keys, tags := c.getKeys(subsysIPSec)
	drvEnc.Keys = keys
	drvEnc.Tags = tags

	c.drvRegistry.WalkDrivers(func(name string, driver driverapi.Driver, capability driverapi.Capability) bool {
		err := driver.DiscoverNew(discoverapi.EncryptionKeysConfig, drvEnc)
		if err != nil {
			logrus.Warnf("Failed to set datapath keys in driver %s: %v", name, err)
		}
		return false
	})

	c.WalkNetworks(joinCluster)

	return nil
}

func (c *controller) agentJoin(remoteAddrList []string) error {
	agent := c.getAgent()
	if agent == nil {
		return nil
	}
	return agent.networkDB.Join(remoteAddrList)
}

func (c *controller) agentDriverNotify(d driverapi.Driver) {
	agent := c.getAgent()
	if agent == nil {
		return
	}

	if err := d.DiscoverNew(discoverapi.NodeDiscovery, discoverapi.NodeDiscoveryData{
		Address:     agent.dataPathAddress(),
		BindAddress: agent.bindAddr,
		Self:        true,
	}); err != nil {
		logrus.Warnf("Failed the node discovery in driver: %v", err)
	}

	drvEnc := discoverapi.DriverEncryptionConfig{}
	keys, tags := c.getKeys(subsysIPSec)
	drvEnc.Keys = keys
	drvEnc.Tags = tags

	if err := d.DiscoverNew(discoverapi.EncryptionKeysConfig, drvEnc); err != nil {
		logrus.Warnf("Failed to set datapath keys in driver: %v", err)
	}
}

func (c *controller) agentClose() {
	// Acquire current agent instance and reset its pointer
	// then run closing functions
	c.Lock()
	agent := c.agent
	c.agent = nil
	c.Unlock()

	if agent == nil {
		return
	}

	var cancelList []func()

	agent.Lock()
	for _, cancelFuncs := range agent.driverCancelFuncs {
		cancelList = append(cancelList, cancelFuncs...)
	}

	// Add also the cancel functions for the network db
	cancelList = append(cancelList, agent.coreCancelFuncs...)
	agent.Unlock()

	for _, cancel := range cancelList {
		cancel()
	}

	agent.networkDB.Close()
}

// Task has the backend container details
type Task struct {
	Name       string
	EndpointID string
	EndpointIP string
	Info       map[string]string
}

// ServiceInfo has service specific details along with the list of backend tasks
type ServiceInfo struct {
	VIP          string
	LocalLBIndex int
	Tasks        []Task
	Ports        []string
}

type epRecord struct {
	ep      EndpointRecord
	info    map[string]string
	lbIndex int
}

func (n *network) Services() map[string]ServiceInfo {
	eps := make(map[string]epRecord)

	if !n.isClusterEligible() {
		return nil
	}
	agent := n.getController().getAgent()
	if agent == nil {
		return nil
	}

	// Walk through libnetworkEPTable and fetch the driver agnostic endpoint info
	entries := agent.networkDB.GetTableByNetwork(libnetworkEPTable, n.id)
	for eid, value := range entries {
		var epRec EndpointRecord
		nid := n.ID()
		if err := proto.Unmarshal(value.([]byte), &epRec); err != nil {
			logrus.Errorf("Unmarshal of libnetworkEPTable failed for endpoint %s in network %s, %v", eid, nid, err)
			continue
		}
		i := n.getController().getLBIndex(epRec.ServiceID, nid, epRec.IngressPorts)
		eps[eid] = epRecord{
			ep:      epRec,
			lbIndex: i,
		}
	}

	// Walk through the driver's tables, have the driver decode the entries
	// and return the tuple {ep ID, value}. value is a string that coveys
	// relevant info about the endpoint.
	d, err := n.driver(true)
	if err != nil {
		logrus.Errorf("Could not resolve driver for network %s/%s while fetching services: %v", n.networkType, n.ID(), err)
		return nil
	}
	for _, table := range n.driverTables {
		if table.objType != driverapi.EndpointObject {
			continue
		}
		entries := agent.networkDB.GetTableByNetwork(table.name, n.id)
		for key, value := range entries {
			epID, info := d.DecodeTableEntry(table.name, key, value.([]byte))
			if ep, ok := eps[epID]; !ok {
				logrus.Errorf("Inconsistent driver and libnetwork state for endpoint %s", epID)
			} else {
				ep.info = info
				eps[epID] = ep
			}
		}
	}

	// group the endpoints into a map keyed by the service name
	sinfo := make(map[string]ServiceInfo)
	for ep, epr := range eps {
		var (
			s  ServiceInfo
			ok bool
		)
		if s, ok = sinfo[epr.ep.ServiceName]; !ok {
			s = ServiceInfo{
				VIP:          epr.ep.VirtualIP,
				LocalLBIndex: epr.lbIndex,
			}
		}
		ports := []string{}
		if s.Ports == nil {
			for _, port := range epr.ep.IngressPorts {
				p := fmt.Sprintf("Target: %d, Publish: %d", port.TargetPort, port.PublishedPort)
				ports = append(ports, p)
			}
			s.Ports = ports
		}
		s.Tasks = append(s.Tasks, Task{
			Name:       epr.ep.Name,
			EndpointID: ep,
			EndpointIP: epr.ep.EndpointIP,
			Info:       epr.info,
		})
		sinfo[epr.ep.ServiceName] = s
	}
	return sinfo
}

func (n *network) isClusterEligible() bool {
	if n.scope != datastore.SwarmScope || !n.driverIsMultihost() {
		return false
	}
	return n.getController().getAgent() != nil
}

func (n *network) joinCluster() error {
	if !n.isClusterEligible() {
		return nil
	}

	agent := n.getController().getAgent()
	if agent == nil {
		return nil
	}

	return agent.networkDB.JoinNetwork(n.ID())
}

func (n *network) leaveCluster() error {
	if !n.isClusterEligible() {
		return nil
	}

	agent := n.getController().getAgent()
	if agent == nil {
		return nil
	}

	return agent.networkDB.LeaveNetwork(n.ID())
}

func (ep *endpoint) addDriverInfoToCluster() error {
	n := ep.getNetwork()
	if !n.isClusterEligible() {
		return nil
	}
	if ep.joinInfo == nil {
		return nil
	}

	agent := n.getController().getAgent()
	if agent == nil {
		return nil
	}

	for _, te := range ep.joinInfo.driverTableEntries {
		if err := agent.networkDB.CreateEntry(te.tableName, n.ID(), te.key, te.value); err != nil {
			return err
		}
	}
	return nil
}

func (ep *endpoint) deleteDriverInfoFromCluster() error {
	n := ep.getNetwork()
	if !n.isClusterEligible() {
		return nil
	}
	if ep.joinInfo == nil {
		return nil
	}

	agent := n.getController().getAgent()
	if agent == nil {
		return nil
	}

	for _, te := range ep.joinInfo.driverTableEntries {
		if err := agent.networkDB.DeleteEntry(te.tableName, n.ID(), te.key); err != nil {
			return err
		}
	}
	return nil
}

func (ep *endpoint) addServiceInfoToCluster(sb *sandbox) error {
	if ep.isAnonymous() && len(ep.myAliases) == 0 || ep.Iface().Address() == nil {
		return nil
	}

	n := ep.getNetwork()
	if !n.isClusterEligible() {
		return nil
	}

	sb.Service.Lock()
	defer sb.Service.Unlock()
	logrus.Debugf("addServiceInfoToCluster START for %s %s", ep.svcName, ep.ID())

	// Check that the endpoint is still present on the sandbox before adding it to the service discovery.
	// This is to handle a race between the EnableService and the sbLeave
	// It is possible that the EnableService starts, fetches the list of the endpoints and
	// by the time the addServiceInfoToCluster is called the endpoint got removed from the sandbox
	// The risk is that the deleteServiceInfoToCluster happens before the addServiceInfoToCluster.
	// This check under the Service lock of the sandbox ensure the correct behavior.
	// If the addServiceInfoToCluster arrives first may find or not the endpoint and will proceed or exit
	// but in any case the deleteServiceInfoToCluster will follow doing the cleanup if needed.
	// In case the deleteServiceInfoToCluster arrives first, this one is happening after the endpoint is
	// removed from the list, in this situation the delete will bail out not finding any data to cleanup
	// and the add will bail out not finding the endpoint on the sandbox.
	if e := sb.getEndpoint(ep.ID()); e == nil {
		logrus.Warnf("addServiceInfoToCluster suppressing service resolution ep is not anymore in the sandbox %s", ep.ID())
		return nil
	}

	c := n.getController()
	agent := c.getAgent()

	name := ep.Name()
	if ep.isAnonymous() {
		name = ep.MyAliases()[0]
	}

	var ingressPorts []*PortConfig
	if ep.svcID != "" {
		// This is a task part of a service
		// Gossip ingress ports only in ingress network.
		if n.ingress {
			ingressPorts = ep.ingressPorts
		}
		if err := c.addServiceBinding(ep.svcName, ep.svcID, n.ID(), ep.ID(), name, ep.virtualIP, ingressPorts, ep.svcAliases, ep.myAliases, ep.Iface().Address().IP, "addServiceInfoToCluster"); err != nil {
			return err
		}
	} else {
		// This is a container simply attached to an attachable network
		if err := c.addContainerNameResolution(n.ID(), ep.ID(), name, ep.myAliases, ep.Iface().Address().IP, "addServiceInfoToCluster"); err != nil {
			return err
		}
	}

	buf, err := proto.Marshal(&EndpointRecord{
		Name:         name,
		ServiceName:  ep.svcName,
		ServiceID:    ep.svcID,
		VirtualIP:    ep.virtualIP.String(),
		IngressPorts: ingressPorts,
		Aliases:      ep.svcAliases,
		TaskAliases:  ep.myAliases,
		EndpointIP:   ep.Iface().Address().IP.String(),
	})
	if err != nil {
		return err
	}

	if agent != nil {
		if err := agent.networkDB.CreateEntry(libnetworkEPTable, n.ID(), ep.ID(), buf); err != nil {
			logrus.Warnf("addServiceInfoToCluster NetworkDB CreateEntry failed for %s %s err:%s", ep.id, n.id, err)
			return err
		}
	}

	logrus.Debugf("addServiceInfoToCluster END for %s %s", ep.svcName, ep.ID())

	return nil
}

func (ep *endpoint) deleteServiceInfoFromCluster(sb *sandbox, method string) error {
	if ep.isAnonymous() && len(ep.myAliases) == 0 {
		return nil
	}

	n := ep.getNetwork()
	if !n.isClusterEligible() {
		return nil
	}

	sb.Service.Lock()
	defer sb.Service.Unlock()
	logrus.Debugf("deleteServiceInfoFromCluster from %s START for %s %s", method, ep.svcName, ep.ID())

	c := n.getController()
	agent := c.getAgent()

	name := ep.Name()
	if ep.isAnonymous() {
		name = ep.MyAliases()[0]
	}

	if agent != nil {
		// First delete from networkDB then locally
		if err := agent.networkDB.DeleteEntry(libnetworkEPTable, n.ID(), ep.ID()); err != nil {
			logrus.Warnf("deleteServiceInfoFromCluster NetworkDB DeleteEntry failed for %s %s err:%s", ep.id, n.id, err)
		}
	}

	if ep.Iface().Address() != nil {
		if ep.svcID != "" {
			// This is a task part of a service
			var ingressPorts []*PortConfig
			if n.ingress {
				ingressPorts = ep.ingressPorts
			}
			if err := c.rmServiceBinding(ep.svcName, ep.svcID, n.ID(), ep.ID(), name, ep.virtualIP, ingressPorts, ep.svcAliases, ep.myAliases, ep.Iface().Address().IP, "deleteServiceInfoFromCluster", true); err != nil {
				return err
			}
		} else {
			// This is a container simply attached to an attachable network
			if err := c.delContainerNameResolution(n.ID(), ep.ID(), name, ep.myAliases, ep.Iface().Address().IP, "deleteServiceInfoFromCluster"); err != nil {
				return err
			}
		}
	}

	logrus.Debugf("deleteServiceInfoFromCluster from %s END for %s %s", method, ep.svcName, ep.ID())

	return nil
}

func (n *network) addDriverWatches() {
	if !n.isClusterEligible() {
		return
	}

	c := n.getController()
	agent := c.getAgent()
	if agent == nil {
		return
	}
	for _, table := range n.driverTables {
		ch, cancel := agent.networkDB.Watch(table.name, n.ID(), "")
		agent.Lock()
		agent.driverCancelFuncs[n.ID()] = append(agent.driverCancelFuncs[n.ID()], cancel)
		agent.Unlock()
		go c.handleTableEvents(ch, n.handleDriverTableEvent)
		d, err := n.driver(false)
		if err != nil {
			logrus.Errorf("Could not resolve driver %s while walking driver tabl: %v", n.networkType, err)
			return
		}

		agent.networkDB.WalkTable(table.name, func(nid, key string, value []byte, deleted bool) bool {
			// skip the entries that are mark for deletion, this is safe because this function is
			// called at initialization time so there is no state to delete
			if nid == n.ID() && !deleted {
				d.EventNotify(driverapi.Create, nid, table.name, key, value)
			}
			return false
		})
	}
}

func (n *network) cancelDriverWatches() {
	if !n.isClusterEligible() {
		return
	}

	agent := n.getController().getAgent()
	if agent == nil {
		return
	}

	agent.Lock()
	cancelFuncs := agent.driverCancelFuncs[n.ID()]
	delete(agent.driverCancelFuncs, n.ID())
	agent.Unlock()

	for _, cancel := range cancelFuncs {
		cancel()
	}
}

func (c *controller) handleTableEvents(ch *events.Channel, fn func(events.Event)) {
	for {
		select {
		case ev := <-ch.C:
			fn(ev)
		case <-ch.Done():
			return
		}
	}
}

func (n *network) handleDriverTableEvent(ev events.Event) {
	d, err := n.driver(false)
	if err != nil {
		logrus.Errorf("Could not resolve driver %s while handling driver table event: %v", n.networkType, err)
		return
	}

	var (
		etype driverapi.EventType
		tname string
		key   string
		value []byte
	)

	switch event := ev.(type) {
	case networkdb.CreateEvent:
		tname = event.Table
		key = event.Key
		value = event.Value
		etype = driverapi.Create
	case networkdb.DeleteEvent:
		tname = event.Table
		key = event.Key
		value = event.Value
		etype = driverapi.Delete
	case networkdb.UpdateEvent:
		tname = event.Table
		key = event.Key
		value = event.Value
		etype = driverapi.Delete
	}

	d.EventNotify(etype, n.ID(), tname, key, value)
}

func (c *controller) handleNodeTableEvent(ev events.Event) {
	var (
		value    []byte
		isAdd    bool
		nodeAddr networkdb.NodeAddr
	)
	switch event := ev.(type) {
	case networkdb.CreateEvent:
		value = event.Value
		isAdd = true
	case networkdb.DeleteEvent:
		value = event.Value
	case networkdb.UpdateEvent:
		logrus.Errorf("Unexpected update node table event = %#v", event)
	}

	err := json.Unmarshal(value, &nodeAddr)
	if err != nil {
		logrus.Errorf("Error unmarshalling node table event %v", err)
		return
	}
	c.processNodeDiscovery([]net.IP{nodeAddr.Addr}, isAdd)

}

func (c *controller) handleEpTableEvent(ev events.Event) {
	var (
		nid   string
		eid   string
		value []byte
		isAdd bool
		epRec EndpointRecord
	)

	switch event := ev.(type) {
	case networkdb.CreateEvent:
		nid = event.NetworkID
		eid = event.Key
		value = event.Value
		isAdd = true
	case networkdb.DeleteEvent:
		nid = event.NetworkID
		eid = event.Key
		value = event.Value
	case networkdb.UpdateEvent:
		logrus.Errorf("Unexpected update service table event = %#v", event)
		return
	}

	err := proto.Unmarshal(value, &epRec)
	if err != nil {
		logrus.Errorf("Failed to unmarshal service table value: %v", err)
		return
	}

	containerName := epRec.Name
	svcName := epRec.ServiceName
	svcID := epRec.ServiceID
	vip := net.ParseIP(epRec.VirtualIP)
	ip := net.ParseIP(epRec.EndpointIP)
	ingressPorts := epRec.IngressPorts
	serviceAliases := epRec.Aliases
	taskAliases := epRec.TaskAliases

	if containerName == "" || ip == nil {
		logrus.Errorf("Invalid endpoint name/ip received while handling service table event %s", value)
		return
	}

	if isAdd {
		logrus.Debugf("handleEpTableEvent ADD %s R:%v", eid, epRec)
		if svcID != "" {
			// This is a remote task part of a service
			if err := c.addServiceBinding(svcName, svcID, nid, eid, containerName, vip, ingressPorts, serviceAliases, taskAliases, ip, "handleEpTableEvent"); err != nil {
				logrus.Errorf("failed adding service binding for %s epRec:%v err:%v", eid, epRec, err)
				return
			}
		} else {
			// This is a remote container simply attached to an attachable network
			if err := c.addContainerNameResolution(nid, eid, containerName, taskAliases, ip, "handleEpTableEvent"); err != nil {
				logrus.Errorf("failed adding container name resolution for %s epRec:%v err:%v", eid, epRec, err)
			}
		}
	} else {
		logrus.Debugf("handleEpTableEvent DEL %s R:%v", eid, epRec)
		if svcID != "" {
			// This is a remote task part of a service
			if err := c.rmServiceBinding(svcName, svcID, nid, eid, containerName, vip, ingressPorts, serviceAliases, taskAliases, ip, "handleEpTableEvent", true); err != nil {
				logrus.Errorf("failed removing service binding for %s epRec:%v err:%v", eid, epRec, err)
				return
			}
		} else {
			// This is a remote container simply attached to an attachable network
			if err := c.delContainerNameResolution(nid, eid, containerName, taskAliases, ip, "handleEpTableEvent"); err != nil {
				logrus.Errorf("failed removing container name resolution for %s epRec:%v err:%v", eid, epRec, err)
			}
		}
	}
}

redpajama_set_name: RedPajamaGithub


James Matthew Wilson, a new contributor, has published eight books, including, most recently, The Hanging God (Angelico) and The Vision of the Soul: Truth, Goodness, and Beauty in the Western Tradition (CUA). An associate professor of religion and literature in the Department of Humanities and Augustinian Traditions, at Villanova University, he also serves as poetry editor for Modern Age magazine and as series editor for Colosseum Books, from the Franciscan University at Steubenville Press. His Amazon page is here.


text:
Q: how to call stored procedure having input as integer array parameter using hibernate I have created a TYPE of integer array named as 'INTARRAY'.
Later I created a procedure taking input as integer Array.
Procedure: SP_SET_MENU(roleId IN INTARRAY)
Now in my java application using hibernate, I have the following integer array:
Integer[] roleArr = new Integer[2];
roleArr[0] = 12;
roleArr[2] = 13;

I am calling the procedure as per the code below:
Session session = sessionFactory.getCurrentSession();
Query query = session.createSQLQuery("CALL SP_SET_MENU(:roleId)");
query.setParameterList("roleId", roleArr);
query.executeUpdate();

During execution I am getting the following exception:
Hibernate: CALL SP_SET_MENU(?, ?)
org.hibernate.exception.SQLGrammarException: could not execute native bulk manipulation query
    at org.hibernate.exception.SQLStateConverter.convert(SQLStateConverter.java:90)
    at org.hibernate.exception.JDBCExceptionHelper.convert(JDBCExceptionHelper.java:66)
    at org.hibernate.engine.query.NativeSQLQueryPlan.performExecuteUpdate(NativeSQLQueryPlan.java:198)
    at org.hibernate.impl.SessionImpl.executeNativeUpdate(SessionImpl.java:1190)
    at org.hibernate.impl.SQLQueryImpl.executeUpdate(SQLQueryImpl.java:357)
    at com.iris.admin.menumapmngt.dao.MenuRoleMapDao.executeHQL(MenuRoleMapDao.java:139)
    at com.iris.admin.menumapmngt.service.MenuRoleMapService.executeHQL(MenuRoleMapService.java:113)
    at com.iris.admin.menumapmngt.controller.MenuRoleMapController.addMenu(MenuRoleMapController.java:196)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
    at java.lang.reflect.Method.invoke(Method.java:606)
    at com.opensymphony.xwork2.DefaultActionInvocation.invokeAction(DefaultActionInvocation.java:450)
    at com.opensymphony.xwork2.DefaultActionInvocation.invokeActionOnly(DefaultActionInvocation.java:289)
    at com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:252)
    at org.apache.struts2.interceptor.DeprecationInterceptor.intercept(DeprecationInterceptor.java:41)
    at com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:246)
    at org.apache.struts2.interceptor.debugging.DebuggingInterceptor.intercept(DebuggingInterceptor.java:256)
    at com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:246)
    at com.opensymphony.xwork2.interceptor.DefaultWorkflowInterceptor.doIntercept(DefaultWorkflowInterceptor.java:167)
    at com.opensymphony.xwork2.interceptor.MethodFilterInterceptor.intercept(MethodFilterInterceptor.java:98)
    at com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:246)
    at com.opensymphony.xwork2.validator.ValidationInterceptor.doIntercept(ValidationInterceptor.java:265)
    at org.apache.struts2.interceptor.validation.AnnotationValidationInterceptor.doIntercept(AnnotationValidationInterceptor.java:68)
    at com.opensymphony.xwork2.interceptor.MethodFilterInterceptor.intercept(MethodFilterInterceptor.java:98)
    at com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:246)
    at com.opensymphony.xwork2.interceptor.ConversionErrorInterceptor.intercept(ConversionErrorInterceptor.java:138)
    at com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:246)
    at com.opensymphony.xwork2.interceptor.ParametersInterceptor.doIntercept(ParametersInterceptor.java:254)
    at com.opensymphony.xwork2.interceptor.MethodFilterInterceptor.intercept(MethodFilterInterceptor.java:98)
    at com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:246)
    at com.opensymphony.xwork2.interceptor.ParametersInterceptor.doIntercept(ParametersInterceptor.java:254)
    at com.opensymphony.xwork2.interceptor.MethodFilterInterceptor.intercept(MethodFilterInterceptor.java:98)
    at com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:246)
    at com.opensymphony.xwork2.interceptor.StaticParametersInterceptor.intercept(StaticParametersInterceptor.java:191)
    at com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:246)
    at org.apache.struts2.interceptor.MultiselectInterceptor.intercept(MultiselectInterceptor.java:73)
    at com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:246)
    at org.apache.struts2.interceptor.CheckboxInterceptor.intercept(CheckboxInterceptor.java:91)
    at com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:246)
    at org.apache.struts2.interceptor.FileUploadInterceptor.intercept(FileUploadInterceptor.java:252)
    at com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:246)
    at com.opensymphony.xwork2.interceptor.ModelDrivenInterceptor.intercept(ModelDrivenInterceptor.java:100)
    at com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:246)
    at com.opensymphony.xwork2.interceptor.ScopedModelDrivenInterceptor.intercept(ScopedModelDrivenInterceptor.java:141)
    at com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:246)
    at com.opensymphony.xwork2.interceptor.ChainingInterceptor.intercept(ChainingInterceptor.java:145)
    at com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:246)
    at com.opensymphony.xwork2.interceptor.PrepareInterceptor.doIntercept(PrepareInterceptor.java:171)
    at com.opensymphony.xwork2.interceptor.MethodFilterInterceptor.intercept(MethodFilterInterceptor.java:98)
    at com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:246)
    at com.opensymphony.xwork2.interceptor.I18nInterceptor.intercept(I18nInterceptor.java:139)
    at com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:246)
    at org.apache.struts2.interceptor.ServletConfigInterceptor.intercept(ServletConfigInterceptor.java:164)
    at com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:246)
    at com.opensymphony.xwork2.interceptor.AliasInterceptor.intercept(AliasInterceptor.java:193)
    at com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:246)
    at com.opensymphony.xwork2.interceptor.ExceptionMappingInterceptor.intercept(ExceptionMappingInterceptor.java:189)
    at com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:246)
    at com.iris.interceptor.HibernateSessionInterceptor.intercept(HibernateSessionInterceptor.java:45)
    at com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:246)
    at com.iris.interceptor.security.AuthenticationInterceptor.intercept(AuthenticationInterceptor.java:77)
    at com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:246)
    at com.iris.interceptor.RedirectMessageInterceptor.doIntercept(RedirectMessageInterceptor.java:38)
    at com.opensymphony.xwork2.interceptor.MethodFilterInterceptor.intercept(MethodFilterInterceptor.java:98)
    at com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:246)
    at com.iris.interceptor.security.XssInterceptor.intercept(XssInterceptor.java:87)
    at com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:246)
    at org.apache.struts2.impl.StrutsActionProxy.execute(StrutsActionProxy.java:54)
    at org.apache.struts2.dispatcher.Dispatcher.serviceAction(Dispatcher.java:562)
    at org.apache.struts2.dispatcher.ng.ExecuteOperations.executeAction(ExecuteOperations.java:77)
    at org.apache.struts2.dispatcher.ng.filter.StrutsPrepareAndExecuteFilter.doFilter(StrutsPrepareAndExecuteFilter.java:99)
    at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:243)
    at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:210)
    at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:225)
    at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:169)
    at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:472)
    at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:168)
    at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:98)
    at org.apache.catalina.valves.AccessLogValve.invoke(AccessLogValve.java:927)
    at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:118)
    at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:407)
    at org.apache.coyote.http11.AbstractHttp11Processor.process(AbstractHttp11Processor.java:999)
    at org.apache.coyote.AbstractProtocol$AbstractConnectionHandler.process(AbstractProtocol.java:565)
    at org.apache.tomcat.util.net.JIoEndpoint$SocketProcessor.run(JIoEndpoint.java:309)
    at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)
    at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)
    at java.lang.Thread.run(Thread.java:745)
Caused by: java.sql.SQLException: ORA-06553: PLS-306: wrong number or types of arguments in call to 'SP_UPDATE_MENU_ROLE_MAPS'

    at oracle.jdbc.driver.SQLStateMapping.newSQLException(SQLStateMapping.java:70)
    at oracle.jdbc.driver.DatabaseError.newSQLException(DatabaseError.java:133)
    at oracle.jdbc.driver.DatabaseError.throwSqlException(DatabaseError.java:206)
    at oracle.jdbc.driver.T4CTTIoer.processError(T4CTTIoer.java:455)
    at oracle.jdbc.driver.T4CTTIoer.processError(T4CTTIoer.java:413)
    at oracle.jdbc.driver.T4C8Oall.receive(T4C8Oall.java:1034)
    at oracle.jdbc.driver.T4CPreparedStatement.doOall8(T4CPreparedStatement.java:194)
    at oracle.jdbc.driver.T4CPreparedStatement.executeForRows(T4CPreparedStatement.java:953)
    at oracle.jdbc.driver.OracleStatement.doExecuteWithTimeout(OracleStatement.java:1222)
    at oracle.jdbc.driver.OraclePreparedStatement.executeInternal(OraclePreparedStatement.java:3387)
    at oracle.jdbc.driver.OraclePreparedStatement.executeUpdate(OraclePreparedStatement.java:3468)
    at oracle.jdbc.driver.OraclePreparedStatementWrapper.executeUpdate(OraclePreparedStatementWrapper.java:1350)
    at com.mchange.v2.c3p0.impl.NewProxyPreparedStatement.executeUpdate(NewProxyPreparedStatement.java:410)
    at org.hibernate.engine.query.NativeSQLQueryPlan.performExecuteUpdate(NativeSQLQueryPlan.java:189)
    ... 85 more

Please help to resolve this issue. Thanks in advance.

redpajama_set_name: RedPajamaStackExchange


text:
/**
 * @file
 *   This file includes definitions for Thread URIs.
 */

#ifndef THREAD_URIS_HPP_
#define THREAD_URIS_HPP_

namespace Thread {

/**
 * The URI Path for Address Query.
 *
 */
#define OPENTHREAD_URI_ADDRESS_QUERY    "a/aq"

/**
 * @def OPENTHREAD_URI_ADDRESS_NOTIFY
 *
 * The URI Path for Address Notify.
 *
 */
#define OPENTHREAD_URI_ADDRESS_NOTIFY   "a/an"

/**
 * @def OPENTHREAD_URI_ADDRESS_ERROR
 *
 * The URI Path for Address Error.
 *
 */
#define OPENTHREAD_URI_ADDRESS_ERROR    "a/ae"

/**
 * @def OPENTHREAD_URI_ADDRESS_RELEASE
 *
 * The URI Path for Address Release.
 *
 */
#define OPENTHREAD_URI_ADDRESS_RELEASE  "a/ar"

/**
 * @def OPENTHREAD_URI_ADDRESS_SOLICIT
 *
 * The URI Path for Address Solicit.
 *
 */
#define OPENTHREAD_URI_ADDRESS_SOLICIT  "a/as"

/**
 * @def OPENTHREAD_URI_SERVER_DATA
 *
 * The URI Path for Server Data Registration.
 *
 */
#define OPENTHREAD_URI_SERVER_DATA      "n/sd"

}  // namespace Thread

#endif  // THREAD_URIS_HPP_


text:
M.A. Ansari: Gandhi's Infallible Guide
Mushirul Hasan
Manohar, 2010 - Biography & Autobiography - 339 pages
While history has obscured the role of Mukhtar Ahmad Ansari, Mahatma Gandhi referred to his tenacity of character, his sense duty, and his passion for Hindu-Muslim unity. For more than two decades, his political career had been an extraordinary trek, attended by reverses and recoveries. This book seeks a better understanding of Dr. Ansari in relation to his political environment. In studying his ideas and engagements, M.A. Ansari: Gandhi's Infallible Guide charts the course plotted by him in his ambition to become the leader of the Congress Muslims, a role that had eluded some of his leading contemporaries. In this revised and enlarged version, Mushirul Hasan examines the politics of the 1920s and 1930s with skill and ingenuity. He avoids hagiography and demonology while bringing out all of Ansari's strengths, as well as his weaknesses. Like many of his recent writings, he demonstrates his grasp of the detail of Ansari's life with a magisterial ability to sweep the grand horizon. He contrasts his career with that of Mohammed Ali, the hero of the Khilafat days, with special emphasis on the impact of each upon the other. Mushirul Hasan offers a corrective to the distorted image of the Nationalist Muslim. He refreshingly sheds much light on the pre- and post-Khilafat scenario, and illuminates, above all, Gandhi's role which shaped the politics of the early 1920s. He describes the rise of the communal temperature vividly and exceptionally well.
M.A. ANSARI
Muhirul Hasan teaches at the Jamia Milia Islamia, New Delhi.
Title M.A. Ansari: Gandhi's Infallible Guide
Author Mushirul Hasan
Edition illustrated, revised
Publisher Manohar, 2010
Biography & Autobiography / Religious
Religion / Islam / General


Karrueche Tran's name has been thrust into the spotlight -- for better or for worse -- due to her relationship with R&B singer Chris Brown. Now she's addressing the hurt and betrayal she feels with Iyanla Vanzant on her OWN reality show, 'Fix My Life,' Saturday night (March 28).
Jamie Foxx puts on a solid performance of his new song, "You Changed Me," with Chris Brown at the 2015 iHeartRadio Music Awards.
Did Rihanna throw a subtle jab at her ex-boyfriend Chris Brown. Well, maybe. While promoting her upcoming animated flick 'Home,' the R&B superstar discussed briefly her past relationship in reference to her favorite animated movie.
This is a TGIF that Chris Brown can truly be thankful for. The singer's felony probation as a result of his 2009 assault against then-girlfriend Rihanna has come to an end.
Chris Brown is now taking his baby mama to court to lower his child support payments after she allegedly blabbed to the media about him being the father of her child.
Thankfully for the X creator, there's at least one person in his corner during the whole baby drama he's been dealing with this week: Lil Wayne.
Chris Brown's 9-month-old daughter was a surprise to everyone this week, including his girlfriend Karrueche Tran. Now the name of the child has been revealed.
A bomb hit Twitter and various media outlets late Tuesday night (March 3) when news broke that R&B bad boy Chris Brown was the father of a 9-month-old baby girl, which was a surprise to pretty much everyone, including Brown's on-and-off girlfriend, Karrueche Tran.