text:
module.exports = function (poet, app, comments) {
  poet.addRoute('/comments/:comment_resource', function (req, res, next) {
    // comments are saved under the resource name of post.url
    var post = poet.helpers.getPost(req.params.comment_resource);
    var properties_to_fetch = {
      _id: true,
      author: true,
      date: true,
      message: true
    };

    if (post) {
      comments.getComments(post.url, properties_to_fetch, function (error, results) {
        if (error) {
          console.log('get comments fail: ' + error);
          res.send(404);
        } else {
          results.toArray(function (err, docs) {
            if (err) {
              console.log('mongo cursor to array fail: ' + err);
              res.send(404);
            } else {
              app.render('includes/comments', { comments: docs }, function (err, html) {
                if (err) {
                  console.log('HTML/Jade rendering fail: ' + err);
                  res.send(404);
                } else {
                  res.json({html: html});
                }
              });
            }
          });
        }
      });
    } else {
      console.log('post path fail');
      res.send(404);
    }
  });
};


text:
The Revival of a Patriotic Order: Knights Templar in England & New York - Dr. Susan Mitchell Sommers
Dr. Susan Mitchell Sommers is Professor of History at Saint Vincent College in Latrobe, Pennsylvania in the United States. Her PhD is from Washington University in St Louis in 1992, where she studied Early Modern British political history under Professors Richard W. Davis and Derek M. Hirst.
Dr. Sommers's first book, Parliamentary Politics of a County and its Town: General Elections in Suffolk and Ipswich in the Eighteenth Century, came out in 2002. She has a number of research projects currently underway, which have provided material for recent presentations in the history of Freemasonry. These include a biography of Thomas Dunckerley, as well as The Society of the Supporters of the Bill of Rights: the Radical Brotherhood, and Job's Children: on the Fringe in Late Eighteenth-Century London.
Other recent presentations and publications include: "Marranos, Masons, and the Case of the Mislaid Text," in the 2009 Canonbury Papers; "Ebenezer Sibly: The Mystical Doctor," Canonbury Masonic Research Centre, Tenth International Conference, Freemasonry & the Sciences. October 25, 2008. (both forthcoming); A number of articles in Cecile Révauger and Charles Porset, editors, Le Monde Maçonnique au XVIIIe siècle, Articles (Presses Universitaires de Bordeaux , forthcoming, 2011) and "Sir John Coxe Hippisley and the Cause of Catholic Emancipation," in Nancy LoPatin-Lummis, ed., Festschrift for Dr. Richard W. Davis, The Parliamentary History Yearbook Trust, 27, 1 (February, 2008) 82-95.

redpajama_set_name: RedPajamaCommonCrawl


