?

Log in

Some Greyhound experiences

A post I made elsewhere, on my past many trips:

I had an awesome conversation with some girl I was sitting next to, though she never wrote me back afterwards. One of my first photos with a new camera was of another cute girl across the aisle (I asked permission.) One time I sat next to a vet who had a pet ferret in his backpack. I didn't ask where it crapped.

The station in San Francisco sells porn. The station in Omaha mostly sells stuff with crosses or other Christian themes. Also one time the Omaha station felt like a refugee camp: 4am, possibly some bus was delayed due to drivers, lots of people sitting around looking bleary with what looked like their worldly possessions. (not really)

It was neat stepping out in or near Salt Lake City and seeing the mountains there.

Heading west to Spokane I encountered my first dry electrical storm, not having ever heard of such a thing. It was really creepy: no rain, no sound, not even many visible lightning bolts, just the sky flashing frequently. I had crazy thoughts about Canadian nuclear barrage or something.

Montana really is Big Sky Country and it gives me the willies.

Some line not far west of the Mississippi river separates "not enough rain for many trees" and "trees will grow unless actively suppressed". This first became obvious when I woke up in Arkansas, going east, and Surprise! Trees! outside the window.

If you're north enough there are trees in the west again, but they're stands if not plantations of conifers and really boring.

Around 2005 our bus almost broke down in the Rockies; certainly the air conditioning stopped working. The driver said their new CEO had previously cost-cut Northwest Airlines into bankruptcy. Around this time the company also dropped a lot of the small town stops, including the not-that-small college town of Bloomington Indiana. Around this time I stopped riding Greyhound much...

See the comment count unavailable DW comments at http://mindstalk.dreamwidth.org/443092.html#comments

links

Allergies suck. Job hunting sucks. Let me dig up saved links that aren't live politics or RPGs.

Maps of store zones in cities https://www.washingtonpost.com/news/wonk/wp/2016/04/26/what-your-city-looks-like-when-nearly-every-store-is-mapped/?postshare=5051461732762915&tid=ss_fb

Origins of modern racism https://www.reddit.com/r/AskHistorians/comments/4gzfbf/how_true_is_the_statement_race_is_a_modern_idea/d2m2zri

WWII production numbers https://www.reddit.com/r/AskHistorians/comments/4h4c7w/could_the_soviet_union_have_defeated_nazi_germany/d2nfhkd

Clinton role in Irish peace process http://irishamerica.com/2015/03/when-it-comes-to-irish-peace-hillary-and-history-rhyme/

on worker co-op productivity http://www.thenation.com/article/worker-cooperatives-are-more-productive-than-normal-companies/
https://www.reddit.com/r/CapitalismVSocialism/comments/4h8lip/why_do_cooperatives_work_why_dont_they/d2ofrr8

why exit polls mislead http://www.nytimes.com/2014/11/05/upshot/exit-polls-why-they-so-often-mislead.html?_r=0

Klingon and copyright https://www.publicknowledge.org/news-blog/blogs/in-a-lawsuit-over-copyright-in-klingon-here-come-the-klingon-speakers/

feminist season of GoT? https://forum.rpg.net/showthread.php?780808-Game-of-Thrones-Show-Book-SPECULATION-and-SPOILERS-Episode-6x1-quot-The-Red-Woman-quot&p=20027961#post20027961

Krugman on the importance of models http://krugman.blogs.nytimes.com/2016/04/25/economics-and-self-awareness/?_r=0
and tax progressivity not being the end-all: http://krugman.blogs.nytimes.com/2016/04/25/a-note-on-the-soda-tax-controversy/

See the comment count unavailable DW comments at http://mindstalk.dreamwidth.org/442637.html#comments

Tags:

Misleading descriptions

Inspired by a Scalzi article on accurate but misleading movie descriptions, I tried some of my own. Not always as complete as his:

Cordelia's Honor: a woman falls in love with her captor and is convinced to cover up a mass murder.

The Warriors Apprentice: a mentally unstable noble acquires a private fleet through deceit.

Nine Princes in Amber: the inmate of an insane asylum has increasingly surreal adventures.

The X-Men: a teen runaway meets and falls for a much older and dangerous man.

Castle in the Sky: two kids defy the advice of their elders and destroy a priceless historical site.

Nanoha: a boy spends months living with a girl without telling her he's a boy.

Lord of the Rings: a special forces team sets out to infiltrate enemy territory and assassinate the enemy leader. Multiple betrayals ensue.

See the comment count unavailable DW comments at http://mindstalk.dreamwidth.org/442445.html#comments

Tags:

More fun with honorifics

I have since finished the Akagami anime, and almost all of the manga.

* Kiki and Mitsuhide, Prince Zen's first two guards/attendants, who used -dono on each other until they asked each other to stop, are in fact noble. Shirayuki uses -san with them even in private, contrary to my guess last time. They don't use an honorific with her or Zen, Zen and S don't use honorifics with each other (in private; his attendants qualify as private.)

* Obi, the definitely non-noble ninja, got promoted all the way to "Obi-sama" by a palace servant in Tanbarun. In the same scene, underage royalty call him Obi-san. That's not surprising given the relative ranks, but I note it.

