Perl: ternary operator

Perl self-tutoring: the tutor mentions the ternary operator.

Let’s imagine the variable $v0 is not defined, and therefore false from Perl’s point of view.

$v0 ? print ‘defined’ : print ‘not defined’

will output not defined.

a?b:c is known as the ternary operator. If a is true, then b happens; else, c.

Source:

perlmaven.com

roberts perl tutorial

Jack of Oracle Tutoring by Jack and Diane, Campbell River, BC.

English: hilarities?

Tutoring English, a specific question arises: the tutor investigates if hilarity can pluralize to hilarities.

In my Feb 14 post I use the word hilarities, which the spell-checker doesn’t like, though it’s happy with hilarity. So, is the word hilarities valid?

A source online describes hilarity as “a situation of humour.” Well, then, two different situations of humour are two hilarities, aren’t they?

PS: The spell checker doesn’t like humour, either:)

Source:

dictionary.cambridge.org

Barber, Katherine et al. Oxford Canadian Dictionary of Current English. Don Mills: Oxford University Press, 2005.

Jack of Oracle Tutoring by Jack and Diane, Campbell River, BC.

Baking: red velvet cake, part II

Self-tutoring about baking: the tutor follows up about his attempt at red velvet cake.

On February 8 I talk about red velvet cake and my decision to make it.

My wife arrived as I was blending the icing. Seeing the cakes cooling on the wire racks, she naturally asked if I wanted her help. I happily agreed for her to ice the cake, but watched her do so, looking for hints.

The cake turned out well, but was better on the second day than the first. Moisture from the icing penetrated the cake, while the icing itself seemed to get lighter as a result, becoming like whipped cream. The cake, after a day, reminded me of strawberry shortcake.

It’s long gone now. The question: If I make another one, will I use the same recipe, or experiment? This recipe turned out fine:)

Source:

allrecipes.com

Jack of Oracle Tutoring by Jack and Diane, Campbell River, BC.

English: is it relatable?

Tutoring English, you never run out of material. The tutor shares an observation – will it be relatable?

relatable (adj): 1. sensibly connected to some other event or state; 2. understandable by others.

The word relatable is listed by a couple of authorities I’ve checked. Yet, the spell checker in one of the apps I use doesn’t like it. I wonder who finds this situation relatable?

Source: Mish, Frederick C. The Merriam-Webster Dictionary. Springfield: Merriam-Webster, 2004.

dictionary.cambridge.org

Jack of Oracle Tutoring by Jack and Diane, Campbell River, BC.

English: numbskull, or numskull?

Tutoring English, some hilarities just present themselves.

Numbskull can also be spelled numskull, according to two dictionaries I’ve checked.

Who knew?

Source:

Mish, Frederick C (editor). The Merriam-Webster Dictionary. Springfield: Merriam-Webster, 2004.

Gilmour, Lorna (editor). Collins Essential Canadian English Dictionary and Thesaurus. Glasgow: HarperCollins, 2006.

Jack of Oracle Tutoring by Jack and Diane, Campbell River, BC.

Lifestyle: waxing a snow shovel?

Self-tutoring about snow clearing: the tutor mentions an idea he tried.

I’ve never heard of anyone’s waxing a snow shovel. Yet, this morning, the idea came to me.

I was using a deep shovel. When I would throw the snow, about 20% remained embedded within the shovel: it wouldn’t clear. I wondered what to do.

I recalled a story told me many years ago. An outdoorsman came upon some skis, so decided to try them. He was used to waxing toboggans, so did so to the skis.

He found the skis moved far too easily: he quickly gained unsafe speed on the hill. Not being a skier, he couldn’t control it properly and went down. Next he scraped the wax from the skis: much better.

Would wax work as well on the shovel? I dried it then rubbed an old candle in its bed. Trying it out, I noticed an absolute difference: the snow didn’t stick.

The wax needed re-applying every few minutes, yet it helped a lot.

Best of luck with your snow-clearing:)

Jack of Oracle Tutoring by Jack and Diane, Campbell River, BC.

Perl: map

Tutoring Perl: the tutor gives an example of Perl’s fantastic map function.

Suppose you have the array (1,2,3,4), but you want to musically enhance it to (and a 1, and a 2,….)

@arr=map {‘and a ‘.$_} (1,2,3,4);

yields

@arr = (and a 1, and a 2, and a 3, and a 4)

Source:

Tutorials Point (India) Pvt. Ltd.

Jack of Oracle Tutoring by Jack and Diane, Campbell River, BC.

Computer science: PHP: the register_globals phenomenon

Self-tutoring about PHP: the tutor looks into the hazard of register_globals.

In PHP, register_globals, when set to 1 (or on), could allow variables to be created and set from within web requests. In particular, if a variable was uninitialized in a function on the server, it could be initialized with a compromising value from a request.

PHP versionregister_globals status
<4.2default ON
≥4.2default OFF
5.3.0deprecated
5.4.0removed

For specific purposes, register_globals offered a useful and interesting option. However, its inherent security risk led to its removal from PHP.

Source:

php.net

php.net

Jack of Oracle Tutoring by Jack and Diane, Campbell River, BC.

Perl: greedy vs lazy match

Perl tutoring: the tutor compares a greedy match with its corresponding lazy one.

argumentgreedylazy
e2ee9a/e\w*\d//e\w*?\d/
matche2ee9e2

Source:

roberts perl tutorial

McGrath, Mike. Perl in easy steps. Southam: Computer Step, 2004.

Jack of Oracle Tutoring by Jack and Diane, Campbell River, BC.

Bodybuilding: Eddie Hall

Self-tutoring about point of view: the tutor mentions a discussion with his son.

Returning from the gym this morning, my son mentioned Eddie Hall.

“He dead-lifted 500kg. From the exertion, he forgot his children’s names for two weeks.”

I paused, then looked at my son. “Well, I guess that was a great accomplishment, then.”

“Obviously.”

When a person is really devoted to a pursuit, they celebrate the sacrifice it can take.

Source:

euronews.com

Jack of Oracle Tutoring by Jack and Diane, Campbell River, BC.
Top
%d bloggers like this: