Angelino Heights

 

The “Charmed” house:

[

Scheerer House, Queen Anne cottage:

Out of place amongst the Victorians:

Heim House:
Heim House

Sessions House, 1889:
Sessions House

The gardener said the house was used in a DiCaprio movie but didn’t know which one (Pretty sure it wasn’t Titanic.):
Angelino Heights

The Michael Jackson “Thriller” house:
The "Thriller" House

Angelino Heights

Angelino Heights

Elvis Costello at the House of Blues

 
Elvis Costello
Elvis Costello, House of Blues – Nov 28, 2018

First time I’ve seen a concert at House of Blues in Anaheim. It’s a general admission standing room venue that holds I’d say around 1,500 people plus a seated balcony that you can get into for a premium price.

Pros and cons you can probably guess: You’ll have to stand for about 3 hours but once the show starts, you don’t really think about it. If the 64-year-old performer can stand for the whole show, so can I.

On the plus side, you can get quite close to the stage. Maybe not right in front unless you’re first in line to get in, but the sides of the stage you can get to easily.

Also, you get to see an A-list performer in a small room.

I don’t go to concerts in large venues anymore — Staples Center, Honda Center, the Forum, Rose Bowl, etc. I wouldn’t enjoy that.

I go to medium-sized venues, but even then, I prefer something unusual or unique like the Neil Young solo acoustic show at the Dolby Theater.

I’ve included the set list (to the best of my recollection) here as a Spotify playlist. Everything after “Everyday I Write the Book” was performed as an encore.

Making it Easier for Women to Do Things They Don’t Want to Do

 

Apple launching tech camps for women in bid to diversify industry

Like other major tech companies, Apple has been trying to lessen its dependence on men in high-paying programming jobs.

I don’t think “dependence” is the right word there. Is that dependence like alcohol dependence, or like dependence on foreign oil?

It’s an oblique way of saying “we’re trying to employ fewer men,” but explicitly singling out members of a certain group for unwelcome attention sounds discriminatory and possibly illegal.

Women filled just 23 percent of Apple’s technology jobs in 2017, according to the company’s latest breakdown.

“Just” — why do we assume that working at Apple is a goal that a lot of women have? Maybe women found better jobs? Or something else they’d rather be doing?

Industry critics have accused the technology companies of discriminating against women through a male-dominated hierarchy that has ruled the industry for decades.

I’m more inclined to think that if women wanted to work in technology in greater numbers, they’d be doing so.

I’ve noticed recently that when President Trump says something, the media report it, but they’ve started following it up with a caveat along the lines of “He offered no evidence to support his claims.”

Now there’s a phrase you could use all day long! “Industry critics have accused technology companies of discriminating against women. They offered no evidence to support their claims.”

The fact that men outnumber women — or the other way around — in a profession is not evidence of discrimination. It may be evidence that women have more of a preference for “helping professions” — healthcare, social work, teaching, counseling, in all of which women significantly outnumber men — and men have more of a preference for technology.

It’s the simplest available explanation. That doesn’t mean it has to be right, but I think it is.

Thus spoke The Programmer.

Competitive Programming: SPOJ – Glass Beads

 

Link to problem

Once upon a time there was a famous actress. As you may expect, she played mostly Antique Comedies most of all. All the people loved her. But she was not interested in the crowds. Her big hobby were beads of any kind. Many bead makers were working for her and they manufactured new necklaces and bracelets every day. One day she called her main Inspector of Bead Makers (IBM) and told him she wanted a very long and special necklace.

The necklace should be made of glass beads of different sizes connected to each other but without any thread running through the beads, so that means the beads can be disconnected at any point. The actress chose the succession of beads she wants to have and the IBM promised to make the necklace. But then he realized a problem. The joint between two neighbouring beads is not very robust so it is possible that the necklace will get torn by its own weight. The situation becomes even worse when the necklace is disjoined. Moreover, the point of disconnection is very important. If there are small beads at the beginning, the possibility of tearing is much higher than if there were large beads. IBM wants to test the robustness of a necklace so he needs a program that will be able to determine the worst possible point of disjoining the beads.

The description of the necklace is a string \(A = a_{1}a_{2} … a_{m}\) specifying sizes of the particular beads, where the last character \(a_{m}\) is considered to precede character \(a_{1}\) in circular fashion.

The disjoint point \(i\) is said to be worse than the disjoint point \(j\) if and only if the string \(a_{i}a_{i+1} … a_{n}a_{1} … a_{i-1}\) is lexicographically smaller than the string \(a_{j}a_{j+1} … a_{n}a_{1} … a_{j-1}\). String \(a_{1}a_2 … a_n\) is lexicographically smaller than the string \(b_1b_2 … b_n\) if and only if there exists an integer \(i, i \leq n\), so that \(a_j = b_j\), for each \(j, 1 \leq j < i\) and \(a_i < b_i\).

Input

The input consists of \(N\) cases. The first line of the input contains only positive integer \(N\). Then follow the cases. Each case consists of exactly one line containing necklace description. Maximal length of each description is 10000 characters. Each bead is represented by a lower-case character of the English alphabet (a–z), where a < b … z.

Output

For each case, print exactly one line containing only one integer — number of the bead which is the first at the worst possible disjoining, i.e. such \(i\), that the string \(A[i]\) is lexicographically smallest among all the \(n\) possible disjoinings of a necklace. If there are more than one solution, print the one with the lowest \(i\).

Time limit: 0.5s

Sample input
 
4
helloworld
amandamanda
dontcallmebfu
aaabaaa
 
Sample output
 
10
11
6
5
 

Solution below . . .

Read more

The Saints Went Marching In

 

And, behold, the veil of the temple was rent in twain from the top to the bottom; and the earth did quake, and the rocks rent;

And the graves were opened; and many bodies of the saints which slept arose,

And came out of the graves after his resurrection, and went into the holy city, and appeared unto many.

It is an easy thing to tell a lie, but it is difficult to support the lie after it is told. The writer of the book of Matthew should have told us who the saints were who came to life again and went into the city. and what became of them afterward, and who it was that saw them — for he is not hardy enough to say that he saw them himself; whether they came out naked and all in natural buff, he-saints and she-saints; or whether they came fully dressed, and where they got their dresses; whether they went to their former habitations, and reclaimed their wives, their husbands and their property, and how they were received; whether they entered ejectments for the recovery of their possessions, or brought actions of crim. con. against the rival interlopers; whether they remained on earth, and followed their former occupation of preaching or working; or whether they died again, or went back to their graves alive and buried themselves.

Strange, indeed, that an army of saints should return to life and nobody know who they were, nor who it was that saw them, and that not a word more should be said upon the subject, nor these saints have anything to tell us!

Had it been the prophets who (as we are told) had formerly prophesied of these things, they must have had a great deal to say. They could have told us everything and we should have had posthumous prophecies, with notes and commentaries upon the first, a little better at least than we have now. Had it been Moses and Aaron and Joshua and Samuel and David, not an unconverted Jew had remained in all Jerusalem. Had it been John the Baptist, and the saints of the time then present, everybody would have known them, and they would have out-preached and out-famed all the other apostles. But, instead of this, these saints were made to pop up, like Jonah’s gourd in the night, for no purpose at all but to wither in the morning.

— Thomas Paine, The Age of Reason

A Reading From the Book of Numbers

 

Biblical warfare

And Moses, and Eleazar the priest, and all the princes of the congregation, went forth to meet them without the camp.

And Moses was wroth with the officers of the host, with the captains over thousands, and captains over hundreds, which came from the battle.

And Moses said unto them, Have ye saved all the women alive?

Behold, these caused the children of Israel, through the counsel of Balaam, to commit trespass against the Lord in the matter of Peor, and there was a plague among the congregation of the Lord.

Now therefore kill every male among the little ones, and kill every woman that hath known man by lying with him.

But all the women children, that have not known a man by lying with him, keep alive for yourselves.

The language is a bit archaic but you understand what’s happening: Kill the boys, kill their mothers, rape the daughters. Thus saith the Lord. Amen.

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

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.

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

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?

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.