* Those royal kids get "omae-tachi", or "you two" from their older and very annoyed brother. "omae" is a pretty casual/rude way of saying "you", like "hey you" -- Mitsuhide uses it on Obi a lot. One of the kids uses "nii-sama" for that brother, which is like "Exalted Big Brother". The kids also says Shirayuki-san, when their older brother, the first prince of their country, is saying Shirayuki-dono. That's kind of interesting... sort of they're responding to her base status, he's treating her as an honored guest plus all the... complications... they have.

* Between careful listening and the manga, I'm pretty sure he says "ojou-san" for Shirayuki much of the time, not my guess of an accented "ojou-sam". But he can switch it up: in one scene he opens with "ojou-san" as basically "Hi" or "Yo", but uses "ojou-sama" when speaking formally to her a moment later. For her part, she just calls him Obi. Then in that scene he loosens up and almost calls her by name, "Shirayu-" before clapping his hand to his mouth in horror.

* ...I just accidentally discovered TV Tropes ojou, which distinguishes 'ojou', lady, from 'oujo', princess. *headdesk* Not a distinction I'd been aware of, obviously, and not sure one my ear would be trained to discern even listening for it. It'll be interesting to try, though, especially where Shirayuki is concerned. Probably it's been 'ojou'.

* Speaking of which, a pirate captain calls Shira "ojou-chan". Given the personality and situation, this was probably mocking, it's like "little lady".

* After being rescued, Shirayuki is "Zen-ouji, Kiki-san, Mitsuhide-san", but once the outsider is dismissed and in the process of leaving, she's back to "Zen!". She'd also used Zen-ouji in talking *about* him to the local prince.

* The chief court herbalist, the one who calls S Shirayuki-kun, says Mitsuhide-sama and Zen-denka. Why is Mitsuhide -sama to her and -dono originally to Kiki? I have no idea. Maybe because Kiki was noble. You'd think a senior court official would kind of rank... Various random guards say "Kiki-dono". (But in the manga, they use -sama.) S uses Zen-ouji in front of her, keeping up appearances. I feel she's more diligent about that this season than she was last, but could be wrong.

* Mitsuhide says Izana-denka in talking about the first prince, S says Izana-ouji in talking nto him. Again, I don't know if that has any meaning other than varying things up. Except, I note I'm not sure she's *ever* said denka, she uses ouji whenever she bothers being that formal. (Nope, she has, I just caught her saying "Zen-denka" when asking "you're Prince Zen's older brother, right?" Mostly uses ouji, though.)

* Manga: chief herbalist uses -kun on visiting herbalists who are her juniors but not her direct subordinates. She just calls Ryuu by his name though; he's the 12 year old prodigy who outranks most of the others; I assume she's going by his age. Oh, right, he asked S to call him Ryuu, and she's his junior, though he keeps calling her -san. The Chief also says Obi-kun, which is amusing. What *do* you call the prince's sketchy messenger? Izana honors both the chief and Ryuu with -dono, which given his rank and personality really is high honor.

* Huh, I never noticed what Prince Izana calls or uses for Shirayuki. Assuming he's ever *had* to use her name.

* Huh, Raji was saying "Shirayuki-dono" while talking about her to Zen back in first season, when he didn't respect her, just feared Zen. Uses it in talking to her a bit later, too. I guess he's been properly cowed, or is treating her as Zen's lover, which he thought she was.

* Not an honorific per se, but the second time Izana confronts S, I catch him saying "anata", "you", which is fairly rude in Japanese. Then he uses 'hime', "princess", right after that, which is mocking-rude in context.

See the comment count unavailable DW comments at http://mindstalk.dreamwidth.org/442339.html#comments

Tags:

Fun with honorifics

One thing I've become fascinated by in Japanese in the use of honorifics to convey degrees of intimacy and relationship. I don't think English was ever quite so developed, and modern society has lost much of the nuance we had (e.g. Miss Bennett vs. Miss Elizabeth.) Which may be just as well for social equality, but still, interesting subject. Two examples weigh on my mind.

First is the Nanoha franchise, and the many names of Fate Testarossa (given name, family name), especially in the first two series, where she's a 9 to 10 year old girl.

* Fate-chan to Nanoha and many others. This is the default state of a little girl, almost anyone can -chan them on minimal acquaintance.
* Fate to her mother and her familiar. This is really intimate, but those are the people you'd expect that from. If it has shades of being condescending, too... well, her mother's not very nice.
* Fate-kun while speaking to 'Admiral' Graham, as a probationary member of magical Starfleet. -kun is sort of the -chan for boys, but it's also used for junior employees, including female ones. So this fits.
* Fate-san to Lindy, who also uses it for mundane girls like Arisu and Suzuka. I like my interpretation, wherein Lindy believes in treating everyone with dignity and respect, even 9 year old girls, and even 9 year old girls who can't defeat her in single combat (which Fate quite possibly could). But it's odd seeing a conversation wherein Chrono or Amy refers to Fate-chan and Lindy uses Fate-san, in adjacent lines.
* Testarossa to Signum, an antagonist and old warrior. Seems to fit, standard brusque 'hey, lastname!'
* Testarossa-chan to Shamal, Signum's softer and more motherly colleague. Interesting blend of "little girl that I am not on first name basis with especially as she's an enemy." Logical, but funny.

