What Comfort Can You Give Him?

When you get a person to look at the sun as it bakes down on the daily carnage taking place on earth, the ridiculous accidents, the utter fragility of life, the powerlessness of those he thought most powerful — what comfort can you give him from a psychotherapeutic point of view?

— Ernest Becker, The Denial of Death

Doe Library

Daily Affirmation

I start my daily commute by saying “OK Google, drive to work” into my phone, and Google responds by showing me the fastest route.

This morning, Google thought I said “have to work”:

Have to work

Competitive Programming: SPOJ – String Problem

Link to problem

Substring of some string A is defined as one or more (not necessary succeeding) elements of the string with maintaining the sequence.

There are given two strings, string VOKI and string TOKI. Write the program that will calculate the length of any shortest substring of string VOKI such as it is not substring of string TOKI.

Input

In first line of input file there is string VOKI and in second one is string TOKI. The only characters that will occur are lowercase characters of English alphabet (‘a’- ‘z’). String lengths will be less or equal to 1000.

Note: input data will be such so there will always be a solution.

Output

In the first line of file you should print the length of wanted substring.

Sample input
 
banana 
anbnaanbaan 
 
Sample output
 
5 
 
(eg. banna) 

Sample input
 
babab 
babba 
 
Sample output
 
3 
 
(eg. aab) 

Solution below . . .

Read more

Teaching Computer Science: Tips and Tricks for the AP CS Principles Performance Tasks

Your most valuable resource for the performance tasks is the AP Computer Science Principles Exam page. Look for the section titled Sample Responses and Scoring Information.

There’s a rubric for performance tasks, but they’re graded by humans so scoring is somewhat subjective. This page takes the guesswork out of it.

You’ll find multiple student responses from previous exam administrations, including scoring guidelines and commentary. Some of the responses are excellent, some are bad, and the rest are somewhere in-between. But they all come with a detailed explanation for each row of the rubric as to why points were or were not awarded.

Don’t submit your performance tasks without ensuring that they most closely resemble the high-scoring examples on this page.

 

Teachers are limited in the type of questions they can answer regarding your performance tasks. It has to be your own work.

That being said, if you have a question, ask it. Let the teacher decide whether the question can be answered or partially answered.

Don’t not ask a question because you’ve heard that teachers can’t answer questions.

 

As with any standardized test graded by humans, the people grading your test are not going to be sitting in an armchair with a pipe and a gin and tonic ready to immerse themselves in your written responses.

Grading is an assembly-line process. There’s a room full of graders, they’re jacked up on coffee and doughnuts, and they’re on the clock: score a paper, pass it on, score the next one, and so on.

You must make it as easy as possible for a grader to give you the points. For example, there’s a question on the Explore Task that asks you to describe one beneficial effect and one harmful effect of a computing innovation. Use the words “beneficial effect” and “harmful effect” in your answer. Underline them! You might think I’m kidding but I’m not.

Don’t overestimate the graders. They can miss things, especially if they have to guess at or interpret what you’re trying to say.

They have the same rubric you have. They know that they’re supposed to find one beneficial effect and one harmful effect. If you use the words “beneficial effect” and “harmful effect” and underline them, you may get the points for that alone. They love you! They’re fishtailing between nausea and euphoria from the coffee and doughnuts and you’ve made their job easy.

Don’t worry about your answer being articulate or whether your favorite English teacher would consider it well-written. You are not getting style points for writing like Jane Austen. You’re not showing off your vocabulary.

You must beat the graders over the head with the expected answers. Use the words from the rubric and underline them.

More Words and Phrases I’m Sick Unto Death Of

Calendar

“Calendar” as a verb: “Can you given me an estimated delivery date so I can calendar it?”

I’ve never heard that before today and I’m already sick of it.

Competitive Programming: SPOJ – Palindromes

A palindrome is a word, phrase, number or other sequence of units that has the property of reading the same in either direction, e.g. ‘racecar’, ‘solos’.

Task

You are given a number k (2 <= k <= 30000) and a non-empty string S whose length does not exceed 30000 lowercase letters.

We say two palindromes are different when they start from different positions. How many different palindromes of the length k does S contains?

Input

The first line contains K. The second line contains S. K does not exceed the length of S.

Output

The first and only line should consist of a single number – the number of palindromes found.

Example

Input:
5
ababab

Output:
2

Time limit: 0.100s

Link to problem

Solution below . . .

Read more

Two Great Fears

We now know that the human animal is characterized by two great fears that other animals are protected from: the fear of life and the fear of death.

— Ernest Becker, The Denial of Death

Competitive Programming: SPOJ – Distinct Substrings

Given a string, we need to find the total number of its distinct substrings.

Input

T- number of test cases. T<=20;
Each test case consists of one string, whose length is <= 1000

Output

For each test case output one number saying the number of distinct substrings.

Example

Sample Input:
2
CCCCC
ABABA

Sample Output:
5
9

Explanation for the testcase with string ABABA:
len=1 : A,B
len=2 : AB,BA
len=3 : ABA,BAB
len=4 : ABAB,BABA
len=5 : ABABA
Thus, total number of distinct substrings is 9.

