thanks, hunting, prayer

It Doesn't End Well For The Kitten

Idea generator

(no subject)
thanks, hunting, prayer
novalis
Holy fuck.

I randomly encountered this behavior while testing something entirely unrelated, and googled around until I found some evidence that this was a known issue:

Quoth Matz, the creator of Ruby:

> "string ".gsub(/\s*$/, 'P')
> "stringPP"

The first try replaces all trailing spaces with "P", then second try
replaces empty at the end of string with "P".


Well, wait a second here -- after the first replacement, you'll have zero characters left to consume, right? Then after the second replacement, you still have zero characters left to consume. So shouldn't /\s*$/ match again? And again?

Apparently, I'm not the first person to have their mind blown by this, and apparently (reading to the end of the comments), Python sometimes gets it right and sometimes gets it wrong, making this one of the rare cases where Python gets anything wrong.

The Mirage
thanks, hunting, prayer
novalis
OK, so in _Fluid Concepts and Creative Analogies_, Douglas Hofstadter describes a computer program that contemplates analogies between transformations on letter strings and picks the ones that are the most satisfying.

Here is one: If ABC becomes ABD, what does IJK become? Well, there is only one great answer: IJL. But what happens to XYZ? There are a few answers: XYA is one, assuming that letters wrap around. ZYD is another, assuming that the rule is that the last letter becomes D. XYZ is anotherl the rule there would be "replace C with D". But there is another one that the program only finds about 10% of the time, but when it finds it, it achieves maximal satisfaction: WYZ.

_The Mirage_, by Matt Ruff, is the WYZ solution. The part of my brain which is Hofstadter's program is very, very satisfied. Go: read it.

Alpha beta
thanks, hunting, prayer
novalis



The other 2.894 oz were sliced up with a razor and still haven't fully recovered.

This entry was originally posted at http://novalis.dreamwidth.org/162809.html. Please comment there using OpenID.

Blogger XSS vulnerability
thanks, hunting, prayer
novalis
Using blogger? Watch your gadgets.

... but I could be wrong.

This entry was originally posted at http://novalis.dreamwidth.org/162058.html. Please comment there using OpenID.

Lamb and author
thanks, hunting, prayer
novalis
(1) regyt has some wool laid out on a towel top of the chest freezer. I just reached into the freezer to get some lamb stock, and it struck me how apt it was that I was reaching under lamb wool to get (boiled) lamb bones.

(2) A couple of my friends had posts up which mentioned Will Shetterly, but they didn't say his name. I wondered what they were afraid of, so I went into the bathroom, turned out the lights, and said "Will Shetterly, Will Shetterly, Will Shetterly," while spinning around in front of the mirror. When I opened my eyes, I saw nothing at all in the mirror -- but suddenly, all that comes out of my hot water tap is tomato juice, and all that comes out of my cold water tap is vodka. And why has my soap been replaced with this tabasco sauce?

(Edit: I swear I posted this before I saw xkcd)

(no subject)
thanks, hunting, prayer
novalis
We use Mediawiki to manage our recipes, and we highly recommend it. As we've cooked increasingly complicated dishes, we've started to change the way we organize our wiki. We now have recipes which are composed of subrecipes using a template that some people on #mediawiki helped me put together. When I was putting together the prep list for this Saturday's dinner, I noticed that I couldn't do this recursively. A bit of googling later, and I came to the solution:

Read more...Collapse )

(no subject)
thanks, hunting, prayer
novalis
I don't think I have your snail-mail address. Comments are screened.

(no subject)
thanks, hunting, prayer
novalis
Vote rm in the elections. There are only three users who have a serious explicit commitment to freedom of speech in their platform, and rm is both the best and most popular of these. My second and third choices are hopeless, so my ballot is effectively truncated.

This is one of those cases where I would rather that jameth, a non-serious candidate with no articulable platform, win than the current leader, legomymalfoy, because I think that LJ is ultimately doomed anyway, and a candidate who is serious about the status quo is significantly more likely to give the advisory board an air of legitimacy than a candidate who represents the protest vote. Still, I won't give jameth my second- or third-place vote because I think it's probably better to vote sincerely and see how it goes.

Note: this is somewhat different from how I would advise voting in a general election, because while I know lots of people who have left LJ, I know nobody (or almost nobody; I'm sure I'm forgetting someone) who has left their country because of politics.

Correlations your automated process will never find
thanks, hunting, prayer
novalis
I'm presently reading The Lost Steersman, the third Steerswoman novel by Rosemary Kirstein. It's going to be impossible to explain the awesome bit without minor spoilers for the second novel, so I'm not going to bother. I can't even give you the bare conclusion, because it will give you the entirely wrong idea about the book.

Read more...Collapse )

(no subject)
thanks, hunting, prayer
novalis
I got udon for lunch today, and realized that I would have to add it to the list of foods (chocolate mousse, baby back ribs) where mine is so good that it's not worth ordering at restaurants.

Or maybe this was a bad restaurant.

?

Log in