Even my friend W eventually granted that the diversity in Fate's case was a bit much.

We could get really geeky and consider who's actually Japanese or speaking it. The franchise chickens out of considering any language or translation issues; the simplest explanation seems to be to assume that the non-Earthlings are mostly using translation programs through their Devices. Fate's family isn't Earthling, so it could be that her mother and familiar are simply using her name. Lindy is a Japanophile -- she's got a thing that goes doink in her starship office -- and thus could plausibly be learning Japanese on her own, so maybe she's using -san as many foreigners do, to not mess up. Signum and Shamal are outsiders but must have had Japanese downloaded into them before they booted up this time around.

***

Then there's a more recent one, Akagami no Shirayukihime ("Snow White with the Red Hair"). The star's given name is Shirayuki, family name unknown. Age also unknown to me, but I'd say somewhere between 15 and 25, probably 18-20. It's set in a Disney-like "fantasy" quasi-European world: no magic or fantastic elements yet, but a weird anachronistic stew of gas or electric lighting, big glass greenhouses, leaf spring carriage wheels, essays on cyanobacteria, and no guns. My subtitles here, unlike the Nanoha ones, try to translate ("Miss Shirayuki") rather than copy honorifics, which I'll grudgingly grant is maybe appropriate for the setting, but I listen for the honorifics in the spoken Japanese anyway. There do seem to be a lot fewer of them, and a lot more use of simple (given name), but they are there.

One particularly interesting one is -dono, which is even more divergent in use than -kun. One use is to address a social superior, but someone not as superior as -sama implies. Another use is for superiors to address each other, sort of granting "you are *someone's* superior and I respect that, though of course you aren't *my* superior."

So, when I was re-watching and paying attention for this stuff, I caught the palace guards of Clarines addressing the heroine as Shirayuki-dono. Who is she to them? At one level, she's a town girl from another kingdom, with no inherent social status whatsoever, definitely not a -sama. At another level, she's the prince's friend (or, they might imagine, mistress) with his personal invitation to visit the palace, and who addresses *him* with his given name, no honorific, which AIUI is kind of more intimate than actually having sex. So more than the default -san. -dono fits perfectly.

Later, another prince visits, and the princes address each other as Raji-dono and Izana-dono, which fits: equal social superiors acknowledging each other's superiority.

More surprising: a recent flashback revealed that Prince Zen's bodyguards initially used -dono with each other. I don't know their background; given their clothing and their job as his permanent companions, it's plausible that they're members of the minor nobility. In the current time they're on unadorned given name basis with each other, Prince Zen, and I think Shirayuki.

Obi, a later guard/attendant, who's some lower class ninja scum, got to be "Obi-dono" recently while accompanying the heroine on a semi-state visit. I imagine that was "you're the personal attendant of this girl who isn't a princess but is kind of being treated like one, and you're dressed up, -dono seems safe, won't insult any -samas who overhear and you won't kill me if it turns out you really are a -sama yourself." For his own part he may still use honorifics with the other two guards (I'm not sure, I haven't paid *that* close attention), and definitely refers to Shira with respect; if not an actual honorific, then certainly a lot of "oujo" (lady/princess), especially when talking about her.

As mentioned, Shirayuki normally addresses the star prince as simply Zen, which must be shocking and provocative for those who overhear. Usually he's either Denka or Zen-denka to people. The chief herbalist used "Zen-sama" in talking to him about how he could abuse his position, but I couldn't parse it more than that. When Shira said goodbye to him recently, while surrounded by lots of people, she used Zen-ouji (another suffix for 'prince'), I assume to cater to appearances for once. She also addressed his older brother as Izana-ouji. Why ouji vs. denka? I have no idea. I've seen 'denka' translated as "highness" while 'ouji' is literally "king-boy", but I don't know the relative status.

Shira herself as apprentice court herbalist is Shirayuki-kun to the Chief Herbalist (that employer-employee thing against), Shirayuki-san to Ryu, who is her herbal senior but her junior in age, and Shirayuki-chan way back in the first episode to the old people she'd grown up among.

I'm trying to recall if anyone addressed Prince Raji, who's a sleazy scummy chump, as Raji-kun to be insulting.

See the comment count unavailable DW comments at http://mindstalk.dreamwidth.org/441935.html#comments

Tags:

PR vs. gerrymandering

I was at an anarchism reading discussion last night, and afterwards talking with a fellow social democrat about election reform. He didn't see why I said proportional representation solves gerrymandering, and I didn't have a fluent explanation at the time. Thus this post.

Of course, if you do PR from a single district, or pre-existing districts like US states, then there's nothing to gerrymander, so we assume multiple districts are drawn, for locality or to limit ballot size, with some number n of delegates being elected from each.