Link to problem

Solution below . . .

Read more

Teaching Computer Science: Inequality = Bad?

I’m volunteering a couple mornings a week in a high school computer science class . . .

Equality

“Why don’t schools and classes have sponsors?” I ask one of the teachers. “When my kid was in school, they were always complaining about not having enough money. So why couldn’t you, for example, come in and say, ‘Hey kids, before you come to 1st period, make sure you have a good breakfast at McDonald’s. I’m lovin’ it!’?

“And McDonald’s pays you 100 grand or whatever to say that.”

“My concern,” he says, “is that would lead to more inequality in education.”

I’m not sure he really thought that through. It seems more like a mechanical response to an abstract notion, i.e., “Inequality is bad.”

As a parent, I always supported inequality in education. I wanted my kid to get the best possible education, better than most other kids.

As a classroom volunteer, I want kids in my classes to get a better computer science education than kids in other classes where a computing professional is not present.

Does a teacher really think that students at his school should not be allowed to get a better education than students at other schools?

Dawn Wells is 80!?

Dawn Wells

Here’s some information that will ruin your day if not your entire life: Dawn Wells is 80 years old!

We Didn’t Even Have Indoor Plumbing

In October 2018, the Intergovernmental Panel on Climate Change (IPCC) released a special report on “the impacts of global warming of 1.5 degrees C above pre-industrial levels.”

“Pre-industrial levels” is defined in the report as the the period from 1850 to 1900.

Not explained in the report, unless I missed it, is why I should feel confident in the scientific precision of air and sea surface temperatures taken in the 19th century.

Willie McCovey, 1938-2018

Willie McCovey baseball card

Willie McCovey: Giants legend dead at 80SFChronicle.com

My boyhood sports idols are dying . . .

RIP Willie McCovey

$15 Trillion for “Free” Healthcare

$300K = free healthcare for 60 people?! $50K per person?!

Multiply by 300 million Americans . . . check me on the math but isn’t that $15 trillion? For “free” healthcare?!?!?!

Here’s what it looks like if you write it out: $15,000,000,000,000.

Is this guy insane?!?!?!

Things to Leave Out of Your Online Dating Profile

Former NFL player Rae Carruth released from prison after serving 18 years for killing his pregnant girlfriendNY Daily News

Jesus Discovers America

Again, the devil taketh him up into an exceeding high mountain, and sheweth him all the kingdoms of the world, and the glory of them.

“Satan, what is that land mass way over there to the west?”

“Oh that’s America. It hasn’t been discovered yet.”

Map of the World

Amazon Has Good News and Bad News for You on the Minimum Wage

Robot

Good News: We are raising the minimum wage for all U.S. employees to $15 an hour.

Bad News: We’re replacing all of you with robots.

And That’s the Truth: Believe Women

Sojourner Truth

[And That’s the Truth is a feature by our guest blogger, Sojourner Truth– PE]

Believe Women . . . I can’t help thinking about that poor boy Emmett Till.

And Norma McCorvey . . . lied about being raped so she could get an abortion. That’s before she became Jane Roe.

You never knowed a woman to tell a lie? To tell a lie to hurt someone?

Woman can do anything a man can do. Good or bad.

And that’s the Truth!

Spot the Fake News: Students Call For USC Professor To Be Fired

USC Seal

A professor at the University of Southern California has come under fire after sending a reply-all email last week to the student body stating “accusers sometimes lie.”

“If the day comes you are accused of some crime or tort of which you are not guilty, and you find your peers automatically believing your accuser, I expect you find yourself a stronger proponent of due process than you are now,” Professor James Moore wrote in the email. “Accusers sometimes lie.”

Nearly 100 students reportedly attended a rally called “Times Up for James Moore” on Monday in protest of Moore — who is tenured — demanding that he be fired.

Nearly 100 students! Not mentioned: USC has 44,000 students.

A more accurate way to frame this would be “Out of 44,000 USC students, 43,900 understand that a person whose political views are not a mirror image of their own can still be allowed to hold a job.”

In the Fake News Taxonomy, this falls under Misleading Content, i.e., misleading use of information to frame an issue/individual.

FIGHT ON!

EppsNet at the Movies: A Star is Born

OK, actually I haven’t seen A Star is Born and here’s why:

  1. When I go to the movies, I like to see something I’ve never seen before. I don’t care for sequels, prequels, reboots, spinoffs, adaptations of TV shows, video games, comic books or other movies.
  2. I don’t like love stories. I find them unrealistic. I read a lot and the books and authors I like mostly exclude the possibility of true love.
  3. What is worse than when you want to see a movie and someone spoils it by telling you how it ends? If you’re remaking A Star is Born for the fifth time, everyone already knows how it ends. You’ve spoiled your own movie.
 

A Star Is Born

A musician helps a young singer find fame, even as age and alcoholism send his own career into a downward spiral.

Director: Bradley Cooper
Cast: Lady Gaga, Bradley Cooper, Sam Elliott, Andrew Dice Clay

IMDb rating: 8.4 (50058 votes)