text:
Posts Tagged 'history'
The Trumpocalypse: Angry = Stupid
Posted in Trumpocalypse, tagged Anger Management, Donald Trump, Election 2016, history, politics, Psychology on November 21, 2016| Leave a Comment »
Also: Angry = Malleable
Polls tell us that people voted for Trump because they're angry: angry at the economy for leaving them behind; angry at the government for not helping; angry at politicians for doing nothing. It's understandable, the economy is clearly not serving middle class America. Plus there's a drug epidemic out there, the threats of terrorism are real, and some parts of the country can't even drink the water. Yep, lots to be angry about.
There's a real problem with that, though. When you're angry, you're stupid. Science says so.
Anger is a powerful emotion. It evolved in humans as a mechanism to protect oneself, or one's food, or one's mate, or one's offspring. It — like it's counterpart, fear — is a knee-jerk reaction to a threat. Something threatens you, and your instincts gurgle up one of these two emotions, depending on your likelihood of survival. If your instincts think you can beat back the threat, then anger wells up, raising adrenaline and endorphins, giving you more strength than you normally might have. You can then bellow in rage or outright attack to fend off the threat. Fear is different: if your instincts think you have no chance of survival, they'll use that nasty feeling in the pit of your stomach to convince you to run away or hide.
Here's the rub: neither of those emotionally-driven reactions are controlled by the mind. They're not, because the mind is too slow. You'll be sitting there, pondering all the options, while that sabre-tooth tiger gnaws on your bones. Your instincts must work, and they must work now, or you're a dead proto-human.
Let's fast-forward the clock 10,000 years. Most of the immediate threats to our lives no longer exist (the only one left is, well, Man). So … what good are the strong emotions of Fear and Anger? Well, they're kinda worthless today, but we've had them for sooooo long now, they're hard to shake. They crop up at the worst times and, because they shut off the thinking mind, they make us stupid.
In some cases, they short-circuit our well-being. An overwrought anger mechanism is the worst sort of demon one can have. You're a walking Rage Monster, ready to fly off the handle if someone looks at you funny or takes the last Hot Pocket. If you're self-aware, you seek counseling or find an outlet to keep from tearing yourself or your family apart. If you're not self-aware, well, you're probably going to end up in prison. You're certainly not going to walk around making sane life choices.
The other thing that's bad about anger is it's easily manipulatable. You can use all sorts of trickery to trigger an anger response, and media outlets (who are more marketers than journalists) are experts at it. It's even worse in a crowd, there's a reason demagogues are successful.
So let's now couple these two things together: anger makes us stupid, and it's easy to manipulate people through anger. Here's the earth-shattering conclusion:
People who are stirring up your anger are doing so to manipulate you into making stupid decisions.
That's the key story of The Trumpocalypse: between the various right-wing media outlets, the Republican Party, the Christian Right, and Donald Trump himself, enough of the voting public was manipulated into making the stupidest decision of our lives.
The Trumpocalypse: What Were You Thinking?
Posted in Trumpocalypse, tagged Donald Trump, Election 2016, history, Presidency on November 15, 2016| 1 Comment »
His Fraudulency, The President of the United States
It's been seven days since America proved, by actual vote, that it's lost its mind. I am still utterly disgusted. Not disappointed, but actually disgusted. I know things suck in many parts of the country. I know economic statistics belie the misery of underemployment. I know there are a lot of reasons to suspect that America is up against the ropes and isn't living up to its potential. And there is definitely something wrong with our political institutions, especially the two major parties. Still, I have to ask:
What in the world were you thinking?
I hate to break the news to you, but Donald Trump is a fraud. A masterful marketer? Yes. A reality-show diva? Absolutely. A wizard at real estate? Without a doubt [edit: but many doubts exist]. But in terms of having the knowledge, the skills, the temperament, the dedication, the wherewithal, the understanding, or even the fundamental class & decency necessary to hold the highest office in the land? Absolutely not. In all these terms, he's a total fraud. You have been duped, my fellow Americans, and you've screwed us all accordingly. You elected a snake-oil salesman as President of the United States of America.
This is a man who made his billions riding the vagaries of the real estate market. That's … pretty much it. He bought low & sold high at the right times, that's his only primary skill. The rest? It's all fluff and nonsense. Sure, he has a team of high-powered lawyers to screw over contractors and protect his interests. Sure, he has clever accountants who know how to ride the tax system. But what has he actually contributed to society? Nothing. At least Ross Perot created a couple of early-era tech companies, resulting in thousands of highly paid jobs. At least Michael Bloomberg ran a respected financial research company, providing millions of investors, large and small, with quality information. What did Trump do for anyone other than his immediate family and close circle of sycophants? Create crappy service-sector jobs cleaning toilets and carrying golf clubs Yippee.
Beyond that, what is he? He's a masterful marketer and self-promoter, that's what he is. Trump-this and Trump-that, all of these products essentially frauds. Most things with his name on them are just license arrangements, he's only directly involved in a handful of businesses. He's nothing but a trademark. He's the Wizard of Oz: a big, bloated head, floating around, trying to scare people. Behind the curtain? A very small and unimportant man. He's all show and no do; all bluster and no muster. He has done nothing but promote promote promote, always about himself, never about others. Even his charitable works are under serious suspicion. He's even screwed over veterans' causes. First rule of being a president is you must care about the country and its people. He has never, in his sordid history, shown the least concern about anyone or anything other than his own brand.
Shouldn't a president have some knowledge of how the world truly works? If you think he (or she) should, have you ever listened … I mean really listened … to anything Donald Trump says? Stereotypical marketing blather, that's all. His statements on how to "make America great again" contain as much understanding and wisdom as an Axe Body Spray commercial. His quotes are right up there with "I'll paint any car for $99.95" and "makes your colors bright and your whites white" (hmmm, that last one may have been a poor example for a completely different set of reasons). There's even serious evidence that he's functionally illiterate. Why would you want such a person in high office? For the lulz?
Finally, shouldn't a president at least have some dignity? The president represents the entire country. The job simultaneously requires strength and gravitas, neither of which Donald Trump has ever shown. He is weak-willed and goofy, he has skin as thick as a ripe peach and all the seriousness of a bag of gummy worms. He sends vitriolic tweet storms against low-grade comics who pick on him on TV, and spent his debate appearances defending his own penis size. He's his own caricature, a walking punch line, a joke of the worst sort. This is even before considering his constant stream of insulting remarks made over the last 18 months. How is any of that presidential? Sure, it makes the average fourth-grader laugh, but how does that represent our country, our values? If you voted for Donald Trump as president, you clearly have as much respect for the country as you have for a high school pep squad.
I don't get it. I honestly do not get it. I do have a suspicion as to where this country is heading, though. Four years from now, it's gonna look something like this:
"What the Heck Are You Up To, Mr. President?"
Posted in Books & Music, tagged books, history, Jimmy Carter, Kevin Mattson on October 19, 2015| Leave a Comment »
There was only one topic I wanted to discuss in a blog post on Jimmy Carter, and that was how a Presidency could fail. It is as important, if not more so, to study failure as it is to study success. I scoured Amazon & Google for books on the Carter presidency, hoping to find a treatise on how it went so wrong.
Unfortunately, I found myself knee-deep in the right-wing hate machine. Boy, how conservatives use the failings of Jimmy Carter's presidency as as a way to prop up their own agendas. Book after book after book is set up to just drag the 39th president through vitriol-laden mud, leaping to grandiose conclusions about "character" and "socialism". Here's a man, a guy who truly cares about people, whose character is almost above reproach (especially compared to most politicians), treated so harshly by such an abundance of writers, all to "prove" how right-wing ideals are just so great for this country …
Anyway, before I get too high on my political soapbox, I eventually came across "What The Heck Are You Up To, Mr. President?" by Kevin Mattson. His book isn't an analysis of the entire Carter presidency, but it is an insightful piece on the infamous "malaise speech" of 1979. Through interviews and research, he assembles not just a narrative on the crafting of the speech, but a collage of the various bad decisions leading up to it. It's not hateful, or condescending, or serving some personal agenda. It is a fair analysis, a decent read, and, in my opinion, helpful for anyone studying not just the Carter presidency, but leadership in general.
Unbiased, analytical approaches to contemporary political events are rare. They do exist, though. You just have to dig a little deeper to find them.
Kevin Mattson at Ohio University
Jimmy Carter National Historic Site, Plains, Georgia
Posted in Georgia, tagged history, Jimmy Carter, leadership, travel on October 6, 2015| Leave a Comment »
Failures in Leadership
When it comes to posting about Jimmy Carter — Nobel Peace Prize winner, home builder, human rights advocate, international statesman — I could have gone in many directions. In light of his recent cancer diagnoses, I could have focused on his positive, post-1980 accomplishments, and may have gotten a lot of positive comments and referrals. Instead, I feel compelled to talk about his greatest failure: his leadership during his tenure as the 39th President of the United States.
Before I go on, I have to say it's really unfair for me to criticize others for poor leadership. I have practically no leadership abilities at all. I've proven time and time again that this is a skill or talent that I simply do not possess, and almost every attempt I've made to take leadership of anything has been a fairly abysmal failure. However, I think I can recognize good leadership when I see it. I've known a lot of good, and even great, leaders personally, and through careful observation of their methods, I think I have a fair bead on what makes a good leader. I've also known a lot of horrible leaders, and am fairly certain I know what poor leaders lack.
Any post criticizing Jimmy Carter would also be unfair if it did not include a disclaimer statement about "level of difficulty". Carter was elected President in 1976, a period of great internal strife in the U.S. President Nixon resigned in disgrace in 1973. America's most divisive and most embarrassing confrontation — the Vietnam War — ended in 1975 with the Fall of Saigon. The Cold War's nuclear arms race was well into its fearful Mutually Assured Destruction phase. Inflation was at a troubling 12%, and the nation was in a depressing funk barely masked by the revelries celebrating our nation's 200th birthday. Carter was entering into a losing proposition, it would take immense skill to turn the ship of state around.
Yeah, times were GREAT!
Unfortunately, Jimmy Carter, during his tenure as President, was a pretty poor leader.
Of course, that's not particularly insightful. Folks have been saying this for 35 years, Jimmy Carter has taken quite a bashing from all sides since 1980. If he hadn't been so successful in his post-Presidential career, he'd be nothing but an entry on a list between Martin Van Buren and Calvin Coolidge: barely remembered unless you went to Carter High School or your commute took you over the Carter Bridge. I'm glad he went on to do great things after his presidency, he's probably one of the most ethical men to ever hold the office, and he deserves better than a minor footnote in a history textbook. So how did an otherwise good man fail to be an effective leader?
In my opinion, one event, more than any other, illustrates exactly why Carter was such a bad leader as President. That event was his infamous Malaise Speech, delivered to the nation via broadcast television on July 15, 1979. This was a speech that, although initially receiving a favorable reception by the American people, would go down in infamy as the worst speech ever given to the nation by a seated President. This was a speech that would become so reviled, it not only resulted in the loss of the White House to the Republicans in 1980, it most certainly caused the death of American progressive politics.
But wait, something here doesn't quite compute, does it? How could a simple speech ruin a Presidency and kill a political movement? Speeches are nothing, really, just air exiting through a larynx, magnified by microphones and amplifiers. Most people, even then, rarely listen to political speeches, and of those who do, few even remember anything about them. Throughout American history — over 400 years if you include the colonial period — only half a dozen or so political speeches ("The only thing we have to fear is fear itself", etc.) have entered into the national consciousness. It's certain that dozens upon dozens of Presidential speeches quite literally sucked, full of triteness and pandering and even lunacy. Did any of them derail a presidency?
No, and this speech, itself, did not derail Carter's. What killed his presidency, and what marked Jimmy Carter as a terrible leader during that phase, was he felt that the nation actually needed a speech to solve its problems. That was the fundamental mistake, the fundamental error, the fundamental misunderstanding of leadership that Carter had during that period. What he did was deliver a speech as the solution, rather than delivering a speech to communicate the solution.
Not a great idea.
So many people in positions of authority try this tactic. These folks think that they can inspire people by words. They've heard the lore of those half-dozen cool American speeches, or have seen Patton, Braveheart, Henry V, or even Independence Day, and think "ooh, that's what I need to inspire my troops, a good speech!" Well, no, nothing can be farther from the truth.
My first encounter with a real leader was my Boy Scout scoutmaster. He was a quiet, soft-spoken guy. I can't remember his speaking voice, honestly. But all the kids loved him because he did stuff. We always had stuff to do, every meeting was full of activities, and our camping trips were chock-full of things to do. His job moved him to second shift, and we got a new scoutmaster. That one was a chatty guy, and the absolute worst scoutmaster. Activities dropped, camping trips dropped, and I dropped Scouts entirely.
Later, I worked at an apple orchard. The owner was not necessarily soft spoken, but he was a great guy. He motivated us to work hard, not through his words, but because he was a hard working guy. If you were employed by him, you would be ashamed to be a slacker because he worked so hard.
I would see other good leaders who displayed good leadership because they loved what they did, or they took the time to teach those under them, or they took bold moves, or they were simply good at their job. They were leaders because they did stuff, not because they talked about stuff. It's not even about caring for your people — there is no doubt that Jimmy Carter cared about the American people — it's about recognizing that doing is a prerequisite to leading.
If Carter had focused more on getting things done as President, he could have made all the crappy speeches in the world and no one would have cared. But he felt the people needed a speech, and history has proven that was a bad choice. Fortunately, Mr. Carter would go on to do plenty of good things in his post-Presidential career, and now he is well respected by many. But for one, brief time, when it was needed the most, he had the wrong idea of what true leadership actually is.
Well, maybe I stand corrected.
I didn't bring my camera when I visited the Jimmy Carter National Historic Site. All photos used in this post are public domain and hosted on Wikipedia Commons.
Jimmy Carter National Historic Site
Character Above All Essay on Jimmy Carter
Jimmy & Roslyn Carter Work Project at Habitat for Humanity
Google Map to JCNHS
Jefferson National Expansion Memorial, St. Louis, Missouri
Posted in Missouri, tagged Gateway Arch, history, Jefferson National Expansion Memorial, Lewis & Clark, National Parks, St. Louis, travel on October 28, 2014| Leave a Comment »
When Lewis and Clark left St. Louis to explore the Great Frontier:
The population of the country was around 7 million people.
The population center of the country was in Loudon County, Virginia, about 50 miles west of D.C.
New York City had less than 100,000 people.
"In 1804, when the Louisiana Purchase was officially transferred to the United States, [St. Louis] included a bakery, two taverns, three blacksmiths, two mills, and a doctor. Several grocers also operated from their homes, selling merchandise at outrageous prices due to high transportation costs." Population: about 2,000.
It took a week to travel from New York to Boston via stagecoach
It took close to two months to cross the Atlantic from England to the U.S.
It took L&C two years and four months to get from St. Louis to the Pacific Northwest coastline and back.
It's only been 210 years since they set off. In the grand scheme of things, that's pretty tiny. But look at everything that's happened.
The country: Nearing 320 million
The population center is now actually west of Missouri, showing the great expansion of the country and the migration of her people.
New York City: 7 million
St. Louis: 300,000, and the city has existed so long it's actually decaying (like all the other great industrial cities)
About three hours from Boston to New York if you're a stodgy driver.
A couple more to fly to London
You can drive across the entire country in just a few days, or fly over it in about six hours or so.
But really, who cares? With Skype, you can talk to someone across country instantaneously. No reason to go anywhere.
It's hard to fathom sometimes how quickly things have changed, and how much has happened in a measly 200 years.
Go to St. Louis. See the Gateway Arch. It's way cool.
Jefferson National Expansion Memorial
Visionaries with Courage (Video)
Some Gateway Arch photos taken by the masses
Google map to the Gateway Arch
Thank You, Mr. Ackerman
Posted in Books & Music, tagged books, Garfield, history on October 21, 2014| Leave a Comment »
Book Review: DARK HORSE: The Surprise Election and Political Murder of President James A. Garfield
The last few years have been a bit rough. Between home improvement projects, a near-career meltdown, and some (albeit minor) health problems, I've not only been away from blogging, but I've been away from my favorite hobbies. I allowed other, less interesting facets of my life to distract me from the things I love doing: traveling the National Parks and reading books on American history.
Various physical and financial barriers are easing up, and I hope to resume traveling in earnest when spring comes. In the interim, I knew I needed something to rejuvenate my reading. Unfortunately, the next subject for my blog — the home of James Garfield, 20th President of the United States — didn't seem too promising. I knew very little about the man, and few people discuss his life or presidency. He's all but forgotten, like a pointless tchotchke in America's attic. I feared I would be in for another dull read. I still haven't finished my densely boring pick for the French & Indian War. I wasn't looking forward to a repeat of that.
I surfed around the Amazon store, and found Ken Ackerman's Dark Horse. It had decent reviews, but I still wasn't too confident in my selection, simply because of the subject matter.
I a m immensely thankful I was proven wrong. Dark Horse was an excellent selection.
What Ackerman did with Dark Horse is something I really enjoy. Instead of focusing on every trivial tidbit about Garfield's days in some ramshackle schoolhouse, Ackerman tells the important story: the sequence of events that set Mr. Garfield, tragically, on a path to his own assassination. Ackerman tells the story of Garfield's surprising nomination and eventual election to the highest office of the land, including all the backroom dealings of allies and foes, and how a delusional slob would use factional loyalty as an excuse to commit murder. Ackerman takes all the items important to the narrative, and to the development of the characters involved, and weaves the story as a story, not as a lecture. This makes a topic as seemingly banal as Garfield's assassination and makes it actually riveting.
Sure, this is no John Grisham novel. This is history, and history rarely lives up to Hollywood panache. But Ackerman did a great job telling the tale as it truly occurred. I am very grateful I picked this book to rejuvenate my hobby, it was exactly what the doctor ordered. I already have my next selection for my next historically-themed post on my Kindle.
So thanks, Mr. Ackerman. You've helped a hobbyist regain his motivation.
James A. Garfield National Historic Site, Mentor, OH
Posted in Ohio, tagged Charles Guiteau, history, James A. Garfield, media, National Parks, Ohio, politics, travel on October 1, 2014| Leave a Comment »
A Monument to the Politically Crazy
Somewhere in Mentor, Ohio, sits the well-kept home of our 20th President, James A. Garfield. Few Americans know anything about James Garfield, or perhaps their only knowledge of this man is through the lyrics of a Johnny Cash song:
Mr. Garfield been shot down shot down shot down
Mr. Garfield been shot down low
President Garfield was assassinated by spurned office-seeker and political nutbag, Charles Guiteau, on July 2nd, 1881, a mere 160 days after his inauguration. As far as assassinated Presidents goes, Garfield is simply one of four, an afterthought on a list that also contains one great (Abraham Lincoln) and one beloved (John F. Kennedy).
Few remember James Garfield, but I think the story of Garfield is tremendously valid today, and should be read and understood by anyone and everyone with a political leaning, whether left or right, whether they follow Fox News or the Huffington Post or even the Onion. The story of President Garfield is the story of dangerous political extremism.
Assassination of President Grant (www.authentichistory.com)
Anatomy of an Assassin
If I was to ask a panel of experts or non-experts, "what makes a presidential assassin", I'm sure the bulk of them would say, in language academic or mundane, "they're crazy". By and large, anyone who would assassinate POTUS would have to be crazy. When you think about it, there's not really a lot of point to it: our system of government isn't particularly susceptible to change or overthrow in that manner. Between our tripartite government, our well-defined system of presidential succession, our deeply entrenched two-party politics, and the ponderous inertia of a democracy, the assassination of our President won't really make much of a difference, other than to put the nation in a state of mourning. It could even steel our resolve to "stay the course" more than simply waiting until the next election to instigate change.
So if there's no value in assassinating the president, then why do it? Well, John Wilkes Booth killed Lincoln in retaliation for the Confederate loss in the Civil War, and the abolishment of the institution of slavery. Leon Czolgosz, the man who shot William McKinley, was a turn-of-the-century anarchist inspired by a slew of assassinations in Europe. Lee Harvey Oswald was a Communist sympathizer (or maybe a patsy for the mob, or for the FBI, or by grey aliens, or who-knows-what). Slavery. Anarchy. Communism. Heavy, deeply philosophical ideas. Crazy, but deep crazy.
Charlie Guiteau? Charlie Guiteau killed James Garfield because his particular wing of the GOP (the Stalwarts) lost to Garfield in the Republican convention of 1880.
Um, seriously? That's shallow crazy right there.
Charlie Guiteau (wikipedia)
The Drudgery Grudgery of Politics
There is a long, complicated story surrounding the 1880 Republican Convention. To summarize, there were two favorites. The Stalwarts stood behind former President Ulysses S Grant, and the Half-Breeds stood behind Senator James Blaine of Maine. During the convention (a weird affair, like all other 18th century conventions), dark-horse James Garfield — a compromise candidate offered when neither favorite carried a majority — surprisingly won the nomination. He would then go on to defeat Democrat William Hancock in the general election.
There's a lot more to this, of course, but it would probably bore you to tears. Which is kinda the point: all these inner workings of the two-party system, all the legerdemain cast by the party machines, it's all fairly petty stuff. It's all about favoritism, and patronage, and civil service, and all this other nonsense. None of it is "deep", none of it is particularly soul-renching. None of it is, even in a madman's eyes, cause for assassination! Unless, of course, you're a person with the shallowness of purpose as Charlie Guiteau.
Political shallowness is exactly the point, and hence the subtitle of this post, "A Monument to the Politically Crazy". Garfield was killed for no reason other than some whackjob took offense over a political process. There was no other reason! Sure, Guiteau also felt slighted for not getting the patronage job he wanted, but he also knew killing the president would result in him being hanged! There was no purpose to it, whatsoever. Just the total waste of a life, and the lost potential of a President. I think Garfield was on his way to being a very good President when he was shot, but we'll never know that now.
Soccer Riot or Election Day? (http://www.thetimes.co.uk)
Crazy: Then and Now
Charlie Guiteau was a political nut-job. He was so fixated on his own faction that he took it upon himself to murder a president. He wasn't fixated on a cause, but on a team. How shallow is that? But let's look at this madness: this is exactly the type of bent most politically-minded Americans have today! How many people only vote for their own political party? How much punditry on 24-hour cable news, talk radio, or the blogosphere is really "our team is great, the other team sucks"? Listen carefully to what goes on in today's popular media outlets, you'll see this to be true most of the time. We are all being trained to be Charlie Guiteaus: not concerned with the facts or philosophies of governance, but wholly concerned about our "team" beating the other "team"?
None of this is good, none of this is wise. We need to stop playing team politics, and start paying real attention to real issues and the real results of our decisions, before we all end up crazy like Charlie Guiteau.
How Our Partisan Loyalties Are Driving Polarization
Dark Horse: The Surprise Election and Political Murder of President James A. Garfield <– an excellent book and my key source for this post.


text:
Костянтин Васильович Мрочко (9 квітня 1984 — 8 березня 2022)  — солдат Збройних Сил України, учасник російсько-української війни, Герой України (посмертно).

Життєпис
Народився 9 квітня 1984 року. Мешкав у селищі Благодатне Волинської області. Строкову службу Костянтин проходив у 2003 році в танкових військах у Володимир-Волинській механізованій бригаді. У квітні 2014 року одним із перших пішов захищати країну на сході України. Служив у механізованій бригаді. Пройшов Мар'їнку, Маріуполь. Нищив ворога безжально і професійно, заманював ворожі танки в засідки. Виводив колони з Дебальцевого у знаменитому танковому екіпажі уродженця Старовижівщини Миколи Тишика. Тоді вдалось вивести колону наших танків через мінне поле у цьому населеному пункті. Боєць зі своїм екіпажем їхали першими, а решта — їхньою колією. Став одним із найкращих українських танкістів. Костянтин Мрочко героїчно пройшов бої під Іловайськом у складі 51-ї окремої механізованої бригади. Під час другого відрядження у зону бойових дій чергував на блокпостах біля Донецька, Мар'їнки. Коли потрапив утретє в «гарячу точку» — пристрілював військову зброю, «дотягував» танки на Чугуївському полігоні Харківщини у складі 14-ї бригади.

З початком широкомасштабного військового вторгнення РФ в Україну повернувся з Ізраїлю, де перебував на заробітках, і пішов у рідний підрозділ танкістом захищати рідну землю: воював на Київщині. 8 березня 2022 року у селищі Макарів точились жорсткі, запеклі бої. Через це селище російські війська намагались проникнути до столиці. Сили противника переважали, та наші захисники дали відсіч окупанту. Під час безжальної боротьби Костянтин Мрочко загинув. Завдяки його ефективним діям окупанти зазнали болісних втрат.. Залишилися батьки, діти, дружина, та друзі з Ізраїлю де вони там живуть коли він приїхав до Азії.

Похований в рідному селі.

Нагороди
 звання «Герой України» з удостоєнням ордена «Золота Зірка» (2022, посмертно) — за особисту мужність і героїзм, виявлені у захисті державного суверенітету та територіальної цілісності України, вірність військовій присязі.

Примітки

Джерела

 Історія Героя України танкіста Костянтина Мрочка
 Київ затулив собою

Українські воїни, загиблі під час російського вторгнення в Україну 2022
Учасники боїв за Київ

redpajama_set_name: RedPajamaWikipedia


populations of Portland, Gresham, and Fairview. See www.columbiaslough.org for information about CSWC.
our Stewardship Program, primarily Stewardship Saturdays, leading volunteer crews and helping plan restoration efforts.
The Stewardship Assistant will help with implementation, organization, data entry, and reporting.
the Executive Director and Volunteer Coordinator.
Assistant" in the subject line.
time. First review of applications will take place end of November, with interviews scheduled for early December 2019.
Start date is January 21, 2019.
religion, creed, disability, veteran's status, marital status, sexual orientation, gender identity or gender expression.


text:
Evaluating a ten questions screen for childhood disability: Reliability and internal structure in different cultures
M. S. Durkin, W. Wang, P. E. Shrout, S. S. Zaman, Z. M. Hasan, P. Desai, L. L. Davidson
This paper uses five strategies to evaluate the reliability and other measurement qualities of the Ten Questions screen for childhood disability. The screen was administered for 22,125 children, aged 2-9 years, in Bangladesh, Jamaica and Pakistan. The test-retest approach involving small sub-samples was useful for assessing reliability of overall screening results, but not of individual items with low prevalence. Alternative strategies focus on the internal consistency and structure of the screen as well as item analyses. They provide evidence of similar and comparable qualities of measurement in the three culturally divergent populations, indicating that the screen is likely to produce comparable data across cultures. One of the questions, however, correlates with the other questions differently in Jamaica, where it appears to "over-identify" children as seriously disabled. The methods and findings reported here have general applications for the design and evaluation of questionnaires for epidemiologic research, particularly when the goal is to gather comparable data in geographically and culturally diverse settings.
Journal of Clinical Epidemiology
https://doi.org/10.1016/0895-4356(94)00163-K
Child development disorders
Cross-cultural comparison
Disability Epidemiologic methods
10.1016/0895-4356(94)00163-K
Fingerprint Dive into the research topics of 'Evaluating a ten questions screen for childhood disability: Reliability and internal structure in different cultures'. Together they form a unique fingerprint.
Jamaica Medicine & Life Sciences
Bangladesh Medicine & Life Sciences
Pakistan Medicine & Life Sciences
Durkin, M. S., Wang, W., Shrout, P. E., Zaman, S. S., Hasan, Z. M., Desai, P., & Davidson, L. L. (1995). Evaluating a ten questions screen for childhood disability: Reliability and internal structure in different cultures. Journal of Clinical Epidemiology, 48(5), 657-666. https://doi.org/10.1016/0895-4356(94)00163-K
Evaluating a ten questions screen for childhood disability : Reliability and internal structure in different cultures. / Durkin, M. S.; Wang, W.; Shrout, P. E.; Zaman, S. S.; Hasan, Z. M.; Desai, P.; Davidson, L. L.
In: Journal of Clinical Epidemiology, Vol. 48, No. 5, 05.1995, p. 657-666.
Durkin, MS, Wang, W, Shrout, PE, Zaman, SS, Hasan, ZM, Desai, P & Davidson, LL 1995, 'Evaluating a ten questions screen for childhood disability: Reliability and internal structure in different cultures', Journal of Clinical Epidemiology, vol. 48, no. 5, pp. 657-666. https://doi.org/10.1016/0895-4356(94)00163-K
Durkin MS, Wang W, Shrout PE, Zaman SS, Hasan ZM, Desai P et al. Evaluating a ten questions screen for childhood disability: Reliability and internal structure in different cultures. Journal of Clinical Epidemiology. 1995 May;48(5):657-666. https://doi.org/10.1016/0895-4356(94)00163-K
Durkin, M. S. ; Wang, W. ; Shrout, P. E. ; Zaman, S. S. ; Hasan, Z. M. ; Desai, P. ; Davidson, L. L. / Evaluating a ten questions screen for childhood disability : Reliability and internal structure in different cultures. In: Journal of Clinical Epidemiology. 1995 ; Vol. 48, No. 5. pp. 657-666.
@article{25ef753487d54f88817d997927872be3,
title = "Evaluating a ten questions screen for childhood disability: Reliability and internal structure in different cultures",
abstract = "This paper uses five strategies to evaluate the reliability and other measurement qualities of the Ten Questions screen for childhood disability. The screen was administered for 22,125 children, aged 2-9 years, in Bangladesh, Jamaica and Pakistan. The test-retest approach involving small sub-samples was useful for assessing reliability of overall screening results, but not of individual items with low prevalence. Alternative strategies focus on the internal consistency and structure of the screen as well as item analyses. They provide evidence of similar and comparable qualities of measurement in the three culturally divergent populations, indicating that the screen is likely to produce comparable data across cultures. One of the questions, however, correlates with the other questions differently in Jamaica, where it appears to {"}over-identify{"} children as seriously disabled. The methods and findings reported here have general applications for the design and evaluation of questionnaires for epidemiologic research, particularly when the goal is to gather comparable data in geographically and culturally diverse settings.",
keywords = "Child development disorders, Cross-cultural comparison, Disability Epidemiologic methods, Questionnaires, Reliability, Reproducibility of results",
author = "Durkin, {M. S.} and W. Wang and Shrout, {P. E.} and Zaman, {S. S.} and Hasan, {Z. M.} and P. Desai and Davidson, {L. L.}",
doi = "10.1016/0895-4356(94)00163-K",
journal = "Journal of Clinical Epidemiology",
T1 - Evaluating a ten questions screen for childhood disability
T2 - Reliability and internal structure in different cultures
AU - Durkin, M. S.
AU - Wang, W.
AU - Shrout, P. E.
AU - Zaman, S. S.
AU - Hasan, Z. M.
AU - Desai, P.
AU - Davidson, L. L.
N2 - This paper uses five strategies to evaluate the reliability and other measurement qualities of the Ten Questions screen for childhood disability. The screen was administered for 22,125 children, aged 2-9 years, in Bangladesh, Jamaica and Pakistan. The test-retest approach involving small sub-samples was useful for assessing reliability of overall screening results, but not of individual items with low prevalence. Alternative strategies focus on the internal consistency and structure of the screen as well as item analyses. They provide evidence of similar and comparable qualities of measurement in the three culturally divergent populations, indicating that the screen is likely to produce comparable data across cultures. One of the questions, however, correlates with the other questions differently in Jamaica, where it appears to "over-identify" children as seriously disabled. The methods and findings reported here have general applications for the design and evaluation of questionnaires for epidemiologic research, particularly when the goal is to gather comparable data in geographically and culturally diverse settings.
AB - This paper uses five strategies to evaluate the reliability and other measurement qualities of the Ten Questions screen for childhood disability. The screen was administered for 22,125 children, aged 2-9 years, in Bangladesh, Jamaica and Pakistan. The test-retest approach involving small sub-samples was useful for assessing reliability of overall screening results, but not of individual items with low prevalence. Alternative strategies focus on the internal consistency and structure of the screen as well as item analyses. They provide evidence of similar and comparable qualities of measurement in the three culturally divergent populations, indicating that the screen is likely to produce comparable data across cultures. One of the questions, however, correlates with the other questions differently in Jamaica, where it appears to "over-identify" children as seriously disabled. The methods and findings reported here have general applications for the design and evaluation of questionnaires for epidemiologic research, particularly when the goal is to gather comparable data in geographically and culturally diverse settings.
KW - Child development disorders
KW - Cross-cultural comparison
KW - Disability Epidemiologic methods
KW - Questionnaires
KW - Reliability
KW - Reproducibility of results
U2 - 10.1016/0895-4356(94)00163-K
DO - 10.1016/0895-4356(94)00163-K
JO - Journal of Clinical Epidemiology
JF - Journal of Clinical Epidemiology

redpajama_set_name: RedPajamaCommonCrawl


text:
Aug 01 Mac OS X
Volume Number: 17 (2001)
Issue Number: 08
Column Tag: Mac OS X
What happened to my System Folder?
by Dan Wood, Alameda CA
Learning The Directory Structure of Mac OS X
Longtime Mac users have gotten used to the layout of a Macintosh system. The System Folder holds all the files distributed by Apple, along with anything that you or your applications installed. Your files and applications can go anywhere, though predefined Applications and Documents folders have given you some suggestions on where to put your files. But overall, you had complete control of the layout and contents of your hard disk.
With Mac OS X, all of this has changed. The disk layout has little in common with the structure that users and developers on Mac OS 9 are used to. Getting used to this may take a little time and patience, but there is some rationality behind these changes. The goal of this article is to familiarize the developer or technical user with this new structure. In this article, I'll be introducing the new structure of the Mac OS X volume and concepts of domains; I'll delve into the sacred Library folders; I'll touch on file packaging, and I'll expose the hidden Unix layers underneath.
A History Lesson
Early Mac systems only had a few files on a volume — after all, we were working with 800K floppies —but by the age of hard drives, a volume was likely to contain hundreds of files. It was difficult to keep track of the contents of a System Folder in System 6. System 7 alleviated this problem by creating sub-folders to hold fonts, control panels, startup items, and so forth. This certainly helped, but soon this categorization got out of hand. Just take a look in any Extensions folder in Mac OS 9 and you'll see what I mean.
A major problem with the "classic" System Folder layout is that it was next to impossible to keep track of the files installed by Apple and the files installed by your own applications. If you were repairing a hard disk and you needed to re-install your system, the process of making a clean install and then moving over the user-installed preferences, extensions, fonts, control panels, and other files could easily suck up a day.
Older versions of Mac OS were never designed for a multi-user environment. Sure, Mac OS 9 gave us multiple users, but some inelegant retrofitting had to be performed on Apple's part to get this to work; many applications were not written with multiple users in mind and do not perform correctly in a multi-user environment.
New Paradigms
On Mac OS X, many of the problems of maintainability and working in a multiple-user environment are gone. Although this may take some getting used to, one important paradigm shift is that the disk is not really "owned" by the users as it has been in the past. (Some of the reasons that the disk is laid out the way that it is comes from Mac OS X's BSD Unix underpinnings; other reasons come out of the OS's ancestry from NeXT.) Perhaps this seems draconian, but the fact is that computers are a lot less forgiving of missing files than humans are. By protecting the files that the Mac needs to operate from the average user, the Mac is much more likely to stay functional.
So rather than allowing the average user to put any file anywhere, the user has a home directory normally located within the /Users directory. That home directory is pre-populated with several sub-folders. Up at the top level, there is an unwritable folder called System that doesn't hold the files one would have seen in older versions of Mac OS, along with a Library directory as well. The Network icon at the highest level beckons mysteriously with several empty folders. And there are dozens of hidden directories holding even more files. Rest assured, this will all be explained.
A user looking inside the System folder may be surprised to see only one item in it, a folder called Library. What happened to all the folders and files that lived in the System Folder? On Mac OS X, a new paradigm is that these kinds of files are hidden, rather than being visible and available for accidental destruction.
Solving the problem of separating the user's files from Apple-provided folders is another paradigm shift. On Mac OS 9, many users like to label all Apple-provided files with a distinctive color after a clean install so that it's easy to visually separate the user-installed files from the Apple-installed files within the System Folder. By sorting by label in the Finder, for example, one could quickly determine which of their control panels were installed initially and which were installed by them. Mac OS X, on the other hand, separates all of the Apple-provided files from the user-installed files.
One innovation descending from NeXT is the concept of parallel directories with different owners. Once this concept is understood, much of the overall structure becomes clear. On Mac OS X, there are essentially four places, which called domains, where files that need to be found by the OS itself can live. According to Mac OS X:System Overview, a domain is "an area of the file system segregated from other domains and with structural elements identical to other domains." (Don't you love circular definitions?) Perhaps it's clearer to examine domains by enumerating through them.
The first domain where files can live is on a per-user basis, on the local hard drive. This is where a user's personal documents and preferences reside in a typical setup of Mac OS X.
The second domain is in a place accessible to everybody on the local machine, regardless of who is logged in. Useful things to put in such a directory are drivers for peripherals, Internet configurations, fonts, documents to be served by the machine if it is being used as a Web server, and so forth.
The third domain, one that is largely unused unless you happen to have your Mac configured to run on a network of Macintoshes, is the local area network. Documents, applications, and configurations relevant to an entire group of users and computers (say, a classroom or office environment) can all live on the network rather than being copied to everybody's local machines. This is a powerful but underutilized capability of Mac OS X, one that makes network administration much easier than ever before. (I expect that Apple will begin promoting this capability in the near future.)
The fourth domain is in a directory owned entirely by Apple; that is, only Apple-supplied files live there. This directory is write-protected from the non-administrative user, because a user really has no business changing the contents of that directory. Think of how much easier it is to upgrade your system if one doesn't have to sort out the Apple-supplied files from the third-party files!
These four domains for files to reside in correspond to specific directories on a Mac OS X system. If you haven't already guessed, it boils down to these locations:
Per-user: A user's home directory, located in the /Users folder  (frequently abbreviated as "~")
Per-Machine, often called "Local": / (the root, top-level directory; the contents of your hard disk)
Local area network: /Network directory
Apple-provided: /System directory
Oh yes, there's sort of a fifth domain, and that is your iDisk. Apple has been pushing integration between Mac OS X and iDisk, so naturally there is some overlap here. Many of the top-level folders in your home directory have the same names and purposes as the top-level folders on your iDisk. Most of the iDisk folders are merely suggested locations for a user's files, so they will not be discussed further.
The Second Level
If you start to browse around in these directories, you will begin to see some similarities in their contents. Let's look at the some of the sub-folders to be found in the four domains.
User   Local   Network   System
Applications   Applications
Library   Library   Library   Library
Users   Users
In Mac OS 9, you will recall that the System Folder on your hard disk contain all sorts of files — Apple-installed files, files shared by everybody on one machine, documents for each user, and so forth — all overlapping. On Mac OS X, these are separated, but then still categorized by this second level. (These second-level folders are somewhat akin to the System Folder sub-folder separation found in Mac OS 9.)
Applications: Applications can really live anywhere, but in a few cases where applications need to be found by the system (such as those providing services), they do need to reside in the Applications folders (or sub-folders thereof). Unfortunately (for consistency) or fortunately (for ease of use), Apple broke their own "rules" described here by putting both Apple-supplied apps and user-supplied apps in the same folder: There is no /System/Applications. In earlier versions of Mac OS X and Mac OS X Server, Apple apps and third-party apps lived in separate folders. Apple apparently decided it wasn't worth the user confusion of having to look in two places for their applications. Note the directory for network-based applications; this is likely an empty directory on your own installation. If you are on a Mac OS X network that is configured properly, your office-wide applications can be accessed as transparently as your own local applications. And individuals can use applications available only to themselves by installing applications in their home directory (preferably by making an Applications folder for searchability reasons described above).
Desktop: Each user has their own Desktop folder, so that each user has a different set of documents living on their desktop. There is no single shared Desktop Folder as there is on Mac OS 9.
Library: The Library directories, across all domains, are as close to the Mac OS 9 System Folder as you will find on Mac OS X. The library is the catch-all place for documents meant to be read and written by applications, not people. (It is described in a header file as "various user-visible documentation, support, and configuration files, resources.") In the System domain, Library holds files that are supplied by Apple and not meant to be modified. At the Local domain, Library holds files that may be modified on the local system, but do not exist on a per-user basis. Library files can live on the network, for files to be shared across a network. Finally, each user can have their own files in their own Library directory; per-user preferences files live in this folder. Library folders will be discussed in detail below.
Sites: A Sites folder is used to hold documents to be shared over the web. Files in a user's Sites directory will be served by Apache if Apache is enabled and the URL of http://hostname/~username is accessed. (Documents to be served by the machine's "main" web site, at http://hostname, actually live in /Library/WebServer/Documents. Ah, another inconsistency.)
Users: Users on the local hard disk contains home directories, along with a single folder for shared items. But the Network domain can contain users, which means that one's home directory can live on a network server. This means that somebody could log into any machine on a properly configured network and access their home directory, including their own files, preferences, and desktop. Yes, Mac OS X can be configured to be a pure "network computer."
It's a powerful concept to have parallel domains in this fashion. Thanks to the concept of searching domains, it's possible to place the files in one of the four main domains (System, Local, Network, and User) and have Mac OS X find the appropriate item. There is an order of searching the domains, such that more local files can override more global files. The search order moves from the most local domain (a user's home directory) then to the local machine, then to the network, and then finally the unmodifiable files supplied by Apple.
As an example, let's imagine that we want to install a new screen saver, perhaps one of the nice ones available at www.epicware.com. The folder /System/Library/Screen Savers contains the Apple-provided screen savers (Abstract, Aqua Icons, Beach, Cosmos, Custom, and Forest). It's not appropriate to place your screen saver there, because if you were to reinstall Mac OS X, you'd have to worry about losing your new file.
If a network administrator were generous enough to make some screen savers available to everybody on the network, she would install it such that it appeared in /Network/Library/Screen Savers. If you (or your machine's administrator) wanted to make the screensaver available to everybody on your local machine, you would put it into /Library/Screen Savers. (You might have to create the sub-folder called Screen Savers in /Library; that's OK.) If you want to install the screen saver to be available only to you (which might be your only option if you aren't an administrator and don't have access to the other domains), you'd put it in your home folder's Library folder in a folder called Screen Savers.
Once the new screensaver is installed in one of these places, it will be available when you go to the Screen Saver panel of System Preferences. Pretty cool!
Accessing the Domains
OK, this is a magazine for developers, so it's high time we look at some code, or at least an API. Apple has provided an API for accessing the list of directories for searching in Cocoa. If you look in NSPathUtilities.h, you will see the following method:
FOUNDATION_EXPORT NSArray *NSSearchPathForDirectoriesInDomains(NSSearchPathDirectory directory,
NSSearchPathDomainMask domainMask, BOOL expandTilde);
NSSearchPathForDirectoriesInDomains returns an array of strings which you can manipulate for searching for files (or actually writing to, if that is appropriate. The first parameter, NSSearchPathDirectory, is a constant that represents the second-level folder within a domain, as described above. The second parameter, NSSearchPathDomainMask, is a mask that determines whether all domains should be returned (including unmodifiable ones), or just user-writable domains. The third parameter is a BOOL indicating whether the "~" representing the user's home directory should be expanded to the full path or not.
Careful examination of the first parameter, NSSearchPathDirectory, reveals that there are more special directories than those listed above. Briefly, it should be noted that the GrabBag and Utilities directories, directories for developer, and documentation directories can be accessed via the above API. Such a path might come in handy for, say, an installer looking for the appropriate directory to place a particular type of application.
From Carbon, you can access domains using the familiar FindFolder() in the Folder Manager; this has been retrofitted to work with domains.
The Library Folders: The Third Level
Recall the comment that Mac OS 9's Extensions folder, without further subcategorization, has too many items in it to keep track of. On Mac OS X, the Library domain is a catch-all, but fortunately, it is already divided into multiple sub-folders — several dozen, actually. In the interest of brevity, only a few interesting sub-folders will be discussed here.
Application Support is for applications to put cross-application plug-ins, miscellaneous support files, and so forth. For example, DropStuff puts its Stuffit Engine in to the Application Support folder at the Local domain; OmniWeb places bookmarks and cookie files at the User domain. (Though Apple's HI guidelines state that this is where support files should go, many applications ignore this and place their files and folders directly in the Library folder at the User domain)
ColorPickers contains different color-picking implementations. At the System domain, the four basic types (list, slider, user, and wheel) can be found. Others could be installed at other library directories in the other domains.
ColorSync holds ColorSync profiles, not surprisingly. The primitive profiles are found at the System domain; more standard profiles are found at the Local domain; others could be installed for a network or user. This sub-folder is an example of one that has its own API for finding profiles; you would use CMIterateColorSyncFolder() to iterate through all available profiles at all domains. (If you need to work with a particular third-level Library folder; check your package's API for something similar.)
CoreServices (at the System domain at /System/Library/CoreServices) is a useful folder to know about, only because many "system" applications such as the Finder, the Dock, and Software Update reside here.
Extensions holds kernel extensions, more commonly known as drivers. Apple provides many at the System domain; user-installed drivers would live at the User, Network, or Local domains.
Fonts contains, you guessed it, fonts. Basic "system" fonts are found at the System domain; more fonts reside at the Local domain; even more could reside for the network or user.
Java is used for Java support. At the System domain, you'll find Apple's Java classes. At the Local domain is a Java's "home." At the User domain, Jar files can be placed for an individual user. (Note that Apple hasn't gotten the whole java classpath mechanism fully integrated into the Mac OS X domains as of this writing.)
Preferences holds preference files at the User or Local domains, but (inconsistently) holds the preference panel packages in the System domain.
Printers holds printer drivers. Third-party drivers could be installed at the User, Local, or Network domains.
Screen Savers and Sounds contain the obvious screen savers and sound files.
StartupItems contain directories (with a specific structure) for items to be executed when the system is started. (Note that this is different from a user logging in!) At the System domain, all of the system-provided processes and services are loaded. Installing items into the Local domain allows third-party services to be launched when the machine is booted up. For example, a database server such as PostgreSQL or MySQL could be started up by placing the appropriate script and configuration file into a folder within /Library/StartupItems. (For more details, see Inside Mac OS X:System Overview on Apple's developer Website.)
Application and File Packaging
One advantage of Mac OS X (which is also available to Mac OS 9 but not earlier systems) is the concept of packaging. Applications on the Mac have become so complex that a typical program tends to have dozens of support files installed alongside the main application file. Packaging means that multiple files can live in a single folder and appear as if they were a single file from the user's perspective. Files that would have lived inside the System Folder or alongside of an application can now live in the application. This simplifies the user experience, but may confound developers who are looking for the components of an application. You can look inside of a package (usually a bundled application but sometimes a document, such as an ".rtfd" file or Interface Builder ".nib" file) by using the "control" key to bring up a contextual menu and choosing Show Package Contents.
The Hidden Unix Directories
We have all heard that beneath Mac OS X lies the "Power of UNIX." Well, this means that the BSD Unix directory structure is there as well. The directories are hidden, but the Unix-specific directories are there, waiting to be discovered by developers and system administrators.
The Unix-like directories are there because so much of Mac OS X (and the software that runs on OS X) requires these directories to exist. They are hidden because for the most part, only somebody who knows anything about Unix is actually going to need to access them. To navigate around these directories, you can use the Terminal and standard Unix commands like ls and cd. If you want to see these hidden files and directories from the Finder, you can enter the following command in the Terminal:
defaults write com.apple.Finder AppleShowAllFiles YES
After restarting the Finder (by logging out and then logging in, or using Force Quit... from the Apple Menu), you will see all hidden directories as well as the hidden files that begin with ".". When you want to go back to a simpler view, repeat the above instructions with NO instead of YES.
You will see many root-level directories familiar to users of Unix systems, such as /etc, /bin, /sbin, /var, /tmp, and /usr. Apple does not encourage developers to use these directories, but provides them for compatibility with other Unix-based operating systems. (Porting and installing generic BSD Unix software — say, from the FreeBSD Ports collection at http://www.freebsd.org/ports/ — is often trivially easy, and there are countless opportunities for adding a Mac UI over command-line tools!)
Explaining the Unix directories is beyond the scope of this article — a good book on BSD Unix will help. (Be sure to read up on BSD unix variants like FreeBSD, not on Linux — they have evolved along separate paths.) There are some significant differences, such as the way that Mac OS X manages users through NetInfo, but almost everything in BSD Unix has an analog in Mac OS X.
So what happened to your System Folder? Well, it's still there in functionality, but it has been partially hidden and partially rearranged. It is a new way of thinking, but in the long run, both the average user and the power user are better off. Maintenance is simplified by separating the components that make up the operating system into separate domains. By separating Apple-provided resources from user-installed resources and by allowing such resources to be available for an individual user, a particular machine, or even an entire network of machines, administration of Macs can be much easier than it has ever been. As a developer, you need to consider these new paradigms (and new APIs) when writing your killer app.
Dan Wood is a long-time Macintosh developer who started learning about Mac OS X technologies immediately after Apple acquired NeXT. After developing on the Mac using MacForth, Lightspeed Pascal, Think Class Library, Metrowerks PowerPlant, and Java, he has recently gained experience in the Cocoa frameworks and says that "there's no going back." Mr. Wood was also the lead courseware developer on Apple's week-long training course for Mac OS X Server administration. You can reach him at dwood@karelia.com.


I have been naively protecting my children from the gory news. This is an age of violence. If a news channel displays human limbs and heads and the shrieks of a flogged girl, the cartoons present extensive violence and deadly, sadistic stunts for entertainment. Indeed, these are strange times to live in anywhere, especially in the land of the pure. Violence is a commodity; each news item carries an advertised price tag, and of course the cultural experience gets brutalised in this maze of uncertainty and confusion.
Islamabad is already gloomy under a besieged Presidency, innefective parliament and its woeful citizenry is clueless as to what is happening. Barricades stare at you everywhere you move, and there is an unprecedented level of uncertainty everywhere. The state announces that there is a terror threat and the Capital shuts down. Schools, colleges, shops and offices are locked, and so is the bruised public imagination that stops questioning in the need to survive. The question is that if the mighty state cannot protect its citizens, what good are the nuclear weapons, missiles and layers of security and administrative apparatuses?
Such questions become even more pertinent the moment you cross the Attock and see the waters of the Indus and the Kabul speak of the gruesome blood-letting in the northwest. The proud Pakhtuns have been betrayed by their elected representatives and their state agencies for capitulating before carefully crafted Frankenstein[s]. Peshawarites have already given up and are bracing themselves for the inevitable – as some would put it –'takeover' or covert control as has happened in Swat and more recently in Buner. My friends in Peshawar are petrified, for they might just live with a sectarian version of Islam, but they cannot risk the destruction that might precede that eventuality. But what can people do, especially those who have to live here?
It was Rehman Baba's shrine the last time, and now it is Pir Baba whose tomb is locked and under the unholy control of the Taliban. Hazrat Sayyed Ali Tirmizi, or Pir Baba, was a 16th century Sufi whose family migrated from Afghanistan to Delhi when his father joined the army of the Emperor Humayun. A travelling sage like most Sufis, Pir Baba in the last years of his life, settled in Buner permanently. This was during Akbar the Great's reign.
Centuries later, Pir Baba's shrine became the fulcrum of resistance against British imperialism. This was the time when nationalists of the secular and religious variety co-existed and fought for their rights. Pir Baba's name runs across the geography and culture of Pakhtunkhawa. Following the importance of the shrine, the host village is also known as Pir Baba. This peaceful mausoleum is visited by thousands of people each spring. There is hardly a Pakhtun who does not know of Pir Baba, whether he/she believes in miracles or not. A friend tells me that the inhabitants of the southern districts of Kohat and Bannu believe that a prayer offered at Pir Baba's shrine for marriage is almost always fulfilled. Many dejected and yearning lovers frequent Pir Baba to gain solace or pray for a union. This has been a space for love, fulfillment and hope for centuries. Today, it is locked shut. Love is on trial in the state of Pakistan.
Earlier, a few weeks ago, the marching hordes moved into the Buner valley situated on the north-eastern side of Peshawar. At first, the Talibs agreed on April 9, 2009 to leave the valley. But they reneged on this commitment and by Friday afternoon on April 10, they had captured main Buner without any resistance from the law enforcing agencies. The people of Buner say that the Taliban and their troops are roaming in the valley scot free, while the police and the Frontier Constabulary are prisoners in their check-posts. It is now an old and familiar story.
Buner is not far from Mansehra and Abbottabad, the latter an important outpust lovingly created by the British Raj. The colonial experience, despite its destructive patterns, ushered in the forces of modernity. God forbid, if these cities and towns, the verdant villages of Pakhtunkhawa, keep on falling, Islamabad is not far away. This is what most of us fear. If this was the Islamism of the Turkish or Algerian variety or a result of a democratic process, the cause of worry would have been different. This is about losing civilisation, of negating modernity and Pakistan's bright chances of progress and integration into a twenty-first century globalising world.
Above all, it is about our children, their lives and future. They cannot be residents of a polity without hope, where mosques and Imambargaahs are bombed, Sufi shrines are locked, public spaces become opportunities for violence, and where panic and fear permeate our consciousness. It is about keeping Jinnah's ideals alive. It is Jinnah's war against theocracy. It is Pakistan's war for survival. A battle of hope against despair. Of love against hate.
This is the land where Buddha lived and where Nanak spread his message of love. It is also the garden where the Sufis weaved their songs of tolerance and inclusiveness. What a shame that we have come to this pass – straddling a tunnel and searching for light. And all we find are more tunnels of darkness, conspiracies and confusion.
Lahore, Islamabad, Karachi and Peshawar are directly and indirectly in the grip of extremism. This is the writing on shaky Pakistani walls. Let those who took oath under the Constitution, the legislators and the rulers, read the Articles where citizens' life, liberty, property and freedom to worship are guaranteed by the state. No excuse, no foreign hand and grand narrative of a Jewish conspiracy will do. We want peace and our nuclear-armed state must deliver it to us. Or else, it should take a sombre view of its capacities and correct them before the enemies annihilate its writ altogether. There is no other way out.
We cannot afford to fail. Thirty eight years ago, we lost half the country. This time around we might lose it all. Let us hope not.


Try to remember to eat your fruits a Bioorganic Keto nd veggies! You have to have at least 5 servings of them per day - doing this will put you on the right track to a healthful entire body, for the reason that fruits and vegetables have valuable fibers, nutritional vitamins and antioxidants. They also fill up your belly rapid so that you don't eat and take into several calories.he other hand, when we focus on the natural Asian burn fat diet pyramid, we are giving our body what it truly craves and therefore our overeating problem will simply cease. Only a natural skinny diet can lead to permanent fat loss.


text:
Q: Snakemake: confusion on how to access config files properly This question follows on from a question I asked previously and it regards understanding how to access config files correctly using Snakemake. I have a specific problem I need to address which I'll ask first and a general problem understanding how indexing works which I'll ask second.
I'm using snakemake to run and ATAC-seq pipeline from Alignment/QC through to motif analysis.
A: Specific Question
I'm trying to add a rule called trim_galore_pe to trim adapters from my fastq files before alignment and an error statement is thrown from snakemake as the names of the output files generated by trim galore do not match what is expected by snakemake. This is because I cannot work out how to write the output file statement correctly in my snakemake file to make the names match.
An example of the names generated by TRIM GALORE contain SRA numbers, for example:
trimmed_fastq_files/SRR2920475_1_val_1.fq.gz
Whereas the file expected by snakemake contain sample references and should read:
trimmed_fastq_files/Corces2016_4983.7B_Mono_1_val_1.fq.gz
This also affects the subsequent rules after the trim_galore_pe rule. I need to work out a way to use the info in my config file to generate the output files required.
For all rules after those shown in the Snakefile I need files to be named by sample name i.e. Corces2016_4983.7A_Mono. It would also be useful for all the FAST_QC and MULTIQC rules shown in the Snakefile below to have the sample names in the output file name structure, which they all already do in the current Snakefile.
However, inputs for Bowtie2, the FASTQC rules and input and output of the trim_galore_pe rules need to contain the SRA numbers. The problem starts at the output of trim_galore and influences all downstream rules.
Although I have extracted SRA numbers in previous rules, I'm not sure how to do this when not using the fastq_files folder which is explicitly stated in the config file. By introducing the trim_galore_pe rule I have effectively moved a new set of SRA files into the new trimmed_fastq_files folder. How to extract only the SRA number from the list of SRA files config file containing the old folder names whilst referencing the new trimmed_fastq_files folder in the Snakefile is the crux of my issue.
I hope this is clear.
Here is my config file:
samples:
    Corces2016_4983.7A_Mono: fastq_files/SRR2920475
    Corces2016_4983.7B_Mono: fastq_files/SRR2920476
cell_types:
    Mono:
    - Corces2016_4983.7A
index: /home/genomes_and_index_files/hg19

Here is my Snakefile:
# read config info into this namespace
configfile: "config.yaml"
print (config['samples'])

rule all:
    input:
        expand("FastQC/PRETRIM/{sample}_{num}_fastqc.zip", sample=config["samples"], num=['1', '2']),
        expand("bam_files/{sample}.bam", sample=config["samples"]),
        "FastQC/PRETRIM/fastq_multiqc.html",
        "FastQC/POSTTRIM/fastq_multiqc.html"

rule fastqc_pretrim:
    input:
        sample=lambda wildcards: f"{config['samples'][wildcards.sample]}_{wildcards.num}.fastq.gz"
    output:
        # Output needs to end in '_fastqc.html' for multiqc to work
        html="FastQC/PRETRIM/{sample}_{num}_fastqc.html",
        zip="FastQC/PRETRIM/{sample}_{num}_fastqc.zip"
    wrapper:
        "0.23.1/bio/fastqc"

rule multiqc_fastq_pretrim:
    input:
        expand("FastQC/PRETRIM/{sample}_{num}_fastqc.html", sample=config["samples"], num=['1', '2'])
    output:
        "FastQC/PRETRIM/fastq_multiqc.html"
    wrapper:
        "0.23.1/bio/multiqc"

rule trim_galore_pe:
    input:
        sample=lambda wildcards: expand(f"{config['samples'][wildcards.sample]}_{{num}}.fastq.gz", num=[1,2])
    output:
        "trimmed_fastq_files/{sample}_1_val_1.fq.gz",
        "trimmed_fastq_files/{sample}_1.fastq.gz_trimming_report.txt",
        "trimmed_fastq_files/{sample}_2_val_2.fq.gz",
        "trimmed_fastq_files/{sample}_2.fastq.gz_trimming_report.txt"
    params:
        extra="--illumina -q 20"
    log:
        "logs/trim_galore/{sample}.log"
    wrapper:
        "0.23.1/bio/trim_galore/pe"

rule fastqc_posttrim:
    input:
        "trimmed_fastq_files/{sample}_1_val_1.fq.gz", "trimmed_fastq_files/{sample}_2_val_2.fq.gz"
    output:
        # Output needs to end in '_fastqc.html' for multiqc to work
        html="FastQC/POSTTRIM/{sample}_{num}_fastqc.html",
        zip="FastQC/POSTTRIM/{sample}_{num}_fastqc.zip"
    wrapper:
        "0.23.1/bio/fastqc"

rule multiqc_fastq_posttrim:
    input:
        expand("FastQC/POSTTRIM/{sample}_{num}.trim_fastqc.html", sample=config["samples"], num=['1', '2'])
    output:
        "FastQC/POSTTRIM/fastq_multiqc.html"
    wrapper:
        "0.23.1/bio/multiqc"

rule bowtie2:
    input:
        "trimmed_fastq_files/{sample}_1_val_1.fq.gz", "trimmed_fastq_files/{sample}_2_val_2.fq.gz"
    output:
        "bam_files/{sample}.bam"
    log:
        "logs/bowtie2/{sample}.txt"
    params:
       index=config["index"],  # prefix of reference genome index (built with bowtie2-build),
       extra=""
    threads: 8
    wrapper:
        "0.23.1/bio/bowtie2/align"

This currently runs, and give a full job list using snakemake -np, but throws the error mentioned above.
B: General question
Is there an online resource that explains succinctly how to reference a config file using python, particularly with reference to snakemake? The online docs are pretty insufficient and assume prior knowledge of python.
My programming experience is mainly in bash and R but I like Snakemake and do generally understand how dictionaries and lists work in python and how to reference items stored within them. However I find the complex use of bracketing, wildcards and inverted commas in some of the Snakemake rules above confusing so tend to struggle when trying to reference different parts of file names in the config file. I want to understand fully how to utilise these elements.
For example, in a rule such as this from the Snakefile posted above:
sample=lambda wildcards: expand(f"{config['samples'][wildcards.sample]}_{{num}}.fastq.gz", num=[1,2])

What is actually happening in this command? My understanding is that we are accessing the config file using config['samples'] and we are using the [wildcards.sample] part to explicitly access the fastq_files/SRR2920475 part of the config file. The expand allows us to iterate through each item in the config file that fit the parameters in the command, i.e all the SRA files, and the lambda wildcards is needed to use the wildcards call in the command. What I'm uncertain about is:

*

*What does the f do just after the expand and why is it needed?

*Why does config['samples'] contain inverted commas within the square brackets but but inverted commas are not needed around [wildcards.sample]?

*Why are the single and double curly brackets used?

*Looking at the Snakefile above, a few of the rules contain parts assigning a sequence of numbers to num, but again these numbers are sometimes enclosed around inverted commas and sometimes not...why?

Any advice, tips, pointers would be greatly appreciated.
C: Clarification on suggestions made below by @bli
I have edited my config file as you suggested in your comment and omitted the folder names leaving only the SRA numbers. This make sense to me, but I have a couple of other issues preventing me getting this Snakefile running.
New config file:
samples:
    Corces2016_4983.7A_Mono: SRR2920475
    Corces2016_4983.7B_Mono: SRR2920476
cell_types:
    Mono:
    - Corces2016_4983.7A
index: /home/c1477909/genomes_and_index_files/hg19

New Snakefile:
# read config info into this namespace
configfile: "config.yaml"
print (config['samples'])

rule all:
    input:
        expand("FastQC/PRETRIM/{sample}_{num}_fastqc.zip", sample=config["samples"], num=['1', '2']),
        expand("bam_files/{sample}.bam", sample=config["samples"]),
        "FastQC/PRETRIM/fastq_multiqc.html",
        "FastQC/POSTTRIM/fastq_multiqc.html",

rule fastqc_pretrim:
    input:
      lambda wildcards: f"fastq_files/{config['samples'][wildcards.sample]}_{wildcards.num}.fastq.gz"
    output:
        # Output needs to end in '_fastqc.html' for multiqc to work
        html="FastQC/PRETRIM/{sample}_{num}_fastqc.html",
        zip="FastQC/PRETRIM/{sample}_{num}_fastqc.zip"
    wrapper:
        "0.23.1/bio/fastqc"

rule multiqc_fastq_pretrim:
    input:
        expand("FastQC/PRETRIM/{sample}_{num}_fastqc.html", sample=config["samples"], num=['1', '2'])
    output:
        "FastQC/PRETRIM/fastq_multiqc.html"
    wrapper:
        "0.23.1/bio/multiqc"

rule trim_galore_pe:
    input:
        lambda wildcards: expand(f"fastq_files/{config['samples'][wildcards.sample]}_{{num}}.fastq.gz", num=[1,2])
    output:
        "trimmed_fastq_files/{wildcards.sample}_1_val_1.fq.gz",
        "trimmed_fastq_files/{wildcards.sample}_1.fastq.gz_trimming_report.txt",
        "trimmed_fastq_files/{wildcards.sample}_2_val_2.fq.gz",
        "trimmed_fastq_files/{wildcards.sample}_2.fastq.gz_trimming_report.txt"
    params:
        extra="--illumina -q 20"
    log:
        "logs/trim_galore/{sample}.log"
    wrapper:
        "0.23.1/bio/trim_galore/pe"

rule fastqc_posttrim:
    input:
        lambda wildcards: expand(f"trimmed_fastq_files/{config['samples'][wildcards.sample]}_{{num}}_val_{{num}}.fq.gz", num=[1,2])
    output:
        # Output needs to end in '_fastqc.html' for multiqc to work
        html="FastQC/POSTTRIM/{sample}_{num}_fastqc.html",
        zip="FastQC/POSTTRIM/{sample}_{num}_fastqc.zip"
    wrapper:
        "0.23.1/bio/fastqc"

rule multiqc_fastq_posttrim:
    input:
        expand("FastQC/POSTTRIM/{sample}_{num}.trim_fastqc.html", sample=config["samples"], num=['1', '2'])
    output:
        "FastQC/POSTTRIM/fastq_multiqc.html"
    wrapper:
        "0.23.1/bio/multiqc"

rule bowtie2:
    input:
        lambda wildcards: expand(f"trimmed_fastq_files/{config['samples'][wildcards.sample]}_{{num}}_val_{{num}}.fq.gz", num=[1,2])
    output:
        "bam_files/{sample}.bam"
    log:
        "logs/bowtie2/{sample}.txt"
    params:
        index=config["index"],  # prefix of reference genome index (built with bowtie2-build),
        extra=""
    threads: 8
    wrapper:
        "0.23.1/bio/bowtie2/align"

Using these new files everything worked fine initially, a partial job list was created by snakemake -np. However, this is because half of the complete job list had already been run; that is the trimmed_fastq_files folder was generated and the correctly named trimmed fastq files were in place within it. When I deleted all the previously created files to see if the entire new version of the Snakefile would work properly, snakemake -np failed, stating that there were missing input files for the rules downstream of the trim_galore_pe rule.
As you can see I'm trying to call the {wildcard.sample} variable set in the input section of the trim_galore_pe rule in the output section, but snakemake doesn't like this. Is is possible to do this?
I also tried this using the tips from the answers below but this didn't work either:
rule trim_galore_pe:
    input:
        sample=lambda wildcards: expand(f"fastq_files/{config['samples'][wildcards.sample]}_{{num}}.fastq.gz", num=[1,2])
    output:
        expand(f"trimmed_fastq_files/{config['samples'][wildcards.sample]}_{{num}}_val_{{num}}.fq.gz", num=[1,2]),
        expand(f"trimmed_fastq_files/{config['samples'][wildcards.sample]}_{{num}}.fastq.gz_trimming_report.txt", num=[1,2])
    params:
        extra="--illumina -q 20"
    log:
        "logs/trim_galore/{sample}.log"
    wrapper:
        "0.23.1/bio/trim_galore/pe"

The error then stated wildcards not defined. So, logically I tried putting lambda wildcards: in front of the two expand statements of the output section in an attempt to define the wildcards, but this threw a syntax error, Only input files can be specified as functions. I also tried using some of the indexing suggestions below but couldn't get the right combination.
This is probably caused by another thing I'm unsure about regarding Snakefiles and that is how scoping works.

*

*If I define a variable in rule all can all other rules access it?

*If I define a variable in the input section of a rule, is it available to all other sections of that rule (i.e. output, shell command etc.), but only that rule?

*If yes, why can't I access the {wildcard.sample} variable if I defined it in the input section? Is that because that variable is enclosed within a 'closed' scope lambda function?

Any (further) suggestions would be greatly appreciated.

A: I'll try to answer your question B, and give extra details that I hope can be useful for you and others.
Edit: I added some attempts at answering question C at the end.
Regarding quotes
First, regarding what you call "inverted" commas, they are usually called "single quotes", and they are used in python to build strings. Double quotes can also be used for the same purpose. The main difference is when you try to create strings that contain quotes. Using double quotes allows you to create strings containing single quotes, and vice-versa. Otherwise, you need to "escape" the quote using backslashes ("\"):
s1 = 'Contains "double quotes"'
s1_bis = "Contains \"double quotes\""
s2 = "Contains 'single quotes'"
s2_bis = 'Contains \'single quotes\''

(I tend to prefer double quotes, that's just a personal taste.)
Decomposing the example
rule trim_galore_pe:
    input:
        sample=lambda wildcards: expand(f"{config['samples'][wildcards.sample]}_{{num}}.fastq.gz", num=[1,2])

You are assigning a function (lambda wildcards: ...) to a variable (sample), which happens to belong to the input section of a rule.
This will cause snakemake to use this function when it comes to determine the input of a particular instance of the rule, based on the current values of the wildcards (as inferred from the current value of the output it wants to generate).
For clarity, one could very likely rewrite this by separating the function definition from the rule declaration, without using the lambda construct, and it would work identically:
def determine_sample(wildcards):
    return expand(
        f"{config['samples'][wildcards.sample]}_{{num}}.fastq.gz",
        num=[1,2])

rule trim_galore_pe:
    input:
        sample = determine_sample

expand is a snakemake-specific function (but you can import it in any python program or interactive interpreter with from snakemake.io import expand), that makes it easier to generate lists of strings. In the following interactive python3.6 session we will try to reproduce what happens when you use it, using different native python constructs.
Accessing the configuration
# We'll try to see how `expand` works, we can import it from snakemake
from snakemake.io import expand

# We want to see how it works using the following example
# expand(f"{config['samples'][wildcards.sample]}_{{num}}.fastq.gz", num=[1,2])

# To make the example work, we will first simulate the reading
# of a configuration file
import yaml

config_text = """
samples:
    Corces2016_4983.7A_Mono: fastq_files/SRR2920475
    Corces2016_4983.7B_Mono: fastq_files/SRR2920476
cell_types:
    Mono:
    - Corces2016_4983.7A
index: /home/genomes_and_index_files/hg19
"""
# Here we used triple quotes, to have a readable multi-line string.

# The following is equivalent to what snakemake does with the configuration file:
config = yaml.load(config_text)
config

Output:
{'cell_types': {'Mono': ['Corces2016_4983.7A']},
 'index': '/home/genomes_and_index_files/hg19',
 'samples': {'Corces2016_4983.7A_Mono': 'fastq_files/SRR2920475',
  'Corces2016_4983.7B_Mono': 'fastq_files/SRR2920476'}}

We obtained a dictionary in which the key "samples" is associated with a nested dictionary.
# We can access the nested dictionary as follows
config["samples"]
# Note that single quotes could be used instead of double quotes
# Python interactive interpreter uses single quotes when it displays strings

Output:
{'Corces2016_4983.7A_Mono': 'fastq_files/SRR2920475',
 'Corces2016_4983.7B_Mono': 'fastq_files/SRR2920476'}

# We can access the value corresponding to one of the keys
# again using square brackets
config["samples"]["Corces2016_4983.7A_Mono"]

Output:
'fastq_files/SRR2920475'

# Now, we will simulate a `wildcards` object that has a `sample` attribute
# We'll use a namedtuple for that
# https://docs.python.org/3/library/collections.html#collections.namedtuple
from collections import namedtuple
Wildcards = namedtuple("Wildcards", ["sample"])
wildcards = Wildcards(sample="Corces2016_4983.7A_Mono")
wildcards.sample

Output:
'Corces2016_4983.7A_Mono'

Edit (15/11/2018): I found out a better way of creating wildcards:
from snakemake.io import Wildcards
wildcards = Wildcards(fromdict={"sample": "Corces2016_4983.7A_Mono"})

# We can use this attribute as a key in the nested dictionary
# instead of using directly the string
config["samples"][wildcards.sample]
# No quotes here: `wildcards.sample` is a string variable

Output:
'fastq_files/SRR2920475'

Deconstructing the expand
# Now, the expand of the example works, and it results in a list with two strings
expand(f"{config['samples'][wildcards.sample]}_{{num}}.fastq.gz", num=[1,2])
# Note: here, single quotes are used for the string "sample",
# in order not to close the opening double quote of the whole string

Output:
['fastq_files/SRR2920475_1.fastq.gz', 'fastq_files/SRR2920475_2.fastq.gz']

# Internally, I think what happens is something similar to the following:
filename_template = f"{config['samples'][wildcards.sample]}_{{num}}.fastq.gz"

# This template is then used for each element of this "list comprehension"
[filename_template.format(num=num) for num in [1, 2]]

Output:
['fastq_files/SRR2920475_1.fastq.gz', 'fastq_files/SRR2920475_2.fastq.gz']

# This is equivalent to building the list using a for loop:
filenames = []
for num in [1, 2]:
    filename = filename_template.format(num=num)
    filenames.append(filename)
filenames

Output:
['fastq_files/SRR2920475_1.fastq.gz', 'fastq_files/SRR2920475_2.fastq.gz']

String templates and formatting
# It is interesting to have a look at `filename_template`
filename_template

Output:
'fastq_files/SRR2920475_{num}.fastq.gz'

# The part between curly braces can be substituted
# during a string formatting operation:
"fastq_files/SRR2920475_{num}.fastq.gz".format(num=1)

Output:
'fastq_files/SRR2920475_1.fastq.gz'

Now let's further show how string formatting can be used.
# In python 3.6 and above, one can create formatted strings
# in which the values of variables are interpreted inside the string
# if the string is prefixed with `f`.
# That's what happens when we create `filename_template`:
filename_template = f"{config['samples'][wildcards.sample]}_{{num}}.fastq.gz"
filename_template

Output:
'fastq_files/SRR2920475_{num}.fastq.gz'

Two substitutions happened during the formatting of the string:

*

*The value of config['samples'][wildcards.sample] was used to make the first part of the string. (Single quotes were used around sample because this python expression was inside a string built with double quotes.)

*The double brackets around num were reduced to single ones as part of the formatting operation. That's why we can then use this again in further formatting operations involving num.
# Equivalently, without using 3.6 syntax:
filename_template = "{filename_prefix}_{{num}}.fastq.gz".format(
    filename_prefix = config["samples"][wildcards.sample])
filename_template

Output:
'fastq_files/SRR2920475_{num}.fastq.gz'

# We could achieve the same by first extracting the value
# from the `config` dictionary
filename_prefix = config["samples"][wildcards.sample]
filename_template = f"{filename_prefix}_{{num}}.fastq.gz"
filename_template

Output:
'fastq_files/SRR2920475_{num}.fastq.gz'

# Or, equivalently:
filename_prefix = config["samples"][wildcards.sample]
filename_template = "{filename_prefix}_{{num}}.fastq.gz".format(
    filename_prefix=filename_prefix)
filename_template

Output:
'fastq_files/SRR2920475_{num}.fastq.gz'

# We can actually perform string formatting on several variables
# at the same time:
filename_prefix = config["samples"][wildcards.sample]
num = 1
"{filename_prefix}_{num}.fastq.gz".format(
    filename_prefix=filename_prefix, num=num)

Output:
'fastq_files/SRR2920475_1.fastq.gz'

# Or, using 3.6 formatted strings
filename_prefix = config["samples"][wildcards.sample]
num = 1
f"{filename_prefix}_{num}.fastq.gz"

Output:
'fastq_files/SRR2920475_1.fastq.gz'

# We could therefore build the result of the expand in a single step:
[f"{config['samples'][wildcards.sample]}_{num}.fastq.gz" for num in [1, 2]]

Output:
['fastq_files/SRR2920475_1.fastq.gz', 'fastq_files/SRR2920475_2.fastq.gz']

Comments about question C
The following is a bit complex, in terms of how Python will build the string:
input:
    lambda wildcards: expand(f"fastq_files/{config['samples'][wildcards.sample]}_{{num}}.fastq.gz", num=[1,2])

But it should work, as we can see in the following simulation:
from collections import namedtuple
from snakemake.io import expand

Wildcards = namedtuple("Wildcards", ["sample"])
wildcards = Wildcards(sample="Corces2016_4983.7A_Mono")
config = {"samples": {
    "Corces2016_4983.7A_Mono": "SRR2920475",
    "Corces2016_4983.7B_Mono": "SRR2920476"}}
expand(
    f"fastq_files/{config['samples'][wildcards.sample]}_{{num}}.fastq.gz",
    num=[1,2])

Output:
['fastq_files/SRR2920475_1.fastq.gz', 'fastq_files/SRR2920475_2.fastq.gz']

The problem in the trim_galore_pe rule is actually in its output section: You shouldn't use {wildcards.sample} there, but just {sample}.
The output section of a rule is where you inform snakemake of what the wildcards attributes will be for a given instance of the rule, by matching the file it wants to obtain with the patterns given. The parts matching the curly braces will be used to set the values of the corresponding attribute name.
For instance, if snakemake wants a file called "trimmed_fastq_files/Corces2016_4983.7A_Mono_1_val_1.fq.gz", it will try to match this against all patterns present in all rule's output sections and eventually find this one: "trimmed_fastq_files/{sample}_1_val_1.fq.gz"
Luckily, it will be able to match the filename with the pattern by establishing a correspondence between Corces2016_4983.7A_Mono and the {sample} part. It will then put a sample attribute in the local wildcards instance, a bit like if I was manually doing the following:
Wildcards = namedtuple("Wildcards", ["sample"])
wildcards = Wildcards(sample="Corces2016_4983.7A_Mono")

I don't know what happens exactly in snakemake if you use {wildcards.sample} instead  of {wildcards}, but let's try with my simulation framework:
Wildcards = namedtuple("Wildcards", ["sample"])
wildcards = Wildcards(wildcards.sample="Corces2016_4983.7A_Mono")
  File "<ipython-input-12-c02ce12bff85>", line 1
    wildcards = Wildcards(wildcards.sample="Corces2016_4983.7A_Mono")
                         ^
SyntaxError: keyword can't be an expression

What about your following attempt?
output:
    expand(f"trimmed_fastq_files/{config['samples'][wildcards.sample]}_{{num}}_val_{{num}}.fq.gz", num=[1,2]),

Here, my understanding is that Python first tries to apply the f string formatting on f"trimmed_fastq_files/{config['samples'][wildcards.sample]}_{{num}}_val_{{num}}.fq.gz".
To do that, it will need to be able to evaluate config['samples'][wildcards.sample], but the wildcards object does not exist yet. Hence the wildcards not defined.
wildcards would be generated only after matching the name of a file needed by a "downstream" rule with a string containing {attribute_name} patterns. But this is the string that snakemake is currently trying to build.
Here are some important points to remember:

*

*wildcards actually exist only locally, in an instance of a rule, after having matched its output with a file required by another "downstream" rule instance.

*You don't define variables in input sections. You use variables to build the concrete names of the files that the rule instance will need (or, more precisely, that you say you want to exist before the rule instance can be run: the rule does not need to actually use those files). Those variables are those defined outside the scope of the rules, directly at the ground level of the snakefile, in pure Python mode, and the local wildcards object. By default, the {attribute_name} placeholders will be substituted by the attributes of the local wildcards object ("{sample}" becomes "Corces2016_4983.7A_Mono"), but if you want to do more complicated stuff to build the file names, you need to do this via a function that will have to explicitly handle this wildcards object (lambda wildcards: f"{wildcards.sample}" becomes "Corces2016_4983.7A_Mono").

A: For the A part of your question, I would suggest using tab-delimited files in order to store sample information, ID, etc, whatever amount of samples you have. You can then store the path to this file in your config file, and access it by using column identifiers with the pandas library. See this thread for more detail.
As for part B:

*

*Looks like it's a new way to format string in python, see this link for ex.

*config['samples'] is intended to access the config file's key "samples", while [wildcards.sample] is intended to access the wildcard  {sample} as defined in your workflow (in rule all).

*Double brackets are generally used to escape simple brackets. Here it avoids expanding {{num}} (can't put my hands on the example from snakemake's documentation).

*num=['1', '2'] is assigning a list of values to the wildcard {num}, so later it can be accessed by using {wildcards.num}. If all rules' inputs and outputs are linked you shouldn't have to define these values more than once.
Hope this clarifies some of your concerns, good luck!

redpajama_set_name: RedPajamaStackExchange


As a premier custom home builder in the Golden Triangle, Bart Nichols Construction has built a reputation for the integrity of our product; with state of the art design and building methods, cost efficiency, on-time delivery and the highest quality materials that create excellent durability and safety in our homes. Our homes are warrantied for 10 years.
One of our core values is a personal approach to custom home building that begins with a desire to deliver quality second to none. We partner with our clients to build homes to last a lifetime.