There would appear to be much in common between Buddhist thought and the 12 Step recovery program practised by some in AA.
A number of books have made the connection between them.
Click on the cover to get more information about the book from Amazon.
Three of the more popular ones include Kevin Griffin's work, One Breath at a Time: Buddhism and the 12 Steps, published in 2004. That was followed in 2009 by Darren Littlejohn's well-known work, The 12-Step Buddhist.
And a third is Thérèse Jacobs-Stewart's book, Mindfulness and the 12 Steps, published in 2010.
Buddhist thought holds that craving leads to suffering (the second noble truth). Twenty-five hundred years ago the Buddha taught that snippets of addiction – constantly wanting, ever craving this or that – are the source of all human suffering.
He also taught that this craving could be reduced and eventually eliminated.
This is where Buddhist mindfulness enters the picture. It can be defined as self-awareness brought about by the practice of meditation.
Meditation leads incrementally towards an "awakening:" an understanding of human interaction in the world that is both craving and delusion-free.
It is certainly worth noting that the the "mindfulness" of Buddhism as a way of dealing with addictive behaviour is ever more prevalent in the rooms of AA.
Some time ago Julie B. celebrated a year of sobriety at the We Agnostics meeting on St. Clair Avenue in Toronto. She chose to have one word, an acronym, on her one-year medallion: S.O.B.E.R.
Respond mindfully – Remember that you have a choice, that you are not required to continue the undesired behaviour.
This mindfulness approach to dealing with the affliction of alcoholism has grown exponentially over the past few decades. Indeed, it is doing so with or without Buddhism.
In 1990, Jon Kabat-Zin published a ground-breaking book, Full Catastrophe Living, which launched the use of mindfulness meditation as a "stress reduction program." Called Mindfulness Based Stress Reduction (MBSR), these programs are readily available in most cities from a number of hospitals and doctors and are used to deal with a wide variety of afflictions, including alcoholism.
In fact, the S.O.B.E.R. inscription on Julie's one-year medallion had its inspiration in an eight-week program based on the Kabat-Zin MBSR model that she had taken in early sobriety at the Centre for Addiction and Mental Health (CAMH).
It is perhaps also worth mentioning that, like AA, the Buddhist approach places a great deal of emphasis on community or "fellowship" as an important part of maintaining sobriety. Buddhism believe that all beings are interdependant and thus has a profound understanding of the importance of the principle of "one alcoholic helping another alcoholic," as an important part of recovery.
Many looking for meditation and mindfulness to deal with the affliction of alcoholism turn to the Buddhist Recovery Network, which has been online since 2009. The website "supports the use of Buddhist teachings, traditions and practices to help people recover from the suffering caused by addictive behaviors." The Buddhist Recovery Network specifically "promotes mindfulness and meditation" as a way of dealing with alcoholism and addiction. It lists a total of sixteen published books that take a Buddhist approach to working the 12 Steps.
On the Buddhist Recovery Network's Meetings Page, it lists times and locations for meetings in half a dozen countries. In the United States there are roughly one hundred meetings, with thirty of them in California. Interestingly, at the Alano Club in Portland, Oregon, where a Beyond Belief agnostic AA meeting is held on Sunday mornings, there is also a Buddhist 12 Step Meditation meeting on Tuesday evenings. Indeed, many of these Buddhist recovery meetings involve the 12 Steps.
A Buddhist approach to the 12 Steps can be an important part of achieving what Bill Wilson described as the "personality change sufficient to bring about recovery from alcoholism" in the Big Book, Alcoholics Anonymous.
Buddhism and the 12 Steps. Do they fit together?
They sure do, for an increasing number of people.
This article is a condensed and gently revised version of Mindfulness and the 12 Steps, originally published on AA Agnostica on September 2, 2012.
The first step of AA requires us to admit powerlessness. AA will tell us that if we don't accept powerlessness then the only option is the delusion of complete control. This might be the case if we possess a dualistic viewpoint. The non-dualistic viewpoint wold assert that powerlessness and complete control are both illusions of the mind.
Powerlessness over alcohol. And yes, it is dualistic but the ego is dualistic and as long as we have an ego the difference is important, even crucial.
While I do not consider myself to be a Buddhist, I find that Buddhism provides some great insights into how to best approach and respond to life. In addition to meditation, I find an understanding of the Four Noble Truths, the Eightfold Path, the Ten Perfections and the Three Characteristics of Existence to be helpful. As well, I try to practice Mindfulness throughout my day. Buddhist philosophy and practices have become an important part of my recovery. My understanding of both Buddhism and AA is that they are not about believing, they are about doing.
Thank you for this article. I am a Buddhist in recovery. Being a fan of Noah Levine and his recovery I purchased the book Refuge Recovery that Dave mentions below. I wonder if this is the same Dave from the book testimonials or from the Nashville meetings? I live in the DC area and unfortunately we do not have any Refuge Recovery meetings here yet – I have to believe someone will start them. I don't know how many more AA meetings I can stomach. I find myself, again, struggling with all the god talk. I really try to practice patience and perspective but an atheist/agnostic in AA is such a difficult path.
The blogging and comments here feel really antagonistic and reductionist and disturbing to me. I'm not so sure I want to be part of this group. I resign the debating society and find solace in Buddhism and many other approaches.
What I am finding so refreshing in this emerging community is the ability for us to express ourselves here without fear of censure. An attraction is my own aversion to fundamentalism and absolutist thinking wherever I find it, be it religion, politics, or 12-step programs. In the WAFT meeting I attend in San Diego I don't like everything I hear, but I am so happy to be in a group that allows people to have a forum to say what they think, without the condescending invocation to "keep coming back".
Remember, when somebody is speaking here, they are an authority, not the authority, in their own individual area of understanding and experience.
Thanks for the interesting topic, Roger. I think that any and all avenues leading to sobriety should be considered, regardless of who said what. I spent over five years in Vietnam during and after the war, and was exposed to Buddhism on a daily level. I was there when the monk demonstrated his antiwar beliefs through self-immolation. I don't recommend that, but their beliefs are strong.
I have recently been introduced to the world of Stephen Batchelor, the author of "Buddhism Without Beliefs" and "Confession of a Buddhist Atheist", among many other books. Like Roger, I felt an immediate correlation between the Four Noble Truths, the Eightfold Path, and our twelve steps. Although he doesn't make a direct connection, to me at least there is a wealth of knowledge there, from which to learn.
I had the enormous pleasure of doing a weekend retreat a few years ago with Martine and Stephen Batchelor at the University of Toronto. What a treat!
Are they still doing retreats, Roger? I understand that they moved to France and were just "living the life". But if they are still doing retreats, I would love to attend one.
And thanks again for introducing the topic.
They are still doing retreats, Don, and in lots of places. Here's some information: Teaching Schedule.
Practicing Buddhism brought me to the 12 step path, eventually meditation and books on Buddhism weren't enough to maintain sobriety for me, I needed the steps and the support of people at AA meetings.
Buddhism is non-theistic which can confuse people, that doesn't mean atheistic. It means a Christian and an atheist can practice side by side with no conflict, as long as everyone tolerates different beliefs and no one tries to evangelize their own beliefs.
AA in its idealized form can be the same way but human nature is what it is and boundaries will be crossed when people are sharing. I'm an agnostic but I once mentioned the concept of a higher power at my Buddhist group, just in casual conversation about recovery, and someone politely shut me down. She said there were several atheist members and that might offend them. That really impressed me.
AA has no professional facilitators or rigid guidelines for sharing at meetings and the concept of a higher power is central to the steps and the Big Book so it's a different environment for sure. Lines get crossed when people bring religions like Christianity into their sharing or rigid views of atheism that can come off as critical of others. Sometimes I think the only solution is to move towards atheist/agnostic AA groups forming their own organization as NA, OCA, Coda and others have done. Mainly because the literature needs to be re-worked for compatibility. There are Buddhist 12 step groups, Christian 12 step groups, why not a separate organization for Atheist/Agnostic 12 steps with its own literature? The literature already exists in many forms. At the same time, there should be debate on efforts to make AA more inclusive of all people and concern that some groups have become religious and oppressive.
I attend one of the Buddhist Recovery Network meetings in my area. I'm an atheist and not a Buddhist, but I feel welcome there. There are some rituals, like bowing, that I don't participate in, but no one cares. They read from material developed by the San Francisco Zen Center. It is a little religious for my taste and closer to conventional understandings of the Steps than I prefer, but it is mostly benign and is helpful generally. And the discussions are intelligent and mostly free of god talk. (Every now and then somebody talks about their higher power.) They open with silent meditation and close with the Serenity Prayer (in a joined-hands circle). No one even blinks when I disclose that I am an atheist. As there are no agnostic AA meetings in my city, it has been a welcome addition to my recovery repertoire.
Rituals can serve a purpose, provided one remembers they are simply a tool towards accomplishing a goal, and not the goal itself. Zen practioners are usually pretty good at making this distinction, provided they have a bona fide teacher and aren't just winging it based on what they read in some popular book.
If someone is discussing their higher power, they are discussing something decidedly NON Buddhist. Buddhism places all responsibility on the individual for his lot in life. That's the whole point of the law of karma. "I am the owner of my karma. Born of my karma, heir to my karma, related to my karma, abide supported by my karma. All I do creates karma, and whether good or bad, I shall inherit that karma" is a recollection all Buddhists are encouraged to remember daily. This means no higher power is going to save us from the situation we put ourselves in. We don't deny the existence of what others may refer to as supernatural beings. We just deny they have any useful purpose in our lives and are just as deluded as we are.
Being an ordained lay Buddhist, I would have serious philosophical problems using the Serenity Prayer in any Buddhist sponsored program. The Buddha NEVER asked gods for anything. When I took refuge, I accepted and publicly affirmed the Buddha, Dharma and Sangha as my ONLY refuges, and confirmed I needed no others, including gods. It saddens me to hear that the SFZC allows this to take place, diluting and corrupting the Buddha's teachings and intent.
I went to Buddhagoya in 2007. That was my 11th month of sobriety. Buddhagoya is the place where prince Siddhrta sat under the bodhi tree for 49 days to become Buddha. That visit was the first step to practice mindfullness meditation for me which is a form of Buddhist Vippassana meditation. Today I am happily sober practising Buddhist psychology and AA philosophy (minus GOD) in my daily life.
Vipassana, especially as practiced among lay persons, is a really new phenomena in Buddhism.
Then there are 'The Zen of Recovery', by Mel Ash, and 'Cool Water: alcoholism, mindfulness and ordinary recovery', William Alexander.
Actually, there is almost nothing in common with what the Buddha really taught and the 12 steps. Attempts to reconcile the two are either by misguided twelve steppers who can't abide the god thing or paper back Buddhist who want to help, but don't really have clue what real Buddhadharma is. Mindfulness, ala Jon Kabat-Zin solves nothing, and from the Buddhist prospective, isn't meant to. I guarantee you can be perfectly mindful and present and in the moment when you hit your thumb with a hammer and it'll still hurt and you'll still cuss a blue streak. Most of what is being passed off as mindfulness these days is anything but from the perspective of authentic Buddhist teachings. If you want to see Buddhist recovery, check out "Refuge Recovery" by Noah Levine or "Eight Step Recovery" by Valerie Mason-John and Dr. Paramabandhu Groves.
Laurie's comment captures that non-North American viewpoint that fascinates me with Buddhism. To me, this quote is that frame of mind: Why, these Steps are fine. For us Buddhists it might be slightly more acceptable if you inserted the word 'good' in your Steps instead of God.
I feel sad for someone who is critical of 12th step work. For me, the fellowship is special and helping is what it is all about. I still am not comfortable with sponsorship or even chairing a meeting but I've learned to cook a great cake.
Twelfth Step work is critical in my life as a Buddhist and in my recovery as a alcohol/drug addict. Thanks for the link to the Buddhist Recovery Network. Your service helped me.
I've found AA and Buddhism to be very compatible. I'm gay and I was very anti-religious at one time for obvious reasons, I resonated with Buddhism before I got sober and when I did show up to AA it was not difficult for me to consider the concepts in the 12 steps, to not view them through a Judeo/Christian lens. To me, Buddhism is like a spiritual psychology, a path of self discovery and meditation has been a very valuable tool. I viewed the 12 steps in the same way. People get hung up on the 4th and 5th steps but Buddhism taught me to not look at my behaviors or past deeds as 'sin', to only see cause and effect with emotional detachment. AA is all about that in my opinion, figuring out behaviors that make us miserable and not judging ourselves so harshly while still developing a conscience and taking personal responsibility. There's nothing religious about these concepts to me.
When I came to AA I had already opened myself up to something bigger than myself which was Buddhist teachings, a very different way of thinking for me at the time and the Buddhist concept of the ego showed me the importance of getting out of my obsessive thoughts about myself. Developing more compassion has been a slow but steady journey for me and both AA and Buddhism aid in this in their own way. Buddhism showed me the value in participating in, or taking refuge in a sangha and I still see AA meetings in a similar way. Something I need to stay connected with even after two decades in the program. I have tried to drift away several times and focus solely on Buddhism but it pulls me back. I love sober alcoholics, they're great fun, more fun than Buddhists most of the time!
David, if what you are saying here and elsewhere in this comment thread is true, Buddhism doesn't seem to be an improvement over Christianity in the religiosity and dogmatism departments. Why would the average AA Agnostica reader be interested in hearing how to be a more correct religious follower, even if the religion in question isn't the one they have specifically rejected? What you seem to be saying is that Western interpretations of Buddhism are less than useless. If that is the case, either you are wrong and arrogant or Buddhism itself is just another example of how narrow-minded and oppressive religion can be. I'm hoping it's the former.
Buddhism is radically different in that it does not accept religiosity or dogma over reality.
Now, Buddhists are people too, prone to the very same bad habits as every else. But the teachings of the Buddha are designed to reveal reality, and turn the tables on those bad habits, not sugar coat things and give us the warm warm fuzzies we numb ourselves with. Most people, including most Buddhists, have a very hard time understanding just how radically different the Buddha's teachings are from all other religious/spiritual traditions.
Thanks for your comments, JHG. Obviously, I am not a "Buddhist" as David describes himself, and what I know of Buddhism is what I have experienced in my 5+ years in Vietnam, and what if have read from such authors as the Dalai Lama (esp. The Art of Happiness), Thich Nhat Hanh (esp. Peace is Every Step), and Stephen Batchelor (esp. Buddhism Without Belief and Confession of an Atheist Buddhist).
All of these authors, in my opinion, represent Buddhism as can be lived by any human who seeks peace and serenity in this life. That is what I have learned from their writings and that is how I apply it not only to a living philosophy, but also to my recovery from alcohol and drug addiction. There are certain aspects of the Big Book that I often refer to when faced with life's problems, such as page 417: "acceptance is the answer to all my problems"; I firmly believe that. By the same token, I also turn to Thich Nhat Hanh, who has a portion of his book titled "Twenty-Four Brand-New Hours" for the comfort not shared in the Big Book, as well as to the other Buddhists who seem to have a handle on how to face life on life's terms.
Personally, I will continue to call on all resources to maintain sobriety and to find the peace in this life that always eluded me before.
I'm interpreting your post to be saying that AA expects religious belief and Buddhism does not. I've never felt forced to accept AA steps and other writings in a fundamentalist way, to reject my sense of reality. When I hear someone say 'take what you want and leave the rest', I believe they mean it.
Buddhism does not tell me to believe in the Tibetan Book of the Dead without question, it tells me to question everything but it does seem like a religion to me when a monk assists a dying person to pass into the spirit realm, to prepare for their next incarnation. No more or less crazy than a 12 stepper praying to a higher power.
The Buddha did not pass down either the Book of the Dead nor methods for guiding the dying on to their next life.
Over the centuries Buddhism has evolved into something beyond the Buddha's teachings. Attempting to define it for other Buddhists is not reality based. It reminds me of people who claim to know what defines a Christian or what defines good 12 step work. Spiritual paths are as varied and unique as people are. Buddhism and AA are inseparable to me.
I don't know much about Buddhism, so have nothing to contribute on that topic.
I do, however, believe I know a little about The Twelve Steps.
I have noticed in this forum that some unbelievers among us believe in the 12 step approach, and have modified it for their own purposes.
What does this category of person think of someone such as I who thinks the 12 step dogma is shear nonsense?
I am firmly in Dodes's camp on why AA works when it does. It's about fellowship and hanging with people who have a common affliction.
I don't believe the steps work no matter how much the believers claim they do.
The 12 steps can and do work for some people. Often as a form of "poor man's" cognitive behavioral therapy. To say they never work is as dogmatic as saying they always work.
I'm confused! What do you mean by Twelve Step Dogma?
I have no use for the 12th step, I sponsored someone once and it went OK but I never wanted to do it again. I've heard people go on and on in meetings about how much they've gotten out of sponsoring people, I believe what they say, some are quite passionate. I just don't want to do it, I find peace in other ways and I don't believe I would get the same benefit that others get. I don't doubt someone who says the steps don't work for them even though many of them have worked for me. Claiming to know what is not helpful to other people is a bit odd.


