Search found 172 matches

by Sandor
Wed Aug 09, 2017 11:07 am UTC
Forum: Coding
Topic: var == 'value' vs 'value' == var
Replies: 20
Views: 4084

Re: var == 'value' vs 'value' == var

EvanED wrote:((a = b)) is what you write if you really want the assign-then-check behavior

I like C's comma operator for assign-then-check behavior, for example like this:

Code: Select all

while (a = func(), a != 0) {
  /* Do stuff with a */
}

It also works for more complicated cases as well.
by Sandor
Mon Jul 10, 2017 7:58 pm UTC
Forum: Individual XKCD Comic Threads
Topic: 1861: "Quantum"
Replies: 69
Views: 4201

Re: 1861: "Quantum"

gmalivuk wrote:Wow you guys are bad at Google.

The ICP (Insane Clown Posse) song "Miracles" includes the line, "Fucking magnets, how do they work?"

So are you saying that the responsibility for avoiding miscommunication lies entirely with the listener?
by Sandor
Fri Mar 17, 2017 10:39 am UTC
Forum: What If?
Topic: What-If 0156: "Electrofishing for Whales"
Replies: 23
Views: 9045

Re: What-If 0156: "Electrofishing for Whales"

Soupspoon wrote:
zjxs wrote:If you can grab your ankles faster than lightning I'm very impressed.

Then pull your feet off the ground altogether, and wait there until the danger has passed. ;)

Traditionally, you grab your bootstraps if you want to pull your feet off the ground, not your ankles.
by Sandor
Fri Dec 16, 2016 1:37 pm UTC
Forum: Logic Puzzles
Topic: Word Puzzle.
Replies: 6
Views: 2538

Re: Word Puzzle.

There is a Scrabble word list called SOWPODS that appears to be available on SourceForge ( direct link to file ). I have no idea if this list is the actual SOWPODS list, but I downloaded it anyway. It has 267,751 words in it, including 1292 3-letter words. If you've got access to a Linux system, the...
by Sandor
Sun Nov 20, 2016 8:30 pm UTC
Forum: Logic Puzzles
Topic: Hidden Cards
Replies: 5
Views: 2487

Re: Hidden Cards

Your goal is to guess the value of the blue card possessed by the person who has a red card with value identical to that of your own blue card. Just running thought the numbers 1 to 10 will reach this goal. The logicians must have some other goal as well. I suspect they should be trying to maximise...
by Sandor
Fri Oct 21, 2016 11:22 am UTC
Forum: Science
Topic: Ideal balance of two bodies in orbit
Replies: 28
Views: 3347

Re: Ideal balance of two bodies in orbit

In classical physics the answer is definitely yes - choose a large enough distance between the two objects and you can push them quickly enough to orbit each other. I don't know about the general relativity calculations for orbital mechanics, but you can read about them here . See also gravitationa...
by Sandor
Fri Oct 14, 2016 11:13 am UTC
Forum: Logic Puzzles
Topic: Solitaire game
Replies: 4
Views: 2441

Re: Solitaire game

I supposed if you can calculate v fast enough, you could make a strategy relating to whether the next ball you add has v=-1 or not. I would have thought so too, but it doesn't seem to work. I tried 3 different strategies for when you pick a v=-1, and had a few millions goes at each: Strategy 1: Rep...
by Sandor
Wed Oct 12, 2016 9:23 am UTC
Forum: Science
Topic: Science fleeting thoughts
Replies: 76
Views: 10232

Re: Science fleeting thoughts