If n=1, almost half of the votes in a district can be wasted. (Or more, with more than two candidates and plurality voting, but let's assume optimal competition instead.)

With n=2, almost 1/3 of the votes can be waste: two candidates with a bit over 1/3 each, and the rest for someone else.

With n=3, almost 1/4. The pattern should be obvious. Bigger (or rather, higher n) districts mean there's less room for throwing votes away.

But I think it's more useful to look at minimal votes need to capture a legislature. With single-member, n=1, like the House, you in theory need bit over 25% of the votes to control the body. (Or less, with plurality...) With half the seats, with half the votes in each of those districts, and no votes anywhere else. Yes, that's absurdly fine tuned, but it's *possible*.

For n=2, you need a bit over 2/3 of the vote in half the districts, for 1/3 of the total vote.

N=3, 3/4 in half, for 3/8. Or half (to get two seats) in 3/4 of the districts, for 3/8 -- comes out the same.

N=10, need 10/11 in half the districts for 5/11 of the total vote, or some other arrangement that I'm fairly sure will come out the same.

Once you have any number of districts greater than 1 (or maybe 2) there's some potential for getting a majority of seats with a minority of votes, but the threshold needed approaches 1/2 as the number of seats in a district rises.

And, of course, bigger districts means fewer districts, which I think reduces the flexibility of gerrymandering.

(Even in a single district, there may be potential to get a majority without a majority of votes if lots of small parties don't make the cut to get any seats, especially if there's an artificially higher threshold. This is the equivalent of more than two parties running for a plurality seat, and not so much 'potential' as "happens all the time".)

See the comment count unavailable DW comments at http://mindstalk.dreamwidth.org/441803.html#comments

Tags:

scale

[Edit: the low numbers seem to be be bunk; I was trusting the report of Google [washington caucus] and such, but e.g. http://www.huffingtonpost.com/michael-p-mcdonald/iowa-caucus-turnout-what-it-means_b_9141408.html and http://iowademocrats.org/statement-from-idp-chair-on-tonights-historically-close-caucus-results/ report much higher Iowa numbers. http://www.dailyjournal.net/view/story/05a3e761e16d4aa2beaa47c294f76071/WA--Washington-Caucuses-Democrats talks about 250,000 turnout, and 26,000 "delegates".]

Alaska caucus: 539 votes. That's not a margin, that's how many people were at the Democratic caucus. (The GOP had about 20,000 people, still small but a lot bigger.)

WA caucus was 26,000 people for the Democrats. The MA primary had nearly 1.2 million voters on the Democratic side, and MA has somewhat fewer people than WA.

HI is similar to the other caucus numbers (AK Democrats seems exceptional.)

Iowa caucus was over 150K for the GOP. About 1400 people for the Democrats.

See the comment count unavailable DW comments at http://mindstalk.dreamwidth.org/441426.html#comments

Peking ravioli

I was so confused when I first saw these here. (At Mary Chung, in fact.) I correctly guessed what they must be, from the name and the lack of anything else called potstickers.

Unrelatedly, I think I only ever heard 'potstickers' after going to college. Growing up, our 'Chinese' food was mostly Mongolian House in Uptown, and we'd order what I remember phonetically as "kwah teh", or maybe "gwa teh". (Also, princess prawns, which I've never seen since. :( )

Unrelatedly, my parents insisted on referring to the nearby high school, Von Steuben, as "Fon Stoyben", not "Von Stewben".

Article

See the comment count unavailable DW comments at http://mindstalk.dreamwidth.org/441299.html#comments

Tags:

Democrats and green energy

Oregon Democrats pass a big new clean energy bill http://www.vox.com/2016/3/17/11252280/oregon-clean-energy-bill

Which is playing catchup to California's green revolution (long article) http://www.motherjones.com/environment/2016/03/california-cuts-greenhouse-gas-jerry-brown-growth-energy
To be fair, that owes some to Arnold. And some Republicans are getting on board with wind and solar when it means business for their districts. But mostly, Democrats.

(As I say, Hillary with a D Congress would be far more progressive than Bernie with an R one, even ignoring the fact that they voted pretty similarly in Congress.)

How to fuck up green energy: Venezuela's socialist government is turning off power for a week. Drought is the trigger, but low investment and subsidized prices have set the stage. http://www.vox.com/2016/3/17/11254860/venezuela-electricity-crisis

Interesting thing on the complex interaction between electric car prices and oil prices. http://www.vox.com/2016/3/4/11161758/electric-cars-oil-crisis

See the comment count unavailable DW comments at http://mindstalk.dreamwidth.org/440961.html#comments

So high, so low, so many things to know

Still job hunting.
Realized that Scala and Clojure are functional languages at least some people pay people to use, I should go learn them! (I have a functional bias.)

As my algorithms studies continue, it's scary to look back and realize how much CS is out there that I didn't even know I didn't know, back when I was working. Both the stuff I learned in grad school (computer theory, OS concepts, graphics, programming language implementation) and the stuff I've learned since (graph algorithms, non-trivial dynamic programming, quickselect, heaps/priority queues, AVL trees...) What did I actually get hired on? Structured programming, lists, trees, recursion, Big-O analysis, hashes (thanks to Perl on a previous job, not any class I took.) Well, you really can do a lot with that. But man.

See the comment count unavailable DW comments at http://mindstalk.dreamwidth.org/440827.html#comments

Primary surprise and party politics

Here something that has nothing to do with the presidential primary: when I voted (actually, when I looked at the sample ballot ahead of time), there were also people running for state and ward committee positions. (And not for Congress; apparently that's a *different* primary.) What are those? Turn out they're *party* positions, and reddit led to some fascinating primers on the subject:

http://www.democraticstatecommittee.com/DSC/Primer_DSC.htm
http://www.democraticstatecommittee.com/DSC/Primer_DTCs.htm

Even if you don't live in MA, it might be an interesting look at how party politics works. Like, it sounds really easy to join up and start working your way up from the ground floor. Also, not much of a progressive caucus -- because the party is old and hostile, or because progressives haven't been showing up? And the MA Democratic party has a lot of diversity baked in, like equal state seats for men and women, and seats reserved for gays, racial minorities, linguistic minorities, etc.

If I wasn't busy job hunting and possibly relocating, I'd be tempted to go look up my local committee right now. Maybe in a few months. I've said before "it's not like I'm committed to being a Democrat, they just run the people I can vote for", which is true, but it seems likely they'll be running all the people I can vote for for the foreseeable future, might as well get involved.

(I wonder if anyone has ever been centrist enough to be involved in both parties at the same time.)

See the comment count unavailable DW comments at http://mindstalk.dreamwidth.org/440534.html#comments

A reminder to Bernie fans

Bernie's campaign is a long shot.

It's easy to forget that now, in all the enthusiasm, but step back some months and look at the candidates objectively:

Hillary is an established national figure who finished the 2008 primary in a dead heat. (Say what you want about DNC bias, she's proven the ability to get the support of half the Democratic voters.) She's gotten only stronger since then, with a fine career as Secretary of State.

Martin O'Malley -- remember him? -- is an actual Democratic governor, who talked more about the environment than either of the other two.

Bernie is a Senator from a small state, a self-described socialist, unhead of to much of the Democratic base, and *not even a member of the party he's now running in*. (DNC bias? Shockingly, people in a party prefer people who have put in the time to help build or at least be part of the party, to outsiders suddenly crashing the party...) He'd also be the oldest person to become President, by over five years. (Reagan's currently oldest. Hillary's a bit younger than Reagan, relatively, and women have better life expectancy.)

Go back a year, and we'd rationally expect Bernie's campaign to die an ignominious death, like that of Kucinich and various would-be progressive candidates. That the old socialist who's not even a Democrat would be, not just getting 5-10% of the vote, but crushing out a governor and turning the race into a two-way, would be incredible. That it's actually happening is amazing, and kudos to Bernie. (And that O'Malley got ignored is I think some evidence that Bernie's support is actual hunger for leftist ideas, not just sexism against Hillary. There was another man available. (Not to mention Webb, but really.))

But for all that, it's *still* a long shot. It's possible he can pull another Obama. It's possible Hillary can snatch defeat from the jaws of victory. Those aren't even terribly unlikely possibilities, at this point.

But I'd say they're well less than 50% chances. Again: socialist who hasn't even been a Democrat, vs. a long-standing Democrat who's already roped in half of the electorate before, and has the "first woman President" cachet to boot. If he wins, wow. But if he doesn't? Don't feel crushingly disappointed, feel amazed that he did as well as he did. And then go vote for Hillary in November, the way you voted for Obama before.

***

A related reminder: the Democratic Party is not naturally a liberal or leftist party. It is a big tent party that liberals can find a place in. A coalition of diverse interest groups loosely united by an interest in equality, fairness, or helping the underdog (especially when it's themselves.) But full-bore ideological leftists? We're a distinct minority. The party has big chunks who care about economic help but aren't all that socially liberal, and social liberals who feel the existing market economy is treating them quite well. And if we want to get things done, we need to work with at least one of those chunks, if not both, not view the Democratic party as our natural territory that's somehow been stolen from us.

Conversely, it's not the enemy either: a plurality electoral system can only stably support two parties, and at the moment the Democratic party is the one for us. Not satisfied with it? Try to change it, first of all by voting at every chance, second by convincing other voters that your ideas are attractive.

Cuz, well, for all the talk about plutocracy, money doesn't win elections. Ask Jeb Bush or Ross Perot. Money buys airtime, money can influence elections, but votes (or electoral fraud) wins elections. And politicians listen to the voters... especially voters they can *mostly* rely on. Like, voters who actually come out to vote in every election, as opposed to ones who vote for the Presidency but skip the Congressional primaries and elections. Which, sadly, describes much of the Democratic base, especially youth and progressive blocs.

Especially the youth. Young people who don't vote because Bernie didn't win aren't sending a message, they're just doing what young people have always done: not vote, and thus be not worth politicians worrying about.

***

(And if you need a reminder of what the Democratic party has done for us recently: just off the top of my head: raised the minimum wage by 40%; fundamentally reformed how health care is provided; regulated tobacco and credit card companies; at least tried to regulate carbon emissions; stimulated the economy back from complete sickness; funding that's causing a big boom in renewable energy; Dodd-Frank Wall street reform; repealed DADT. And that's with the GOP controlling Congress for most of the last 8 years, because Democratic turnout collapsed in 2010 and 2014.)

At state levels, increased minimum wage further in many places. A whole slew of new progressive laws in California. Pharmacy birth control in Oregon. Banning "conversion therapy" in Illinois. Etc.)

See the comment count unavailable DW comments at http://mindstalk.dreamwidth.org/440269.html#comments

Pronoun compression

So, you'd think languages would tend to shorten the length of commonly used words. And in English, all pronouns are short. 'our' is arguably two syllables. 'theirs' is one syllable though a lot of phonemes. But I, you, though, we, your, ... all short.

Spanish too, mostly: yo, tu, el, ella. (But, nosotros). Even though inflections mean you often don't need them.

In Japanese, not so much. Of the truly excessive list of pronouns, I think all are 2+ syllables. Of the standard ones, watashi (I) and anata (you) are both three. Some informal ones are two (ore, boku). A standard really formal one is four (watakushi, I). And if you want to indicate possession, that needs another syllable, e.g. 'watashi no' for 'my'.

But, apparently, pronouns aren't used as much in Japanese. Raising a chicken and egg question: are they dropped because they're long, or are they long because they're easily dropped? At any rate, all I read says Japanese is good at dropping parts of its syntax in favor of context (more so than other languages?) so don't need to say 'I' if you're obviously talking about yourself.

Also, simply using 'anata' is often rude, and it's more proper to use people's names. And some girls trying to be cutesy will instead of using watashi, or the cutesy variant atashi, use their own names, like "Mariko-chan is hungry" instead of "I am hungry".

Which seems like a lot of work! Except... the pronouns *are* long, I realize, so the opportunity cost is a lot less. Personal names are typically 2-3 syllables, family names commonly 3-4 syllables, add a standard honorific and we're talking 3-5 syllables. Given that the alternatives are generally three syllables themselves, using the name might not take any more time. Or it might take 5 syllables to 3 -- Nakajima-san vs. anata -- but I don't know how our brains process that. Is it just as bad as using 3 for 1, two extra syllables, or is it "only 67% longer" vs. "three times longer"?

And for the cutesy usage, well, not only are personal names shorter than family names on average, they can be further truncated, especially if you're being cutesy. One manga Mariko I know of is Mari-chan (or -tan, or -chin) to her friends, and presumably if she were the sort of girl to refer to herself in the third person she'd use those forms too. No longer than atashi, then.

See the comment count unavailable DW comments at http://mindstalk.dreamwidth.org/440043.html#comments

Democratic Primary

I'm still undecided as to my vote, but since most of my friends seem to be pro-Bernie, I find myself in the position of skeptic, by which I mean passing on links.

Bernie pandering to liberals?

One woman's "How Bernie lost me". Links to Sady Doyle on progressive sexism, and another column on defending Hillary.

Imagine GOP attacks on a self-declared socialist. (From back when the Cold War was still on!)

Someone on Facebook on Hillary as embattled survivor, Bernie from a nice safe environment. Point is, Bernie's had the luxury of sticking to his principles and freely speaking his mind because he had liberal Vermont voters who loved him. As I've put it, Hillary had to change her own name to help Bill win over Arkansas voters. Not to mention the over 20 years of attacks that Doyle talks about.

***

Off topic but maybe thematically related: Kevin Drum on liberal reality distortion. I haven't had the time to read all the stuff he links to, so I'm posting it as "maybe interesting".

See the comment count unavailable DW comments at http://mindstalk.dreamwidth.org/439694.html#comments

MLP:RiM Episode 3, and Python timing

One drawback to automatic memoization is that it will cheerfully memoize *all* the parameters, even ones that don't matter, like a counter you were threading through in order to have debugging statements printed with the right number of spaces to indicate nested calls. After getting rid of that, my Python find-edit-path-with-lists code runs much more reasonably... though still by far the slowest of my (memoized) versions, and increasingly so with N. But it's 6x slower at N=800, rather than 100x slower at N=100.

I'm still in the position that the first thing I did was best, and attempts to optimize the code (in legibility or speed) have made things worse for reasons I don't understand. Well, I can guess that strings are represented more compactly than a list of chars, whereas a C string *is* an array of char.

...confirmed! A simple program with s=' '*10,000,000 takes 17 megabytes. s=[' ']*10,000,000 takes 83.5 megabytes. Wow. (Not that you can use such commas in Python proper, but I use them here for legibility.) A tuple takes as much space as a list.

Timing experiment indicates that incrementing a number variable is faster than incrementing a number as a list component (s+=1 vs. a[0]+=1), taking about 80% of the time. That might explain my 'concise' code slowdown, which tried using max() over small lists rather than chaining if statements.

Decrementing a counter in a while loop takes twice the time of using range (Python 3) in a for loop. I don't think that matters for me but good to know.

So I guess I'm starting to understand: lists are convenient to code but terrible for performance, compared to string and number types. Best to avoid repeated list accesses, and don't use a list in lieu of a handful of variables. Increment a counter then store it in a list when you're done, don't use a list location as a counter.

Of course if you *really* cared about performance you wouldn't use Python, but presumably there's a middle ground of wanting easy coding but decent performance.

Though I have dim memories that Common Lisp implementations are just as safe and approximately as convenient -- for raw code, inferior libraries for modern needs -- while being at least 3x faster than Perl or Python. *Shakes fist*.

(I'm also in the position of having many key insights as I try to go to sleep.)

***

And it mostly all makes sense, with a bit more thought. A string really can be an array of chars (or wchars?) internally, while a list can store anything anywhere, and needs the type and pointer information to do that. And list access is bounds-checked, so you've got that overhead calculation on top of the dereference. I just didn't appreciate the magnitude of the overhead when you've only got a few operations to begin with.

Now I wonder about the actual numbers. 17M for 10m chars suggests two bytes per character. I thought a basic ASCII char would take 1 byte but I haven't studied Unicode formats. 83.5M is almost 5x as much, and a pointer in addition to a char would work, but that seems too simple.

See the comment count unavailable DW comments at http://mindstalk.dreamwidth.org/439506.html#comments

MLP:RiM Episode 2

Protip: when modifying values returned by a memoized function, make sure you're appending copies of the table/cache values, and not references or pointers into the table. I managed to get burned by this in two different languages. Notably, having your core function return a copy of what it's been working on won't help, if its memoized cousin is returning references that you call ++ or .append() on.

Relatedly, the list version of my Python edit-finding program works now. It's 100x slower than the string version, though. This despite the fact that the string version is actually repeatedly copy-modifying strings it might not need to, while the list defers any copying until its made its final choice. I'm guessing slicing lists sucks. It was also using tons of memory earlier than other versions.

I'd wondered if the Python optimization problems in the previous RiM post were actually algorithm problems. Happily I had a C version right there to check. Or after a bit of work, multiple C versions.

Without memoization, C starts off as 3^n, as analysis expects, then seems to slide to the 5^n of the unmemoed Python versionn. With memo, simple distance finding goes up 3x for every 2x in input, which is better than the 4x expected... up to a point, when it slides to 5x. I suspect CPU cache overflow, but that's a cargo cult answer, I can't visualize what's going on. Python distance finding is 14x slower than C for N=200, 150x slower for N=1600.

Getting the C version to generate paths led to some exciting hours of debugging. This problem has weird boundary conditions (that's not just me being lazy: Skiena's version assumes you've padded your input strings with a beginning space) so there's a lot of -1 in my code. Which was fine for simple distance finding, where I could just return a number when the input was -1, but when I ended up trying to use -1 as an index into a C array... not so good. Sadly, it *does* work often enough to be hard to pin down.

And then, I actually had been copying my return values (see the beginning), but changed that in my flailing attempts to find the mysterious segfaults, which combined with what had been concise and elegant code, led to incrementing my table values.

But all that was eventually fixed, and it scales roughly quadratically. The last doubling takes 6.5x longer than the previous, which is still better than O(n^3). It also takes 3.6G of RAM which is why it's the last step; *memory* use certainly is cubic in this implementation, with N^2 entries of char[N] arrays. At modest N it's 5x slower than not finding strings, and 5x faster than the fastest Python version that does.

Of course, I've just been trusting that lru_cache is actually smart. Might be worth trying an manually memoed Python version, using a list of lists. *Pre-allocated* list of lists, probably.

So:
* Memoization is definitely an easy way of turning a slow algorithm into a fast one
* ...not so easy in pure C, though my final code is still pretty simple (but not re-entrant, if I tried making a library out of it.)
* It's definitely not a sure path to being optimal, or even a constant factor of optimal
* ...especially if using a language that makes it easy, at the cost of who knows what mechanisms chewing up time or memory.

I still think it'd be useful at least as a stepping stone to testing more optimal versions, being able to run on much bigger input than naive code while still being high-probability correct. Though in this problem, there can be multiple optimal-length edits, so the path returned by two correct programs needn't be the same. Ah well.

See the comment count unavailable DW comments at http://mindstalk.dreamwidth.org/439212.html#comments

The money in politics myth

Money isn't as decisive as some people think. Tends to buy apathy not action, and to matter less when voters pay attention. (Like my idea that ads mostly work when people have little opinion anyway.) Big issues have money on both sides, stalemating. Lobbying is often providing information (fight by having better paid staffers) and, ahem, votes. Leftism is hampered by structural problems (gerrymandering, the Senate) and the actual conservatism of many Americans.

http://www.vox.com/2016/2/9/10941690/campaign-finance-left

See the comment count unavailable DW comments at http://mindstalk.dreamwidth.org/438997.html#comments

Tags:

My Little Program: Recursion Is Magic

One of the DP problems I alluded to in my last post is minimum edit distance: how many one-letter changes does it take to turn text string A into string B? Skiena gives a simple recursive solution, which is described incorrectly in the text but correctly as code. I'd coded my own version in C, and it worked, slowly. Then I memoized it by hand and it worked, much faster. Then more recently, as I practice Python by translating my C and Perl programs into it, I did a Python naive code, which worked, slowly. Then I memoized it with the lru_cache decorator, and it worked much faster. All is well.

But often you'd want to know an actual path of edits to make, not just how long the distance is. Skiena gives a full DP solution, filling one table of 'cached' lengths and another one of 'last moves', which you can then use to reconstruct the path. Skiena himself says it can be a bit tricky to get the boundaries and such right. I decided to try to get paths myself, but with the recursive version.

At first I was thinking in terms of last-move tables too, and worrying that I might need the memoization table hidden by the lru_cache. But then I thought, "no, this is all wrong, I should be thinking about a pure recursive solution first." And in a flash it came to me: the best path is the previous best path, plus whatever the current move is. Plus a base case, of course. That's it! Like all good recursive solutions it feels magical or cheating, like you're punting the work somewhere else indefinitely, but it does work, with pretty transparent code. Yay! Magic!

But magic has its price. I tried timing the code as inputs scaled, especially making two strings of length N and doubling N. "Oh no, it's exponential! Nx2, time x8! No wait, that's cubic, whew." But the algorithm is supposed to be quadratic, O(N^2) not O(N^3).

Well, I can guess why. Recursive programming makes clear and correct code easy, at the cost of often slinging copies of lists or strings around. If there are N^2 steps but each one is taking N steps of its own to copy or hash a string, that's cubic. And it looked like my code was copying path strings a lot; also, memoization works by hashing arguments, I think.

So when I was lying awake in bed thinking on the problem, I imagined this post was going to be a happy story of how I made a couple of tweaks and got my running time down. Sadly, that has not been the case. The string arguments never change, so I lifted them out of the function that gets memoized, but that didn't make much difference. Maybe it was already looking at their addresses and not their contents? I also tried building my paths up in lists rather than strings, but so far that's not correct. I suspect some sort of reference collision but haven't solved it yet, even by returning whole-list slices. And as a side project, I tried making a more concise version of the string-path code, but it took twice as long. I've clawed some of that back but it still takes 30-40% more time than the original.

I was surprised to find that avoiding using the min() function, even on an array of 3 items, in lieu of chained if..then, made a big difference. I'm guessing any function call is expensive.

I'm having bad flashbacks to my one 'big' Haskell class project (in an algorithms class, even), which was clearly non-optimal but also really hard to improve from its original form.

Well, today's frustration about code optimization aside, I can still be happy that the recursive path-finding magic works. The next related project is whether I can find similarly simple solutions to the related problems Skiena adapted his DP solution to solve, like approximate substring matching.

Also good to know: for deep recursion, you can and in fact have to modify Python's stack and recursionlimit in your code, no apparent need to mess with ulimit from the shell. Right now I'm setting the recursionlimit as a function of N...

See the comment count unavailable DW comments at http://mindstalk.dreamwidth.org/438710.html#comments

learning stuff and grousing about it

So, I'm finally looking for software jobs again. As part of this I've been studying Skiena's algorithms book, figuring fundamentals were more important than details of some language. OTOH, between intensive study, the stress of a phone coding interview, and lack of sleep, the last few days I've decided to do something that doesn't take thought, like learn Python.

Read more...Collapse )

See the comment count unavailable DW comments at http://mindstalk.dreamwidth.org/438324.html#comments

links: Bernie, bus, taxis, Japan, etc.

I'm tired and lazy. Here's some things I found interesting.

Nacreous clouds seen in UK.

Couple pieces on "Bernie bros" and sexist attacks on Hillary.
http://www.buzzfeed.com/evanmcsan/the-bernie-bros?utm_term=.ir8KRbEOo#.vl4DeMR27
http://www.vox.com/2016/2/4/10918710/berniebro-bernie-bro
And is Bernie ready for Republican attacks? For being asked unfair questions like why he wants to destroy the economy and turn us into Venezuela, or why he thought socialism was cool during the Cold War? http://www.vox.com/2016/2/3/10903404/gop-campaign-against-sanders
Speaking of Venezuela, the rationing is so bad even lines are being rationed. And the economy czar doesn't believe in inflation. https://www.washingtonpost.com/news/wonk/wp/2016/01/29/venezuela-is-on-the-brink-of-a-complete-collapse/?tid=pm_business_pop_b
But to be positive: Bernie's Fed agenda http://www.vox.com/2016/1/26/10829888/bernie-sanders-federal-reserve

Harry Reid saved the renewable energy revolution.

How Houston improved bus ridership "for free": sparser network of higher frequency buses, in a grid rather than radial pattern. http://www.vox.com/2016/1/28/10852884/houston-bus-ridership

How Likud won the 2015 election in Israel. http://www.vox.com/2016/1/28/10861560/israel-election-amit-channel-2

From last April, one article on how taxi medallions prices have dropped due to Lyft and Uber. http://www.foxbusiness.com/features/2015/04/07/as-uber-lyft-hire-more-drivers-taxicab-medallion-values-tank.html

A trippy 9 minute history of Japan. The Reddit comments linked to by Vox are good glosses. http://www.vox.com/2016/2/3/10905274/japan-history-video

Purported evolution of fairy tales. http://www.bbc.com/news/uk-35358487

Memoization in Python https://stackoverflow.com/questions/1988804/what-is-memoization-and-how-can-i-use-it-in-python

Thread on previews of a new edition of the Blue Rose RPG http://forum.rpg.net/showthread.php?775100-Blue-Rose-previews

Obama's reform of federal solitary confinement http://www.vox.com/2016/1/26/10834770/obama-solitary-confinement-changes

See the comment count unavailable DW comments at http://mindstalk.dreamwidth.org/438210.html#comments

Profile

Phoenix
mindstalk
Damien Sullivan
Website

Latest Month

May 2016
S M T W T F S
1234567
891011121314
15161718192021
22232425262728
293031    

Tags

Syndicate

RSS Atom
Powered by LiveJournal.com
Designed by Lilia Ahner