text:
Log in|
Journal of Clinical Oncology
Jobs in Milford
Full Time, Milford, Massachusetts 1
Full Time, Employer, Massachusetts 1
Medical Oncologist 1
Oncologist / Hematologist 1
Milford Remove selection
Found 1 Employer, Full Time job
Medical Oncologist/Hematologist, Dana-Farber Cancer Institute - South Shore, Milford, Foxborough
approximately 25 minutes from Boston
Competitive salary offered
Dana-Farber Cancer Inst
Medical Oncologist/Hematologist, Dana-Farber Cancer Institute - South Shore, Milford and Foxborough Dana-Farber Cancer Institute (DFCI) is seeking ...
View details Medical Oncologist/Hematologist, Dana-Farber Cancer Institute - South Shore, Milford, Foxborough
Save Medical Oncologist/Hematologist, Dana-Farber Cancer Institute - South Shore, Milford, Foxborough
© 2015 - 2023 American Society of Clinical Oncology (ASCO). All Rights Reserved Worldwide. Powered by Madgex Job Board Platform


Im scared of death ..any advice/ help pls ?
Why are you afraid of something you can't control?
This is a very sad news, I pray that his soul rest in peace and whatever the cause of the death shall be revealed.
u dey mad wel wel, shey na ur papa get Nl abi?
Every satanic attack against me, my family, wife to be, finance, life and my friends/ well-wishers...DIE BY FIRE!!!
how did it happen? well so many strange things are happening this days, sorry for the lost may his soul walk up to God in one peace.
may his soul rest in peace.God shall console the soul of the parent.
Rest in peace! the question now is what lessons can be learned from this sad experience for the living... i hope a medical post mortem examination would be done to ascertain the cause of his death!
Eyah... Rest in piece o.


text:
Does Overwatch Need More Heroes?
Will Blizzard Add New Heroes to Overwatch? Currently, Overwatch has 21 playable characters, but players have started to speculate that more characters might be added soon. Though Blizzard has debunked these fan theories, theories that were entirely based off an Overwatch short titled "Hero," it certainly would make sense that new characters would eventually be added to Overwatch. For now, it seems like Blizzard is content with the game's diverse group of heroes, but if they w
As a developer who grew up in the 90's, I wasted many hours dreaming up game ideas for the NES, SNES and N64. These were the platforms that I was exposed to at the time, and these are the systems that dictated my career choice. By the time I finally learned the skills needed to actually develop games, these systems had become relics of the past. With such powerful technology available, and platforms that are easier to work with, why bother launching a game on a "dead" system?
Overwatch First Impressions
Overwatch is fun. Okay, it's really fun. With its briskly paced gameplay, wide array of unique characters, and tight controls, it's hard to imagine that people are going to stop playing Overwatch anytime soon. In terms of competitive multiplayer first-person shooters, it is absolutely top-notch, especially because it stands out as something completely unique in the genre. In the past decade, companies have shelled out FPS after FPS, attempting to perfect a prewritten standa
Our bodies are a constant battlefield, fighting off a wide array of hostile microbial life forms. It's surprising that we don't often see too many games capitalize on the invisible wars taking place right under our skin. Single celled organisms have always fascinated me in how utterly alien and bizarre they are compared to other typical life forms we encounter on a daily basis. These microbial life forms out number us all a trillion to one. Plasma Puncher is a beautifully s
Polygon's Doom Debacle
Polygon has found itself at the center of an unusual controversy that has sparked an internet sensation. While playing the newest Doom during their first look review, a representative of the site played the game so poorly that Polygon had to pull the footage due to mass ridicule. Luckily, several people manged to nab some of their "gameplay" footage and posted it all over YouTube. Below we have a video of some highlights from this disaster presented by Dorkplay played to th
Anime Review: Dimension W
In the year 2036, a fourth dimensional axis with a limitless amount of energy is found and named Dimension W. This energy is drawn-out by cross-dimensional towers created by New Tesla Energy; there are 60 of these towers located across the world in a honeycomb structure, and these towers are used to stabilize the energy from this new dimension. Coils are created to give energy to everything in the world from cars, guns, robots, to everything in-between. Dimension W takes pla
Ever want to build a ship from scratch? Ever want to use this said ship to hunt down sea monsters, and blow other ships apart piece by piece? If your answer to any of those questions is yes, (if you answer "no" to all of these, please get your mental health checked out by your local doctor) then you need to check out The Last Leviathan. I've played several Minecraft mods involving ship building, and these mods sparked a personal obsession with building boats. Sadly, most of
Battlefield 1 Classes Confirmed
Battlefield 1 rocked the gaming world by introducing a theater of war that has barely been touched by first person shooters. Before Battlefield 1, Verdun, a WWI game created by a small team, took steam by storm. The game boasted outstanding gameplay, and proved that its WWI setting had more than what it takes to deliver a unique and fun experience. Verdun might have been first to the party, but the game only focuses on more authentic, infantry based combat on the French front
I have been a major fan of both real time and turn based strategy games for as long as I have been interested in gaming, and I have always craved a mobile strategy game I could sink my teeth into. There are many options on the market, and many are great games, BUT none of them have given me that felling of massive armies slamming into each other. I want to see those massive battles that are usually simulated via stats and numbers actually happen. I crave the feeling of bein
Battlefield 1 Officially Confirmed!
Battlefield 1 has been officially announced along with a brand new in game trailer. After numerous leaks over the past few days, it has been confirmed that the game will take place during World War 1. On their live stream, DICE Studios told viewers to expect this Battlefield to be the biggest and the "most dynamic battle in FPS history." Battlefield 1 will bring tanks, planes, and artillery back to the franchise. It was also announced that there will be an open beta in the ne


Offices.net offers fully furnished executive suites, professionally equipped office space and cost effective corporate real estate in Minnesota. The office space for rent includes a wide range of essential services, making setting up a business in Minnesota faster and easier than ever.
Click the name of a city above to find office space for rent in Minnesota, or call 1-877-693-6433 to speak to a consultant.
Located in the Midwestern United States, Minnesota is the twelfth largest and the twenty-second most populous state in the country (2018 data). The state's largest city is Minneapolis and its capital is Saint Paul. The 'Twin Cities' form the Minneapolis-Saint Paul metropolitan area, and thriving area that is at the centre of state's government, education, transportation, business and industrial sectors. Outside of this urban region, much of the state remains largely rural with agriculture, mining, forestry and recreation as economic drivers. Although Minnesota was once primarily known for producing raw materials, its economic growth is increasingly a result of activity in producing finished products and in service sectors. Core industries now include biosciences, manufacturing, clean and renewable energy, banking and insurance, data centres, and health care services.


text:
Home / In the Media / UNC scientist plays key role in upcoming NASA mission to measure Earth's water levels
UNC scientist plays key role in upcoming NASA mission to measure Earth's water levels
By Kim Spurr
When a Falcon 9 rocket takes off from California's Vandenberg Space Force base Thursday, it will carry a satellite that represents almost two decades of UNC-Chapel Hill hydrologist Tamlin Pavelsky's work. The satellite will measure the height of water's surface in lakes, rivers and oceans across the globe while also using radar to detect where water is located.
Pavelsky is the United States' hydrological science lead for the project, which is called the Surface Water and Ocean Topography mission, or SWOT.
The News & Observer


text:
Ala Ghawas is an independent singer, songwriter, musician and producer from Bahrain.With his haunting lyrics and smoky voice backed with his acoustic guitar and piano, he produced a compelling acoustic body of work that illustrates the influences of his life in the form of songs.
"Hums," EP was Ghawas' first serious independent recording project, undertaken while studying in Boston as a Fulbright Scholar in 2007. "Hums" received positive reviews from music critics in Bahrain and the song "Replica" was a regular on several local radio stations. "Whispers," EP released in December 2008, confirmed Ghawas as one of Bahrain's most important musicians of his generation and received critically acclaimed reviews. "Screams," EP released in October 2009, continued raising the intensity of the sound and subject of his music and completed the trilogy of EPs that he had been working on for three years.
He then released his first major LP, "Armor," featuring 10 new songs written and produced by Ghawas. The LP was the product of Ghawas' partnership with one of Bahrain's most talented bands, "Likwid". The album was released in November 2013.
Ala Ghawas - Elsewhere 3:08
Ala Ghawas - Elsewhere Instrumental 3:08


Welcome to our Welsh Cabin named "Caban Cwtch" Anyone with Welsh heritage will understand "cwtch", it can mean a loving hug and/or a safe warm place where you can hide yourself away or store your precious possessions.
A spacious, close to nature, peaceful, country holiday, where you can retreat from the world, relax and re-charge your batteries. Looking to escape from the public eye or just looking for peace and quiet, where discretion is guaranteed. This is a very private and secluded wooden lodge/cabin with it's own private drive through a field entrance with your own parking area, previously used for friends and family now available for holiday breaks. Set in it's own ancient woodland of half an acre, surrounded by farmland in the rolling hills of the Carmarthenshire and Pembrokeshire border. The accommodation comprises of large lounge/kitchen/diner, spacious bathroom with shower over bath, utility room, 2 main bedrooms one with a double the other with twin beds, a 3rd room is a study/3rd bedroom.
Don't expect manicured lawns and tarmac drives, we have tried to have as light an impact on the surroundings as possible, trying to maintain a balance between encouraging wildlife with wild native plant areas and wood piles & gravel paths, as well as providing a useful garden area. This is very much a rustic setting - you are surrounded by mature trees giving shade in those hot summer days and fields of Welsh grassland as far as the eye can see, with our local village (with shop/post office & pub) just 20 mins walk away.
Set nearly equi-distant from the north & south coasts of the South West Wales Peninsula, taking just over half an hour to either coast with its stunning coastal path. 10 miles to Narberth, with Oakwood, Folly Farm and many other attractions (inc Historic Castles) nearby, not forgetting the world class water sports available all around the coast. Take the time to de-stress, perhaps to walk, write, paint, read or just indulge in navel gazing, enjoying the surroundings!
This is a unique property, specially built as a future proofing concept in conjunction with our renewable energy business, to demonstrate it's ability through innovative systems to provide practically all of life's comforts & modern facilities, ensuring that life can continue quite comfortably regardless of any future political, industrial or social upheaval - basically a "CWTCH"!
Dog friendly, we also have many wildlife visitors inc badgers, foxes, squirrels, woodpeckers, jays, buzzards, kites, pheasants, bats, to name just a few!
Facilities include: Dual Heating System of LPG Central Heating and auxiliary Wood Burner with Back Boiler, 32" Smart Flat Screen TV (FreeView HD), Fridge Freezer, Gas Cooker, Microwave, Toaster, Free Wifi Internet (25mbps download speed). Although the Cabin is non-smoking, you may smoke on the covered verandah. Outside - log seats around a fire-pit with garden furniture.
In the interests of your own comfort and hygiene, please bring your own Duvet Covers, Sheets, Pillow Cases & Towels. - Duvets (1 double or 2 singles) and Pillows are supplied.
Copyright © 2019 EnergiStar & Hay-UK. All Rights Reserved.


