text:
Instrumentally influenced by the heavy, hard edge of classic rock, Boston-born Somerset conversely breathes a sigh of relief and fulfillment in their self-titled debut album, Somerset.
Listening to Somerset once isn't enough. Honing in on a rich and reminiscent sound, the band showcases sweeping anthems, beautiful ballads, and groove-worthy jams, giving listeners exactly what they're looking for and what they didn't know they needed. The six-piece Boston-based alt rock group—with Nick Aikens on lead vocals, David Apostolides on keyboards, Bobby Borenstein and Sean Silva on guitar, Jake Damphousse on drums, and Connor Milligan on bass—started as a cover band in 2018, but grew beyond with the release of their debut LP of original material, Somerset. While not explicitly presented as a concept album, Somerset provides a psychological analysis of life's misfortunate situations and how one chooses to perceive and grow from them. The album runs rampant with compelling hooks, flashy solos, complex vocal harmonies, and rich power chords that leak vulnerability in the most badass, beautiful, and rebellious of ways.
Opening track "The Carnival" is the perfect introduction to the album and all that is Somerset. Lyrically, it welcomes the chaos of a literal carnival, with a hastened tempo, quick keys, driving guitar melody and lingering vocals creating a compelling and complex energy. Ultimately, this reflects the album's theme of moving on from mayhem.
Meanwhile, songs like "Revere Street," "Cardinal Sin," and "These Lights" lead with an inspiring undertone, each exploring the concepts of positivity and closure. In "Revere Street," a sweeping guitar melody and bold bass ostinato parallel bright keys to create a space of triumph and comfort. The warm chorus overtakes the track's soundscape: "This is the last time / Everything will be fine / So let it go / I will make it mine." "Cardinal Sin" tackles this common idea of moving on with an entirely different approach of sound. The song starts with a gently plucked bass, heavy tom pattern, and off-beat guitar strokes. Yet again, the lyrics are ready to fight back: "That's just not what I'm about / I am not your patient." The song stands up for what one deserves, with the electric guitar driving the energy of its point.
"These Lights," in contrast, is one of the most sweet-sounding cuts on the album, starting with a subtle, slow, solo piano melody. It eventually builds over a catchy bass line and full, epic chorus: "these lights / shining down above me / so right / I'm finally, finally becoming me." With Nick belting out deeply-resonating lyrics, the song breaks and builds with a moody and earthy guitar solo overlapping every other ingredient, sonically pushing and pulling at all emotions.
The theme of moving on carries with "Dreamer" and "Space I'm Wasting," which outline various dilemmas about moving on and personal growth, only to expand on the means of getting out of them. Musically powered by warm vocal harmonies and an involved, poetic bass line, "Dreamer" describes what it feels like to be trapped, pleading: "take me far away from here / wait until we're in the clear / calm me down and hold on tight." The harmonies tie together with a drum pattern that emotionally escalates with the end of each refrain.
Starting with layered guitar melodies, "Space I'm Wasting" does exactly what it intends to do, a slow consistent jam that fully captures its message, drawing a parallel between the empty space in an attic and the clout of anxieties filling one's head: "can't I empty out this space I'm wasting."The album is also sprinkled with songs to break up the introspection, like the opener, "The Carnival," or songs like "The Few," "Pinch," and "Phoenix," which all vary in topic from World War II to an inescapable nightmare and finally, to our generation's technology-focused identity. Experimenting with a more authentic rock sound, "Phoenix" starts with encompassing electric guitars, hastened drums, and chromatically repetitive keys, building into the chorus, "Open your eyes/turn off the lights"—emphasizing the importance of our generation's problems and its tethers to technology—only to end with clean, striking solos from dueling guitars. The band and this album grow in fervor with each individual listen, simply because of what Somerset writes about: it's real, and is written in an incredibly refreshing and relatable way.


text:
Flowers against loneliness
Many of us could have felt more alone in 2021 than at any other time of our lives.
We had to learn to enjoy our own company or the company of another via a mirror when the pandemic cut us off from our loved ones.
So, what can we do with it? Ok, there's no magic wand, but we think flowers are still a good way to let your friends or relatives know you're thinking about them – and that you're in the same boat.
Flowers to combat loneliness
Flowers draw people closer and can be used to deliver a greeting without having to say something. Every flower has a unique significance and can speak for itself.
It's much cooler when the gorgeous bouquet arrives as a surprise on their doorstep, ready to wow them the moment they walk in the gates. In these weird days, it's a way of reaching out that isn't through a phone to give some affection.
Here are only a few of the best flowers to combat depression, if you want to cheer someone up, bring a splash of color to their day, or say "I love you" if you can't visit.
Is there ever a wrong time to send a rose bouquet? No, we don't believe so. Plus, depending on the color and number of flowers you give, this ever-popular bloom can have a variety of meanings.
Give a bouquet of pink roses to reassure a friend that they are not alone. Pink roses are thought to reflect joy and appreciation. Choose only three pink roses – maybe with some greenery and gypsophila thrown in for good measure – and you're simply expressing your love for them.
If you're feeling guilty about not communicating as much as you'd like – don't be too harsh on yourself; we're all going through the same thing! – Instead of sending a bouquet, consider sending a blue hyacinth plant. These bell-shaped blooms are said to symbolize forgiveness and are an excellent way to express regret while also showing that you care.
Hyacinths, on the other hand, only bloom in the spring, so don't wait; substitute white tulips and you'll send the same message: "I'm sorry I haven't been around lately, but I'm here for you."
Send a bouquet of these seasonal blooms their way to brighten their day. Those classic yellow petals and fuzzy faces – which are actually made up of hundreds of smaller sunflowers! – will immediately brighten their day and let them know you care.
Send a nice note along with the bouquet to let them know you're there for them if they need anything.
With a cheerful bunch of daffodils delivered right to their house, add a ray of sunshine to the cold days of early spring.
These bright blooms are best sent in a larger posy and are said to symbolize fresh beginnings, making them perfect for a new or soon-to-be mother.
Let them know you're not leaving and that you're available on the other end of the phone if they have any questions.
Other ways to deal with isolation
We also have different ways of dealing with feelings of isolation. Here are some strategies to consider if you're feeling isolated:
Reach out -A acquaintance, a family member, or a coworker. To start a conversation, reach out to someone and ask how they are or what they have been up to. It could be an email, a phone call, or simply commenting on their most recent Instagram post. Alternatively, plan a socially distant walk together where you can catch up in person.
Talk to someone you've not spoken to for a while -That old colleague, a high school acquaintance, the girl you met at the gym who asked for advice on how to use the weight machine... If things have gotten a little stale, text them and start talking again. They'll be grateful that you reached out, and you'll feel less alone as a result.
Try to plan in something social - We know we're sick of chatting with screens, but scheduling anything social, whether it's a Zoom call or a FaceTime catch-up, gives us something to anticipate. It's like going on a date with our mates, except we don't have to leave our computers. A win-win situation! Organize a flower arrangement session with your friends by clicking on the joy that flowers offer us.
Interact with your housemates-Do you live in a flat share but just say hello to the other professionals in the building? It's time to face your fears and start talking to the people you live with. Get to know each other better by chatting in the kitchen, organizing a walk together, or planning a house dinner. In the room next door, you could find a new best friend.
Get out of the house-We know it's easier said than done (especially right now), but going for a walk around the block and greeting people who pass by, or going to the store or your local cafe and striking up a conversation with the people who work there, can help.
Of course, it's important that we follow guidelines and preserve social distance at this point, however many of these can be enjoyed over a video call or from two meters away outside.

redpajama_set_name: RedPajamaCommonCrawl


text:
Double chocolate: Two classic recipes for chocolate crackle cookies
A-frame house plans for second homes & family vacation cabins: 12 retro designs from the '50s & '60s
Peanut butter chiffon pie with pretzel crust & a black-bottom peanut butter chiffon pie (1972)
The story of the truly bizarre Winchester Mystery House: From the haunted, mixed-up mind of Mrs William W Winchester
America gets in the mood: Mood rings seen everywhere as colorful new-age trend of the '70s captures the minds of millions
Festive & fancy ways to pouf-wrap gifts with tissue paper (1964)
Cranberry-mushroom, sausage-pecan & other sensational '70s stuffing recipes
How to make an edible Christmas tree with star-shaped cookies (1962)
How to snare a male: Dating & marriage advice from 1950
In the '70s, you could make oceans and mountains with a Wham-O Magic Window toy
Quick apple coffee cake: A classic breakfast recipe from the '70s
Stove top meatloaf recipes from the sixties
What did people think of autism in the 1960s? Here's a look back at some of the attempts to understand
1960s, Vintage discoveries & classic inventions, Vintage family & old-fashioned parenting, Vintage health & medical info
Autistic youngsters are children living in shells (1967)
by Robert Shields, London Observer Writer
"Alan behaves as though other people don't exist. He shows no affection to anyone, always plays alone (if you call it play), and when he does talk, he refers to himself in the third person.
"Objects are most valuable to him if he can make them spin or if they are small enough to pick up and drop, over and over again. He seems happy, too, when pouring water from one container to another. This activity will occupy him for hours.
Climbing on fences
"He is unafraid of things that would make an ordinary child nervous, like climbing dangerously on furniture or fences. On the other hand, he easily flies into a panic or fury if his daily routine is disturbed in any way.
"Alan moves awkwardly, sometimes like a puppet. Despite this peculiarities, the psychologist says he is of above-average intelligence."
The mother who made these quotes about her 6-year-old knows that he is an autistic child.
Developed normally
He was, she says, an exceptionally good baby, and, as far as she could see, he developed normally during his first three years. Then he gradually deteriorated and became increasingly withdrawn. He has just been found a place in a unit for autistic children.
In recent years autism, a very severe form of mental illness in children, which affects four times as many boys as girls, has been the subject of intense study and debate.
It still remains a mystery, and despite all that medical, educational and psychological research has to offer, the majority of autistic children face a bleak and emotionally crippled future.
It's deeply affecting
It is a deeply affecting experience to watch a group of these children, who so often are exceptionally beautiful and well-built.
Though in close proximity, they ignore one another, each locked in silence, or constantly repeating some apparently meaningless phrase, or carrying out over and over again a particular gesture or action which has significance only for him.
If you smile at one of them the smile is not returned; if you say something it seems not to be understood. There is no place for others in the private world the autistic child occupies.
MORE How autism was described in the 1970s: Easy to define, hard to pinpoint
Dates from 1930s
Mental illness in children is not a new phenomenon, although systematic research into autism only dates from the 1930s. Three American psychiatrists — Drs Lauretta Bender, Margaret Mahler and Leo Kanner — have spearheaded this research.
They disagree on a number of points, but they are at one in thinking that the psychotic child is not as much withdrawn as "alone." Alone in the sense that each autistic lives in an inner secret and frightening world into which he dare not let others intrude.
The autistic child holds this personal world together precariously, just this side of uncontrollable panic. Many of his repetitious actions appear to be a kind of magical preoccupation aimed at keeping others out and preserving the thin walls of self-defense.
It is because the small patient dreads the breakdown of his insecure inner world that he is so easily distressed by any change in his environment. Inanimate objects are, for him, much safer than people because they do not behave unpredictably, they make no demands and can be manipulated without difficulty.
If you pick up and then drop a toy brick, it will always fall in much the same way. If you pour water from one jar to another, much the same thing happens every time. You have control. There is nothing to be frightened of.
Educationists and clinicians who have worked closely with this type of child are generally agreed that he constantly fears that if his magical but tenuous hold on the object-world were to break down he would disintegrate or be annihilated.
How do these unfortunate children become ill in the first place? How do they come to lose, or never fully gain, the knack of enjoying themselves in the real world of loving parents, of brothers and sisters?
MORE An early look at autism: 'Wooden doll' illness noted by university researchers (1960)
No one as yet has advanced a fulling convincing answer. Early workers in the field tended to link the illness with one single cause, but recent research would seem to suggest a combination of factors. A number of specialists think that the unknown factor may be pseudo-maturity.
There is evidence to show that children who later become autistic often reveal in earliest infancy unusual sensitivity and emotional vulnerability.
Such children man, for a variety of reasons (and inadequate maternal care is often mentioned), become too mature too quickly. If this happens the personality may lack the strength and resilience of the normal child's; and, should he then be faced with a stressful situation, or crisis of some kind, he may retreat into an autistic type of existence.
Dr John Bowlby in England and Margaret Ribble in America have separately demonstrated that, to be emotionally healthy, the infant needs a warm, responsive, intimate and continuously loving relationship with his mother or mother-substitute.
MORE Mom: Autism is not your fault, and other good advice from 1963
Many clinicians and research psychologists who have worked with autistic children and their families, while not suggesting that the autistic child was rejected by his parents in the conventional sense, have found that the mother-child relationship has often proved to be unusual.
Kerner Commission: Racism confronted after months of soul-searching (1968)
Deck the halls with lots of homemade '60s-style Christmas decor
Milton Bradley board games for family fun (1950s & 1960s)
10 top TV catchphrases of the '60s
Categories: 1960s, Vintage discoveries & classic inventions, Vintage family & old-fashioned parenting, Vintage health & medical info
Source: Salt Lake Tribune (Salt Lake City, Utah)
Original publication date: February 12, 1967
Tags: 1967, autism, mothers, parenting, psychiatry
Added or last updated: April 3, 2019
New phone services: Call Waiting & Call Forwarding (1974)
Longing for an uncluttered life? Doris Day tells you how to get organized! (1959)


As Doctors with decades of experience practicing Functional and Integrative Medicine, there is worldwide demand for our services. We receive requests for appointments from you every day, and for those of you who live nearby or can travel to Blum Center, we happily make plans for you to become a patient.
For those of you who can't travel to our Center, we are restricted from engaging in a doctor-patient relationship unless we are licensed in the state where you live. This is the current state of legal restrictions on the practice of Telemedicine. Telemedicine is defined as a service that allows health care professionals to evaluate, diagnose and treat patients in remote locations using telecommunications technology, which includes video or telephone calls.
We are researching whether we may be able to offer Telemedicine to people outside New York. If we determine that we are able to do so, we will let you know by posting an announcement on this site.
However, we can help you via Tele-Education!
We have always been an Education Center, providing Lifestyle Education Classes and free Informational Talks to our community. Our Faculty of clinicians have a wealth of information to share with you, and without becoming a patient of Blum Center for Health, there is a lot we can do to help you via Tele-Education!
Learn about online educational consultations with our Faculty using our Health Education Services.


A straight-forward Dress Shirt for the gentleman who prefers the ease of shopping online rather than battling the mobs at the store. This pairs perfectly with the Argyle Five-Button Vest or the Argyle Jacket.
Don't know your dress shirt size? Check out out Measuring Guide for assistance.


Enhancing Global Development of SMBG Devices Research and Development Facility Established in Korea | ARKRAY, Inc.
ARKRAY, Inc. has opened its "Korean Development Center" R&D facility in the Republic of Korea (hereunder, Korea). In the future, this facility will cooperate with facilities in Japan and Singapore in the development of new SMBG device systems.
ARKRAY, Inc. (hereunder, ARKRAY) has opened its "Korean Development Center" in Gunpo, Korea. Presently, ARKRAY has R&D facilities in Japan (Kyoto) and Singapore, making the Korean facility the 3rd addition to this group. In the future, the Korean facility will cooperate with the Singapore facility in the development of new systems for ARKRAY's primary SMBG meter products.
ARKRAY will continue to build upon its global R&D system and develop products which answer frontline medical needs in every country and region.


Prerequisites: Interested students should have working knowledge of Python in advance of the class, and also should have completed a fundamental probability or statistics course.
Tanya / Srikar (HW + project related): Wed 10:30-11:30AM, 205 South hall.
This course is designed primarily for upper-level undergraduate engineering and technical students. Graduate students at a mezzanine level can also take a co-located section of the course. The course material offers an understanding at the intersection of foundational math mathematical concepts and current computer science tools, with applications of real world problems. Math concepts include filtering, prediction, classification, decision-making, entropy as part of information theory, LTI systems, spectral analysis, and frameworks for learning from data. Computer science tools for this course include open source tools such as Python with Numpy, Scipy, Pandas, SQL, NLTK, Tensor Flow, and Spark. The course includes a team based data application project.
The lectures present alternating and related topics between mathematical frameworks and the same concept within code examples. One goal is that students who understand math concepts can bring them to life with scalable CS tools. And, students who are comfortable with computer software code can create systems by understanding selected, structured mathematical frameworks. This course is designed to be more applied than a traditional ML algorithms course as it includes a systems view and covers implementation concepts.
Applications of this course are broad. They include industry sectors such as finance, health, engineering, transportation, energy, and many others. The lab section of the course meets in parallel with the lecture. In the lab, the first 4 weeks are used to generate a story and low-tech demo for a real-world project that performs actions on data, and the following 8 weeks will be an agile sprint, with a demonstration of working project code by the end of the class. The skill set learned in this class can be applied to a broad range of industry sectors such as finance, health, engineering, transportation, energy, and many others.
Find our amazing projects from previous semesters here.
The class will be graded according to the categories below. At the end of the class there will be a poster presentation + live demo during reading week where invited judges will provide assessment of each project.
Based on our previous experience in the course, we have decided to use the following percentile thresholds for the final grading. We plan to award A (top 30%), A- (next 30%), B+ (next 25%) and case by case grading for the rest. We reserve the right to increase or decrease these thresholds based on the performance of the class.
All slides and notebook samples will be updated at this site.
Theory: Overview of Frameworks for obtaining insights from data (Slides).
Project Bring three ideas to the class.
To include, if possible tool: Connecting Pandas to SQL for Long-term storage. AWS / SQL / Parallelization.
Example application topics may include examples such as recommendation engines, digital mirror, customer journey, bloom filters, fuzzy join applications.


