Wednesday, July 25, 2018

Girls' Last Tour

Okay, I want to get this out of the way immediately:
Seriously. It should have a legally required warning. If it doesn't make you sad, then you are a monster and I do not want to know you.

It is also one of the best things I have seen in a long, long time. Not just anime. Anything.

It is available on Amazon Prime Video (link in title). This is the synopsis:
"In a future where most of humanity has perished, two young girls explore the ruins of civilization looking for food and fuel."
That's the entire plot. By all rights, I should think this was boring as hell, but it never was. Even watching it the second time, when I knew exactly what was coming.

The two protagonists, Chito and Yuuri, are immediately engaging, just driving through the dark, barely talking. That, combined with the weird abandoned-industrial setting, had me invested in the story from the get-go.

Chito (Chi) is thoughtful and bookish (also easily irritated by Yuuri). The (very) occasional flashbacks and dream sequences are from her PoV. She keeps a journal, even though she knows no one will ever read it.
Yuuri (Yuu) is living on Zen time (there is only today and there never will be anything except today). Sometimes she briefly wonders about the past, but never more than as idle curiosity. Same with the future, but even more so. She can barely read or write, but isn't dumb.
Both of them are well aware of their situation. Neither seems deeply bothered by it.

There are some nice, touching moments. There are some really funny moments. There are some brief existential discussions. But it's still just these two (mostly - they do meet some other people) driving around aimlessly (they went into the factory in the first episode on Yuu's whim). Their only destination is "higher" (it's a Layered City) , and even the search for food/fuel doesn't seem that urgent to them, although they are always aware of their limited supplies (and of what happens if they run out).

There is a lot more to say about it (and really, no one is going to read this - spoilers aren't an issue), but I don't want to go deep into specifics right now.

If you don't mind a sad story, this is a good one that I cannot recommend strongly enough.


UPDATE: One sort-of negative thing: I'm not sure my issue with heights counts as even mild acrophobia, but oh-someone's-god did the third and eighth episodes set it off.

Thursday, October 15, 2015

river math problem

So a few days ago, my attention was brought to this article. It's a very straight-forward minimization problem. The crocodile/zebra spin is just fluff, the equation that needs minimized is given to the student. Find the derivative and evaluate it at zero. I can't imagine this being "too hard" for anyone who has taken Calculus 1.

I got to thinking about it, and decided to try to find a general solution. So I needed to set up the original equation. That wasn't too hard. Given width of the river, W; the distance along the bank to the target, L; and the relevant velocities (swimming, Vs; running, Vr; and flow speed, Vf (not considered in the given formula, but what the hell) the relationship is pretty easy to find. I decided to make it a function of the angle at which the crocodile swims (in my set up 0° is directly across the river, and the angle increases clockwise).

So: total time is the sum of swimming time and running time. Swimming time is easy. It is the distance across the river (at the given angle) divided by the swimming speed. Running time is a little trickier, but it works out to the absolute value of the horizontal distance to the target minus the horizontal distance covered by the swimming angle, plus drift distance. Drift distance is swimming time times flow speed. So, the total time as a function of angle is:

Taking the derivative and minimizing gives:

Check it out. It looks like the W and L don't matter. Just the ratio of velocities. But if the swimming speed is higher than the running speed plus flow speed, the result is meaningless. It turns out that even if it is close, the angle it gives is ridiculous. It isn't obvious from any of this but the function has a discontinuity cusp where
tan(θ) = L/W, and the minimization will only work to that point.

I was having a hard time showing this on paper, so I did what I always do in these situations: I wrote a program to do it for me. I used the browser-based Python interpreter at CodeSkulptor

Here it is. Use this one. Feel free to play with it.(The last I knew, CodeSkulptor doesn't work right in IE) You can change the distances and velocities. Note that negative W, Vr, and Vs are nonsense. The program can't handle negative L. Negative Vf is fine, though.

Here's a screen shot of the solution to the original problem:

Here's a screenshot of one of the weird results.

(FIX: there was a bug in my drift calculation when I took that. The minimum time will never have the crocodile landing upstream of the target. It is fixed in the final version)


UPDATE: I changed the color scheme for better contrast, and fiddled with the scale and offset to show that the discontinuity cusp is still there in the original problem

The discontinuity cusp is at θ = atan(L/W) if there is no drift. Adding drift changes the angle at which the crocodile would swim directly to the target. That is where the run time calculation (the absolute value term in the total time equation) is zero. I'm not sure I can simplify it to a relationship. I can see that Vr divides out, and the angle depends on W, L, Vs, and Vf. Maybe I'll work on it more this weekend.


UPDATE #2: Okay, I worked out the relationship that determines the angle where the discontinuity cusp is. It is a horribly messy quadratic:

The quadratic formula technically has '+ or -', but the '-' case can be discounted because that result is outside of the range the problem makes sense for, [0°,90°). If flow speed (Vf) is zero, this simplifies to cos(θ) = W/√W²+L², which equates to tan(θ) = (L/W).

Aside from the initial minimization that made me aware of the discontinuity cusp , this has all been algebra and trigonometry. Messy, sure, but not actually hard.

So here Use this one. is the final version of my program. Here is a screenshot of the original problem, showing the location of the discontinuity cusp:


UPDATE #(Again? WTF?): It occurred to me that I was using "discontinuity" wrong. The function is not discontinuous, it is continuous but not differentiable at the cusp. So, I have corrected the post.

Note to self: Do not use Blogger's "compose" mode. It adds a ton of weird, unnecessary html to the post.


UPDATE #(Seriously, what the hell is wrong with you?): I couldn't help thinking about the cases where the minimization doesn't apply. It really isn't that mysterious. As Vs approaches (or equals) Vr+Vf, the resulting θ would be beyond the cusp. which means that it doesn't apply. The total time function follows a different curve to the right and left of the cusp. There is actually a discontinuity in the curve. 1/cos(θ) → infinity as θ → 90°. Of course, the cusp usually comes before you get close to the discontinuity, so the minimum time will always be between 0° and the cusp. Well, if the flow speed is high, the cusp calculation can be outside the (-90°, 90°) range. but in that case the function is differentiable across that entire range, and the minimization applies. This got me wondering why my program didn't work for L < 0. It should have been obvious. I was only evaluating the equation for θ in [0°, 90°). If L < 0, θ < 0°. Once I fixed that to (-90°, 90°), I had to put an absolute value on the cos(θ) in the swim time evaluation (even if the angle at which the crocodile swims across the river is negative, the time it takes is still positive). I changed my graphics to reflect the change. So, once again, here is the actual, final version Use this one.
And the obligatory screenshot:


UPDATE #(Holy Shit! You're still on about this?): I couldn't stop fiddling with the program. I added Try-Except statements to the input handlers so that entering bad values wouldn't crash the program. Try it. I also made some corrections to the graph display. So here is the latest 'final' version.
And a screenshot:


Sunday, August 23, 2015

Cherry Marshamallows

This is the sort of thing that happens when I get bored:

The pink mess in the bowl is a previous batch that I left too close to a hot oven, and melted into a gooey pile.  Jac suggests making Rice Krispy treats with it.  I'll probably do that.

The plate on the right has the finished marshmallows from the second batch.  They are dusted in powdered sugar to keep them from sticking together.  They are actually purple, as can be seen on the exposed half-marshmallow.  These are awesome in hot chocolate or s'mores.

The plate on the left has the Frankensteinian remnants, and a few salvaged pieces from the first batch, dipped in chocolate.

The reason the first batch is pink, and the second purple is a change in the recipe. The original recipe called for cherry extract and a few drops of red food coloring.  I used the last of my cherry extract making it.  When I decided to make another batch, I went to the store to get more, but there wasn't any.  So I got cherry juice and substituted it for the water in the original.  I wasn't sure it would work, but I'm pretty happy with the results.  Next time I'll add some extract, too, though.  The cherry flavor is pretty subtle with just the juice.

So here's my (revised) recipe for Cherry Marshmallows.

   Electric mixer
   Rubber scraper
   Heavy-bottomed 2-qt saucepan
   Candy thermometer
   Medium mixing bowl (I prefer one with straight sides)
   Small microwave-safe bowl
   Baking dish (I used an 11"x7" brownie pan)
   Cling wrap
   Chef's knife

   2 lg. egg whites, at room temperature
   1 c. cherry juice (I used black-cherry juice, I think that's why they're purple)
   3 envelopes unflavored gelatin
   2 c. granulated sugar
   1/2 c. light corn syrup
   1/4 t. salt
   1 t. cherry extract (or more for a stronger flavor)
   powdered sugar
   non-stick spray

   Line the baking dish with cling wrap and spray with non-stick spray.
   Mix gelatin and 1/2 c cherry juice in microwave safe bowl and set aside.
   Put egg whites in mixing bowl and set aside.
   Mix remaining 1/2 c juice, granulated sugar, corn syrup, and salt in saucepan.
   Heat on med-high.  Stir until sugar is dissolved.  Insert thermometer.
   Heat to 260°F.  Note - when it starts to boil, it will make a mess if the saucepan is
   too small.
   Watch the thermometer.  When the sugar mixture gets to about 240°F, start 
   beating the egg whites.
   They should form stiff peaks about the time the sugar gets to 260°.
   Microwave gelatin on high for 20 seconds.  Stir to fully liquefy.
   Whisk gelatin into sugar mixture.  Note - this will cause a lot of steam.  Be careful.
   Slowly pour sugar/gelatin mixture into egg whites while beating on low.  Not too
   slowly, if the sugar cools it will harden.
   Add cherry extract and gradually increase speed to med-high.
   Beat until very thick and glossy, 8 to 10 minutes.
   Pour into prepared dish.  Let sit at least 8 hours to allow gelatin to set.
   Dust (liberally) a cutting board with powdered sugar.  Flip marshmallow onto
   board and remove pan and cling wrap.  Dust marshmallow with powdered sugar.
   Cut into strips (then cubes) with chef's knife.  Dust knife with powdered sugar as it
   gets sticky. And it will.  
   Dust cubes with powdered sugar, then brush off excess.


Saturday, May 16, 2015

Quote button

A long time ago, shortly after I added the "new quote" button on my random quote generator, Tom said it would be better to have the button above the quote so that it didn't move every time the quote length changed.  I didn't really care, so I never bothered.  Until just now.


Saturday, March 14, 2015

Happy Pi Day! Key Lime edition

Preheat oven to 350°F

    1+1/4 c. graham cracker crumbs
    2 T. sugar
    1/3 c. melted butter (unsalted)

    mix together and press into pie plate.
    bake 10 minutes, let cool

    3 egg yolks
    1+1/2 t. freshly grated key lime zest
    1 can (12oz) sweetened condensed milk
    2/3 c. freshly squeezed key lime juice

   Beat yolks and zest on high for 5 min
   Add condensed milk and continue to beat 4 more minutes
   Reduce speed to minimum.  Slowly pour in lime juice.  Stop when just combined

Pour filling into pie shell.  Bake 10 minutes.
 (if, like me, you made the shell too deep, and there isn't enough filling, make another batch, pour that into shell (pour any excess filling into a ramekin for a key-lime custard).  Bake another 10 minutes. )

Sunday, April 06, 2014

Manhattan clam chowder

I felt like making some Manhattan clam chowder for lunch, but I didn't want a lot of leftovers, so I cut the recipe back to make two servings.

I made an incredibly fortuitous mistake.  I wasn't paying attention at the store (big surprise) and grabbed a can of diced tomatoes with habaneros instead of plain.

It was awesomely spicy.

So, for posterity, here's my recipe for Manhattan clam chowder

Manhattan clam chowder
   - 2 fairly big servings. (You could reasonably call this 3 servings, 4 would be
          pushing it)

2 strips thick sliced bacon
1/4 c onion, chopped
1/4 c red bell pepper, chopped
1/4 c carrots, chopped
1/4 c celery chopped
2 cloves garlic, chopped or pressed
1 T Italian seasoning (just oregano would probably be fine)
1/4 c dry white wine (I use Chardonnay)
1/2 c clam juice
1 T fish sauce (you might need to visit an Asian market for this)
1 bay leaf
1 small potato, cubed (about 1/2 c)
1 can (10 oz) diced tomatoes with habaneros (do not drain)
1 can (6.5 oz) chopped clams in clam juice (do not drain)
salt and pepper to taste
fresh parsley, chopped

Fry bacon in heavy skillet until crisp.  Remove, drain, and crumble.
Add onions, bell pepper, carrots, and celery to bacon fat.  Reduce heat to low,
     cover, and cook until tender (about five minutes)
Turn heat to medium, add garlic and Italian seasoning.  Sauté about 2 minutes
Add wine and cook, stirring occasionally, until liquid is reduced about half
Transfer to a 2 qt saucepan, add clam juice, fish sauce, bay leaf, potatoes, and
Bring to a simmer, reduce heat to low, cover and let simmer for 30 min.
Add clams and bacon, continue to simmer for about 10 more minutes.
Add salt and pepper to taste.
Garnish with parsley and serve.

I ended up eating both servings.

Friday, July 19, 2013

Today's rant:

Okay. Listen to this:

That's "Hail to the Geek" by Deaf Pedestrians. Funny song. Here's the problem: There is one verse that applies to me. And they get it way wrong.

I play Dungeons and Dragons
I got a 13th level halfling fighter-thief
Got seven hit die on the backstab
Sometimes you know it's good to be a geek.
"Fighter-thief" and "backstab" indicate that he's playing 1st or 2nd edition AD&D. But backstab was a damage multiplier. A 13th level thief would have a backstab multiplier of x5. When Wizards of the Coast acquired D&D and released 3rd edition, "Thief" became "Rogue", "backstab" became "sneak attack", and the damage multiplier became extra dice.

But it get's worse.

1st and 2nd edition were kind of vague on multiclassing, but even so, the classes were treated separately and most DM's just made players split xp between classes, which, given the different xp requirements (thieves gained levels much faster than any other class), normally resulted in a staggered advancement. "13th level fighter-thief" is pretty much meaningless. In 3rd edition all classes used the same xp table for level progression, and the concepts of character level and class level were specified. So "13th level fighter/rogue" would indicate a character level of thirteen, but says nothing about the level of each class. The character would be listed as (for example) a "3/10 fighter/rogue" instead. However, given the "Got seven hit die on the backstab" line, the character would need 13 rogue levels to have a sneak attack of +7d6, and would have no fighter levels.

Which brings me to my last point:

"Die" is singular. "Dice" is plural. No D&D geek would say "seven hit die", and many might become violent upon hearing it. "Seven hit dice" is correct.

As Jac said once: "You're going to have to try a lot harder than that if you want to be a geek at this table."