text:
package com.google.inject.internal;

import com.google.common.base.Equivalence;
import com.google.common.base.Objects;
import com.google.common.base.Throwables;
import com.google.common.collect.ImmutableList;
import com.google.common.collect.ImmutableSet;
import com.google.common.collect.Lists;
import com.google.common.collect.Maps;
import com.google.common.collect.Ordering;
import com.google.inject.ConfigurationException;
import com.google.inject.CreationException;
import com.google.inject.Guice;
import com.google.inject.Key;
import com.google.inject.MembersInjector;
import com.google.inject.Provider;
import com.google.inject.Provides;
import com.google.inject.ProvisionException;
import com.google.inject.Scope;
import com.google.inject.TypeLiteral;
import com.google.inject.internal.util.Classes;
import com.google.inject.internal.util.SourceProvider;
import com.google.inject.internal.util.StackTraceElements;
import com.google.inject.spi.Dependency;
import com.google.inject.spi.ElementSource;
import com.google.inject.spi.InjectionListener;
import com.google.inject.spi.InjectionPoint;
import com.google.inject.spi.Message;
import com.google.inject.spi.ScopeBinding;
import com.google.inject.spi.TypeConverterBinding;
import com.google.inject.spi.TypeListenerBinding;

import java.io.Serializable;
import java.lang.annotation.Annotation;
import java.lang.reflect.Constructor;
import java.lang.reflect.Field;
import java.lang.reflect.Member;
import java.lang.reflect.Method;
import java.lang.reflect.Type;
import java.util.Arrays;
import java.util.Collection;
import java.util.Collections;
import java.util.Formatter;
import java.util.List;
import java.util.Map;
import java.util.Set;
import java.util.concurrent.ConcurrentHashMap;
import java.util.logging.Level;
import java.util.logging.Logger;

/**
 * A collection of error messages. If this type is passed as a method parameter, the method is
 * considered to have executed successfully only if new errors were not added to this collection.
 *
 *
Errors can be chained to provide additional context. To add context, call {@link #withSource}
 * to create a new Errors instance that contains additional context. All messages added to the
 * returned instance will contain full context.
 *
 *
To avoid messages with redundant context, {@link #withSource} should be added sparingly. A
 * good rule of thumb is to assume a method's caller has already specified enough context to
 * identify that method. When calling a method that's defined in a different context, call that
 * method with an errors object that includes its context.
 *
 * @author jessewilson@google.com (Jesse Wilson)
 */
public final class Errors implements Serializable {

  private static final Logger logger = Logger.getLogger(Guice.class.getName());

  private static final Set<Dependency<?>> warnedDependencies =
      Collections.newSetFromMap(new ConcurrentHashMap<Dependency<?>, Boolean>());

  /**
   * The root errors object. Used to access the list of error messages.
   */
  private final Errors root;

  /**
   * The parent errors object. Used to obtain the chain of source objects.
   */
  private final Errors parent;

  /**
   * The leaf source for errors added here.
   */
  private final Object source;

  /**
   * null unless (root == this) and error messages exist. Never an empty list.
   */
  private List<Message> errors; // lazy, use getErrorsForAdd()

  public Errors() {
    this.root = this;
    this.parent = null;
    this.source = SourceProvider.UNKNOWN_SOURCE;
  }

  public Errors(Object source) {
    this.root = this;
    this.parent = null;
    this.source = source;
  }

  private Errors(Errors parent, Object source) {
    this.root = parent.root;
    this.parent = parent;
    this.source = source;
  }

  /**
   * Returns an instance that uses {@code source} as a reference point for newly added errors.
   */
  public Errors withSource(Object source) {
    return source == this.source || source == SourceProvider.UNKNOWN_SOURCE
        ? this
        : new Errors(this, source);
  }

  /**
   * We use a fairly generic error message here. The motivation is to share the
   * same message for both bind time errors:
   *
Guice.createInjector(new AbstractModule() {
   *   public void configure() {
   *     bind(Runnable.class);
   *   }
   * }

   * ...and at provide-time errors:
   *
Guice.createInjector().getInstance(Runnable.class);

   * Otherwise we need to know who's calling when resolving a just-in-time
   * binding, which makes things unnecessarily complex.
   */
  public Errors missingImplementation(Key key) {
    return addMessage("No implementation for %s was bound.", key);
  }

  public Errors jitDisabled(Key key) {
    return addMessage("Explicit bindings are required and %s is not explicitly bound.", key);
  }

  public Errors jitDisabledInParent(Key<?> key) {
    return addMessage(
        "Explicit bindings are required and %s would be bound in a parent injector.%n"
        + "Please add an explicit binding for it, either in the child or the parent.",
        key);
  }

  public Errors atInjectRequired(Class clazz) {
    return addMessage(
        "Explicit @Inject annotations are required on constructors,"
        + " but %s has no constructors annotated with @Inject.",
        clazz);
  }

  public Errors converterReturnedNull(String stringValue, Object source,
      TypeLiteral<?> type, TypeConverterBinding typeConverterBinding) {
    return addMessage("Received null converting '%s' (bound at %s) to %s%n"
        + " using %s.",
        stringValue, convert(source), type, typeConverterBinding);
  }

  public Errors conversionTypeError(String stringValue, Object source, TypeLiteral<?> type,
      TypeConverterBinding typeConverterBinding, Object converted) {
    return addMessage("Type mismatch converting '%s' (bound at %s) to %s%n"
        + " using %s.%n"
        + " Converter returned %s.",
        stringValue, convert(source), type, typeConverterBinding, converted);
  }

  public Errors conversionError(String stringValue, Object source,
      TypeLiteral<?> type, TypeConverterBinding typeConverterBinding, RuntimeException cause) {
    return errorInUserCode(cause, "Error converting '%s' (bound at %s) to %s%n"
        + " using %s.%n"
        + " Reason: %s",
        stringValue, convert(source), type, typeConverterBinding, cause);
  }

  public Errors ambiguousTypeConversion(String stringValue, Object source, TypeLiteral<?> type,
      TypeConverterBinding a, TypeConverterBinding b) {
    return addMessage("Multiple converters can convert '%s' (bound at %s) to %s:%n"
        + " %s and%n"
        + " %s.%n"
        + " Please adjust your type converter configuration to avoid overlapping matches.",
        stringValue, convert(source), type, a, b);
  }