text:
Jennifer Aniston and Adam Sandler's Murder Mystery is Netflix's most watched title on 73 MILLION
Netflix released its very own 2019 wrap up on Monday, revealing its top 10 movies, series and documentary releases.
Claiming the overall spot of the most popular release for 2019 was Murder Mystery – the comedic mystery starring Jennifer Aniston and Adam Sandler.
Released in June, the 97 minute movie broke the streaming service's three-day viewership record and went on to claim 73 million viewers within the first four weeks.
The streaming service, which boasts more than 158 million subscribers around the world, has always been secretive about its viewing figures. It only selectively releases viewership figures for programming it considers a hit, and the numbers are not verified by a third party.
Stranger Things came in second, followed by the Michael Bay action movie 6 Underground. The animated movie Incredibles 2 and Martin Scorsese's gangster film The Irishman took the fourth and fifth spots, respectively.
Netflix stated via Twitter on Monday that the 'lists were ranked based on accounts that chose to watch two minutes or more of a title during its first 28 days.'
Jennifer Aniston and Adam Sandler's Murder Mystery film has topped Netflix's most watched title, with 73 million people tuning in within the first four weeks of the title's release
Top titles that were released this month, such as Kevin Hart: Don't F**k This Up (December 27) and You: S2 (December 26), were given viewing predictions.
The stats come after a Netflix spokesperson told EW earlier in the year that a view was only counted 'when it surpassed 70 per cent of the run time (including credits)'.
TOP 10 MOST POPULAR NETFLIX RELEASES OF 2019
1. Murder Mystery
3 3. 6 underground
4. The Incredibles 2
5. The Irishman
6. The Witcher
7. Triple Frontier
8. Extremely Wicked, Shockingly Evil and Vile
9. The Umbrella Academy
10. The Highwaymen
Ranking based on the number of households watching at least two minutes of the show during its first 28 days on Netflix in 2019
All of Netflix's top 10 titles were Netflix originals – besides number four, The Incredibles 2.
British royal series 'The Crown,' whose first two seasons cost a reported $130 million to make, did not appear in the top 10 list for either the U.S. or the UK or Canada despite having won major awards, including for its leading actors. Season 3 was released in November and Netflix did not supply any viewing data.
Executives at Netflix have said they plan to be more transparent with audience data to satisfy Hollywood producers and stars and to help viewers decide what to watch.
The limited details on what grabbed Netflix viewers' attention this year came ahead of the company's January 21 quarterly earnings report, which will disclose revenue and membership by region for the first time.
The streaming heavyweight is facing new competition, particularly from Walt Disney Co, which has been removing its movies from Netflix and putting them on the Disney+ streaming service.
Netflix shares have risen 23 per cent this year, the smallest annual rise in three years. The S&P 500 Index is up 29 per cent for the year.
1. Murder Mystery:
On June 18, Netflix reported that 30.9 million households had watched the film in the first 72 hours.
And while the it appears to have annihilated the competition, it still stands with a 6/10 rating on IMDb, a 45 per cent on Rotten Tomatoes and a low 38 per cent on Metacritic.
Murder Mystery went on to be nominated for three Teen Choice Awards and Four People's Choice Awards.
It won one out of the seven – People's Choice Award for Favorite Comedic Movie.
The film saw Jennifer and Adam's characters get caught up in a murder investigation on a billionaire's yacht.
2. Stranger Things – Season 3:
Stranger Things' third season was revealed to be its most watched to date – seeing 64 million views in its first four weeks.
Stranger Things' third season was revealed to be its most watched to date – seeing 64 million views in its first four weeks
The third series was released over the July 4 weekend and saw an average of 26.4 million viewers in just the US.
The premiere episode saw 19.2 million viewers – a 7 per cent increase from the 17.1 million viewers of the premiere episode of season two.
According to Nielsen, by the end of the first release day on July 4, 824,000 viewers had already streamed the entire eight-episode season.
Stranger Things season three, saw the kids, Eleven (Millie Bobby Brown), Mike (Finn Wolfhard), Lucas (Caleb McLaughlin), Max (Sadie Sink), Will (Noah Schnapp) and Dustin (Gaten Matarazzo) back together during the summer of 1985 where the monsters from the Upside Down make a return.
3. 6 Underground:
6 Underground landed the third spot in the overall most popular release and second spot as the most popular movie, following Murder Mystery.
The 128 minute action-thriller which had a $150 million budget, stars Ryan Reynolds, Melanie Laurent and Manuel Garcia-Rulfo.
6 underground sees Ryan's character, an unnamed American billionaire and philanthropist, fake his own death to form an anonymous vigilante squad.
His plan takes place four years after he witnessed a horrible regime in Turgistan to take down criminals and terrorists that the governments continue to ignore.
He names himself, One, and recruits five other people to leave their pasts to join him as ghosts.
Together, they have, Two, a spy, Three, a hit-man, Four, a parkour runner/thief, Five, a doctor, and Six, a driver.
6 Underground landed the third spot in the overall most popular release and second spot as the most popular movie, following Murder Mystery (Ryan Reynolds is pictured left at the premiere in December). In the most popular nonfiction category, Marie Kondo's, Tidying Up With Marie Kondo, right sparked the most joy, claiming the top spot
In the most popular nonfiction category, Marie Kondo's, Tidying Up With Marie Kondo, sparked the most joy, claiming the top spot.
Conversations With a Killer: The Ted Bundy Tapes: Limited Series was the most popular documentary release, with Our Planet, FYRE: The Greatest Party That Never happened and Queen Bee's, HOMECOMING: A film by Beyonce, following behind.
And despite being released on December 27, Kevin Hart's Don't F**k This Up was named the 10th most popular documentary release of 2019.
Dave Chappelle: Sticks and Stones, topped the comedy special, with Ellen DeGeneres', Relatable' not even making the top ten.
Kevin Hart: Irresponsible, Gabriel 'Fluffy' Iglesias: One Show Fits All and Ken Jeong: You Complete Me, Ho, followed behind.
Amy Schumer placed fifth for, Growing, and was joined by Wanda Sykes: Not Normal, at spot nine as the only females to make the list.
Three days in! Despite being released on December 27, Kevin Hart's Don't F**k This Up was named the 10th most popular documentary release of 2019
TOP 10 MOST POPULAR NETFLIX MOVIES OF 2019
Wreck-It Ralph 2
TOP 10 MOST POPULAR NETFLIX SERIES OF 2019
Stranger Things: Season 3
you: Season 2


text:
De-Arabization of Iran
Topic: De-Arabization of Iran
De-Arabization of Iran: a Mission for all Iranians
Persian Journal ^ | 11/24/05 | Bahman Aghai Diba
Iranians are not Arabs. The people of Iran do not care what is happening in Palestine. Even if they do, their feeling is in the same level as they care for the "Chechens in Russia". The feeling is mutual. Arabs look at Iran as another Israel. They do not see Iranians as Muslims. Iran is not admitted to any gathering of the Arabs.
These things are shocking for almost all of the people in the Western countries.
This means that the Iranians have not done their share of struggle to demonstrate to the people of the world that Iran has a civilization and culture different from Arabs and although Iranians are mostly Muslim, they do not have much respect for the mediums of the Islam, i.e. the nomadic Arabs who invaded Iran. It is an important mission for the Iranians to make this distinction known.
The treacherous Islamic regime of the Islamic Republic Iran, which does not represent the people of Iran and at the same time, it is ideologically hostage to Arab line of thinking, has been trying for the last quarter of century to spread Arabization in Iran. This is a mission and a duty for all Iranians, especially those who live in the other countries and enjoy the fruits of the freedom of expression, to show that Iran is a country different from Arabs from all points of view.
This is not a mission aimed against the Arab people or countries. It is defense of the separate identity of Iranians. The Arabs have been doing the same thing since the advent of Islam among the nomadic Arabs in the present day Saudi Arabia. They have been praised for conquering the Great Empire of Iran and trying to impose their culture over the people of Iran. The identity of Iranians was so important that unlike all other countries conquered and culturally devastated by Arabs (like Egypt, which received the recycled religion of the ancient Egyptians through Islam), Iran never given up its cultural identity and even Iranians have invented the Shiite sect of Islam as a defense against the main stream Sunni Islam. The Arabs have been criticizing Iranians since then for the invention of Shiitism.
The modern day Arabs do not trust Iran too. Even when the regime of Iran speaks against Israel or in defense of the Palestinians, the Arabs feel that an outsider is interfering in the affairs of their "Arab bothers". Among the Arab countries, Syria has made itself closer to the regime of Iran due to:
1- Getting cheap oil from the Islamic Republic of Iran.
2- Thousands of Iranians go to Syria each year to spend money.
3- Syria gets all kinds of weapons from Iran (or Iran pays the cost) and they give them to the Palestinians groups that follow the Syrian line. The Syrian line is aimed at getting advantages form Israel for Syria. This system was established by the Hafez Assad, the Bismarck of Arab world.
However, even the Bismarck of the Arab world and his son has never supported the rights of Iran in any occasion. The Syrians along with all other Arab countries, especially the members of the Gulf Cooperation Council [the Iranian regime always puts a "Persian" before the name of the "GCC" to give the impression that Arabs have acknowledged the historical name of the Persian Gulf, while in fact the name of "GCC" is another example of the violation of the Iranian rights by the Arabs] have been condemning Iran for occupying the three islands claimed by the United Arab Emirate (UAE). However, they have intentionally forgotten that Iran played the most important role in creation of the UAE. There was no UAE at the time that Iran took back some of its islands and failed to get others (especially Bahrain) in order to pave way for independence of the UAE.
Almost in every occasion, including the Persian GUlf Cooperation Council's meetings at all levels and the sessions of the Arab League, at least once and sometimes repeatedly, the Arab countries support the baseless claims of the UAE against Iran.
It is the duty of every Iranian to reciprocate this heart felt feeling. The people of Iran, unlike the government of the Islamic Republic of Iran, do not feel any obligation to support the nationalistic and Arab oriented policies of any Arab group (including and especially the Palestinians), and any Arab country (especially Syria).
Here are some of the practical ways for defending the cultural identity of Iran, as a separate culture from the Arabs:
1- Take out Arabic words from your language as much as possible.
2- Do not listen to any speaker who uses too many Arabic words, especially the Mullahs.
3- Try to explain for as many as possible people around you, starting from the family members, and extending to the people you meet at work place, neighborhood and so on and take any occasion to explain that Iranians are not Arabs.
4- Explain your Iranian sentiments about the nomadic Arabs who invaded Iran in every occasion.
5- Do not let the issues about Islam, as a religion, which is like any other, block your view about the barbaric Arabs who plundered Iran and changed the fate of a civilized nation to the course of nomadic Arabs.
6- Find new ways to do this task and let others know them.
http://www.iranian.ws/iran_news/publ...le_11026.shtml
Just an informative piece to educate guys on the Iranian side of the story and how we, iranians, are trying to get rid of what has been imposed upon us.
thnx for attention!
What comes to my mind is that I have no clue how large the group is that you are talking about.
Is it not so that the "Iranians" who benefit from the mullah-rule do not share this view? And I'll bet they call themselves Iranian too. I am genuinly interested in the seculair group versus clerical group and all the things revolving around that...