Some work has been done on the environmental impacts of common medications too, such as birth control pills which have shown measured impacts on marine life downstream from big cities. I have often wondered how this could even be possible. I did a quick Google, and it appears that (as one webpage p...
by Sandor
Mon Sep 19, 2016 2:50 pm UTC
Forum: Science
Topic: Reversing entropy with unlimited energy
Replies: 9
Views: 2695

Re: Reversing entropy with unlimited energy

That just isn’t possible: UNLESS there is a giant outside source of energy supplying the Earth with huge amounts of energy. If there were such a source, scientists would certainly know about it. I know! It's not like there is a giant, extremely hot mass of gas and plasma flooding the planet in all ...
by Sandor
Tue Aug 09, 2016 4:17 pm UTC
Forum: Logic Puzzles
Topic: Sharing secret information publicly
Replies: 27
Views: 4632

Re: Sharing secret information publicly

Take the sum modulo 7. This ensures that there are multiple hands for each answer, but with three cards you can still figure it out (since C's card has a potential variance of at most 6). For example, suppose A gives 5 as his answer. His hand could be 147, 156, 237, 246, or 345. The car...
by Sandor
Fri Aug 05, 2016 10:45 am UTC
Forum: Logic Puzzles
Topic: The Locker Puzzle
Replies: 5
Views: 8737

Re: The Locker Puzzle

Spoiler:
Monox D. I-Fly wrote:...quadratic numbers...

More commonly called "square numbers".
by Sandor
Tue Jun 28, 2016 12:03 am UTC
Forum: Logic Puzzles
Topic: Two puzzles for the price of 1!
Replies: 17
Views: 4384

Re: Two puzzles for the price of 1!

It's a series of puns (sore/saw, whole/hole, hoarse/horse). What dialect do you speak such that sore and saw are homophones? I've never, ever heard that. They don't even have the same vowel for me, let alone the same post-vowel sound (which is "none" for saw). I believe ConMan is from oz,...
by Sandor
Mon Jun 27, 2016 1:24 pm UTC
Forum: Logic Puzzles
Topic: Logic Puzzle - Scavenger Hunt
Replies: 9
Views: 4138

Re: Logic Puzzle - Scavenger Hunt

The letters that are present appear to be fairly close to the normal frequencies for English. But there aren't enough different letters. The notable omissions, in decreasing order of their usual frequencies, are the letters "T", "U", "W", "Y", "B", &...
by Sandor
Wed Jun 22, 2016 3:10 pm UTC
Forum: Logic Puzzles
Topic: Seeking Advise from Puzzle Masters
Replies: 20
Views: 3886

Re: Seeking Advise from Puzzle Masters

There are only a limited number of possible combinations, so I think this should be brute-forceable. You can try every possible permutation against a set of 12 clues, to see how many match. There should be only one match, obviously. 10 compounds and 4 slots is only 10^4 = 10000 permutations, but I d...
by Sandor
Fri Jun 17, 2016 12:18 pm UTC
Forum: Language/Linguistics
Topic: My wife and I's...
Replies: 30
Views: 5685

Re: My wife and I's...

I would use the word "our" whenever possible. The same problem can arise with "your" as well as "my". In that case, some dialects don't have a distinct 2nd person plural possessive pronoun (no "y'all's" or similar) you can use instead. One example might be &q...
by Sandor
Tue May 24, 2016 7:38 am UTC
Forum: Logic Puzzles
Topic: Open puzzle about game
Replies: 36
Views: 5617

Re: Open puzzle about game

Cauchy wrote:Someone can check me, but I think this is a rock-paper-scissors scenario.

I agree. Well played.
by Sandor
Mon May 23, 2016 4:57 pm UTC
Forum: Logic Puzzles
Topic: Open puzzle about game
Replies: 36
Views: 5617

Re: Open puzzle about game

This sets a size bound on potential winning sets. If there's a single best set, it must beat this set, which means it needs to force this set to go first. That's not particularly hard, but it's nice to know that such a set can't have more than one size 1 piece or more than two pieces of size less t...
by Sandor
Fri May 20, 2016 11:36 am UTC
Forum: Logic Puzzles
Topic: What is the last number (alphabetically)?
Replies: 12
Views: 3943

Re: What is the last number (alphabetically)?

being pedantic: Zulu time and GMT are the same time but not the same time-zone. Also big ben runs on british summer time during summer, which differs by a full hour from zulu time. Being more pedantic: Some common varieties of time: ⋅  UT1 : Solar mean time at Greenwich. Based on the Sun&...
by Sandor
Mon May 02, 2016 3:58 pm UTC
Forum: Science
Topic: Dropping a Cloud Nine From Orbit
Replies: 38
Views: 5064

Re: Dropping a Cloud Nine From Orbit

I'd never heard of a "Cloud Nine" before. Interesting idea. For those that can't be bothered to follow the link, it's "the name Buckminster Fuller gave to his proposed airborne habitats created from giant geodesic spheres, which might be made to levitate by slightly heating the air in...
by Sandor
Tue Apr 26, 2016 8:24 pm UTC
Forum: Science
Topic: How large a disc would it take to block a star from view for all of earth?
Replies: 26
Views: 4066

Re: How large a disc would it take to block a star from view for all of earth?

You will probably have to constrain the question to a given time period to get a sensible answer (e.g. the star in question only needs to be not-visible from the Earth +/- some period of time from now), and the answer will heavily depend on that period of time. For +/- 1 second - not much bigger tha...
by Sandor
Tue Apr 26, 2016 3:09 pm UTC
Forum: Science
Topic: How large a disc would it take to block a star from view for all of earth?
Replies: 26
Views: 4066

Re: How large a disc would it take to block a star from view for all of earth?

There isn't an orbit around Earth that would work, because it can't actually orbit at all. It has to stay on the same side of Earth at all times. I wonder if putting the shield in some orbit of the sun that takes 365 days would work. The period of an orbit is directly related to its semi-major axis...
by Sandor
Sat Mar 12, 2016 11:26 pm UTC
Forum: Individual XKCD Comic Threads
Topic: 1654: "Universal Install Script"
Replies: 52
Views: 7850

Re: 1654: "Universal Install Script"

The real question is: Where is zypper? Or "rpm --install"? Writing a bash script and giving it a ".sh" extension as if it were a Bourne script always strikes me as slightly wrong. I do it anyway, because ".bash" as a file extension seems wronger, although I don't know ...
by Sandor
Fri Jan 29, 2016 12:24 pm UTC
Forum: Language/Linguistics
Topic: most words with fewest different letters
Replies: 16
Views: 5936

Re: most words with fewest different letters

KarenRei wrote:Why do people use online services to solve problems like this? Don't you all have egrep/grep -E and /usr/share/dict/words?

I'm curious, how would use egrep and a dictionary to solve this? I just can't see it.
by Sandor
Fri Jan 08, 2016 1:22 pm UTC
Forum: Fictional Science
Topic: Galactic timekeeping
Replies: 20
Views: 8604

Re: Galactic timekeeping

Meh, let's forget trying to use celestial events and instead use the one truly unambiguous measure of time--radioactive decay rates. Indeed. Just pick a convenient isotope from here . Or make it that your nearly-immortal alien just assumes that everyone knows the half-lives of every isotope, and ju...
by Sandor
Tue Nov 24, 2015 7:16 pm UTC
Forum: Language/Linguistics
Topic: most words with fewest different letters
Replies: 16
Views: 5936

Re: most words with fewest different letters

Sorry if a double post is against the rules, but this is more a follow-on than an edit. I took some short cuts when calculating these, so there is a (very small) chance some of this is incorrect. Based on the word list I linked to earlier, I found these groups of letters can form the most words: ah ...
by Sandor
Mon Nov 23, 2015 9:19 pm UTC
Forum: Language/Linguistics
Topic: most words with fewest different letters
Replies: 16
Views: 5936

Re: most words with fewest different letters

How profuse must my display of gratitude be to convince you to carry this to “9 or 10” letters? I think this can be done for all 26 letters. I'll have a go. Watch this space... There are also word lists available that include a frequency count, based on a given corpus. For example, what's the minim...
by Sandor
Wed Nov 18, 2015 7:56 pm UTC
Forum: Logic Puzzles
Topic: Escape the Frictionless Circle
Replies: 136
Views: 26363

Re: Escape the Frictionless Circle

So another question. You are standing outside the circle with the tether and the gold block. Is there any reliable way to get into the initial position in this setup? In this kind of idealised setup, the physics are reversible. If you can somehow get out from the centre, you can reverse the procedu...
by Sandor
Wed Nov 18, 2015 2:55 pm UTC
Forum: Logic Puzzles
Topic: Escape the Frictionless Circle
Replies: 136
Views: 26363

Re: Escape the Frictionless Circle

Consider this flat surface on the top of a ball. The gravitational force as you move towards the outside of the circle would actually have a component that pulled you BACK towards the center of the circle assuming the contact point of the flat surface was the exact center of the circle and the ball...
by Sandor
Mon Nov 16, 2015 3:35 pm UTC
Forum: Language/Linguistics
Topic: most words with fewest different letters
Replies: 16
Views: 5936

Re: most words with fewest different letters

Given a word list, this is not too difficult to program, at least for the first few letter lists. Here's what I found: est - 15 words est see sees set sets settee settees setts stet tee tees test testes tests tsetse aest - 50 words as ass asses assess assesses asset assets at ate attest attests ease...
by Sandor
Fri Nov 13, 2015 8:37 pm UTC
Forum: Logic Puzzles
Topic: Escape the Frictionless Circle
Replies: 136
Views: 26363

Re: Escape the Frictionless Circle

Gravity totally comes from your limbs. F = m_limb m_other thing / r^2. There is no "m_other thing" in this scenario that has mass. If there where it would be exerting a force (gravity) on you, and that's specifically disallowed. The minutiae of the set-up is crucial, and the OP hasn't pro...
by Sandor
Fri Nov 13, 2015 4:26 pm UTC
Forum: Logic Puzzles
Topic: Escape the Frictionless Circle
Replies: 136
Views: 26363

Re: Escape the Frictionless Circle

jaap wrote:I can probably rule out Coriolis forces because the puzzle does say "Using only forces exerted by your limbs".

A lot of people seem happy to try and use gravity, which also isn't exerted by your limbs. I don't see why gravity would be OK, but Coriolis or centrifugal forces wouldn't.
by Sandor
Thu Nov 12, 2015 12:00 pm UTC
Forum: Individual XKCD Comic Threads
Topic: 1602: Linguistics Club
Replies: 117
Views: 16723

Re: 1602: Linguistics Club

the hebdomadary interval. That doesn't quite work as silly way of saying "week". As far as can tell, "hebdomadary" (as used here) is a synonym for "weekly". A "weekly interval" has to be an interval from doing (or between) something, but you don't say what. T...
by Sandor
Fri Nov 06, 2015 12:45 pm UTC
Forum: Logic Puzzles
Topic: Escape the Frictionless Circle
Replies: 136
Views: 26363

Re: Escape the Frictionless Circle

Any cube-pushing or rope-pulling I do will leave the centre of gravity of the (cube+rope+myself) system right where it is, just next to the centre of the circle. You can move the centre of gravity of the system up and down. You could jump, and a sufficiently strong person could throw the gold cube ...
by Sandor
Thu Oct 29, 2015 4:24 pm UTC
Forum: Science
Topic: Sun as final storage for radwaste?
Replies: 134
Views: 23396

Re: Sun as final storage for radwaste?

Mars is too small, you'd never get the ~30km/s change, you'd be underground and it wouldn't have worked. There's a few factors, but it generally works best on a planet with a large escape velocity, Mars is only 5km/s. What you can do is use Mars and Earth to get you out to Jupiter in the first plac...
by Sandor
Thu Oct 29, 2015 12:59 pm UTC
Forum: Science
Topic: Sun as final storage for radwaste?
Replies: 134
Views: 23396

Re: Sun as final storage for radwaste?

Can someone post some info on the Jupiter slingshot to the sun maneuver? Starting from an orbit similar to the Earth's, you need 30 km/s delta-v to kill your orbital velocity and drop into the Sun. However, that's not the most efficient method. Instead, you can put yourself into an elliptical orbit...
by Sandor
Mon Oct 26, 2015 11:43 am UTC
Forum: Logic Puzzles
Topic: "Shoot for the moon. If you miss, you may hit a star."
Replies: 8
Views: 3668

Re: "Shoot for the moon. If you miss, you may hit a star."

In order to hit a star other than the sun you would need enough velocity to escape the solar system. That is you would need to escape earth with an extra 42.12km/s. Once you've escaped Earth, you'll be orbiting the Sun with a similar orbit to Earth's, so with an orbital velocity of around 30 km/s. ...
by Sandor
Thu Oct 15, 2015 1:58 pm UTC
Forum: Logic Puzzles
Topic: Help Deciphering Cipher With No Spaces
Replies: 7
Views: 4667

Re: Help Deciphering Cipher With No Spaces

It sounds like you've been trying to solve it as a substitution cipher . The next to try are Vigenère and polyalphabetic ciphers (the former being a special case of the later). The basic idea is to look at the difference in locations between repetitions of the same trigrams and digrams. The key leng...
by Sandor
Thu Oct 15, 2015 10:48 am UTC
Forum: Individual XKCD Comic Threads
Topic: 1590: "The Source"
Replies: 70
Views: 9528

Re: 1590: "The Source"

I envy those who can't hear these very high pitch noises (such as my wife who e.g. can't hear the hum of our CRT TV when it is on) as these noises are all very annoying. In the UK, you sometimes get shopkeepers using The Mosquito , a device that generates a 17.4 kHz whine to try and deter teenagers...
by Sandor
Tue Oct 13, 2015 2:56 pm UTC
Forum: Logic Puzzles
Topic: Kirkman's Schoolgirls
Replies: 12
Views: 2984

Re: Kirkman's Schoolgirls

I haven't explicitly tested it, but I applied my transformation to the first matrix in Sandor's solution and got a different set than the one he provided. It might be the same basic arrangement, but displayed in a different order with different names for the girls. One could try all 15! permutation...
by Sandor
Mon Oct 12, 2015 5:44 pm UTC
Forum: Logic Puzzles
Topic: Kirkman's Schoolgirls
Replies: 12
Views: 2984

Re: Kirkman's Schoolgirls

Seeing as nobody has actually posted a solution, I thought I would. I first tried many patterns different patterns, similar to MOJr 's attempt above. I did this by hand, but used a computer to visualise the results. After a couple of hours I decided that wasn't going to work - you seem to ne...

Go to advanced search