  public Errors bindingToProvider() {
    return addMessage("Binding to Provider is not allowed.");
  }

  public Errors subtypeNotProvided(Class<? extends javax.inject.Provider<?>> providerType,
      Class<?> type) {
    return addMessage("%s doesn't provide instances of %s.", providerType, type);
  }

  public Errors notASubtype(Class<?> implementationType, Class<?> type) {
    return addMessage("%s doesn't extend %s.", implementationType, type);
  }

  public Errors recursiveImplementationType() {
    return addMessage("@ImplementedBy points to the same class it annotates.");
  }

  public Errors recursiveProviderType() {
    return addMessage("@ProvidedBy points to the same class it annotates.");
  }

  public Errors missingRuntimeRetention(Class<? extends Annotation> annotation) {
    return addMessage(format("Please annotate %s with @Retention(RUNTIME).", annotation));
  }

  public Errors missingScopeAnnotation(Class<? extends Annotation> annotation) {
    return addMessage(format("Please annotate %s with @ScopeAnnotation.", annotation));
  }

  public Errors optionalConstructor(Constructor constructor) {
    return addMessage("%s is annotated @Inject(optional=true), "
        + "but constructors cannot be optional.", constructor);
  }

  public Errors cannotBindToGuiceType(String simpleName) {
    return addMessage("Binding to core guice framework type is not allowed: %s.", simpleName);
  }

  public Errors scopeNotFound(Class<? extends Annotation> scopeAnnotation) {
    return addMessage("No scope is bound to %s.", scopeAnnotation);
  }

  public Errors scopeAnnotationOnAbstractType(
      Class<? extends Annotation> scopeAnnotation, Class<?> type, Object source) {
    return addMessage("%s is annotated with %s, but scope annotations are not supported "
        + "for abstract types.%n Bound at %s.", type, scopeAnnotation, convert(source));
  }

  public Errors misplacedBindingAnnotation(Member member, Annotation bindingAnnotation) {
    return addMessage("%s is annotated with %s, but binding annotations should be applied "
        + "to its parameters instead.", member, bindingAnnotation);
  }

  private static final String CONSTRUCTOR_RULES =
      "Classes must have either one (and only one) constructor "
          + "annotated with @Inject or a zero-argument constructor that is not private.";

  public Errors missingConstructor(Class<?> implementation) {
    return addMessage("Could not find a suitable constructor in %s. " + CONSTRUCTOR_RULES,
        implementation);
  }

  public Errors tooManyConstructors(Class<?> implementation) {
    return addMessage("%s has more than one constructor annotated with @Inject. "
        + CONSTRUCTOR_RULES, implementation);
  }

  public Errors constructorNotDefinedByType(Constructor<?> constructor, TypeLiteral<?> type) {
    return addMessage("%s does not define %s", type, constructor);
  }

  public Errors duplicateScopes(ScopeBinding existing,
      Class<? extends Annotation> annotationType, Scope scope) {
    return addMessage("Scope %s is already bound to %s at %s.%n Cannot bind %s.",
        existing.getScope(), annotationType, existing.getSource(), scope);
  }

  public Errors voidProviderMethod() {
    return addMessage("Provider methods must return a value. Do not return void.");
  }

  public Errors missingConstantValues() {
    return addMessage("Missing constant value. Please call to(...).");
  }

  public Errors cannotInjectInnerClass(Class<?> type) {
    return addMessage("Injecting into inner classes is not supported.  "
        + "Please use a 'static' class (top-level or nested) instead of %s.", type);
  }

  public Errors duplicateBindingAnnotations(Member member,
      Class<? extends Annotation> a, Class<? extends Annotation> b) {
    return addMessage("%s has more than one annotation annotated with @BindingAnnotation: "
        + "%s and %s", member, a, b);
  }

  public Errors staticInjectionOnInterface(Class<?> clazz) {
    return addMessage("%s is an interface, but interfaces have no static injection points.", clazz);
  }

  public Errors cannotInjectFinalField(Field field) {
    return addMessage("Injected field %s cannot be final.", field);
  }

  public Errors cannotInjectAbstractMethod(Method method) {
    return addMessage("Injected method %s cannot be abstract.", method);
  }

  public Errors cannotInjectNonVoidMethod(Method method) {
    return addMessage("Injected method %s must return void.", method);
  }

  public Errors cannotInjectMethodWithTypeParameters(Method method) {
    return addMessage("Injected method %s cannot declare type parameters of its own.", method);
  }

  public Errors duplicateScopeAnnotations(
      Class<? extends Annotation> a, Class<? extends Annotation> b) {
    return addMessage("More than one scope annotation was found: %s and %s.", a, b);
  }

  public Errors recursiveBinding() {
    return addMessage("Binding points to itself.");
  }

  public Errors bindingAlreadySet(Key<?> key, Object source) {
    return addMessage("A binding to %s was already configured at %s.", key, convert(source));
  }

  public Errors jitBindingAlreadySet(Key<?> key) {
    return addMessage("A just-in-time binding to %s was already configured on a parent injector.", key);
  }

  public Errors childBindingAlreadySet(Key<?> key, Set<Object> sources) {
    Formatter allSources = new Formatter();
    for (Object source : sources) {
      if (source == null) {
        allSources.format("%n    (bound by a just-in-time binding)");
      } else {
        allSources.format("%n    bound at %s", source);
      }
    }
    Errors errors = addMessage(
        "Unable to create binding for %s."
      + " It was already configured on one or more child injectors or private modules"
      + "%s%n"
      + "  If it was in a PrivateModule, did you forget to expose the binding?",
        key, allSources.out());
    return errors;
  }

  public Errors errorCheckingDuplicateBinding(Key<?> key, Object source, Throwable t) {
    return addMessage(
        "A binding to %s was already configured at %s and an error was thrown "
      + "while checking duplicate bindings.  Error: %s",
        key, convert(source), t);
  }

  public Errors errorInjectingMethod(Throwable cause) {
    return errorInUserCode(cause, "Error injecting method, %s", cause);
  }

  public Errors errorNotifyingTypeListener(TypeListenerBinding listener,
      TypeLiteral<?> type, Throwable cause) {
    return errorInUserCode(cause,
        "Error notifying TypeListener %s (bound at %s) of %s.%n"
        + " Reason: %s",
        listener.getListener(), convert(listener.getSource()), type, cause);
  }

  public Errors errorInjectingConstructor(Throwable cause) {
    return errorInUserCode(cause, "Error injecting constructor, %s", cause);
  }

  public Errors errorInProvider(RuntimeException runtimeException) {
    Throwable unwrapped = unwrap(runtimeException);
    return errorInUserCode(unwrapped, "Error in custom provider, %s", unwrapped);
  }

  public Errors errorInUserInjector(
      MembersInjector<?> listener, TypeLiteral<?> type, RuntimeException cause) {
    return errorInUserCode(cause, "Error injecting %s using %s.%n"
        + " Reason: %s", type, listener, cause);
  }

  public Errors errorNotifyingInjectionListener(
      InjectionListener<?> listener, TypeLiteral<?> type, RuntimeException cause) {
    return errorInUserCode(cause, "Error notifying InjectionListener %s of %s.%n"
        + " Reason: %s", listener, type, cause);
  }

