The ISE PhD degree program prepares students to be research leaders in academic and applied laboratory or industry settings. Our students work with internationally recognized faculty in areas of operations research, production systems, manufacturing, and human factors. The program combines rigorous coursework with supervised research experiences culminating in a significant, independent research project (the PhD dissertation). By the end of the degree program, students have become independent scholars, presenting and publishing their work in peer-reviewed conferences and journals.
The PhD program requires a minimum of 72 credit hours.
Generally, coursework is completed in 2 to 3 years. Courses should be selected by the student with the approval of their advisor (or the graduate director for first year students) and vary based on the primary research interests of the student (operations research, human factors, or production systems/manufacturing), and student research interests. Students should insure they take an appropriate set of courses to prepare for the B-exam in one of three areas.
A minimum of 12 and a maximum of 24 credit hours of dissertation research are required. The variable credit dissertation exists to allow students flexibility to take additional content courses. It does not impact the expectations for the scope and effort of the dissertation.
A maximum of 36 credit hours from a Master's degree(s) may be applied toward the 72 credit hour requirement for the PhD degree. Of these, no more than six credit hours may be derived from a master's thesis. Students may apply transfer credits to waive the course requirements for the specialty area. However, students are still responsible for course content in those courses included on the PhD core examination (the B-exam). Please see the Graduate Director or your academic advisor to discuss transfer courses.
This examination tests the candidate's ability in the core courses and selected elective courses. It is required for formal acceptance into PhD candidacy, and is taken at the end of the first year of study (in May).
The B-exam consists of 5 questions focused on operations research, production systems/manufacturing, or human factors.
The examination is closed-book. Each questions is allotted 45 minutes. Exam questions are set and graded by the faculty member who most recently offered the course. The department faculty determine a pass/fail/undecided grade for each student. Students in the undecided category are offered an oral exam (either overall, or focusing on specific courses) and a subsequent pass/fail decision is made based on their performance. Students who fail the exam have one opportunity to retake the exam, in August.
After passing the B-exam, students should select an advisor based on their research interests. The student-advisor match is one of mutual choice: both the student, and the faculty member, must agree. Students work with their advisor to choose at least two additional faculty members to be a part of the student's committee. The core committee members must be part of the UB Graduate Faculty. Additional committee members beyond three are possible and can be from outside of the University. It is possible to change committee members and advisors during the program. Please consult the Graduate Director for guidance.
The A-exam is scheduled sometime after the majority of course work is completed and the student has selected a dissertation topic (generally before the end of the 3rd year). Content is based on the student's dissertation topic to gauge the student's capability for research in the chosen area. There is a written examination followed by an oral examination. The questions, timing, and format of the exam are determined by the advisor and committee but typically students have 2 to 3 weeks to complete the written portion of the exam. Students can pass, provisionally pass (with requirements for revisions, completion of additional coursework, or other measures set by the committee) or be asked to retake the exam at a later date (only one retake is allowed).
Students should to complete their Application to Candidacy as soon as possible after forming a committee and completing a plan for finishing coursework and their dissertation. Students should seek assistance from the academic coordinator with this form and additional paperwork required.
Students should work closely with their advisor and committee to write a formal dissertation proposal prior to beginning research which the student intends to serve as the dissertation work. The proposal is presented to the committee and defended in through oral examination to determine preparedness and significance of the proposed topic and to insure agreement among the student and committee members regarding the plan of the ultimate dissertation research.
PhD students are required to defend their dissertation in a seminar attended by the PhD committee and which is open to department faculty, students and the public. Students must notify the academic coordinator a minimum of two weeks prior to schedule the defense and provide an abstract and title.
The MS IE and ME degrees provide advanced study beyond the baccalaureate degree for those with initial degrees in IE as well as for those from other disciplines who wish to enter the field. Students admitted to the MS IE program who choose an all course option may select from a variety of broad courses in Industrial Engineering, while students who wish to pursue independent research do so in the areas of human factors, operations research, or production systems/manufacturing (see descriptions below).
The MS and ME program require a minimum of 30 credit hours.
Generally, coursework is completed in 1 to 2 years. Courses should be selected by the student with the approval of their advisor (or the graduate director ) and vary based on the primary interests of the student (general IE, operations research, human factors, or production systems/manufacturing). and whether they will complete a thesis.
A maximum of 6 MS thesis hours or 6 credits of ME project may be applied to the degree. Students must have the approval of an advisor to register for and conduct an MS thesis.
By a formal research thesis representing 3 or 6 credits, satisfactory performance in an oral defense of thesis examination, and completion of 24 or 27 credits of nonthesis course work.
The ME degree is completed through the ME project.