text:
«Тираноборцы» () — бронзовый древнегреческий памятник в виде скульптурной группы. Был хорошо известен в древнем мире в двух основных версиях, но сохранился только в римских мраморных копиях.

Памятник был посвящён древнегреческим афинским гражданам — Гармодию и Аристогитону, совершившим в 514 году до н. э. покушение на братьев-тиранов Гиппия и Гиппарха, в результате чего они убили последнего и погибли сами. После свержения тирании и установления в Афинах первой в мире демократии Гармодий и Аристогитон стали знаковыми фигурами борьбы против тирании.

Первая версия памятника, выполненная скульптором Антенором и возведённая в Афинской агоре, была украдена персами, когда они оккупировали Афины в 480 году до н. э. во время греко-персидских войн, и увезена в Сузы. По мнению современных историков, она была возвращена в Афины, но впоследствии утрачена.

Чтобы заменить украденную первую версию, афиняне поручили Критию и Несиоту создать новую статую, которая была установлена на рубеже 477—476 годов до н. э.. Скульптурная группа стояла в Агоре ещё во 2-м веке нашей эры, однако и она была утрачена. В отличие от работы Антенора, вторая версия была скопирована и растиражирована ещё в эллинистические и римские времена. Образцовая и наиболее известная мраморная копия времён Адриана находилась в коллекции Фарнезе; теперь её можно увидеть в Национальном археологическом музее Неаполя. В городе Байи были обнаружены гипсовые фрагменты слепков, сделанных с оригинальной бронзовой группы.

Современные трактовки «Тираноборцев» принадлежат Ивану Коржеву и Вере Мухиной (см. «Рабочий и колхозница»). Слепок начала XX века — в Пушкинском музее.

Литература
 Taylor, Michael W. The Tyrant Slayers: The Heroic Image in Fifth Century B.C. Athenian Art and Politics 2nd ed. 1991.
 Gisela M. A. Richter. The Right Arm of Harmodios, American Journal of Archaeology 32.1 (January — March 1928:1-8).

Примечания

Ссылки
 О памятнике тираноубийцам

Скульптуры из мрамора
Скульптуры Древней Греции
Скульптуры V века до н. э.
Здания и коллекции рода Фарнезе
Скульптуры из собраний Археологического музея Неаполя
Цветаевская коллекция слепков
Агора
Копии древнегреческих скульптур

redpajama_set_name: RedPajamaWikipedia


Before I wrote this article I'll be honest, I didn't really know much about Kendall Jenner…. I've never really watched or been a fan of the Kardashians but even I recognised Kendall as it seems she's the face of so many iconic brands. Chanel, Topshop, Balmain, Fendi, Calvin Klein and even creating a killer lipstick for Estee Lauder, it seems Kendall really is the 'it girl' of the moment!
Looking at pictures of her style I'd say she is very casual, sporty and laid-back, really just sticking to a classic pair of jeans and a T-shirt. But she tends to get glammed up for special events and looks gorgeous. She has pretty much the perfect figure so she basically would look amazing in anything!
I must say I'm not the greatest fan of Kendall's overall style. I think during the day she plays it very safe and dare I say boring? On special events she glams up but even then I feel she doesn't really have a signature look or iconic style yet. I loved a recent picture of her in a denim 70's jumpsuit but other than that she seems to stick to rather casual outfits that lack a certain something for me. There's no denying she is absolutely stunning and looks gorgeous in anything but I feel she needs to express herself a bit more through her outfit choices and experiment a bit.
A slightly more 'rock chick' look here, but again not really feeling this outfit… It's very 'I'm going to my first ever gig' and teamed with the tan boots it just doesn't work for me!
Yes! This is killer! If I had Kendall's figure I would wear this everyday. She pulls of major 70's vibes effortlessly and teamed with a tan belt, boots and gorgeous bag she looks incredible! Definitely a 5/5 for this one!
This coat is seriously unreal and the pastel colour is gorgeous but the shiny black jeggings…I feel they look a tad, dare I say, tacky?!
Big fan of this one. It's casual and plain yet looks very elegant and chic. The red turtle neck is gorgeous and I love the cut of the jeans and the brogues too. This gets a big thumbs up from me!
Unreal! This gorgeous monochrome, checked suit is just gorgeous. It screams coco chanel and teamed with holly golightly style sunglasses, it's just dreamy!
I do quite like the print of the dress but…it doesn't quite work for me especially with the shoes.
Overall I'll rate Kendall a 3/5.


text:
Double bridge replacement for ALE
By Leila Steed2019-07-23T10:24:00+01:00
ALE jacks down one of the new bridges into place as part of a double bridge replacement in Newcastle, UK
ALE has completed a double bridge replacement in under 110 hours in Newcastle, UK.
The two bridges, which help serve 36 million passengers every year, were replaced as part of a modernisation project for the region's metro system.
To carry out the replacement, ALE first had to remove the old bridges. The 55 tonne structures were jacked up off the abutments using climbing jacks mounted on self propelled modular transporter (SPMT) trailer beds, before transporting them to a laydown area almost a mile (1.5 km) away.
Weighing 200 tonnes, the new bridges were transported to the site and jacked down into position and installed.
Each of the transport moves were carried out using 24 axle lines of SPMT in a 2 x 4 file 6 configuration, with the bridges supported using ALE trestles. Multiple items of street furniture were removed to facilitate the transport, which required the co-ordination of numerous parties, including multiple energy companies and two local councils.
ALE was given just 52 hours to complete each replacement over consecutive weekends, to minimise disruption to traffic.
The bridge replacements required ALE to first remove the old bridges, weighing 55 tonnes, and then install the new ones, which weighed 200 tonnes.
ALE installs 2,100 tonne bridge
A 2,100 tonne bridge links Azerbaijan hotel's two towers at 120 metres in the air
New bridge by ALE
Strand jacks make quick bridge lift over a reservoir in Spain
Quick recovery by ALE
ALE puts a ship to rights in a fast turnaround recovery operation


Points to simple body parts.
Asks for common foods by name (pronunciation may be unclear).
Beginning to use two-word combinations.
Identifies body parts, basic animals, and common items around home.
Speech is becoming more accurate but child may still elave off ending sounds.
Sings familiar songs with common actions.
Children are connecting and coordinating many ideas into a single sentence.
Uses most speech sounds but may distort some of the more difficult sounds such as l, r, s, sh, ch, y, v, z, and th.
Groups objects such as clothes, foods, animals, etc.
Unfamiliar listeners are able to understand 90% of what child has said.
Describes how to do things.


text:
"""Tails the oplog of a shard and returns entries
"""

import logging

import bson

try:
    import Queue as queue
except ImportError:
    import queue
import sys
import time
import threading

import pymongo

from pymongo import CursorType

from doc_managers import global_variable

from mongo_connector import errors, util
from mongo_connector.constants import DEFAULT_BATCH_SIZE
from mongo_connector.gridfs_file import GridFSFile
from mongo_connector.util import log_fatal_exceptions, retry_until_ok

LOG = logging.getLogger(__name__)