  public Errors exposedButNotBound(Key<?> key) {
    return addMessage("Could not expose() %s, it must be explicitly bound.", key);
  }

  public Errors keyNotFullySpecified(TypeLiteral<?> typeLiteral) {
    return addMessage("%s cannot be used as a key; It is not fully specified.", typeLiteral);
  }

  public Errors errorEnhancingClass(Class<?> clazz, Throwable cause) {
    return errorInUserCode(cause, "Unable to method intercept: %s", clazz);
  }

  public static Collection<Message> getMessagesFromThrowable(Throwable throwable) {
    if (throwable instanceof ProvisionException) {
      return ((ProvisionException) throwable).getErrorMessages();
    } else if (throwable instanceof ConfigurationException) {
      return ((ConfigurationException) throwable).getErrorMessages();
    } else if (throwable instanceof CreationException) {
      return ((CreationException) throwable).getErrorMessages();
    } else {
      return ImmutableSet.of();
    }
  }

  public Errors errorInUserCode(Throwable cause, String messageFormat, Object... arguments) {
    Collection<Message> messages = getMessagesFromThrowable(cause);

    if (!messages.isEmpty()) {
      return merge(messages);
    } else {
      return addMessage(cause, messageFormat, arguments);
    }
  }

  private Throwable unwrap(RuntimeException runtimeException) {
   if(runtimeException instanceof Exceptions.UnhandledCheckedUserException) {
     return runtimeException.getCause();
   } else {
     return runtimeException;
   }
  }

  public Errors cannotInjectRawProvider() {
    return addMessage("Cannot inject a Provider that has no type parameter");
  }

  public Errors cannotInjectRawMembersInjector() {
    return addMessage("Cannot inject a MembersInjector that has no type parameter");
  }

  public Errors cannotInjectTypeLiteralOf(Type unsupportedType) {
    return addMessage("Cannot inject a TypeLiteral of %s", unsupportedType);
  }

  public Errors cannotInjectRawTypeLiteral() {
    return addMessage("Cannot inject a TypeLiteral that has no type parameter");
  }

  public Errors cannotSatisfyCircularDependency(Class<?> expectedType) {
    return addMessage(
        "Tried proxying %s to support a circular dependency, but it is not an interface.",
        expectedType);
  }

  public Errors circularProxiesDisabled(Class<?> expectedType) {
    return addMessage(
        "Tried proxying %s to support a circular dependency, but circular proxies are disabled.",
        expectedType);
  }

  public void throwCreationExceptionIfErrorsExist() {
    if (!hasErrors()) {
      return;
    }

    throw new CreationException(getMessages());
  }

  public void throwConfigurationExceptionIfErrorsExist() {
    if (!hasErrors()) {
      return;
    }

    throw new ConfigurationException(getMessages());
  }

  public void throwProvisionExceptionIfErrorsExist() {
    if (!hasErrors()) {
      return;
    }

    throw new ProvisionException(getMessages());
  }

  private Message merge(Message message) {
    List<Object> sources = Lists.newArrayList();
    sources.addAll(getSources());
    sources.addAll(message.getSources());
    return new Message(sources, message.getMessage(), message.getCause());
  }

  public Errors merge(Collection<Message> messages) {
    for (Message message : messages) {
      addMessage(merge(message));
    }
    return this;
  }

  public Errors merge(Errors moreErrors) {
    if (moreErrors.root == root || moreErrors.root.errors == null) {
      return this;
    }

    merge(moreErrors.root.errors);
    return this;
  }

  public List<Object> getSources() {
    List<Object> sources = Lists.newArrayList();
    for (Errors e = this; e != null; e = e.parent) {
      if (e.source != SourceProvider.UNKNOWN_SOURCE) {
        sources.add(0, e.source);
      }
    }
    return sources;
  }

  public void throwIfNewErrors(int expectedSize) throws ErrorsException {
    if (size() == expectedSize) {
      return;
    }

    throw toException();
  }

  public ErrorsException toException() {
    return new ErrorsException(this);
  }

  public boolean hasErrors() {
    return root.errors != null;
  }

  public Errors addMessage(String messageFormat, Object... arguments) {
    return addMessage(null, messageFormat, arguments);
  }

  private Errors addMessage(Throwable cause, String messageFormat, Object... arguments) {
    String message = format(messageFormat, arguments);
    addMessage(new Message(getSources(), message, cause));
    return this;
  }

  public Errors addMessage(Message message) {
    if (root.errors == null) {
      root.errors = Lists.newArrayList();
    }
    root.errors.add(message);
    return this;
  }

  public static String format(String messageFormat, Object... arguments) {
    for (int i = 0; i < arguments.length; i++) {
      arguments[i] = Errors.convert(arguments[i]);
    }
    return String.format(messageFormat, arguments);
  }

  public List<Message> getMessages() {
    if (root.errors == null) {
      return ImmutableList.of();
    }

    return new Ordering<Message>() {
      @Override
      public int compare(Message a, Message b) {
        return a.getSource().compareTo(b.getSource());
      }
    }.sortedCopy(root.errors);
  }

  /** Returns the formatted message for an exception with the specified messages. */
  public static String format(String heading, Collection<Message> errorMessages) {
    Formatter fmt = new Formatter().format(heading).format(":%n%n");
    int index = 1;
    boolean displayCauses = getOnlyCause(errorMessages) == null;

    Map<Equivalence.Wrapper<Throwable>, Integer> causes = Maps.newHashMap();
    for (Message errorMessage : errorMessages) {
      int thisIdx = index++;
      fmt.format("%s) %s%n", thisIdx, errorMessage.getMessage());

      List<Object> dependencies = errorMessage.getSources();
      for (int i = dependencies.size() - 1; i >= 0; i--) {
        Object source = dependencies.get(i);
        formatSource(fmt, source);
      }

      Throwable cause = errorMessage.getCause();
      if (displayCauses && cause != null) {
        Equivalence.Wrapper<Throwable> causeEquivalence = ThrowableEquivalence.INSTANCE.wrap(cause);
        if (!causes.containsKey(causeEquivalence)) {
          causes.put(causeEquivalence, thisIdx);
          fmt.format("Caused by: %s", Throwables.getStackTraceAsString(cause));
        } else {
          int causeIdx = causes.get(causeEquivalence);
          fmt.format("Caused by: %s (same stack trace as error #%s)",
              cause.getClass().getName(), causeIdx);
        }
      }

      fmt.format("%n");
    }

    if (errorMessages.size() == 1) {
      fmt.format("1 error");
    } else {
      fmt.format("%s errors", errorMessages.size());
    }

    return fmt.toString();
  }

