Why not celebrate by picking up a copy of my book?
The final question assigned to the class was “What is life?” Merry’s answer was something her father and mother chuckled over together that night. According to Merry, while the other students labored busily away with their phony deep thoughts, she — after an hour of thinking at her desk — wrote a single, unplatitudinous declarative sentence: “Life is just a short period of time in which you are alive.” “You know,” said the Swede, “it’s smarter then it sounds. She’s a kid — how has she figured out that life is short? She is somethin’, our precocious daughter. This girl is going to Harvard.” But once again the teacher didn’t agree, and she wrote beside Merry’s answer, “Is that all?” Yes, the Swede thought now, that is all. Thank God, that is all; even that is unendurable.
RIP Philip Roth
I can’t decide which one to get . . .
A palindrome is a symmetrical string, that is, a string read identically from left to right as well as from right to left. You are to write a program which, given a string, determines the minimal number of characters to be inserted into the string in order to obtain a palindrome.
As an example, by inserting 2 characters, the string “Ab3bd” can be transformed into a palindrome (“dAb3bAd” or “Adb3bdA”). However, inserting fewer than 2 characters does not produce a palindrome.
Your program is to read from standard input. The first line contains one integer: the length of the input string N, 3 <= N <= 5000. The second line contains one string with length N. The string is formed from uppercase letters from ‘A’ to ‘Z’, lowercase letters from ‘a’ to ‘z’ and digits from ‘0’ to ‘9’. Uppercase and lowercase letters are to be considered distinct.
Your program is to write to standard output. The first line contains one integer, which is the desired minimal number.
Solution below . . .
One good thing about being British royalty is if your wife turns out to be a disappointment in some respect, you can have her executed. Can I get an Amen on that?
A reader asks:
I was interested to find out how you center yourself and clear your thoughts before writing. I’ve had a difficult time clearing my mind in getting my thoughts out there. I do enjoy writing however it just seems like the first 10 to 15 minutes are usually lost simply just trying to figure out how to begin. Any recommendations or hints?
Let’s start out assuming that you actually have something to say. If you don’t, that’s okay. Come back later when you do.
The sticking point in starting to write is, in my opinion, trying to do two things at once, i.e., figuring out what you want to say and how you want to say it.
Take it one step at a time. To start with, write it all down like you’re talking to someone. Don’t edit as you go, e.g., “Is this the best word choice?”, “Should I say this before that or that before this?” You will think about all that later. Write like you talk . . . just stream it.
What is your topic? Do you need 10-15 minutes to gather yourself before conversing with someone about it? Probably you don’t.
Once you’ve got it all written down, only then do you start to revise. Write, then revise. Don’t try to write and revise at the same time.
Turning it off and back on again also fixes washing machines.
I saw a young woman in a graduation gown cross the street toward me. She was wearing high heels and when she stepped onto a set of those sidewalk bumps that keep blind people from inadvertently striding into traffic, she lost her footing and almost fell.
“Are you okay?” I asked.
“Yeah,” she said, “I stumble in that same place every day.”
Is it good or bad that she’s graduating? It’s good in that she won’t stumble there anymore, but it’s bad in that she’s leaving without having mastered the skill of walking on sidewalk bumps in heels.
Now she’ll have to go out into the world and compete with people who can walk around without falling down all the time.
If she went to a better school — let’s say she was a Berkeley grad — she could walk into a wall three times and people would say “That’s how she collects her thoughts.”
But a Chapman University pedigree is not going to get you the same benefit of the doubt . . .
Jerusalem is still the capital of Israel and must remain an undivided city. — Bill Clinton
As soon as I take office, I will begin the process of moving the United States ambassador to the city Israel has chosen as its capital. — George W. Bush
Jerusalem will remain the capital, and I have said that before and I will say it again. — Barack Obama
I have decided that it is time to officially recognize Jerusalem as the capital of Israel. — Donald Trump
Today we officially open the United States embassy in Jerusalem. Congratulations, it’s been a long time coming. — Donald Trump
My fellow Americans —
I heard or read the Trump sound bite — “These are not people. These are animals.” — several times this week, always with no context to clarify who or what the pronoun “these” refers to.
I plan to use that line next time I visit the National Zoo. It’s going to be hilarious.
Listeners and readers were invited to apply the broadest possible interpretation, i.e., Trump said immigrants are animals.
He was reviled by people who relied on the short, skewed attention span of the American public to avoid facing the regrettable fact that they use the same “dehumanizing” language themselves.
This doesn’t work as well as it did before Twitter became an online memory bank for better or worse. For example, here is CNN “journalist” Ana Navarro:
Once it became widely known that Trump was referring specifically to MS-13 gang members, Nancy Pelosi and other Democrats shifted to an “MS-13 members are people too” strategy that doesn’t seem promising.
Pelosi, who should probably be hidden away somewhere at this point, said that “there’s a spark of divinity in every person on Earth,” although I don’t remember her objecting when her party’s most recent presidential candidate identified half the country as “a basket of deplorables,” “irredeemable” and “not America.”
Trump supporters are irredeemable but homicidal gang members have “a spark of divinity”?
Can the Democrats win on that in November? I’m going to say no. It’s bad enough on its own merits, but — I say this as someone who is not an abortion opponent — it’s a perfect setup for asking why “unborn children” don’t have “a spark of divinity.”
- The top five problems you have with <topic> and how to solve them
- Why <topic> sucks and what we can do about it
- Mistakes I made in <topic> and what I learned
- The most frequently asked questions and brilliant answers about <topic>
- The truth about <topic> and how it can help you
- Smart shortcuts and clever tricks only experts know about <topic>
- The five reasons you win by giving me <topic>
- Why <topic> will change your life forever, for free, right now
Not every problem someone has with his girlfriend is necessarily due to the capitalist mode of production. — Herbert Marcuse
In how many ways can you tile a 3xn rectangle with 2×1 dominoes?
Here is a sample tiling of a 3×12 rectangle.
Input consists of several test cases followed by a line containing -1. Each test case is a line containing an integer 0 <= n <= 30.
For each test case, output one integer number giving the number of possible tilings.
2 8 12 -1
3 153 2131
Solution below . . .
We come and we go . . . that’s a thing that I keep in the back of my head . . .
Everything that bloggers have done for journalism — and I personally think they’ve done a lot — Wolfe did it first, he did it 30 years earlier, and he did it better. And I think we’re still catching up to him.
Tom Wolfe had a rare combination of ideas, insight and a virtuosity with language. A lot of writers do well with at most one out of the three. You can read Tom Wolfe quotes all over the web but I include one of my favorites (from The Bonfire of the Vanities) here:
Sherman made the terrible discovery that men make about their fathers sooner or later . . . that the man before him was not an aging father but a boy, a boy much like himself, a boy who grew up and had a child of his own and, as best he could, out of a sense of duty and, perhaps love, adopted a role called ‘Being a Father’ so that his child would have something mythical and infinitely important: a Protector, who would keep a lid on all the chaotic and catastrophic possibilities of life.
RIP Tom Wolfe
Girls who grow up with working moms are more likely to have careers themselves and to have higher paying jobs in the future, according to a report in Fortune, citing study data. The research found that, “daughters of working mothers in the U.S. make about 23% more than daughters of stay-at-home mothers.”
This article is headlined — inaccurately, in my view — Girls with working moms fare better.
Shouldn’t the headline stay with the facts and say “Girls with working moms make more money” instead of “Girls with working moms fare better”?
- seems to reflect an inappropriately narrow obsession with money as the only metric for measuring life outcomes.
- misrepresents facts to promote an opinion, i.e., “working moms are good for society.”
The sinner is at the very heart of Christianity. Nobody is so competent as the sinner in matters of Christianity. Nobody, except the saint. — Charles Peguy
No matter what framework or method your management thinks they are applying, learn to work this way:
- Produce running, tested, working, integrated software every two weeks, every week. Build your skills until you can create a new fully operational version every day, twice a day, multiple times a day.
- Keep the design of that software clean. As it grows, the design will tend to become complex and crufty. Resist and reverse this tendency consciously, refactoring in tiny continuous steps, all the time, so that your rate of progress is as steady and consistent as possible.
- Use the current increment of software as the foundation for all your conversations with your product leadership and management. Speak in terms of what’s ready to go, and in terms of what they’d like you to do next.
This is the development team’s best hope for a reasonable life. By keeping the software always ready to go, we can hit any deadline with the best possible result. “Is today the deadline? Here’s what we’ve got, it’s ready to ship.”
It will never be known what acts of cowardice have been committed for fear of not looking sufficiently progressive. — Charles Peguy, Notre Patrie (1905)