class ReplicationLagLogger(threading.Thread):
    """Thread that periodically logs the current replication lag.
    """

    def __init__(self, opman, interval):
        super(ReplicationLagLogger, self).__init__()
        self.opman = opman
        self.interval = interval
        self.daemon = True

    def log_replication_lag(self):
        checkpoint = self.opman.checkpoint
        if checkpoint is None:
            return
        newest_write = retry_until_ok(self.opman.get_last_oplog_timestamp)
        if newest_write < checkpoint:
            # OplogThread will perform a rollback, don't log anything
            return
        lag_secs = newest_write.time - checkpoint.time
        if lag_secs > 0:
            LOG.info("OplogThread for replica set '%s' is %s seconds behind "
                     "the oplog.",
                     self.opman.replset_name, lag_secs)
        else:
            lag_inc = newest_write.inc - checkpoint.inc
            if lag_inc > 0:
                LOG.info("OplogThread for replica set '%s' is %s entries "
                         "behind the oplog.",
                         self.opman.replset_name, lag_inc)
            else:
                LOG.info("OplogThread for replica set '%s' is up to date "
                         "with the oplog.",
                         self.opman.replset_name)

    def run(self):
        while self.opman.is_alive():
            self.log_replication_lag()
            time.sleep(self.interval)

class OplogThread(threading.Thread):
    """Thread that tails an oplog.

    Calls the appropriate method on DocManagers for each relevant oplog entry.
    """

    def __init__(self, primary_client, doc_managers,
                 oplog_progress_dict, namespace_config,
                 mongos_client=None, **kwargs):
        super(OplogThread, self).__init__()

        self.batch_size = kwargs.get('batch_size', DEFAULT_BATCH_SIZE)

        # The connection to the primary for this replicaSet.
        self.primary_client = primary_client

        # The connection to the mongos, if there is one.
        self.mongos_client = mongos_client

        # Are we allowed to perform a collection dump?
        self.collection_dump = kwargs.get('collection_dump', True)

        # The document manager for each target system.
        # These are the same for all threads.
        self.doc_managers = doc_managers

        # Boolean describing whether or not the thread is running.
        self.running = True

        # Stores the timestamp of the last oplog entry read.
        self.checkpoint = None

        # A dictionary that stores OplogThread/timestamp pairs.
        # Represents the last checkpoint for a OplogThread.
        self.oplog_progress = oplog_progress_dict

        # The namespace configuration
        self.namespace_config = namespace_config

        # Whether the collection dump gracefully handles exceptions
        self.continue_on_error = kwargs.get('continue_on_error', False)

        LOG.info('OplogThread: Initializing oplog thread')

        self.oplog = self.primary_client.local.oplog.rs
        self.replset_name = (
            self.primary_client.admin.command('ismaster')['setName'])

        if not self.oplog.find_one():
            err_msg = 'OplogThread: No oplog for thread:'
            LOG.warning('%s %s' % (err_msg, self.primary_client))

        #################################################
        # DBUS:
        self.message_status_queue = global_variable.message_status_queue
        ###################################################################

    def _should_skip_entry(self, entry):
        """Determine if this oplog entry should be skipped.

        This has the possible side effect of modifying the entry's namespace
        and filtering fields from updates and inserts.
        """
        # Don't replicate entries resulting from chunk moves
        if entry.get("fromMigrate"):
            return True, False

        # Ignore no-ops
        if entry['op'] == 'n':
            return True, False
        ns = entry['ns']

        if '.' not in ns:
            return True, False
        coll = ns.split('.', 1)[1]

        # Ignore system collections
        if coll.startswith("system."):
            return True, False

        # Ignore GridFS chunks
        if coll.endswith('.chunks'):
            return True, False

        is_gridfs_file = False
        if coll.endswith(".files"):
            ns = ns[:-len(".files")]
            if self.namespace_config.gridfs_namespace(ns):
                is_gridfs_file = True
            else:
                return True, False

        # Commands should not be ignored, filtered, or renamed. Renaming is
        # handled by the DocManagers via the CommandHelper class.
        if coll == "$cmd":
            return False, False

        # Rename or filter out namespaces that are ignored keeping
        # included gridfs namespaces.
        namespace = self.namespace_config.lookup(ns)
        if namespace is None:
            LOG.debug("OplogThread: Skipping oplog entry: "
                      "'%s' is not in the namespace configuration." % (ns,))
            return True, False

        # Update the namespace.
        entry['ns'] = namespace.dest_name

        # Take fields out of the oplog entry that shouldn't be replicated.
        # This may nullify the document if there's nothing to do.
        if not self.filter_oplog_entry(
                entry, include_fields=namespace.include_fields,
                exclude_fields=namespace.exclude_fields):
            return True, False
        return False, is_gridfs_file

    ###############################################################################
    # DBUS: ximei : 没有用上  2018.03.19
    # # update newest timestamp and if have failed message, then get new cursor
    # def _update_message_queue(self):
    #     with self.message_status_queue as message_queue:
    #         commit_element = message_queue.commit_point()
    #         update_timestamp = commit_element.key
    #         if update_timestamp is not None:
    #             print "*********  update_timestamp is: " + str(update_timestamp)
    #             self.update_checkpoint(util.long_to_bson_ts(update_timestamp))
    #             message_queue.pop_ok_elements()
    #         seek_element = message_queue.seek_point()
    #         if seek_element is not None:
    #             # when have failed element, then get new cursor
    #             # cursor = self.get_oplog_cursor(seek_element.key)
    #             return False
    #     # cursor = self.get_oplog_cursor()
    #     # return cursor, self._cursor_empty(cursor)

    ##############################################################################################################

    @log_fatal_exceptions
    def run(self):
        """Start the oplog worker.
        """
        ReplicationLagLogger(self, 30).start()
        LOG.debug("OplogThread: Run thread started")
        while self.running is True:
            # 妲珅添加reload实现
            LOG.debug("OplogThread: Getting need_reload")
            need_reload = retry_until_ok(self.init_needreload)
            LOG.critical("111 need_reload: " + str(need_reload))
            if need_reload:
                print "do reload event"
                for docman in self.doc_managers:
                    docman.load_schema_tables()

            # 妲珅添加礼貌退出功能
            LOG.debug("OplogThread: Getting thread_alive")
            thread_alive = global_variable.thread_alive
            if not thread_alive:
                for docman in self.doc_managers:
                    docman.stop()
                self.running = False

            LOG.debug("OplogThread: Getting cursor")
            cursor, cursor_empty = retry_until_ok(self.init_cursor)
            LOG.debug("get cursor")
            # we've fallen too far behind
            if cursor is None and self.checkpoint is not None:
                err_msg = "OplogThread: Last entry no longer in oplog"
                effect = "cannot recover!"
                LOG.error('%s %s %s' % (err_msg, effect, self.oplog))
                self.running = False
                global_variable.thread_alive = False

                continue

            if cursor_empty:
                LOG.debug("OplogThread: Last entry is the one we "
                          "already processed.  Up to date.  Sleeping.")
                time.sleep(1)
                continue

            last_ts = None
            remove_inc = 0
            insert_inc = 0
            update_inc = 0
            try:
                LOG.debug("OplogThread: about to process new oplog entries")
                while cursor.alive and self.running:
                    # 妲珅添加reload实现
                    LOG.debug("OplogThread: Getting need_reload")
                    need_reload = retry_until_ok(self.init_needreload)
                    if need_reload:
                        print "do reload event"
                        for docman in self.doc_managers:
                            docman.load_schema_tables()

                    # 妲珅添加礼貌退出功能
                    LOG.debug("OplogThread: Getting thread_alive")
                    thread_alive = global_variable.thread_alive
                    if not thread_alive:
                        for docman in self.doc_managers:
                            docman.stop()
                        self.running = False

                    LOG.debug("OplogThread: Cursor is still"
                              " alive and thread is still running.")
                    for n, entry in enumerate(cursor):
                        # Break out if this thread should stop
                        if not self.running:
                            break

                        #############################################################################
                        # 妲珅:判断放的地方不对,应该放到外层循环
                        # DBUS: 2 oplog thread and kafka_ctrl thread exit, Politely exit
                        # docman_alive_flag = True
                        # for docman in self.doc_managers:
                        #     if not global_variable.thread_alive:
                        #         docman.stop()
                        #         docman_alive_flag = False
                        #
                        # if not docman_alive_flag:
                        #     break
                        #############################################################################

                        LOG.debug("OplogThread: Iterating through cursor,"
                                  " document number in this cursor is %d"
                                  % n)

                        skip, is_gridfs_file = self._should_skip_entry(entry)
                        if skip:
                            # update the last_ts on skipped entries to ensure
                            # our checkpoint does not fall off the oplog. This
                            # also prevents reprocessing skipped entries.
                            last_ts = entry['ts']
                            continue

                        # Sync the current oplog operation
                        operation = entry['op']
                        ns = entry['ns']
                        timestamp = util.bson_ts_to_long(entry['ts'])
                        for docman in self.doc_managers:
                            try:
                                LOG.debug("OplogThread: Operation for this "
                                          "entry is %s" % str(operation))

                                # Remove
                                if operation == 'd':
                                    # DBUS: docman.remove(entry['o']['_id'], ns, timestamp)
                                    docman.remove(entry, ns, timestamp)
                                    remove_inc += 1

                                # Insert
                                elif operation == 'i':
                                    # Retrieve inserted document from
                                    # 'o' field in oplog record
                                    doc = entry.get('o')
                                    # Extract timestamp and namespace
                                    if is_gridfs_file:
                                        '''
                                        db, coll = ns.split('.', 1)
                                        gridfile = GridFSFile(
                                            self.primary_client[db][coll],
                                            doc)
                                        docman.insert_file(
                                            gridfile, ns, timestamp)
                                        '''
                                        LOG.info("this is gridfs, and we don't support gridfs")
                                    else:
                                        # DBUS: docman.upsert(doc, ns, timestamp)
                                        docman.insert(entry, ns, timestamp)
                                    insert_inc += 1

                                # Update
                                elif operation == 'u':
                                    # DBUS: docman.update(entry['o2']['_id'], entry['o'], ns, timestamp)
                                    docman.update(entry, ns, timestamp)
                                    update_inc += 1

                                # Command
                                elif operation == 'c':
                                    # use unmapped namespace
                                    # DBUS:  doc = entry.get('o')
                                    # DBUS:  docman.handle_command(doc, entry['ns'], timestamp)
                                    docman.handle_command(entry, entry['ns'], timestamp)

                            except errors.OperationFailed:
                                LOG.exception(
                                    "Unable to process oplog document %r"
                                    % entry)
                            except errors.ConnectionFailed:
                                LOG.exception(
                                    "Connection failed while processing oplog "
                                    "document %r" % entry)

                        if (remove_inc + insert_inc + update_inc) % 1000 == 0:
                            LOG.debug(
                                "OplogThread: Documents removed: %d, "
                                "inserted: %d, updated: %d so far" % (
                                    remove_inc, insert_inc, update_inc))

                        LOG.debug("OplogThread: Doc is processed.")

                        # last_ts = entry['ts']

                        # update timestamp per batch size
                        # n % -1 (default for self.batch_size) == 0 for all n
                        # DBUS:  async commit checkpoint
                        if (remove_inc + insert_inc + update_inc) % self.batch_size == 0:
                            # last_ts = None

                            ##################################################
                            #  search send status dict to find the last timestamp in the dict
                            with self.message_status_queue as message_queue:
                                LOG.debug("*********  message_status_queue size: %d " % message_queue.size())
                                commit_element = message_queue.commit_point()
                                if commit_element is not None:
                                    update_timestamp = commit_element.key
                                    LOG.debug("*********  update_timestamp is: " + str(update_timestamp))
                                    self.update_checkpoint(util.long_to_bson_ts(update_timestamp))
                                    message_queue.pop_ok_elements()

                                failed_element = message_queue.seek_failed_point()
                                if failed_element is not None:
                                    self.update_checkpoint(util.long_to_bson_ts(update_timestamp))
                                    break

                                if message_queue.size() > 1000:
                                    LOG.debug("*********  n %d sleep" % n)
                                    time.sleep(2)
                            ####################################################################

                    # update timestamp after running through oplog
                    if last_ts is not None:
                        LOG.debug("OplogThread: updating checkpoint after "
                                  "processing new oplog entries")
                        # self.update_checkpoint(last_ts)

                    ##################################################
                    # # search send status dict to find the last timestamp in the dict
                    with self.message_status_queue as message_queue:
                        LOG.debug("*********  message_status_queue size: %d " % message_queue.size())
                        commit_element = message_queue.commit_point()
                        # checking whether commit_elment is null
                        if commit_element is not None:
                            update_timestamp = commit_element.key
                            # if update_timestamp is not None:
                            LOG.debug("*********  update_timestamp is: " + str(update_timestamp))
                            self.update_checkpoint(util.long_to_bson_ts(update_timestamp))
                            message_queue.pop_ok_elements()

                        failed_element = message_queue.seek_failed_point()
                        if failed_element is not None:
                            self.update_checkpoint(util.long_to_bson_ts(update_timestamp))
                            break

                        if message_queue.size() > 1000:
                            LOG.debug("*********  n %d sleep" % n)
                            time.sleep(2)
                    # reload cursor
                    #  感觉不对,应该删除
                    # if cursor.alive is False:
                    #    continue
                    ####################################################################

            except (pymongo.errors.AutoReconnect,
                    pymongo.errors.OperationFailure,
                    pymongo.errors.ConfigurationError):
                LOG.exception(
                    "Cursor closed due to an exception. "
                    "Will attempt to reconnect.")

            # update timestamp before attempting to reconnect to MongoDB,
            # after being join()'ed, or if the cursor closes
            if last_ts is not None:
                LOG.debug("OplogThread: updating checkpoint after an "
                          "Exception, cursor closing, or join() on this"
                          "thread.")
                # self.update_checkpoint(last_ts)

            ##################################################
            # # search send status dict to find the last timestamp in the dict
            with self.message_status_queue as message_queue:
                LOG.debug("*********  message_status_queue size: %d " % message_queue.size())
                commit_element = message_queue.commit_point()
                if commit_element is not None:
                    update_timestamp = commit_element.key
                    # if update_timestamp is not None:
                    LOG.debug("*********  update_timestamp is: " + str(update_timestamp))
                    self.update_checkpoint(util.long_to_bson_ts(update_timestamp))
                    message_queue.pop_ok_elements()

                failed_element = message_queue.seek_failed_point()
                if failed_element is not None:
                    self.update_checkpoint(util.long_to_bson_ts(update_timestamp))

            LOG.debug("OplogThread: Sleeping. Documents removed: %d, "
                      "inserted: %d, updated: %d"
                      % (remove_inc, insert_inc, update_inc))
            time.sleep(2)

    def join(self):
        """Stop this thread from managing the oplog.
        """
        LOG.debug("OplogThread: exiting due to join call.")
        self.running = False
        threading.Thread.join(self)

    @classmethod
    def _find_field(cls, field, doc):
        """Find the field in the document which matches the given field.

        The field may be in dot notation, eg "a.b.c". Returns a list with
        a single tuple (path, field_value) or the empty list if the field
        is not present.
        """
        path = field.split('.')
        try:
            for key in path:
                doc = doc[key]
            return [(path, doc)]
        except (KeyError, TypeError):
            return []

    @classmethod
    def _find_update_fields(cls, field, doc):
        """Find the fields in the update document which match the given field.

        Both the field and the top level keys in the doc may be in dot
        notation, eg "a.b.c". Returns a list of tuples (path, field_value) or
        the empty list if the field is not present.
        """

        def find_partial_matches():
            for key in doc:
                if len(key) > len(field):
                    # Handle case where field is a prefix of key, eg field is
                    # 'a' and key is 'a.b'.
                    if key.startswith(field) and key[len(field)] == '.':
                        yield [key], doc[key]
                        # Continue searching, there may be multiple matches.
                        # For example, field 'a' should match 'a.b' and 'a.c'.
                elif len(key) < len(field):
                    # Handle case where key is a prefix of field, eg field is
                    # 'a.b' and key is 'a'.
                    if field.startswith(key) and field[len(key)] == '.':
                        # Search for the remaining part of the field
                        matched = cls._find_field(field[len(key) + 1:],
                                                  doc[key])
                        if matched:
                            # Add the top level key to the path.
                            match = matched[0]
                            match[0].insert(0, key)
                            yield match
                        # Stop searching, it's not possible for any other
                        # keys in the update doc to match this field.
                        return

        try:
            return [([field], doc[field])]
        except KeyError:
            # Field does not exactly match any key in the update doc.
            return list(find_partial_matches())

    def _pop_excluded_fields(self, doc, exclude_fields, update=False):
        # Remove all the fields that were passed in exclude_fields.
        find_fields = self._find_update_fields if update else self._find_field
        for field in exclude_fields:
            for path, _ in find_fields(field, doc):
                # Delete each matching field in the original document.
                temp_doc = doc
                for p in path[:-1]:
                    temp_doc = temp_doc[p]
                temp_doc.pop(path[-1])

        return doc  # Need this to be similar to copy_included_fields.

    def _copy_included_fields(self, doc, include_fields, update=False):
        new_doc = {}
        find_fields = self._find_update_fields if update else self._find_field
        for field in include_fields:
            for path, value in find_fields(field, doc):
                # Copy each matching field in the original document.
                temp_doc = new_doc
                for p in path[:-1]:
                    temp_doc = temp_doc.setdefault(p, {})
                temp_doc[path[-1]] = value

        return new_doc

    def filter_oplog_entry(self, entry, include_fields=None,
                           exclude_fields=None):
        """Remove fields from an oplog entry that should not be replicated.

        NOTE: this does not support array indexing, for example 'a.b.2'"""
        if not include_fields and not exclude_fields:
            return entry
        elif include_fields:
            filter_fields = self._copy_included_fields
        else:
            filter_fields = self._pop_excluded_fields

        fields = include_fields or exclude_fields
        entry_o = entry['o']
        # 'i' indicates an insert. 'o' field is the doc to be inserted.
        if entry['op'] == 'i':
            entry['o'] = filter_fields(entry_o, fields)
        # 'u' indicates an update. The 'o' field describes an update spec
        # if '$set' or '$unset' are present.
        elif entry['op'] == 'u' and ('$set' in entry_o or '$unset' in entry_o):
            if '$set' in entry_o:
                entry['o']["$set"] = filter_fields(
                    entry_o["$set"], fields, update=True)
            if '$unset' in entry_o:
                entry['o']["$unset"] = filter_fields(
                    entry_o["$unset"], fields, update=True)
            # not allowed to have empty $set/$unset, so remove if empty
            if "$set" in entry_o and not entry_o['$set']:
                entry_o.pop("$set")
            if "$unset" in entry_o and not entry_o['$unset']:
                entry_o.pop("$unset")
            if not entry_o:
                return None
        # 'u' indicates an update. The 'o' field is the replacement document
        # if no '$set' or '$unset' are present.
        elif entry['op'] == 'u':
            entry['o'] = filter_fields(entry_o, fields)

        return entry

    def get_oplog_cursor(self, timestamp=None):
        """Get a cursor to the oplog after the given timestamp, excluding
        no-op entries.

        If no timestamp is specified, returns a cursor to the entire oplog.
        """
        query = {'op': {'$ne': 'n'}}
        if timestamp is None:
            cursor = self.oplog.find(
                query,
                cursor_type=CursorType.TAILABLE_AWAIT)
        else:
            query['ts'] = {'$gte': timestamp}
            cursor = self.oplog.find(
                query,
                cursor_type=CursorType.TAILABLE_AWAIT,
                oplog_replay=True)
        return cursor

    def get_collection(self, namespace):
        """Get a pymongo collection from a namespace."""
        database, coll = namespace.split('.', 1)
        return self.primary_client[database][coll]

    def dump_collection(self):
        """Dumps collection into the target system.

        This method is called when we're initializing the cursor and have no
        configs i.e. when we're starting for the first time.
        """

        timestamp = retry_until_ok(self.get_last_oplog_timestamp)
        if timestamp is None:
            return None
        long_ts = util.bson_ts_to_long(timestamp)
        # Flag if this oplog thread was cancelled during the collection dump.
        # Use a list to workaround python scoping.
        dump_cancelled = [False]

        def get_all_ns():
            ns_set = []
            gridfs_ns_set = []
            db_list = self.namespace_config.get_included_databases()
            if not db_list:
                # Only use listDatabases when the configured databases are not
                # explicit.
                db_list = retry_until_ok(self.primary_client.database_names)
            for database in db_list:
                if database == "config" or database == "local":
                    continue
                coll_list = retry_until_ok(
                    self.primary_client[database].collection_names)
                for coll in coll_list:
                    # ignore system collections
                    if coll.startswith("system."):
                        continue
                    # ignore gridfs chunks collections
                    if coll.endswith(".chunks"):
                        continue
                    if coll.endswith(".files"):
                        namespace = "%s.%s" % (database, coll)
                        namespace = namespace[:-len(".files")]
                        if self.namespace_config.gridfs_namespace(namespace):
                            gridfs_ns_set.append(namespace)
                    else:
                        namespace = "%s.%s" % (database, coll)
                        if self.namespace_config.map_namespace(namespace):
                            ns_set.append(namespace)
            return ns_set, gridfs_ns_set

        dump_set, gridfs_dump_set = get_all_ns()

        LOG.debug("OplogThread: Dumping set of collections %s " % dump_set)

        def docs_to_dump(from_coll):
            last_id = None
            attempts = 0
            projection = self.namespace_config.projection(from_coll.full_name)
            # Loop to handle possible AutoReconnect
            while attempts < 60:
                if last_id is None:
                    cursor = retry_until_ok(
                        from_coll.find,
                        projection=projection,
                        sort=[("_id", pymongo.ASCENDING)]
                    )
                else:
                    cursor = retry_until_ok(
                        from_coll.find,
                        {"_id": {"$gt": last_id}},
                        projection=projection,
                        sort=[("_id", pymongo.ASCENDING)]
                    )
                try:
                    for doc in cursor:
                        if not self.running:
                            # Thread was joined while performing the
                            # collection dump.
                            dump_cancelled[0] = True
                            raise StopIteration
                        last_id = doc["_id"]
                        yield doc
                    break
                except (pymongo.errors.AutoReconnect,
                        pymongo.errors.OperationFailure):
                    attempts += 1
                    time.sleep(1)

        def upsert_each(dm):
            num_failed = 0
            for namespace in dump_set:
                from_coll = self.get_collection(namespace)
                mapped_ns = self.namespace_config.map_namespace(namespace)
                total_docs = retry_until_ok(from_coll.count)
                num = None
                for num, doc in enumerate(docs_to_dump(from_coll)):
                    try:
                        dm.upsert(doc, mapped_ns, long_ts)
                    except Exception:
                        if self.continue_on_error:
                            LOG.exception(
                                "Could not upsert document: %r" % doc)
                            num_failed += 1
                        else:
                            raise
                    if num % 10000 == 0:
                        LOG.info("Upserted %d out of approximately %d docs "
                                 "from collection '%s'",
                                 num + 1, total_docs, namespace)
                if num is not None:
                    LOG.info("Upserted %d out of approximately %d docs from "
                             "collection '%s'",
                             num + 1, total_docs, namespace)
            if num_failed > 0:
                LOG.error("Failed to upsert %d docs" % num_failed)

        def upsert_all(dm):
            try:
                for namespace in dump_set:
                    from_coll = self.get_collection(namespace)
                    total_docs = retry_until_ok(from_coll.count)
                    mapped_ns = self.namespace_config.map_namespace(
                        namespace)
                    LOG.info("Bulk upserting approximately %d docs from "
                             "collection '%s'",
                             total_docs, namespace)
                    dm.bulk_upsert(docs_to_dump(from_coll),
                                   mapped_ns, long_ts)
            except Exception:
                if self.continue_on_error:
                    LOG.exception("OplogThread: caught exception"
                                  " during bulk upsert, re-upserting"
                                  " documents serially")
                    upsert_each(dm)
                else:
                    raise

        def do_dump(dm, error_queue):
            try:
                LOG.debug("OplogThread: Using bulk upsert function for "
                          "collection dump")
                upsert_all(dm)

                if gridfs_dump_set:
                    LOG.info("OplogThread: dumping GridFS collections: %s",
                             gridfs_dump_set)

                # Dump GridFS files
                for gridfs_ns in gridfs_dump_set:
                    mongo_coll = self.get_collection(gridfs_ns)
                    from_coll = self.get_collection(gridfs_ns + '.files')
                    dest_ns = self.namespace_config.map_namespace(gridfs_ns)
                    for doc in docs_to_dump(from_coll):
                        gridfile = GridFSFile(mongo_coll, doc)
                        dm.insert_file(gridfile, dest_ns, long_ts)
            except:
                # Likely exceptions:
                # pymongo.errors.OperationFailure,
                # mongo_connector.errors.ConnectionFailed
                # mongo_connector.errors.OperationFailed
                error_queue.put(sys.exc_info())

        # Extra threads (if any) that assist with collection dumps
        dumping_threads = []
        # Did the dump succeed for all target systems?
        dump_success = True
        # Holds any exceptions we can't recover from
        errors = queue.Queue()

        if len(self.doc_managers) == 1:
            do_dump(self.doc_managers[0], errors)
        else:
            # Slight performance gain breaking dump into separate
            # threads if > 1 replication target
            for dm in self.doc_managers:
                t = threading.Thread(target=do_dump, args=(dm, errors))
                dumping_threads.append(t)
                t.start()
            # cleanup
            for t in dumping_threads:
                t.join()

        # Print caught exceptions
        try:
            while True:
                LOG.critical('Exception during collection dump',
                             exc_info=errors.get_nowait())
                dump_success = False
        except queue.Empty:
            pass

        if not dump_success:
            err_msg = "OplogThread: Failed during dump collection"
            effect = "cannot recover!"
            LOG.error('%s %s %s' % (err_msg, effect, self.oplog))
            self.running = False
            return None

        if dump_cancelled[0]:
            LOG.warning('Initial collection dump was interrupted. '
                        'Will re-run the collection dump on next startup.')
            return None

        return timestamp

    def _get_oplog_timestamp(self, newest_entry):
        """Return the timestamp of the latest or earliest entry in the oplog.
        """
        sort_order = pymongo.DESCENDING if newest_entry else pymongo.ASCENDING
        curr = self.oplog.find({'op': {'$ne': 'n'}}).sort(
            '$natural', sort_order
        ).limit(-1)

        try:
            ts = next(curr)['ts']
        except StopIteration:
            LOG.debug("OplogThread: oplog is empty.")
            return None

        LOG.debug("OplogThread: %s oplog entry has timestamp %s."
                  % ('Newest' if newest_entry else 'Oldest', ts))
        return ts

    def get_oldest_oplog_timestamp(self):
        """Return the timestamp of the oldest entry in the oplog.
        """
        return self._get_oplog_timestamp(False)

    def get_last_oplog_timestamp(self):
        """Return the timestamp of the newest entry in the oplog.
        """
        return self._get_oplog_timestamp(True)

    def _cursor_empty(self, cursor):
        try:
            # Tailable cursors can not have singleBatch=True in MongoDB > 3.3
            next(cursor.clone().remove_option(CursorType.TAILABLE_AWAIT)
                 .limit(-1))
            return False
        except StopIteration:
            return True

    def init_needreload(self):
        need_reload = global_variable.need_reload
        return need_reload

    def init_cursor(self):
        """Position the cursor appropriately.

        The cursor is set to either the beginning of the oplog, or
        wherever it was last left off.

        Returns the cursor and True if the cursor is empty.
        """
        timestamp = self.read_last_checkpoint()

        if timestamp is None:
            # DBUS: no full dump
            if self.collection_dump:
                '''
                # dump collection and update checkpoint
                timestamp = self.dump_collection()
                self.update_checkpoint(timestamp)
                # todo
                if timestamp is None:
                    return None, True
                '''
                LOG.info("we don't support dump collection")
            else:
                # Collection dump disabled:
                # Return cursor to beginning of oplog but do not set the
                # checkpoint. The checkpoint will be set after an operation
                # has been applied.
                cursor = self.get_oplog_cursor()
                return cursor, self._cursor_empty(cursor)

        cursor = self.get_oplog_cursor(timestamp)
        cursor_empty = self._cursor_empty(cursor)

        if cursor_empty:
            # rollback, update checkpoint, and retry
            LOG.debug("OplogThread: Initiating rollback from "
                      "get_oplog_cursor")
            # DBUS: do not support rollback sink
            # self.update_checkpoint(self.rollback())
            return self.init_cursor()

        first_oplog_entry = next(cursor)

        oldest_ts_long = util.bson_ts_to_long(
            self.get_oldest_oplog_timestamp())
        checkpoint_ts_long = util.bson_ts_to_long(timestamp)
        if checkpoint_ts_long < oldest_ts_long:
            # We've fallen behind, the checkpoint has fallen off the oplog
            return None, True

        cursor_ts_long = util.bson_ts_to_long(first_oplog_entry["ts"])
        if cursor_ts_long > checkpoint_ts_long:
            # The checkpoint is not present in this oplog and the oplog
            # did not rollover. This means that we connected to a new
            # primary which did not replicate the checkpoint and which has
            # new changes in its oplog for us to process.
            # rollback, update checkpoint, and retry
            LOG.debug("OplogThread: Initiating rollback from "
                      "get_oplog_cursor: new oplog entries found but "
                      "checkpoint is not present")
            # DBUS: do not support rollback sink
            # self.update_checkpoint(self.rollback())
            return self.init_cursor()

        # first entry has been consumed
        return cursor, cursor_empty

    def update_checkpoint(self, checkpoint):
        """Store the current checkpoint in the oplog progress dictionary.
        """
        if checkpoint is not None and checkpoint != self.checkpoint:
            self.checkpoint = checkpoint
            with self.oplog_progress as oplog_prog:
                oplog_dict = oplog_prog.get_dict()
                # If we have the repr of our oplog collection
                # in the dictionary, remove it and replace it
                # with our replica set name.
                # This allows an easy upgrade path from mongo-connector 2.3.
                # For an explanation of the format change, see the comment in
                # read_last_checkpoint.
                oplog_dict.pop(str(self.oplog), None)
                oplog_dict[self.replset_name] = checkpoint
                LOG.debug("OplogThread: oplog checkpoint updated to %s",
                          checkpoint)
        else:
            LOG.debug("OplogThread: no checkpoint to update.")

    def read_last_checkpoint(self):
        """Read the last checkpoint from the oplog progress dictionary.
        """
        # In versions of mongo-connector 2.3 and before,
        # we used the repr of the
        # oplog collection as keys in the oplog_progress dictionary.
        # In versions thereafter, we use the replica set name. For backwards
        # compatibility, we check for both.
        oplog_str = str(self.oplog)

        ret_val = None
        with self.oplog_progress as oplog_prog:
            oplog_dict = oplog_prog.get_dict()
            try:
                # New format.
                ret_val = oplog_dict[self.replset_name]
            except KeyError:
                try:
                    # Old format.
                    ret_val = oplog_dict[oplog_str]
                except KeyError:
                    pass

        LOG.debug("OplogThread: reading last checkpoint as %s " %
                  str(ret_val))
        self.checkpoint = ret_val
        return ret_val

    def rollback(self):
        """Rollback target system to consistent state.

        The strategy is to find the latest timestamp in the target system and
        the largest timestamp in the oplog less than the latest target system
        timestamp. This defines the rollback window and we just roll these
        back until the oplog and target system are in consistent states.
        """
        # Find the most recently inserted document in each target system
        LOG.debug("OplogThread: Initiating rollback sequence to bring "
                  "system into a consistent state.")
        last_docs = []
        for dm in self.doc_managers:
            dm.commit()
            last_docs.append(dm.get_last_doc())

        # Of these documents, which is the most recent?
        last_inserted_doc = max(last_docs,
                                key=lambda x: x["_ts"] if x else float("-inf"))

        # Nothing has been replicated. No need to rollback target systems
        if last_inserted_doc is None:
            return None

        # Find the oplog entry that touched the most recent document.
        # We'll use this to figure where to pick up the oplog later.
        target_ts = util.long_to_bson_ts(last_inserted_doc['_ts'])
        last_oplog_entry = util.retry_until_ok(
            self.oplog.find_one,
            {'ts': {'$lte': target_ts}, 'op': {'$ne': 'n'}},
            sort=[('$natural', pymongo.DESCENDING)]
        )

        LOG.debug("OplogThread: last oplog entry is %s"
                  % str(last_oplog_entry))

        # The oplog entry for the most recent document doesn't exist anymore.
        # If we've fallen behind in the oplog, this will be caught later
        if last_oplog_entry is None:
            return None

        # rollback_cutoff_ts happened *before* the rollback
        rollback_cutoff_ts = last_oplog_entry['ts']
        start_ts = util.bson_ts_to_long(rollback_cutoff_ts)
        # timestamp of the most recent document on any target system
        end_ts = last_inserted_doc['_ts']

        for dm in self.doc_managers:
            rollback_set = {}  # this is a dictionary of ns:list of docs

            # group potentially conflicted documents by namespace
            for doc in dm.search(start_ts, end_ts):
                if doc['ns'] in rollback_set:
                    rollback_set[doc['ns']].append(doc)
                else:
                    rollback_set[doc['ns']] = [doc]

            # retrieve these documents from MongoDB, either updating
            # or removing them in each target system
            for namespace, doc_list in rollback_set.items():
                # Get the original namespace
                original_namespace = self.namespace_config.unmap_namespace(
                    namespace)
                if not original_namespace:
                    original_namespace = namespace

                database, coll = original_namespace.split('.', 1)
                obj_id = bson.objectid.ObjectId
                bson_obj_id_list = [obj_id(doc['_id']) for doc in doc_list]

                # Use connection to whole cluster if in sharded environment.
                client = self.mongos_client or self.primary_client
                to_update = util.retry_until_ok(
                    client[database][coll].find,
                    {'_id': {'$in': bson_obj_id_list}},
                    projection=self.namespace_config.projection(
                        original_namespace)
                )
                # Doc list are docs in target system, to_update are
                # Docs in mongo
                doc_hash = {}  # Hash by _id
                for doc in doc_list:
                    doc_hash[bson.objectid.ObjectId(doc['_id'])] = doc

                to_index = []

                def collect_existing_docs():
                    for doc in to_update:
                        if doc['_id'] in doc_hash:
                            del doc_hash[doc['_id']]
                            to_index.append(doc)

                retry_until_ok(collect_existing_docs)

                # Delete the inconsistent documents
                LOG.debug("OplogThread: Rollback, removing inconsistent "
                          "docs.")
                remov_inc = 0
                for document_id in doc_hash:
                    try:
                        dm.remove(document_id, namespace,
                                  util.bson_ts_to_long(rollback_cutoff_ts))
                        remov_inc += 1
                        LOG.debug(
                            "OplogThread: Rollback, removed %r " % doc)
                    except errors.OperationFailed:
                        LOG.warning(
                            "Could not delete document during rollback: %r "
                            "This can happen if this document was already "
                            "removed by another rollback happening at the "
                            "same time." % doc
                        )

                LOG.debug("OplogThread: Rollback, removed %d docs." %
                          remov_inc)

                # Insert the ones from mongo
                LOG.debug("OplogThread: Rollback, inserting documents "
                          "from mongo.")
                insert_inc = 0
                fail_insert_inc = 0
                for doc in to_index:
                    try:
                        insert_inc += 1
                        dm.insert(doc,
                                  namespace,
                                  util.bson_ts_to_long(rollback_cutoff_ts))
                    except errors.OperationFailed:
                        fail_insert_inc += 1
                        LOG.exception("OplogThread: Rollback, Unable to "
                                      "insert %r" % doc)

        LOG.debug("OplogThread: Rollback, Successfully inserted %d "
                  " documents and failed to insert %d"
                  " documents.  Returning a rollback cutoff time of %s "
                  % (insert_inc, fail_insert_inc, str(rollback_cutoff_ts)))

        return rollback_cutoff_ts

redpajama_set_name: RedPajamaGithub