  /**
   * Returns {@code value} if it is non-null allowed to be null. Otherwise a message is added and
   * an {@code ErrorsException} is thrown.
   */
  public <T> T checkForNull(T value, Object source, Dependency<?> dependency)
      throws ErrorsException {
    if (value != null || dependency.isNullable() ) {
      return value;
    }

    // Hack to allow null parameters to @Provides methods, for backwards compatibility.
    if (dependency.getInjectionPoint().getMember() instanceof Method) {
      Method annotated = (Method) dependency.getInjectionPoint().getMember();
      if (annotated.isAnnotationPresent(Provides.class)) {
        switch (InternalFlags.getNullableProvidesOption()) {
          case ERROR:
            break; // break out & let the below exception happen
          case IGNORE:
            return value; // user doesn't care about injecting nulls to non-@Nullables.
          case WARN:
            // Warn only once, otherwise we spam logs too much.
            if (!warnedDependencies.add(dependency)) {
              return value;
            }
            logger.log(Level.WARNING,
                "Guice injected null into parameter {0} of {1} (a {2}), please mark it @Nullable."
                    + " Use -Dguice_check_nullable_provides_params=ERROR to turn this into an"
                    + " error.",
                new Object[] {
                    dependency.getParameterIndex(),
                    convert(dependency.getInjectionPoint().getMember()),
                    convert(dependency.getKey())});
            return null; // log & exit.
        }
      }
    }

    int parameterIndex = dependency.getParameterIndex();
    String parameterName = (parameterIndex != -1)
        ? "parameter " + parameterIndex + " of "
        : "";
    addMessage("null returned by binding at %s%n but %s%s is not @Nullable",
        source, parameterName, dependency.getInjectionPoint().getMember());

    throw toException();
  }

  /**
   * Returns the cause throwable if there is exactly one cause in {@code messages}. If there are
   * zero or multiple messages with causes, null is returned.
   */
  public static Throwable getOnlyCause(Collection<Message> messages) {
    Throwable onlyCause = null;
    for (Message message : messages) {
      Throwable messageCause = message.getCause();
      if (messageCause == null) {
        continue;
      }

      if (onlyCause != null
          && !ThrowableEquivalence.INSTANCE.equivalent(onlyCause, messageCause)) {
        return null;
      }

      onlyCause = messageCause;
    }

    return onlyCause;
  }

  public int size() {
    return root.errors == null ? 0 : root.errors.size();
  }

  private static abstract class Converter<T> {

    final Class<T> type;

    Converter(Class<T> type) {
      this.type = type;
    }

    boolean appliesTo(Object o) {
      return o != null && type.isAssignableFrom(o.getClass());
    }

    String convert(Object o) {
      return toString(type.cast(o));
    }

    abstract String toString(T t);
  }

  private static final Collection<Converter<?>> converters = ImmutableList.of(
      new Converter<Class>(Class.class) {
        @Override public String toString(Class c) {
          return c.getName();
        }
      },
      new Converter<Member>(Member.class) {
        @Override public String toString(Member member) {
          return Classes.toString(member);
        }
      },
      new Converter<Key>(Key.class) {
        @Override public String toString(Key key) {
          if (key.getAnnotationType() != null) {
            return key.getTypeLiteral() + " annotated with "
                + (key.getAnnotation() != null ? key.getAnnotation() : key.getAnnotationType());
          } else {
            return key.getTypeLiteral().toString();
          }
        }
      });

  public static Object convert(Object o) {
    ElementSource source = null;
    if (o instanceof ElementSource) {
      source = (ElementSource)o;
      o = source.getDeclaringSource();
    }
    return convert(o, source);
  }

  public static Object convert(Object o, ElementSource source) {
    for (Converter<?> converter : converters) {
      if (converter.appliesTo(o)) {
        return appendModules(converter.convert(o), source);
      }
    }
    return appendModules(o, source);
  }

  private static Object appendModules(Object source, ElementSource elementSource) {
    String modules = moduleSourceString(elementSource);
    if (modules.length() == 0) {
      return source;
    } else {
      return source + modules;
    }
  }

  private static String moduleSourceString(ElementSource elementSource) {
    // if we only have one module (or don't know what they are), then don't bother
    // reporting it, because the source already is going to report exactly that module.
    if (elementSource == null) {
      return "";
    }
    List<String> modules = Lists.newArrayList(elementSource.getModuleClassNames());
    // Insert any original element sources w/ module info into the path.
    while(elementSource.getOriginalElementSource() != null) {
      elementSource = elementSource.getOriginalElementSource();
      modules.addAll(0, elementSource.getModuleClassNames());
    }
    if (modules.size() <= 1) {
      return "";
    }

    // Ideally we'd do:
    //    return Joiner.on(" -> ")
    //        .appendTo(new StringBuilder(" (via modules: "), Lists.reverse(modules))
    //        .append(")").toString();
    // ... but for some reason we can't find Lists.reverse, so do it the boring way.
    StringBuilder builder = new StringBuilder(" (via modules: ");
    for (int i = modules.size() - 1; i >= 0; i--) {
      builder.append(modules.get(i));
      if (i != 0) {
        builder.append(" -> ");
      }
    }
    builder.append(")");
    return builder.toString();
  }

  public static void formatSource(Formatter formatter, Object source) {
    ElementSource elementSource = null;
    if (source instanceof ElementSource) {
      elementSource = (ElementSource)source;
      source = elementSource.getDeclaringSource();
    }
    formatSource(formatter, source, elementSource);
  }

  public static void formatSource(Formatter formatter, Object source, ElementSource elementSource) {
    String modules = moduleSourceString(elementSource);
    if (source instanceof Dependency) {
      Dependency<?> dependency = (Dependency<?>) source;
      InjectionPoint injectionPoint = dependency.getInjectionPoint();
      if (injectionPoint != null) {
        formatInjectionPoint(formatter, dependency, injectionPoint, elementSource);
      } else {
        formatSource(formatter, dependency.getKey(), elementSource);
      }

    } else if (source instanceof InjectionPoint) {
      formatInjectionPoint(formatter, null, (InjectionPoint) source, elementSource);

    } else if (source instanceof Class) {
      formatter.format("  at %s%s%n", StackTraceElements.forType((Class<?>) source), modules);

    } else if (source instanceof Member) {
      formatter.format("  at %s%s%n", StackTraceElements.forMember((Member) source), modules);

    } else if (source instanceof TypeLiteral) {
      formatter.format("  while locating %s%s%n", source, modules);

    } else if (source instanceof Key) {
      Key<?> key = (Key<?>) source;
      formatter.format("  while locating %s%n", convert(key, elementSource));

    } else if (source instanceof Thread) {
      formatter.format("  in thread %s%n", source);

    } else {
      formatter.format("  at %s%s%n", source, modules);
    }
  }

  public static void formatInjectionPoint(Formatter formatter, Dependency<?> dependency,
      InjectionPoint injectionPoint, ElementSource elementSource) {
    Member member = injectionPoint.getMember();
    Class<? extends Member> memberType = Classes.memberType(member);

    if (memberType == Field.class) {
      dependency = injectionPoint.getDependencies().get(0);
      formatter.format("  while locating %s%n", convert(dependency.getKey(), elementSource));
      formatter.format("    for field at %s%n", StackTraceElements.forMember(member));

    } else if (dependency != null) {
      formatter.format("  while locating %s%n", convert(dependency.getKey(), elementSource));
      formatter.format("    for parameter %s at %s%n",
          dependency.getParameterIndex(), StackTraceElements.forMember(member));

    } else {
      formatSource(formatter, injectionPoint.getMember());
    }
  }

  static class ThrowableEquivalence extends Equivalence<Throwable> {
    static final ThrowableEquivalence INSTANCE = new ThrowableEquivalence();

    @Override protected boolean doEquivalent(Throwable a, Throwable b) {
      return a.getClass().equals(b.getClass())
          && Objects.equal(a.getMessage(), b.getMessage())
          && Arrays.equals(a.getStackTrace(), b.getStackTrace())
          && equivalent(a.getCause(), b.getCause());
    }

    @Override protected int doHash(Throwable t) {
      return Objects.hashCode(t.getClass().hashCode(), t.getMessage(), hash(t.getCause()));
    }
  }
}

redpajama_set_name: RedPajamaGithub