text:
All posts tagged criminal court
Do You Own Your Children?
Do you know who owns your child?
This might seem like a strange question to most… but the answer is even stranger and more terrifying to comprehend.
When a question like this is posed, we the people often look to our legislature and our constitution for the answers, as esoteric and interpretable as those answers may be. But without the rose-colored glasses, we can actually read with our own eyes what the answer to this question is from the eyes and opinion of our government.
Before you can truly attain the answer to this question though, and comprehend how it applies to you and your children, you must first temporarily suspend your emotion, your idealism, and your beliefs. For when we refer to law, these things do not apply. And when it is a corporation that writes these laws, morals, ethics, and values go out the window.
Anger though, for the purpose of the information you are about to receive, is permitted and requested…
First of all, let's clarify that what we are about to see is the opinion of the court system. Courts do not offer "judgment", only "opinion". The justices (not judges) of the "Supreme Court" as well offer nothing but opinion, which then becomes what the BAR association considers to be "Public Policy" or public opinion. The BAR copyrights these opinions then misleadingly calls it the "law".
The side effect of being a consenting citizen of the United States (corporation) is that these copyrighted codes are applied to you with what the U.S.CODE itself calls Prima Facie law (law which derives its authority from presumed consent). Therefore, all branches of government technically operate under presumed law, meaning that the consent of the governed is automatically assumed in all legal matters and decisions based on court opinion.
This, unfortunately, applies to all contracts made with or on behalf of the state…
And one of those contracts is called a "Marriage License".
Yours and your spouses signature on that state-sanctioned and federally registered document signifies a consent-based contract between all three parties – you, your spouse, and the "State".
But don't take my word for it… Let's see what the court system offers in their opinion about this subject?
First, lets visit an Illinois Appellate Court judgment from 1997:
Appellate Court of Illinois, NO. 5-97-0108:
"Marriage is a civil contract to which there are three parties-the husband, the wife and the state."
Van Koten v. Van Koten. 154 N.E. 146.
"…When two people decide to get married, they are required to first procure a license from the State. If they have children of this marriage, they are required by the State to submit their children to certain things, such as school attendance and vaccinations. Furthermore, if at some time in the future the couple decides the marriage is not working, they must petition the State for a divorce. Marriage is a three-party contract between the man, the woman, and the State"
Linneman v. Linneman, 1 Ill. App. 2d 48, 50, 116 N.E.2d 182, 183 (1953), citing Van Koten v. Van Koten, 323 Ill. 323, 326, 154 N.E. 146 (1926).
"The State represents the public interest in the institution of marriage."
Linneman, 1 Ill. App. 2d at 50, 116 N.E.2d at 183 (1953).
"This public interest is what allows the State to intervene in certain situations to protect the interests of members of the family. The State is like a silent partner in the family who is not active in the everyday running of the family but becomes active and exercises its power and authority only when necessary to protect some important interest of family life. Taking all of this into consideration, the question no longer is whether the State has an interest or place in disputes such as the one at bar, but it becomes a question of timing and necessity."
Also, this case law states…
"The state has a wide range of power for limiting parental freedom and authority in things affecting the child's welfare… In fact, the entire familial relationship involves the State."
Prince, 321 U.S. at 167, 64 S.Ct. at 442, 88 L.Ed. 645.
(SOURCE: http://caselaw.findlaw.com/il-court-of-appeals/1486817.html)
Well now… the courts sure do seem to offer the opinion that your child is owned by the state!
But heck, what should we the people (not People) expect?
When such authority and jurisdiction is just arbitrarily handed over to a bunch of attorneys running around in black moo-moos with little wooden hammers yelling that they rule supreme in their houses of judicial worship simply because the state allows them to presume such authority and jurisdiction… I suppose those people who consent to this charade get just what they deserve – slavery through a bondage contract.
But then, when the President of the country is also a lawyer, along with his wife, and for that mater more than half of all U.S. Presidents, 56/100 Senators, over 35% of Congressmen, both "speakers" of the house, and most of the State Governors in office today are all BAR attorneys/lawyers, I suppose we shouldn't be at all surprised that the opinion of the BAR Association is the law of the land…
Of course, the above opinion is not just some isolated case. This opinion is quite general in its purview, and quite common in its legal application. In fact, it is the very basis of the criminal racket we call the dreaded "Child Protective Services (CPS)", which claims its overarching authority from the Federal "Health And Human Services (HHS)" as it legally kidnaps your children.
So where else can we find such blatant power abused so absolutely?
How about in the case of MEADOWS v. MEADOWS, (Aug 2008), in the "Court of Civil Appeals of Alabama"?
"The primary control and custody of infants is with the government."
Tillman V. Roberts. 108 So. 62
"There is no wider area for the exercise of judicial discretion than that of providing for and protecting the best interests of children."
Ex parte Handley, 460 So.2d 167 (Ala.1984).
"The court stands in the position of parens patria[e] of children."
Ayers v. Kelley, 284 Ala. 321, 224 So.2d 673 (1969)․
"…we held that the best interest of the child took precedence over the parent's right to travel."
Everett, 660 So.2d at 601-02.
"In 1984, the Court of Appeals of Idaho ruled that the State had a 'compelling governmental interest' that justified restricting the residence of the custodial parent, holding that the best interests of a child had priority over the parent's right to travel."
Ziegler v. Ziegler, 107 Idaho 527, 691 P.2d 773 (Idaho App.1985) (citing Carlson v. Carlson, 8 Kan.App.2d 564, 661 P.2d 833 (1983)).
**Note: The word "interest", when it is used by the courts on behalf of "the state", should be considered here to be defined in layman's terms as the monetary interest in what the State considers one of its trade-able commodities. For to a for-profit government, people are considered legal "persons", and their value is not in flesh and blood, but in labor and tax. Persons are the original form of legal tender. -Clint-
"Parens patriae," literally "parent of the country," refers traditionally to role of state as sovereign and guardian of persons under legal disability."
Ex parte Bayliss, 550 So.2d 986, 988 n. 1 (Ala.1989) (quoting Black's Law Dictionary 1003 (5th ed.1979)).
"Pursuant to the parens patriae doctrine, 'the primary control and custody of infants is with the government, to be delegated, as of course, to their natural guardians and protectors, so long as such guardians are suitable persons to exercise it.' "
Ex parte Wright, 225 Ala. 220, 222, 142 So. 672, 674 (1932). See also Fletcher v. Preston, 226 Ala. 665, 148 So. 137 (1933); and Striplin v. Ware, 36 Ala. 87 (1860).
"In other words, the state is the father and mother of the child and the natural parents are not entitled to custody, except upon the state's beneficent recognition that natural parents presumably will be the best of its citizens to delegate its custodial powers… 'The law devolves the custody of infant children upon their parents, not so much upon the ground of natural right in the latter, as because the interests of the children, and the good of the public, will, as a general rule, be thereby promoted.' "
Chandler v. Whatley, 238 Ala. 206, 208, 189 So. 751, 753 (1939) (quoting Striplin v. Ware, 36 Ala. at 89) (' ').
(SOURCE: http://caselaw.findlaw.com/al-court-of-civil-appeals/1325717.html)
Wait a minute, you say. This doesn't sound very "constitutional" to me…
Oh, you mean that mythical and more importantly interpretable (in court opinion) document that you believe gives you rights? Silly rabbits, tricks are for kids.
In reality, everything that happens is in fact "constitutional" as long as the court (an attorney in a black moo-moo) says it is "constitutional" from within its (his/her) opinion.
In the end, you have only one right. And that right is the right of non-consent. (Consent is the most important legal term that you can possibly ever comprehend.)
But don't take my word for it… here are a few more instances of "case law" which let you know that the constitution simply does not apply to you in the corporate world of commercial (copyrighted) code…
"But, indeed, no private person has a right to complain, by suit in court, on the ground of a breach of the Constitution. The Constitution it is true, is a compact, but he is not a party to it."
Padelford, Fay & Co., vs. Mayor and Aldermen of the City of Savannah 14 Ga. 438, 520
**Note: Remember, the word "person" refers to your veil of artificial person-hood; your STRAWMAN if you will. The court will never refer to you in the sense that you are a living, breathing, sentient being with god-given rights that cannot be taken away, but instead relies on your presumed consent as the physical representation of your fiction, your corporate self. "Person" is defined in U.S. CODE as an "individual, association, corporation, group…" etc. It is not defined as "people" unless those people are a group of "persons", in which case, as in the constitution, the word "people" is capitalized (i.e. We, the People – referring to the men who signed the constitution, and whom were the only men for which that constitution held under "contract" with any authority. The constitution has no authority accept that for which the court passes judgment (opinion) upon. -Clint-
"The people of the United States resident within any State are subject to two Governments: one State, and the other National; but there need be no conflict between the two. The powers which one possesses, the other does not. They are established for different purposes, and have separate jurisdictions. Together they make one whole, and furnish the people of the United States with a complete government, ample for the protection of all their rights at home and abroad. True, it may sometimes happen that a person is amenable to both jurisdictions for one and the same act… It is the natural consequence of a citizenship which owes allegiance to two sovereignties, and claims protection from both. The citizen cannot complain, because he has voluntarily submitted himself to such a form of government."
The Supreme Court, 92 US 551: "U.S. v Cruikshank"
Well, there you have it!
Even as the Supreme Court – which has mistakenly translated the word "supreme" to mean that these seven appointed "justices" who pass "opinion" upon the masses of consenting "citizens" are more supreme than even God himself – these men and women; who are not voted into these positions of power in any way by the people, but instead are appointed by the President of the United States (corporation)… these self-imposed deities clearly state here that they are the law of the land, and that that "the natural consequence of citizenship" is for the people to be under their supreme opinion!
Well I for one do not voluntarily submit to the opinions of these megalomaniacs any longer.
And for the record, as a free man with God as my witness…
I DO NOT CONSENT!!!
FYI… Stay tuned, subscribe, or do what ever you need to do to monitor future postings from my blog – for there are BIG things happening and lots of important information coming to you soon, free of charge, from yours truly and my band of merry men.
Special thanks to Burt for all that he does to open my eyes. Please visit his YouTube page here:
http://www.youtube.com/user/donotconsent83?ob=video-mustangbase
And keep this future website in your bookmarks, of which I very much plan to be a part of:
onlyfreemen.com
Posted in Common Law, constitution, new world order, Police State, Uncategorized
Tagged beat a ticket, bond, burt do not consent, child abuse, child custody, clinton, court corruption, court procedure, cps, criminal court, donotconsent83, evidence of debt, family court, family law, free man on the land, freedom, freeman, gloog, hhs, how many politicians lawyers, how to beat a parking ticket, killing your strawman, law vs legal, lawyer attorney, obama, onlyfreemen, remedy for strawman, Strawman, traffic court
https://realitybloger.wordpress.com/2011/12/16/do-you-own-your-children/

redpajama_set_name: RedPajamaCommonCrawl


text:
Corporate Spotlight,Youth & Transformative Justice
Los Angeles Chargers Grow Social Justice Footprint Through Expanded Partnership with Liberty Hill Foundation
The Los Angeles Chargers today announced an expanded partnership with Liberty Hill Foundation, a national leader in social justice. The partnership will feature several initiatives to continue growing Bolt Up for Justice – an overarching program within the Chargers organization that includes a player committee focused on social justice reform.
Bolt Up for Justice focuses on identifying meaningful ways the Bolts can support Black and Brown communities through funding, volunteer opportunities and messaging that drives change. The 2020 player committee, which includes running back Justin Jackson, safety Derwin James, defensive tackle Justin Jones, punter Ty Long, defensive end Isaac Rochell and quarterback Tyrod Taylor, meets regularly to dialogue with community leaders and identify organizations at the forefront of social and racial equity across the region.
"Expanding our partnership with Liberty Hill Foundation is another important step in our ongoing efforts to effect meaningful, lasting and necessary change," said President of Business Operations A.G. Spanos. "Our work with Summer Night Lights, Boys & Girls Club Metro Los Angeles and Brotherhood Crusade, among others, were important precursors to this moment. With an overarching internal program now in place and active involvement from players on the development and execution of these initiatives, I'm hopeful that our organization – which has always been a force for good in the community – can play a role in helping bring equity and opportunity to Black and Brown communities across the Los Angeles region."
Liberty Hill Foundation is the leading social justice foundation in Los Angeles whose mission is to leverage the power of community organizers, donor activists and other allies to advance social justice. Through strategic investment in grants, leadership training and campaigns, the Foundation seeks to build power in communities most impacted by systemic racism to achieve justice and equity.
When the country reached a tipping point following George Floyd's death, the Chargers began working with the Foundation to help develop a more comprehensive social justice program for the organization. The initial programing created by Liberty Hill included several Listen & Learn sessions with community leaders in Los Angeles for players. These sessions included an overview of the recent California ballot propositions and conversations with Rep. Karen Bass and LAPD Chief Michel Moore. Additionally, the Bolt Up for Justice committee autographed and auctioned off their game worn jerseys from the Bolts' season opener against the Cincinnati Bengals to support Liberty Hill Foundation.
"We are grateful for the support of the Los Angeles Chargers and look forward to partnering with the team to expand awareness of the racial and social justice issues facing Black and Brown communities in Los Angeles," said Liberty Hill President/CEO Shane Murphy Goldsmith. "The Bolt Up for Justice initiative will build upon the work we started with the team to amplify the voices of those with lived experience and highlight opportunities for mentorship and youth development."
The Chargers established a commitment to social justice early in the region through a seven-figure, three-year commitment to the Mayor's Fund to support the Office of Gang Reduction & Youth Development's Summer Night Lights program (SNL). The Chargers donation ensured the lights stayed on and youth sports programming remained free during evening hours for SNL, a proven violence reduction effort developed and executed in partnership with LAPD. Additionally, after conversations with several players, the Chargers directed $400,000 to the Boys & Girls Club Metro Los Angeles to renovate two multi-sport fields, establish two teen centers and develop a STEM program.
Now, through the Chargers partnership with Liberty Hill Foundation, Bolt Up for Justice will continue to build on a joint commitment to support community organizations that are working to transform the future for our youth and drive police reform. These efforts will be supported by the initiatives below:
Bolt Up for Justice Fund
The Chargers will match up to $250,000 in donations collectively made to the fund by players during the 2020 season. The Chargers and Bolt Up for Justice committee will decide together which organizations to support with the donated funds. The team donated $100,000 in November to Liberty Hill Foundation to help in the development of Mentorship Matters and the I am a Voice for Change Campaign.
Bolt's Mentorship Matters Program
The Bolt's Mentorship Matters program will provide the team opportunities to mentor youth and partner with youth organizations for a variety of activities which may include:
Sustained mentorship relationship for players/staff and youth to support professional and personal development
One-on-one player/youth virtual conversations
Player and youth roundtable discussions on their experiences with the justice system
I am a Voice for Change Campaign
The team will produce content that highlights the importance of racial justice issues such as alternatives to incarceration, investing in youth of color through education, etc. Additionally, Liberty Hill will provide players with engagement opportunities based on the racial and social justice issues identified by the Committee.
For more information on the Chargers social justice programming, visit www.chargers.com/community/justice.


Hey! Don't forget to drop by Dory's Backyard for her birthday and holiday celebration. Bentley is taking his sweetie, Emma from My GBGV Life and her little sister Bailie is going with Pierre. We are so excited.
Oh, such fun and frolics going on over at your place. Are you going to call your new slappy SID ?
I LOVE THE VIDEO!!! That is a VERY handsome sweater I saw down there too! So cute. Glad the boys were so good this year! They sure got a lot of good presents! Merry Christmas and I love y'all!
Wow looks like you had a pawsome Christmas!
That was the cutest video. I love the card tree! We had a good christmas, have a great weekend.
Looks like everyone had a swell time. Have a fabulous Friday.
You boys looks so cute sniffin' out what Santa brought! That Pierre sure has a lot of nerve trying to sneak off with your stuff! I love your Christmas card tree too! See you boys at the party, great photo of us all!
Love the video! Plus cool card tree, got to remember that for next year.
What a card tree. Wow. And you both got a lot of gifts, so I can imagine you both have been nice all year.
OMD...I just love that pretty Christmas Card Tree!! See you at the party!!
Have a great time at Dory's party today. What a neat idea to make a Christmas tree of the cards.
that video was just too cute!!!! LOVE how you displayed your cards and we saw ours right on top! Glad you had a wonderful Christmas!
What a great Christmas you had! We got way more cards than our peeps did, too!
Looks like y'all had a pawsome Christmas!
WOW look at those cards!!!
Looks like you had a great xmas!!! Happy Holidays!
Love the video; Bentley's tail says it all :) The slappy toy looks awesome; I think I might have to put one of those on Laika's bday list.
Now those look like two happy dogs!!
Looks like you had a great Christmas!!
Heeeee! I know - we totally outnumbered the humans over here in the card dep't, too. SCORE!!!
Aww well this video is just full of joy, we loved it. Looks likes you had such a good time! So pleased. Merry Christmas.
I hope your family had a very Merry Christmas!


An appealing scrub with a silky oil texture and the fragrance of prized energizing and toning essential oils. The exfoliating action of the Salt crystals helps to remove dead cells, renew the skin and prepare it for subsequent treatments. The formula has been created for active women. It contains a blend of targeted ingredients to make skin tissue more toned and compact, including Green Coffee extract and a distinctive microalga. It is great for complementing exercise and it is the ideal product for starting an anti-cellulite* and toning routine.
An appealing scrub with a silky oil texture and the fragrance of prized energizing and toning essential oils. The exfoliating action of the Salt crystals helps to remove dead cells, renew the skin and prepare it for subsequent anti-cellulite* treatments.
Direction for use:How to use it: mix the salt with the oil and rub it into damp skin. Rinse with warm water.
Scent:A synergistic array of Neroli, Bitter Orange, Lavender, Scots Pine, and Ylang-ylang essential oils.
Suggestions:Anyone who wants an appealing scrub with a silky oil texture and the fragrance of prized energizing and toning essential oils.
Characteristic:A scrub with an oily texture. Choose it if you want a product that contains no mineral oils or colourings.


text:
The Plantain
The Avocado
Avocado Ads
Only in LA
The Westside
USC/UCLA
God Damn Traffic
Tag: Entertainment
Posts Tagged Entertainment
How To Apply To Be A Writer On SNL While Still Maintaining The Show Sucks On Social Media
Saturday Night Live has been the gold standard for American comedy for over 40 years and, as a funny and inexperienced comedy writer, is the type of national platform that you should write for. Unless they don't want you. In that case, SNL hasn't been good for between 15 and 35 years, depending on your age, and you wouldn't be caught dead writing there.
As either a future SNL writer or someone who would never work for that show even if they paid me millions of dollars, here is a 10 point plan for getting hired to write for Saturday Night Live or, alternatively, crafting the perfect tweet about how you would never want to.
Step 1: Be Obsessed With Saturday Night Live Your Entire Life
SNL isn't everyone's cup of tea, but whether you want to be hired as a writer or tweet @Michael Che about how terrible it's become, you must watch the show every week. Having a deep knowledge of SNL's history will help you understand the sensibilities of the show should you be lucky enough to get hired. It will also give you plenty of materials to cite as examples of how the show used to be so much better in the more likely event that you are not hired.
Step 2: Have An Inflated Sense Of Your Own Talent
It takes an inflated ego to watch a show that has been a bedrock of popular culture since Gerald Ford was in office and think to yourself that you could do that. But who knows? A. Whitney Brown was too but a man with a dream at one point. But before you commit yourself to submitting a packet of original materials to the show to be judged and potentially mocked, consider the possibility, however remote, that you aren't funny.
Are you really funny or do you just like comedy? When you are around a group of people do they laugh at your jokes or just smile and say "that's funny" when you make a sarcastic comment or reference The Office? Being funny is hard, but liking comedy is easy. So if, upon deep and devastating personal reflection, you decide that maybe being a professional comedy writer isn't for you, treat yourself to the consolation prize of Tweeting @ColinJost and telling him that he's no A. Whitney Brown and never will be.
Step 3: Prepare A Packet Of Original Material
Fuck Step 2 and all the haters, you know you are funny and it has been your dream to write for Saturday Night Live since you were a kid. Great, now all you have to do is send them a packet of 3 to 5 sketches. How hard could that be? Just sit at your laptop and let the hilarious ideas start flowing…
Step 4: Struggle To Come Up With One Original Idea You Unfunny Fuck
It's been 6 hours since you started work on your sketches but all you have written so far are the words "Pearl Ham" and a rough outline of a sketch involving President Trump learning his son Baron is dating Greta Thunberg. You delete what little you have, knowing that Baron is off-limits, and as you stare deep into the reflective glow of your laptop screen you question your self-worth. As has happened at least a dozen times since you started working on this packet you mindlessly pull out your phone to swipe through Instagram where you see the smiling faces of all of those SNL phonies that you follow living the life you deserve to be living if only you could focus enough to put together something as hilarious as you assumed you could write before you tried.
After realizing you've now scrolled through two years of Beck Bennet's Instagram photos, you throw your phone across the room and focus back on your laptop. The ideas are in your head and all you need to do is clear your mind and let them flow. You are a funny person and SNL should be glad to have you. It isn't even that good anymore, so you could definitely get on if only it weren't such a goddamn bureaucracy old boys club probably. You place your hands back on your keyboard but then almost preternaturally navigate to Pornhub in your browser and spend the next 35 minutes opening adult movies in new tabs, the vast majority of which you never get to before you finish.
After cleaning yourself up and taking a quick nap you realize you spent nearly 10 hours on the SNL packet and still have nothing to show for it besides "Pearl Ham" which the more you think about seems unlikely to lead anywhere. At this point, the Klonopin has started to take effect and the near non-stop buzzing of your boss texting you to find out why you didn't show up for your shift at the hospital has become white noise. "Will anyone ever really love you?" you ask yourself as you tearfully delete "Pearl Ham" and then immediately type it out again. Maybe it could be something?
Step 5: Mail In Your Packet To Saturday Night Live and Wait!
SNL gets hundreds of thousands of submissions by white bearded guys like you every year, so if you don't hear back from them right away assume that they hated what you submitted and start tweeting about how much you loathe the show. Mention how you thought it was horrible that SNL allowed Donald Trump to host when he was running for President and say something outlandish to prove your point like that it would be like if Hitler went on Mad TV and was in a sketch where he ordered Stewart to invade Poland and Stewart did his "I Don't Wanna" line.
Step 6: Holy Shit They Want To Meet You?
It's been three months since you sent SNL your packet and in that time you have grown steadily obsessed with the cast and writing staff and have sent out thousands of tweets and direct messages letting them know that they are all no A. Whitney Browns and that the show sucks! As you sit at your laptop and discover that Kyle Mooney has blocked yet another of your fucking usernames you get an email alert from a Page at NBC asking to schedule an interview for a writing position at SNL.
As you read, and then re-read the email, you feel like you've entered a fugue state. This could really be it. You start to remember how much the show meant to you when you were growing up and think about what an amazing honor it would be to be part of the same show that launched the careers of Brooks Wheelan and Gilda Radner. You cry and spend the rest of the night deleting all your Twitter accounts and thinking about how much your life is about to change.
Step 7: Impress The The Head Writers
The bad news is you're going to have to quit your job and leave your family to move to New York, but as soon as you step into 30 Rock you know it will be worth it. This is where you belong, and assuming they don't find out you stole most of your packet from sketch examples you found on Twitter or that you have spent the last three months cyberbullying SNL's cast and writing staff, as well as a few costume designers you found on Instagram, this will be your new home.
As you sit nervously in a large conference room waiting for Michael Che and Colin Jost to show up, you try your best to compose yourself but the opportunity is frankly too overwhelming. You steal a pen from the desk. It doesn't even have "SNL" on it. It's just a BIC, but you take it anyway. As you shove a few loose legal-size notepads into your messenger bag the door opens.
It's Colin Jost. And Michael Che. And a Jewish looking fellow who you don't recognize. And for the next hour you tell them about yourself and how much Saturday Night Live means to you and how this has always been a dream and what an honor it is just to be in the building. Collin and the Jewish guy say they feel the same way. Michael was texting with someone as you went on for maybe a little too long but is sort of nodding his head so maybe he feels the same way too? He's sort of hard to read.
After an hour or so of discussing comedy, they thank you for coming and you leave the building. As the brisk air hits your face you call your mom and tell her how well it went and that you're never going back home. "Are you sure this is what you want to do? Why don't you wait until they actually offer you the job?" she asks, but you are sure this is the right move. You text your boss at the hospital and tell her that UCLA Medical Center can find a new head of osteopathic surgery, thank you very much. Your wife and children are upset to learn you're moving across the country, but you have a dream and who are those cunts to tell you that all you'll ever be is a husband and father just because you're their husband and father.
Step 8: Realize You Made A Huge Mistake
It's been three weeks since your interview and you think it's kind of rude that no one from SNL has gotten back to you about when you'll be starting. "They could have really used me," you think to yourself as you watch tonight's episode from the new apartment you rented only a block away from the studio. As the episode draws to an end you sit alone and think about how much you miss your children and wife and wonder if this was all worth it. You know it wasn't. You call Sheila up to tell her that you want her back, but she tells you it's too late. You hear a man's voice in the background. You ask to talk to the kids but she says no. "You made your decision," she tells you as she hangs up.
Step 9: Confront Those Hypocrites At Saturday Night Live Who Wouldn't Know Talent If A. Whitney Brown Were Standing Right In Front Of Them
What have you done, you stupid fuck? You had it all and gave it all up to write for Saturday Night Live who doesn't even want you. But why would they? Why would anybody want you?
You don't know why, but you run out of your apartment to 30 Rock and get in a line of about two dozen teenagers (Harry Styles was tonight's musical guest) waiting by the building's exit for an autograph or picture. You don't have a plan and the young girls waiting in line with you are not interested in small talk and are making you feel like a creep. Bitches.
At around 2:00 AM you spot the Jewish guy from your interview leaving the building. "Hey! Menasha!" you yell out. He turns around and walks over. "Hey…what are you doing here? Did you want to meet Harry Styles?"
It's such a simple question but you struggle to answer it. "No, I don't care about Harry Styles. Did I get the job?" you ask bluntly. He is very polite about it, but lets you know that you didn't.
"But why?" you ask, mouth quivering as the reality that you upended so much of your life for this blown chance sets in.
"Because you plagiarized all of your sketches from the Internet," he says.
"That's not true! The Pearl Ham was mine! Give me another chance," you beg.
"And we know you were harassing Kyle Mooney and some of the girls from wardrobe on social media." You try to explain, but it's no use. "Good luck, Dr. Goran. I have to go."
Step 10: Tweet About How Much SNL Sucks
It will take several months to convince your wife to take you back, but eventually, she will. Things won't be the same, but you both think it's best for the kids to have a two-parent household.
As you reflect on your ill-fated comedy career and imagine all of the things that might have been, you realize this was all for the best.
That first Saturday back home you stay up late to watch SNL. You had never heard of the host or musical guest and most of the jokes and references did nothing but make you feel old and like the world had some how moved on without you. You felt the Pearl Spam sketch was inspired though. As the show's iconic theme plays at its end, your wife comes downstairs. Your relationship with her is still fragile, but she gets warmer toward you with each passing day. She asks you if you are coming to bed soon.
"Just give me a minute," you tell her and she gives you a kiss that is so sweet and loving that you realize how lucky you are to still have her in your life.
As you watch her ascend the steps to the second floor, you log on to Twitter and tweet:
I Took Nick Offerman's Acting Class And All I Learned Was How To Build A Canoe
Nick Offerman does not "believe" in refunds, a fact I learned shortly after handing him an $8,000 check for what was advertised as a "practical acting class" that turned out to be a course on canoe building. Known primarily for his role as Ron Swanson on Parks and Recreation, what most people don't realize is that Nick is also an accomplished woodworker and once showed his penis in an episode of Dead Wood. "This is my shop," he said proudly as he walked me around the space and described its tools and the mechanics of its complex dust collection system that he designed himself. "We're going to be thinking a lot about dust as we build this canoe together." I was confused.
"I'm sorry, did you say we are going to be building a canoe? I thought this was an acting class."
"Son, there isn't much you can't learn about life by building a canoe," he told me before getting back to a surprisingly long conversation about dust and letting me know about his strict no refund philosophy. "A transaction shouldn't linger. It's effete," he said before getting back to dust management which he believes is essential.
"How will building a canoe help me develop practical acting skills?" I asked, to which the Dead Wood penis actor told me that finding success in Hollywood was unlikely given my height and face and that learning a craft such as canoe building would allow me to earn an honest living while my more grandiose dreams fail. "What could be more practical advice for an actor with your build and hairline than that?"
I wasn't convinced and had no use for a canoe, but I had already paid and didn't have much else going on in my life, so for the next 8-weeks I spent every evening in Nick's workshop honing the skills I would need to become a great thespian and intermediate wood craftsmen.
"The first question one must ask when building a canoe is what type of wood to use," Nick told me during our first lesson. In thinking about the question, I felt I understood how acting and woodworking complimented each other and figured Nick was laying the framework for an eventual Karate Kid style revelation where the incremental skills I develop through woodworking come together into a full repertoire of the talents necessary to make it in Hollywood.
"So, picking out the right wood is sort of like deciding on the right part to take as an actor?" I asked, but was told not to read too much into what he was saying.
"No. The best wood to use for a canoe is red cedar. And the best part for you to take at this point in your acting career is anything you are offered, even if they ask you to show your penis. It's only after you have developed your craft that you can experiment with mahogany and other hardwoods or can turn down roles that require an uncomfortable amount of nudity. Remember, you're desperate, and red cedar is a desperate wood for desperate people."
During our first week together I learned the basics of canoe building and that I shouldn't ask Nick Offerman about his personal or professional life while in his shop. "A woodshop is not a place for casual conversation," he told me before pivoting into an explanation on the differences between a jointer and a planer. "A jointer is used to flatten the face of a piece of wood and square up one edge and a planer is used to make the second face flat and parallel to the first," he'd tell me over and over but I still didn't understand the difference.
"What's not to understand?" Nick would yell, letting me know that he was disappointed in my progress and that normally such incompetence in a woodshop would be punished by requiring me to sweep the dust from the floor, but that since his dust collection system was so efficient and there was nothing to sweep I should just stand in the corner as he demonstrates the proper way to shape the canoe's inner stem. "Just go hand me my spokeshave," he told me but I didn't know what that was. "And you expect to make it as an actor?" he scoffed.
Over the next several weeks I tried to make myself useful and for the most part, stayed out of Nick's way as he silently measured out and cut the planks for the canoe. The only bright spot during this period was when Nick's wife, Megan Mullally would come into the shop on occasion. I had read that Megan had discovered Bill Hader and, being impressed by his impressions, recommended him to Lorne Michaels for Saturday Night Live. Since I didn't feel like Nick's lessons would lead me to succeed as an actor, I decided to greet Megan in a variety of accents (cockney, racist Indian, John Malkovich) to demonstrate that I was also ready for Saturday Night Live and an introduction to Lorne. But she would just politely smiled at me before leaving. "I know what you're doing and it won't work," Nick finally told me after I told Megan to "Kiss My Grits" in my best southern accent. I fucking hate woodworking.
Nick was on edge during our last week together and feeling stressed by what would be an intensive two-days of laminating the wood for the boat's hull. I was in charge of managing and attaching the staples and clamps. As I worked through the evening securing the glued wood into its frame Nick finally paid me a compliment.
"That's a nice amount of pressure you got there," he said of my clamp work. "When you're in a woodshop you're going to sometimes want to tighten the clamp as much as possible, but you shouldn't because it could damage the face of the wood. Just let the glue do the work and be patient," he said.
"Thanks." It was the first nice thing he said to me in weeks.
"The same is true when going out on an audition. You're going to want to give the reading your all, but sometimes the best reading requires a little less. It's more important to give an even performance and let the words do the work," he said as he scraped away the glue squeeze.
"Holy shit, it's happening. He's relating acting to canoe building. He's Miyagi and I'm LaRusso," I thought to myself, fully prepared to discover all of the fine acting skills I had subconsciously learned over the last six weeks, but it never came. Our last week together mostly involved the two of us silently planing and sanding the canoe and applying several coats of varnish to the piece. On our last day together we installed the canoe's seat and yoke and built a pair of paddles.
"Well, I think this is a fine canoe. You should be proud," Nick told me as we admired the boat we built.
"Thanks, Dad," I said, horrified that I called him Dad, but to be honest a bit surprised I hadn't done so sooner. "I'm sorry–" I said, but he told me not to worry about it. "It happens in a woodshop."
As I packed up my things and prepared to leave Nick's shop for the last time I felt a level of self-satisfaction that I had never experienced before. I know I wouldn't be able to build a canoe of this quality on my own, but was happy I could now appreciate the energy and skill that goes into building something from the ground up. I thanked Nick for the experience and shook his hand.
"I hope you feel like you learned something," he said. I told him that I did and that while the exact relationship between canoe building and comedic acting felt somewhat attenuated and that I believed his advertisement could have been less misleading, that I felt I had gotten my money's worth.
"I'm glad to hear it," Nick said. "You know, acting is just like any skill. You need to take it seriously if you want to do it professionally. Are you sure you're ready to dedicate yourself to it?" he asked. I told him I was.
"Good. Well, I think I know of a part for you, if you want it." It was happening, I couldn't believe it. "Yeah, of course, I'll take anything," I told him, eager to hear about the role. "I'm red cedar."
"I'm glad to hear that, son," said Nick. "Because the part does require you to show an awful lot of your penis."
Nick Offerman's Woodshop is located in Los Angeles. Acting classes are available to aspiring woodworkers who are comfortable with gratuitous on-camera nudity.
Disney Acquires Pornhub For New "Disney After Dark" Streaming Service
Disney is reportedly considering a separate "adult-themed" streaming service called "Disney After Dark," which will feature more mature content, including the 20th Century Fox catalog of R-rated content, as well as a variety of hardcore pornographic options.
"We knew early on that we wanted Disney Plus to be strictly for families and didn't want it to include R-rated films," said CEO Bob Iger. "But when we purchased 20th Century Fox last year, we also acquired cinematic classics that were not well suited for our main platform and its core audience of childless 30-somethings watching Darkwing Duck and thinking about a time before Trump. We think it's time there was an outlet available for only another $6.99 a month to watch our more mature intellectual property."
The Disney after Dark brand will include 20th Century Fox owned classics like All About Eve, mature action comedies like Deadpool, and a wide variety of hardcore and kink fetish porn made available through Disney's recent acquisition of internet pornography website Pornhub.
When asked why Disney decided to acquire Pornhub, Mr. Iger said it was part of Disney's long-term goal of "owning all the companies."
"At Disney, we believe in being innovative, and we think entering the smut business is key to our future success," said Iger, who noted that a 30-something could only watch Darkwing Duck for so long before getting bored and needing to masturbate. "The show was made for 10-year-olds, it can't realistically sustain an adult's attention for more than, honestly, about half an episode. We want to make sure that when our Disney Plus customers leave our platform to seek out more mature content, they don't go to a competitor."
The Avocado spoke to Harlan Palmer, a 34-year-old graphic designer and self-prescribed Disney fanatic who spent the day binging Disney classics from his youth in between visits to Pornhub. "I guess you can say I'm Disney obsessed," said Mr. Palmer before watching the first 10 minutes of Alice in Wonderland, getting bored, and pulling out his laptop.
The Avocado spoke to a chain smoking Netflix executive about Disney's strategy: "I think it's brilliant. People love nostalgia and porn," he said as an assistant handed him a printout of the number of users who canceled their accounts in the last two weeks. As he sat there contemplating what Disney's entry into the streaming world means for Netflix, he muttered something about "remember how good Orange Is the New Black used to be" before asking us to leave the room so he can "check out the competition."
The Gooms!
Help! I Wanted to Write For Big Mouth But Applied To The Wrong Kroll And Now I'm A Security Consultant
Newsom Bans In-Person Dining At All Non-Michelin Star Restaurants
Woke City Council Votes To Hand Out #BlackLivesMatter Stickers To Unhoused Black People Before Arresting Them For Sitting Down
Kim Kardashian Gives Kanye A Hologram Of His Mom Telling Him To Stop Acting Like A Damn Fool All The Time
Why I'd Vote For Nithya Raman But Can't Because District 4 Is A Gerrymandered Mess
The Avocado is a satirical (meaning fake) publication. Should a reader upon sober reflection, think or believe that anything contained in any post in this web site is true, they are mistaken and should relieve and abandon themselves of that idiotic notion immediately. Anyone who concludes otherwise ought to stay away from this site forever and may want to consider instead seeking immediate help, attention or treatment. This site publishes parodies. Want to contribute to The Avocado? Email your submission to theAvocadoLA@gmail.com
© 2019 The Avocado. All right Reserved


text:
Cop Car (no Brasil, A Viatura; em Portugal, Carro da Polícia) é um filme americano de estrada e suspense de 2015, co-escrito, co-produzido e dirigido por Jon Watts e estrelado por Kevin Bacon. Estreou nos cinemas americanos em 7 de agosto de 2015.

Premissa
O filme segue dois meninos jovens que se deparam com um carro da polícia abandonado de um xerife corrupto.

Elenco

Lançamento
Cop Car estreou no Festival Sundance de Cinema em 24 de janeiro de 2015. O filme foi lançado nos cinemas em 7 de agosto de 2015 pela Focus World, que adquiriu direitos de distribuição ao filme em 28 de janeiro de 2015.

Sua estreia no Brasil ocorreu em 8 de dezembro de 2015 diretamente em DVD.

Recepção
Cop Car recebeu críticas geralmente positivas dos críticos. No Rotten Tomatoes, o filme tem uma aprovação de 79%, com base em 77 resenhas, com uma nota média de 7/10. O consenso crítico do site diz: "Cop Car possui uma ótima premissa e um ato de abertura severamente emocionante - e para alguns espectadores, isso será suficiente para compensar o desfecho desigual do filme." No Metacritic, o filme tem uma pontuação de 66, com base em 21 resenhas, indicando "Avaliações geralmente favoráveis".

Bruce Demara, do Toronto Star, deu ao filme três de quatro estrelas, dizendo "Ancorado por performances sólidas e um roteiro tenso, Cop Car é um passeio de emoção cheio de tensão." Brian Moylan, do The Guardian, concedeu ao filme quatro de cinco estrelas, dizendo: "O filme culmina em uma disputa prolongada que mantém a audiência no limite por mais tempo do que confortável. Eu quero dizer isso como um elogio." Michael O'Sullivan, do The Washington Post, deu ao filme duas de quatro estrelas, dizendo que "Cop Car constrói um bom suspense, misturando comédia sombria, de tal forma que um humor nunca sobrecarrega o outro." Bill Goodykoontz, do The Arizona Republic, deu ao filme três estrelas e meia de cinco, dizendo que "Bacon pode interpretar praticamente qualquer coisa, e ele está se divertindo aqui como um cara que não é suficientemente inteligente para se manter fora de problemas, mas suficientemente esperto para tentar desenterrar-se disso. É divertido de assistir." Todd McCarthy, do The Hollywood Reporter, deu ao filme uma crítica negativa, dizendo: "Uma premissa potencialmente divertida logo não se torna nada divertida em Cop Car, um thriller de ação de baixo custo desafiado pela imaginação." Peter Debruge, da Variety, deu ao filme uma revisão positiva, dizendo: "Watts demonstra controle magistral, empurrando-se contra os limites do que podemos tomar (até mesmo os não-pais serão chocalhados assistindo os meninos manuseando as armas carregadas) e, no entanto, em cada turno, o roteiro fica sem o potencial completo do filme, perdendo oportunidades que poderiam ter feito disto um clássico."

Ligações externas

Filmes dos Estados Unidos de 2015
Filmes em língua inglesa
Filmes de estrada
Filmes de suspense dos Estados Unidos
Filmes policiais dos Estados Unidos
Filmes de suspense da década de 2010
Filmes policiais da década de 2010
Filmes dirigidos por Jon Watts

redpajama_set_name: RedPajamaWikipedia


text:
Saint Jude, also known as Laba or Libaos or Teddy, is the worshiped Saint in the village of El-Midane in the region of Jezzine, South of Lebanon.
In the old Maronite Liturgy, his feast day is on October 14 and he was considered as one of the 70th followers of Jesus. In the Roman Liturgy, his feast day is on October 18. In the liturgy printed out in Saint Charbel's journal by Father Paul Daher in 1973, his feast day is on June 19.
El-Midane celebrates his feast day on October 18.
Saint Jude is also called Tedaous the Disciple, brother of Jack and Simon and Youssy, brothers of the Lord. Many people considered Saint Jude as one of the 12th Disciples of Jesus, and they think he was murdered in the city of Al Roha. Others think he was murdered in the city of Beirut, where a church bearing his name was built there.
In the Liturgy published in Saint Charbel's journal, an old story said that Saint Jude went to preach the Christ in Jerusalem. Then he moved to Iraq, the Arab countries and Armenia, where he was captured by unbelievers and put to death. It was also said that he met Simon the Kanaway in Persia where they joined efforts to preach the Gospel. There, God gave them power over demons, magicians and the healing of the sick. When army commander Bardach saw them, he was getting ready to attack India. They advised him that he will win the war through a peace treaty, to the contrary of what the magicians speculated. That was done, and Bardach was immediately baptized with his men. This created hatred among the magicians who ignited the people to imprison Saint Jude and Simon where they were beaten to death in the year 68.
Maronite Patriarch Stephan Doueihy, the father of the Maronite history, mentioned that Saint Jude is a Disciple. He indicated that in the year 1112, a Becharry priest had 3 daughters one of them, Takla, built many churches among them one in Bechanine in the Zghorta area dedicated to Saint Jude the Disciple. Maronite Patriarch Simon Aouad also called him a Disciple. This clearly shows the status of Saint Jude.
The first priest ordained to serve Saint Jude (Mar Laba) church in El-Midane was Antonios nephew of Patriarch Simon on March 10, 1753. Patriarch Simon Aouad ordained many priests during his tenure, some of them when he was still a Bishop and the others when he became a Patriarch. The first priest in El-Midane was during his patriarchal reign. This meant that El-Midane was not inhabited before he came to the region.
Where was the first Saint Jude church built in 1753? Aged people in El-Midane recall stories about the first church being a small one next to the present one where Patriarch Simon used it to celebrate masses for the small population of the village.
Some of the priests who served Saint Jude church in El-Midane were Simon Jacob Aouad who died in 1914, the son of Teddy son of Joseph son of Elias, the Patriarch's brother. Also, the priest Jacob son of the priest Simon Aouad who died in 1945.
The current church was built in 1903. That was done by the residents of El-Midane with no help from anywhere or anyone, not even the immigrants, where at that time immigration did not yet started. In the earthquake of 1956, the church was subject to limited damages similar to other churches in the area. That triggered a project to enhance the church and to try to enlarge it so that it becomes capable of accommodating the growing population of the village. The project needed, a somehow, large financing at that time. One of El-Midane's sons, Monseigneur Tanios Abou Sleiman who was serving as a Patriarchal delegate in Mexico, called upon a wealthy immigrant from El-Midane, Massoud Farhat, who donated 42000 Lebanese Pounds (almost 20000 US$ at that time) to cover all the expenses for the renovation of the church which ended in the year 1969. The following years saw additional enhancements to the church by the responsible committee, with the help of contributors and El-Midane Club, such as refurnishing, building new restrooms, a kitchen and new cemeteries. In the near future (i.e., in 2007) a new hall will soon be added next to the church in addition to covering its rooftop with red argile.
It is our pleasure to say that the journey of Saint Jude from Hasroun in the Northern Lebanon to El-Midane in the South, through Patriarch Simon Aouad, was the threshold of a new era for the region of Jezzine.
Our Ancestors were simple, loving peasants who worked this land with love, hating no one. We hope that our future will continue to show our commitment to this sacred land and to Jesus Christ, our Lord.
Subscribe to the newsletter to receives news
and announcements to your e-mail inbox
Programming by Rudy Zeinoun. © Copyright 2010 Reel. All rights reserved.


text:
Pieni Jänkäsalo är en ö i sjön Saimen och i kommunen Taipalsaari i landskapet Södra Karelen, i den södra delen av Finland,  km nordost om huvudstaden Helsingfors. Öns area är  kvadratkilometer och dess största längd är  kilometer i öst-västlig riktning. Den ligger söder om Suuri Jänkäsalo.

Källor

Öar i Saimen
Öar i Taipalsaari
Öar i Finland större än 2 kvadratkilometer


text:
package framework

import (
	"fmt"
	"sort"
	"strings"
	"time"

	"github.com/blang/semver"
	"k8s.io/client-go/discovery"
	"k8s.io/client-go/dynamic"
	clientset "k8s.io/client-go/kubernetes"
	"k8s.io/client-go/pkg/api"
	apierrs "k8s.io/client-go/pkg/api/errors"
	"k8s.io/client-go/pkg/api/unversioned"
	"k8s.io/client-go/pkg/api/v1"
	"k8s.io/client-go/pkg/fields"
	"k8s.io/client-go/pkg/labels"
	"k8s.io/client-go/pkg/master/ports"
	"k8s.io/client-go/pkg/runtime"
	"k8s.io/client-go/pkg/util/sets"
	"k8s.io/client-go/pkg/util/uuid"
	"k8s.io/client-go/pkg/util/wait"
	"k8s.io/client-go/pkg/version"
	"k8s.io/client-go/pkg/watch"
	restclient "k8s.io/client-go/rest"
	"k8s.io/client-go/tools/clientcmd"
	clientcmdapi "k8s.io/client-go/tools/clientcmd/api"

	. "github.com/onsi/ginkgo"
	. "github.com/onsi/gomega"
)

const (
	// Initial pod start can be delayed O(minutes) by slow docker pulls
	// TODO: Make this 30 seconds once #4566 is resolved.
	PodStartTimeout = 5 * time.Minute

	// Some pods can take much longer to get ready due to volume attach/detach latency.
	slowPodStartTimeout = 15 * time.Minute

	// How often to Poll pods, nodes and claims.
	Poll = 2 * time.Second

	// How long claims have to become dynamically provisioned
	ClaimProvisionTimeout = 5 * time.Minute
)

var (
	// Label allocated to the image puller static pod that runs on each node
	// before e2es.
	ImagePullerLabels = map[string]string{"name": "e2e-image-puller"}
)

// unique identifier of the e2e run
var RunId = uuid.NewUUID()

var subResourceServiceAndNodeProxyVersion = version.MustParse("v1.2.0")

type CreateTestingNSFn func(baseName string, c clientset.Interface, labels map[string]string) (*v1.Namespace, error)

func nowStamp() string {
	return time.Now().Format(time.StampMilli)
}

func log(level string, format string, args ...interface{}) {
	fmt.Fprintf(GinkgoWriter, nowStamp()+": "+level+": "+format+"\n", args...)
}

func Logf(format string, args ...interface{}) {
	log("INFO", format, args...)
}

func Failf(format string, args ...interface{}) {
	msg := fmt.Sprintf(format, args...)
	log("INFO", msg)
	Fail(nowStamp()+": "+msg, 1)
}

type podCondition func(pod *v1.Pod) (bool, error)

// logPodStates logs basic info of provided pods for debugging.
func logPodStates(pods []v1.Pod) {
	// Find maximum widths for pod, node, and phase strings for column printing.
	maxPodW, maxNodeW, maxPhaseW, maxGraceW := len("POD"), len("NODE"), len("PHASE"), len("GRACE")
	for i := range pods {
		pod := &pods[i]
		if len(pod.ObjectMeta.Name) > maxPodW {
			maxPodW = len(pod.ObjectMeta.Name)
		}
		if len(pod.Spec.NodeName) > maxNodeW {
			maxNodeW = len(pod.Spec.NodeName)
		}
		if len(pod.Status.Phase) > maxPhaseW {
			maxPhaseW = len(pod.Status.Phase)
		}
	}
	// Increase widths by one to separate by a single space.
	maxPodW++
	maxNodeW++
	maxPhaseW++
	maxGraceW++

	// Log pod info. * does space padding, - makes them left-aligned.
	Logf("%-[1]*[2]s %-[3]*[4]s %-[5]*[6]s %-[7]*[8]s %[9]s",
		maxPodW, "POD", maxNodeW, "NODE", maxPhaseW, "PHASE", maxGraceW, "GRACE", "CONDITIONS")
	for _, pod := range pods {
		grace := ""
		if pod.DeletionGracePeriodSeconds != nil {
			grace = fmt.Sprintf("%ds", *pod.DeletionGracePeriodSeconds)
		}
		Logf("%-[1]*[2]s %-[3]*[4]s %-[5]*[6]s %-[7]*[8]s %[9]s",
			maxPodW, pod.ObjectMeta.Name, maxNodeW, pod.Spec.NodeName, maxPhaseW, pod.Status.Phase, maxGraceW, grace, pod.Status.Conditions)
	}
	Logf("") // Final empty line helps for readability.
}

func waitForPodCondition(c clientset.Interface, ns, podName, desc string, timeout time.Duration, condition podCondition) error {
	Logf("Waiting up to %[1]v for pod %[2]s status to be %[3]s", timeout, podName, desc)
	for start := time.Now(); time.Since(start) < timeout; time.Sleep(Poll) {
		pod, err := c.Core().Pods(ns).Get(podName)
		if err != nil {
			if apierrs.IsNotFound(err) {
				Logf("Pod %q in namespace %q disappeared. Error: %v", podName, ns, err)
				return err
			}
			// Aligning this text makes it much more readable
			Logf("Get pod %[1]s in namespace '%[2]s' failed, ignoring for %[3]v. Error: %[4]v",
				podName, ns, Poll, err)
			continue
		}
		done, err := condition(pod)
		if done {
			return err
		}
		Logf("Waiting for pod %[1]s in namespace '%[2]s' status to be '%[3]s'"+
			"(found phase: %[4]q, readiness: %[5]t) (%[6]v elapsed)",
			podName, ns, desc, pod.Status.Phase, IsPodReady(pod), time.Since(start))
	}
	return fmt.Errorf("gave up waiting for pod '%s' to be '%s' after %v", podName, desc, timeout)
}

// IsPodReady returns true if a pod is ready; false otherwise.
func IsPodReady(pod *v1.Pod) bool {
	return IsPodReadyConditionTrue(pod.Status)
}

// IsPodReady retruns true if a pod is ready; false otherwise.
func IsPodReadyConditionTrue(status v1.PodStatus) bool {
	condition := GetPodReadyCondition(status)
	return condition != nil && condition.Status == v1.ConditionTrue
}

// Extracts the pod ready condition from the given status and returns that.
// Returns nil if the condition is not present.
func GetPodReadyCondition(status v1.PodStatus) *v1.PodCondition {
	_, condition := GetPodCondition(&status, v1.PodReady)
	return condition
}

// GetPodCondition extracts the provided condition from the given status and returns that.
// Returns nil and -1 if the condition is not present, and the index of the located condition.
func GetPodCondition(status *v1.PodStatus, conditionType v1.PodConditionType) (int, *v1.PodCondition) {
	if status == nil {
		return -1, nil
	}
	for i := range status.Conditions {
		if status.Conditions[i].Type == conditionType {
			return i, &status.Conditions[i]
		}
	}
	return -1, nil
}

// WaitForPersistentVolumeDeleted waits for a PersistentVolume to get deleted or until timeout occurs, whichever comes first.
func WaitForPersistentVolumeDeleted(c clientset.Interface, pvName string, Poll, timeout time.Duration) error {
	Logf("Waiting up to %v for PersistentVolume %s to get deleted", timeout, pvName)
	for start := time.Now(); time.Since(start) < timeout; time.Sleep(Poll) {
		pv, err := c.Core().PersistentVolumes().Get(pvName)
		if err == nil {
			Logf("PersistentVolume %s found and phase=%s (%v)", pvName, pv.Status.Phase, time.Since(start))
			continue
		} else {
			if apierrs.IsNotFound(err) {
				Logf("PersistentVolume %s was removed", pvName)
				return nil
			} else {
				Logf("Get persistent volume %s in failed, ignoring for %v: %v", pvName, Poll, err)
			}
		}
	}
	return fmt.Errorf("PersistentVolume %s still exists within %v", pvName, timeout)
}

// WaitForPersistentVolumeClaimPhase waits for a PersistentVolumeClaim to be in a specific phase or until timeout occurs, whichever comes first.
func WaitForPersistentVolumeClaimPhase(phase v1.PersistentVolumeClaimPhase, c clientset.Interface, ns string, pvcName string, Poll, timeout time.Duration) error {
	Logf("Waiting up to %v for PersistentVolumeClaim %s to have phase %s", timeout, pvcName, phase)
	for start := time.Now(); time.Since(start) < timeout; time.Sleep(Poll) {
		pvc, err := c.Core().PersistentVolumeClaims(ns).Get(pvcName)
		if err != nil {
			Logf("Get persistent volume claim %s in failed, ignoring for %v: %v", pvcName, Poll, err)
			continue
		} else {
			if pvc.Status.Phase == phase {
				Logf("PersistentVolumeClaim %s found and phase=%s (%v)", pvcName, phase, time.Since(start))
				return nil
			} else {
				Logf("PersistentVolumeClaim %s found but phase is %s instead of %s.", pvcName, pvc.Status.Phase, phase)
			}
		}
	}
	return fmt.Errorf("PersistentVolumeClaim %s not in phase %s within %v", pvcName, phase, timeout)
}

// CreateTestingNS should be used by every test, note that we append a common prefix to the provided test name.
// Please see NewFramework instead of using this directly.
func CreateTestingNS(baseName string, c clientset.Interface, labels map[string]string) (*v1.Namespace, error) {
	if labels == nil {
		labels = map[string]string{}
	}
	labels["e2e-run"] = string(RunId)

	namespaceObj := &v1.Namespace{
		ObjectMeta: v1.ObjectMeta{
			GenerateName: fmt.Sprintf("e2e-tests-%v-", baseName),
			Namespace:    "",
			Labels:       labels,
		},
		Status: v1.NamespaceStatus{},
	}
	// Be robust about making the namespace creation call.
	var got *v1.Namespace
	if err := wait.PollImmediate(Poll, 30*time.Second, func() (bool, error) {
		var err error
		got, err = c.Core().Namespaces().Create(namespaceObj)
		if err != nil {
			Logf("Unexpected error while creating namespace: %v", err)
			return false, nil
		}
		return true, nil
	}); err != nil {
		return nil, err
	}

	return got, nil
}

// deleteNS deletes the provided namespace, waits for it to be completely deleted, and then checks
// whether there are any pods remaining in a non-terminating state.
func deleteNS(c clientset.Interface, clientPool dynamic.ClientPool, namespace string, timeout time.Duration) error {
	if err := c.Core().Namespaces().Delete(namespace, nil); err != nil {
		return err
	}

	// wait for namespace to delete or timeout.
	err := wait.PollImmediate(5*time.Second, timeout, func() (bool, error) {
		if _, err := c.Core().Namespaces().Get(namespace); err != nil {
			if apierrs.IsNotFound(err) {
				return true, nil
			}
			Logf("Error while waiting for namespace to be terminated: %v", err)
			return false, nil
		}
		return false, nil
	})

	// verify there is no more remaining content in the namespace
	remainingContent, cerr := hasRemainingContent(c, clientPool, namespace)
	if cerr != nil {
		return cerr
	}

	// if content remains, let's dump information about the namespace, and system for flake debugging.
	remainingPods := 0
	missingTimestamp := 0
	if remainingContent {
		// log information about namespace, and set of namespaces in api server to help flake detection
		logNamespace(c, namespace)
		logNamespaces(c, namespace)

		// if we can, check if there were pods remaining with no timestamp.
		remainingPods, missingTimestamp, _ = countRemainingPods(c, namespace)
	}

	// a timeout waiting for namespace deletion happened!
	if err != nil {
		// some content remains in the namespace
		if remainingContent {
			// pods remain
			if remainingPods > 0 {
				// but they were all undergoing deletion (kubelet is probably culprit)
				if missingTimestamp == 0 {
					return fmt.Errorf("namespace %v was not deleted with limit: %v, pods remaining: %v, pods missing deletion timestamp: %v", namespace, err, remainingPods, missingTimestamp)
				}
				// pods remained, but were not undergoing deletion (namespace controller is probably culprit)
				return fmt.Errorf("namespace %v was not deleted with limit: %v, pods remaining: %v", namespace, err, remainingPods)
			}
			// other content remains (namespace controller is probably screwed up)
			return fmt.Errorf("namespace %v was not deleted with limit: %v, namespaced content other than pods remain", namespace, err)
		}
		// no remaining content, but namespace was not deleted (namespace controller is probably wedged)
		return fmt.Errorf("namespace %v was not deleted with limit: %v, namespace is empty but is not yet removed", namespace, err)
	}
	return nil
}

// logNamespaces logs the number of namespaces by phase
// namespace is the namespace the test was operating against that failed to delete so it can be grepped in logs
func logNamespaces(c clientset.Interface, namespace string) {
	namespaceList, err := c.Core().Namespaces().List(v1.ListOptions{})
	if err != nil {
		Logf("namespace: %v, unable to list namespaces: %v", namespace, err)
		return
	}

	numActive := 0
	numTerminating := 0
	for _, namespace := range namespaceList.Items {
		if namespace.Status.Phase == v1.NamespaceActive {
			numActive++
		} else {
			numTerminating++
		}
	}
	Logf("namespace: %v, total namespaces: %v, active: %v, terminating: %v", namespace, len(namespaceList.Items), numActive, numTerminating)
}

// logNamespace logs detail about a namespace
func logNamespace(c clientset.Interface, namespace string) {
	ns, err := c.Core().Namespaces().Get(namespace)
	if err != nil {
		if apierrs.IsNotFound(err) {
			Logf("namespace: %v no longer exists", namespace)
			return
		}
		Logf("namespace: %v, unable to get namespace due to error: %v", namespace, err)
		return
	}
	Logf("namespace: %v, DeletionTimetamp: %v, Finalizers: %v, Phase: %v", ns.Name, ns.DeletionTimestamp, ns.Spec.Finalizers, ns.Status.Phase)
}

// countRemainingPods queries the server to count number of remaining pods, and number of pods that had a missing deletion timestamp.
func countRemainingPods(c clientset.Interface, namespace string) (int, int, error) {
	// check for remaining pods
	pods, err := c.Core().Pods(namespace).List(v1.ListOptions{})
	if err != nil {
		return 0, 0, err
	}

	// nothing remains!
	if len(pods.Items) == 0 {
		return 0, 0, nil
	}

	// stuff remains, log about it
	logPodStates(pods.Items)

	// check if there were any pods with missing deletion timestamp
	numPods := len(pods.Items)
	missingTimestamp := 0
	for _, pod := range pods.Items {
		if pod.DeletionTimestamp == nil {
			missingTimestamp++
		}
	}
	return numPods, missingTimestamp, nil
}

// hasRemainingContent checks if there is remaining content in the namespace via API discovery
func hasRemainingContent(c clientset.Interface, clientPool dynamic.ClientPool, namespace string) (bool, error) {
	// some tests generate their own framework.Client rather than the default
	// TODO: ensure every test call has a configured clientPool
	if clientPool == nil {
		return false, nil
	}

	// find out what content is supported on the server
	groupVersionResources, err := c.Discovery().ServerPreferredNamespacedResources()
	if err != nil {
		return false, err
	}

	// TODO: temporary hack for https://github.com/kubernetes/kubernetes/issues/31798
	ignoredResources := sets.NewString("bindings")

	contentRemaining := false

	// dump how many of resource type is on the server in a log.
	for _, gvr := range groupVersionResources {
		// get a client for this group version...
		dynamicClient, err := clientPool.ClientForGroupVersionResource(gvr)
		if err != nil {
			// not all resource types support list, so some errors here are normal depending on the resource type.
			Logf("namespace: %s, unable to get client - gvr: %v, error: %v", namespace, gvr, err)
			continue
		}
		// get the api resource
		apiResource := unversioned.APIResource{Name: gvr.Resource, Namespaced: true}
		// TODO: temporary hack for https://github.com/kubernetes/kubernetes/issues/31798
		if ignoredResources.Has(apiResource.Name) {
			Logf("namespace: %s, resource: %s, ignored listing per whitelist", namespace, apiResource.Name)
			continue
		}
		obj, err := dynamicClient.Resource(&apiResource, namespace).List(&v1.ListOptions{})
		if err != nil {
			// not all resources support list, so we ignore those
			if apierrs.IsMethodNotSupported(err) || apierrs.IsNotFound(err) || apierrs.IsForbidden(err) {
				continue
			}
			return false, err
		}
		unstructuredList, ok := obj.(*runtime.UnstructuredList)
		if !ok {
			return false, fmt.Errorf("namespace: %s, resource: %s, expected *runtime.UnstructuredList, got %#v", namespace, apiResource.Name, obj)
		}
		if len(unstructuredList.Items) > 0 {
			Logf("namespace: %s, resource: %s, items remaining: %v", namespace, apiResource.Name, len(unstructuredList.Items))
			contentRemaining = true
		}
	}
	return contentRemaining, nil
}

// Waits default amount of time (PodStartTimeout) for the specified pod to become running.
// Returns an error if timeout occurs first, or pod goes in to failed state.
func WaitForPodRunningInNamespace(c clientset.Interface, pod *v1.Pod) error {
	// this short-cicuit is needed for cases when we pass a list of pods instead
	// of newly created pod (e.g. VerifyPods) which means we are getting already
	// running pod for which waiting does not make sense and will always fail
	if pod.Status.Phase == v1.PodRunning {
		return nil
	}
	return waitTimeoutForPodRunningInNamespace(c, pod.Name, pod.Namespace, pod.ResourceVersion, PodStartTimeout)
}

func waitTimeoutForPodRunningInNamespace(c clientset.Interface, podName, namespace, resourceVersion string, timeout time.Duration) error {
	w, err := c.Core().Pods(namespace).Watch(SingleObject(v1.ObjectMeta{Name: podName, ResourceVersion: resourceVersion}))
	if err != nil {
		return err
	}
	_, err = watch.Until(timeout, w, PodRunning)
	return err
}

// SingleObject returns a ListOptions for watching a single object.
func SingleObject(meta v1.ObjectMeta) v1.ListOptions {
	return v1.ListOptions{
		FieldSelector:   fields.OneTermEqualSelector("metadata.name", meta.Name).String(),
		ResourceVersion: meta.ResourceVersion,
	}
}

// ErrPodCompleted is returned by PodRunning or PodContainerRunning to indicate that
// the pod has already reached completed state.
var ErrPodCompleted = fmt.Errorf("pod ran to completion")

// PodRunning returns true if the pod is running, false if the pod has not yet reached running state,
// returns ErrPodCompleted if the pod has run to completion, or an error in any other case.
func PodRunning(event watch.Event) (bool, error) {
	switch event.Type {
	case watch.Deleted:
		return false, apierrs.NewNotFound(unversioned.GroupResource{Resource: "pods"}, "")
	}
	switch t := event.Object.(type) {
	case *v1.Pod:
		switch t.Status.Phase {
		case v1.PodRunning:
			return true, nil
		case v1.PodFailed, v1.PodSucceeded:
			return false, ErrPodCompleted
		}
	}
	return false, nil
}

// waitForPodSuccessInNamespaceTimeout returns nil if the pod reached state success, or an error if it reached failure or ran too long.
func waitForPodSuccessInNamespaceTimeout(c clientset.Interface, podName string, namespace string, timeout time.Duration) error {
	return waitForPodCondition(c, namespace, podName, "success or failure", timeout, func(pod *v1.Pod) (bool, error) {
		if pod.Spec.RestartPolicy == v1.RestartPolicyAlways {
			return true, fmt.Errorf("pod %q will never terminate with a succeeded state since its restart policy is Always", podName)
		}
		switch pod.Status.Phase {
		case v1.PodSucceeded:
			By("Saw pod success")
			return true, nil
		case v1.PodFailed:
			return true, fmt.Errorf("pod %q failed with status: %+v", podName, pod.Status)
		default:
			return false, nil
		}
	})
}

// WaitForPodSuccessInNamespace returns nil if the pod reached state success, or an error if it reached failure or until podStartupTimeout.
func WaitForPodSuccessInNamespace(c clientset.Interface, podName string, namespace string) error {
	return waitForPodSuccessInNamespaceTimeout(c, podName, namespace, PodStartTimeout)
}

// WaitForPodSuccessInNamespaceSlow returns nil if the pod reached state success, or an error if it reached failure or until slowPodStartupTimeout.
func WaitForPodSuccessInNamespaceSlow(c clientset.Interface, podName string, namespace string) error {
	return waitForPodSuccessInNamespaceTimeout(c, podName, namespace, slowPodStartTimeout)
}

// ServerVersionGTE returns true if v is greater than or equal to the server
// version.
//
// TODO(18726): This should be incorporated into client.VersionInterface.
func ServerVersionGTE(v semver.Version, c discovery.ServerVersionInterface) (bool, error) {
	serverVersion, err := c.ServerVersion()
	if err != nil {
		return false, fmt.Errorf("Unable to get server version: %v", err)
	}
	sv, err := version.Parse(serverVersion.GitVersion)
	if err != nil {
		return false, fmt.Errorf("Unable to parse server version %q: %v", serverVersion.GitVersion, err)
	}
	return sv.GTE(v), nil
}

func restclientConfig(kubeContext string) (*clientcmdapi.Config, error) {
	Logf(">>> kubeConfig: %s\n", TestContext.KubeConfig)
	if TestContext.KubeConfig == "" {
		return nil, fmt.Errorf("KubeConfig must be specified to load client config")
	}
	c, err := clientcmd.LoadFromFile(TestContext.KubeConfig)
	if err != nil {
		return nil, fmt.Errorf("error loading KubeConfig: %v", err.Error())
	}
	if kubeContext != "" {
		Logf(">>> kubeContext: %s\n", kubeContext)
		c.CurrentContext = kubeContext
	}
	return c, nil
}

func LoadConfig() (*restclient.Config, error) {
	if TestContext.NodeE2E {
		// This is a node e2e test, apply the node e2e configuration
		return &restclient.Config{Host: TestContext.Host}, nil
	}
	c, err := restclientConfig(TestContext.KubeContext)
	if err != nil {
		return nil, err
	}

	return clientcmd.NewDefaultClientConfig(*c, &clientcmd.ConfigOverrides{ClusterInfo: clientcmdapi.Cluster{Server: TestContext.Host}}).ClientConfig()
}

func ExpectNoError(err error, explain ...interface{}) {
	if err != nil {
		Logf("Unexpected error occurred: %v", err)
	}
	ExpectWithOffset(1, err).NotTo(HaveOccurred(), explain...)
}

type EventsLister func(opts v1.ListOptions, ns string) (*v1.EventList, error)

func DumpEventsInNamespace(eventsLister EventsLister, namespace string) {
	By(fmt.Sprintf("Collecting events from namespace %q.", namespace))
	events, err := eventsLister(v1.ListOptions{}, namespace)
	Expect(err).NotTo(HaveOccurred())

	By(fmt.Sprintf("Found %d events.", len(events.Items)))
	// Sort events by their first timestamp
	sortedEvents := events.Items
	if len(sortedEvents) > 1 {
		sort.Sort(byFirstTimestamp(sortedEvents))
	}
	for _, e := range sortedEvents {
		Logf("At %v - event for %v: %v %v: %v", e.FirstTimestamp, e.InvolvedObject.Name, e.Source, e.Reason, e.Message)
	}
	// Note that we don't wait for any Cleanup to propagate, which means
	// that if you delete a bunch of pods right before ending your test,
	// you may or may not see the killing/deletion/Cleanup events.
}

func DumpAllNamespaceInfo(c clientset.Interface, namespace string) {
	DumpEventsInNamespace(func(opts v1.ListOptions, ns string) (*v1.EventList, error) {
		return c.Core().Events(ns).List(opts)
	}, namespace)

	// If cluster is large, then the following logs are basically useless, because:
	// 1. it takes tens of minutes or hours to grab all of them
	// 2. there are so many of them that working with them are mostly impossible
	// So we dump them only if the cluster is relatively small.
	maxNodesForDump := 20
	if nodes, err := c.Core().Nodes().List(v1.ListOptions{}); err == nil {
		if len(nodes.Items) <= maxNodesForDump {
			dumpAllPodInfo(c)
			dumpAllNodeInfo(c)
		} else {
			Logf("skipping dumping cluster info - cluster too large")
		}
	} else {
		Logf("unable to fetch node list: %v", err)
	}
}

// byFirstTimestamp sorts a slice of events by first timestamp, using their involvedObject's name as a tie breaker.
type byFirstTimestamp []v1.Event

func (o byFirstTimestamp) Len() int      { return len(o) }
func (o byFirstTimestamp) Swap(i, j int) { o[i], o[j] = o[j], o[i] }

func (o byFirstTimestamp) Less(i, j int) bool {
	if o[i].FirstTimestamp.Equal(o[j].FirstTimestamp) {
		return o[i].InvolvedObject.Name < o[j].InvolvedObject.Name
	}
	return o[i].FirstTimestamp.Before(o[j].FirstTimestamp)
}

func dumpAllPodInfo(c clientset.Interface) {
	pods, err := c.Core().Pods("").List(v1.ListOptions{})
	if err != nil {
		Logf("unable to fetch pod debug info: %v", err)
	}
	logPodStates(pods.Items)
}

func dumpAllNodeInfo(c clientset.Interface) {
	// It should be OK to list unschedulable Nodes here.
	nodes, err := c.Core().Nodes().List(v1.ListOptions{})
	if err != nil {
		Logf("unable to fetch node list: %v", err)
		return
	}
	names := make([]string, len(nodes.Items))
	for ix := range nodes.Items {
		names[ix] = nodes.Items[ix].Name
	}
	DumpNodeDebugInfo(c, names, Logf)
}

func DumpNodeDebugInfo(c clientset.Interface, nodeNames []string, logFunc func(fmt string, args ...interface{})) {
	for _, n := range nodeNames {
		logFunc("\nLogging node info for node %v", n)
		node, err := c.Core().Nodes().Get(n)
		if err != nil {
			logFunc("Error getting node info %v", err)
		}
		logFunc("Node Info: %v", node)

		logFunc("\nLogging kubelet events for node %v", n)
		for _, e := range getNodeEvents(c, n) {
			logFunc("source %v type %v message %v reason %v first ts %v last ts %v, involved obj %+v",
				e.Source, e.Type, e.Message, e.Reason, e.FirstTimestamp, e.LastTimestamp, e.InvolvedObject)
		}
		logFunc("\nLogging pods the kubelet thinks is on node %v", n)
		podList, err := GetKubeletPods(c, n)
		if err != nil {
			logFunc("Unable to retrieve kubelet pods for node %v", n)
			continue
		}
		for _, p := range podList.Items {
			logFunc("%v started at %v (%d+%d container statuses recorded)", p.Name, p.Status.StartTime, len(p.Status.InitContainerStatuses), len(p.Status.ContainerStatuses))
			for _, c := range p.Status.InitContainerStatuses {
				logFunc("\tInit container %v ready: %v, restart count %v",
					c.Name, c.Ready, c.RestartCount)
			}
			for _, c := range p.Status.ContainerStatuses {
				logFunc("\tContainer %v ready: %v, restart count %v",
					c.Name, c.Ready, c.RestartCount)
			}
		}
		// HighLatencyKubeletOperations(c, 10*time.Second, n, logFunc)
		// TODO: Log node resource info
	}
}

// logNodeEvents logs kubelet events from the given node. This includes kubelet
// restart and node unhealthy events. Note that listing events like this will mess
// with latency metrics, beware of calling it during a test.
func getNodeEvents(c clientset.Interface, nodeName string) []v1.Event {
	selector := fields.Set{
		"involvedObject.kind":      "Node",
		"involvedObject.name":      nodeName,
		"involvedObject.namespace": v1.NamespaceAll,
		"source":                   "kubelet",
	}.AsSelector()
	options := v1.ListOptions{FieldSelector: selector.String()}
	events, err := c.Core().Events(api.NamespaceSystem).List(options)
	if err != nil {
		Logf("Unexpected error retrieving node events %v", err)
		return []v1.Event{}
	}
	return events.Items
}

func isNodeConditionSetAsExpected(node *v1.Node, conditionType v1.NodeConditionType, wantTrue, silent bool) bool {
	// Check the node readiness condition (logging all).
	for _, cond := range node.Status.Conditions {
		// Ensure that the condition type and the status matches as desired.
		if cond.Type == conditionType {
			if (cond.Status == v1.ConditionTrue) == wantTrue {
				return true
			} else {
				if !silent {
					Logf("Condition %s of node %s is %v instead of %t. Reason: %v, message: %v",
						conditionType, node.Name, cond.Status == v1.ConditionTrue, wantTrue, cond.Reason, cond.Message)
				}
				return false
			}
		}
	}
	if !silent {
		Logf("Couldn't find condition %v on node %v", conditionType, node.Name)
	}
	return false
}

func IsNodeConditionSetAsExpected(node *v1.Node, conditionType v1.NodeConditionType, wantTrue bool) bool {
	return isNodeConditionSetAsExpected(node, conditionType, wantTrue, false)
}

func IsNodeConditionSetAsExpectedSilent(node *v1.Node, conditionType v1.NodeConditionType, wantTrue bool) bool {
	return isNodeConditionSetAsExpected(node, conditionType, wantTrue, true)
}

// Checks whether not-ready nodes can be ignored while checking if all nodes are
// ready (we allow e.g. for incorrect provisioning of some small percentage of nodes
// while validating cluster, and those nodes may never become healthy).
// Currently we allow only for:
// - not present CNI plugins on node
// TODO: we should extend it for other reasons.
func allowedNotReadyReasons(nodes []*v1.Node) bool {
	for _, node := range nodes {
		index, condition := GetNodeCondition(&node.Status, v1.NodeReady)
		if index == -1 ||
			!strings.Contains(condition.Message, "could not locate kubenet required CNI plugins") {
			return false
		}
	}
	return true
}

// GetNodeCondition extracts the provided condition from the given status and returns that.
// Returns nil and -1 if the condition is not present, and the index of the located condition.
func GetNodeCondition(status *v1.NodeStatus, conditionType v1.NodeConditionType) (int, *v1.NodeCondition) {
	if status == nil {
		return -1, nil
	}
	for i := range status.Conditions {
		if status.Conditions[i].Type == conditionType {
			return i, &status.Conditions[i]
		}
	}
	return -1, nil
}

// Checks whether all registered nodes are ready.
// TODO: we should change the AllNodesReady call in AfterEach to WaitForAllNodesHealthy,
// and figure out how to do it in a configurable way, as we can't expect all setups to run
// default test add-ons.
func AllNodesReady(c clientset.Interface, timeout time.Duration) error {
	Logf("Waiting up to %v for all (but %d) nodes to be ready", timeout, TestContext.AllowedNotReadyNodes)

	var notReady []*v1.Node
	err := wait.PollImmediate(Poll, timeout, func() (bool, error) {
		notReady = nil
		// It should be OK to list unschedulable Nodes here.
		nodes, err := c.Core().Nodes().List(v1.ListOptions{})
		if err != nil {
			return false, err
		}
		for i := range nodes.Items {
			node := &nodes.Items[i]
			if !IsNodeConditionSetAsExpected(node, v1.NodeReady, true) {
				notReady = append(notReady, node)
			}
		}
		// Framework allows for <TestContext.AllowedNotReadyNodes> nodes to be non-ready,
		// to make it possible e.g. for incorrect deployment of some small percentage
		// of nodes (which we allow in cluster validation). Some nodes that are not
		// provisioned correctly at startup will never become ready (e.g. when something
		// won't install correctly), so we can't expect them to be ready at any point.
		//
		// However, we only allow non-ready nodes with some specific reasons.
		if len(notReady) > TestContext.AllowedNotReadyNodes {
			return false, nil
		}
		return allowedNotReadyReasons(notReady), nil
	})

	if err != nil && err != wait.ErrWaitTimeout {
		return err
	}

	if len(notReady) > TestContext.AllowedNotReadyNodes || !allowedNotReadyReasons(notReady) {
		return fmt.Errorf("Not ready nodes: %#v", notReady)
	}
	return nil
}

// timeout for proxy requests.
const proxyTimeout = 2 * time.Minute

// NodeProxyRequest performs a get on a node proxy endpoint given the nodename and rest client.
func NodeProxyRequest(c clientset.Interface, node, endpoint string) (restclient.Result, error) {
	// proxy tends to hang in some cases when Node is not ready. Add an artificial timeout for this call.
	// This will leak a goroutine if proxy hangs. #22165
	subResourceProxyAvailable, err := ServerVersionGTE(subResourceServiceAndNodeProxyVersion, c.Discovery())
	if err != nil {
		return restclient.Result{}, err
	}
	var result restclient.Result
	finished := make(chan struct{})
	go func() {
		if subResourceProxyAvailable {
			result = c.Core().RESTClient().Get().
				Resource("nodes").
				SubResource("proxy").
				Name(fmt.Sprintf("%v:%v", node, ports.KubeletPort)).
				Suffix(endpoint).
				Do()

		} else {
			result = c.Core().RESTClient().Get().
				Prefix("proxy").
				Resource("nodes").
				Name(fmt.Sprintf("%v:%v", node, ports.KubeletPort)).
				Suffix(endpoint).
				Do()
		}
		finished <- struct{}{}
	}()
	select {
	case <-finished:
		return result, nil
	case <-time.After(proxyTimeout):
		return restclient.Result{}, nil
	}
}

// GetKubeletPods retrieves the list of pods on the kubelet
func GetKubeletPods(c clientset.Interface, node string) (*v1.PodList, error) {
	return getKubeletPods(c, node, "pods")
}

func getKubeletPods(c clientset.Interface, node, resource string) (*v1.PodList, error) {
	result := &v1.PodList{}
	client, err := NodeProxyRequest(c, node, resource)
	if err != nil {
		return &v1.PodList{}, err
	}
	if err = client.Into(result); err != nil {
		return &v1.PodList{}, err
	}
	return result, nil
}

func WaitForPodToDisappear(c clientset.Interface, ns, podName string, label labels.Selector, interval, timeout time.Duration) error {
	return wait.PollImmediate(interval, timeout, func() (bool, error) {
		Logf("Waiting for pod %s to disappear", podName)
		options := v1.ListOptions{LabelSelector: label.String()}
		pods, err := c.Core().Pods(ns).List(options)
		if err != nil {
			return false, err
		}
		found := false
		for _, pod := range pods.Items {
			if pod.Name == podName {
				Logf("Pod %s still exists", podName)
				found = true
				break
			}
		}
		if !found {
			Logf("Pod %s no longer exists", podName)
			return true, nil
		}
		return false, nil
	})
}

func WaitForDeploymentPodsRunning(c clientset.Interface, ns, name string) error {
	deployment, err := c.Extensions().Deployments(ns).Get(name)
	if err != nil {
		return err
	}
	selector := labels.SelectorFromSet(labels.Set(deployment.Spec.Selector.MatchLabels))
	err = WaitForPodsWithLabelRunning(c, ns, selector)
	if err != nil {
		return fmt.Errorf("Error while waiting for Deployment %s pods to be running: %v", name, err)
	}
	return nil
}

// Wait up to 1 minute for all matching pods to become Running and at least one
// matching pod exists.
func WaitForPodsWithLabelRunning(c clientset.Interface, ns string, label labels.Selector) error {
	running := false
	options := v1.ListOptions{LabelSelector: label.String()}
	podClient := c.Core().Pods(ns)
waitLoop:
	for start := time.Now(); time.Since(start) < 1*time.Minute; time.Sleep(5 * time.Second) {
		pods, err := podClient.List(options)
		if err != nil {
			continue waitLoop
		}
		if len(pods.Items) == 0 {
			continue waitLoop
		}
		for _, p := range pods.Items {
			if p.Status.Phase != v1.PodRunning {
				continue waitLoop
			}
		}
		running = true
		break
	}
	if !running {
		return fmt.Errorf("Timeout while waiting for pods with labels %q to be running", label.String())
	}
	return nil
}

redpajama_set_name: RedPajamaGithub


text:
Pilea for Sale Online
About Pilea:
Pilea genus is also known as creeping Charlie and clearweed. It belongs to the family Urticaceae. Pilea consists of 600 to 715 species that may have water-storing leaves. It can grow to a height of 1 foot. It can live life up to 10 years with the right care. This genus is non-toxic to both humans as well as pets. It is present in temperate and tropical regions all over the world. If you are a Pilea lover, order your favorite plant from the sale online at Plantly!
Pilea Care:
Plants of this genus love indirect and bright light where direct lives can scorch their leaves. They generally require water once a week which also depends on sunlight. Pileas need well-drained soil which should be quite rich. They like the temperature up to 13C to 30C. Humidity between 50% to 75% is more suitable. fungus gnats damage the plant and can be removed from it. After that, the plant should be insecticide as soon as possible. Spider mites also attack these plants which can be fled away by onions and garlic.
Rare Plants (325)
Indoor Plants (950)
Outdoor Plants (477)
Plant Accessories & Crafts (100)
Seeds (115)
Pilea peperomioides
Only 10 available and it's in 2 people's basket
The Pilea peperomioides is a popular houseplant thanks to its attractive coin-shaped foliage and ease of care. AKA Chinese Money Plant
4″ Pilea Peperomioides + Planter Basket
Sold By: NEEPA HUT
PLANTER BASKET WITH LIVE INDOOR PLANT
4.5" String of Needles
String of Pearls – Senecio Rowleyanus – Easy to Grow Succulent Plant
Sold By: A&K Plants
The String of Pearls is a member of the Senecio family, which also includes 'Dusty Miller', 'German Ivy', and 'Cineraria', to name a few.


text:
Lacerhate - Blood.Lies.Idiots.Death.CD Digipack
Italian Hardcore / Metal heavyweights Lacerhate are the latest addition to the 1054 roster & this new ablum is an absolute killer !!!!
Packaged in a very slick 6 panel Digipack be prepared to be amazed by the flawless song writing & musicianship with a near perfect productionc be sure to add one of these to your collection !!!!
01. Dawn Of The Black Season
02. 15 (Inhaled)
03. Dirty Flags
04. Puppets
05. Icky Drops
07. Gone
08. Scum Of The Earth (Cliché)
09. B.L.I.D.
Release date Nov 17th 2022
BAND BIO :
Lacerhate started out in 2008, in Cremona/Bergamo (Italy) as a metal/hardcore band influenced by the Punk/HC/Metal scene (bands like Hatebreed, Sepultura, Soulfly, All Shall Perish...).
After recording a self titled four tracks demo in 2009, the band faced various line up changes and finally, on February 2011, released the first official Ep "Reborn From Ashes?": a six track work that shifted their style towards a blend of crossover/hardcore. "Reborn From Ashes?" immediately gained the appreciation of both media and fans, and allowed the band to play around Italy.
The first Lacerhate Album called "Mass Distraction" was released through Revalve Records on October 27th 2014 (with worldwide physical and digital distribution) and contains nine tracks of angry metal sound which recall bands like Hatebreed and Slayer, melted with their trademark of haunting riffworks and heavy rhytmic wall.
Over the years, LacerHate had the pleasure to share the stage with important names of the international metal/hardcore scene (Possessed, Arch Enemy, Walls of Jericho, Aura Noir, Thell Barrio, Death Before Dishonor...) and had the opportunity to play outside Italy (with gigs in Austria, Belgium, Germany, Switzerland).