Search found 1812 matches

by Cosmologicon
Wed Sep 29, 2010 7:13 pm UTC
Forum: Logic Puzzles
Topic: Of Joggers and Psychopaths
Replies: 35
Views: 10732

Re: Of Joggers and Psychopaths

But I mean, clearly the shoe must conserve angular momentum. Will the rotation really be slight enough not to move it the few degrees necessary to make the experiment unreliable? I don't see why A shoe can easily rotate several times (over 1000 degrees) without noticeably affecting its dire...
by Cosmologicon
Wed Sep 29, 2010 7:08 pm UTC
Forum: Logic Puzzles
Topic: Straw power
Replies: 42
Views: 8797

Re: Straw power

Well, your impedance value is obviously way too big. Correct me if I'm wrong, but doesn't Z = 0.25Hz suggest that in the unforced case, the damping timescale is around 4s, ie, one swing? That seems at least an order of magnitude too much damping to me. I know we're not talking about a well-engineere...
by Cosmologicon
Wed Sep 29, 2010 3:23 pm UTC
Forum: Logic Puzzles
Topic: Of Joggers and Psychopaths
Replies: 35
Views: 10732

Re: Of Joggers and Psychopaths

What I don't understand is how the pendulum could still be reliable after a lot of spinning. Won't the shoelace be twisted? I mean, if the shoelace is tied to the light bulb and the light bulb is spinning . . . What? No, that's the whole point. This is an experiment you can try at home.... ...
by Cosmologicon
Wed Sep 29, 2010 11:39 am UTC
Forum: Logic Puzzles
Topic: Straw power
Replies: 42
Views: 8797

Re: Straw power

I sent the guy an email. I'm really not sure how else to get an answer to this "challenge." I hope you didn't tell him your idea about immolating him. Remember, if you feel the desire to kill someone for posting a physics problem you disagree with, take a few deep breaths before emailing ...
by Cosmologicon
Mon Sep 27, 2010 8:34 pm UTC
Forum: Coding
Topic: Coding: Fleeting Thoughts
Replies: 9990
Views: 2004250

Re: Coding: Fleeting Thoughts

Found it: more . It outputs filenames when it's provided more than one input file. It also gives you a bunch of :::::'s to visually separate the filename from the contents, but apparently that's okay. Hm, I'd be more concerned that it doesn't print out the whole files without user interaction. Is t...
by Cosmologicon
Sun Sep 26, 2010 4:46 pm UTC
Forum: Coding
Topic: Coding: Fleeting Thoughts
Replies: 9990
Views: 2004250

Re: Coding: Fleeting Thoughts

That should work. Here's a one-liner if you (like me) don't like saving files you don't have to:

Code: Select all

echo file*.txt | xargs -n1 sh -c 'echo "$0" && cat "$0"'
by Cosmologicon
Sat Sep 25, 2010 1:43 pm UTC
Forum: Logic Puzzles
Topic: Straw power
Replies: 42
Views: 8797

Re: Straw power

I get that air resistance is going to be on the order of 0.1N at maximum. That's not trivial, when you integrate over the back and forth of the swing. I have no idea whether it's possible to overcome that with just your breath. Could be. I can't think of an easy way to estimate the impulse you'd imp...
by Cosmologicon
Sat Sep 25, 2010 1:23 pm UTC
Forum: Coding
Topic: The "IT DOESN'T WORK!" thread
Replies: 1963
Views: 565078

Re: The "IT DOESN'T WORK!" thread

As for the transparency issue, it also depends on which flags you've set. You should post the entirety of your code, not just the rendering parts. In particular, did you enable GL_DEPTH_TEST?
by Cosmologicon
Sat Sep 25, 2010 1:19 pm UTC
Forum: Logic Puzzles
Topic: Number Plates [Solutions]
Replies: 13
Views: 2779

Re: Number Plates [Solutions]

Well it's certainly not a coincidence. If I'm wrong, it's an intentional red herring. Which would be cool, I'm just saying. Anyway, I don't know why you can't tell me whether my solution was right or wrong without further explanation, but here it is: The last 3 letters in each plate are found in con...
by Cosmologicon
Fri Sep 24, 2010 9:32 pm UTC
Forum: Logic Puzzles
Topic: Logic Puzzle HEX Code
Replies: 3
Views: 2341

Re: Logic Puzzle HEX Code

A Google search for your answer returns a strange hit: Searching for "radioman jeeps" shows a webpage titled "Braille Radioman Jeeps R44" on azload.com, but it just looks like a cached search result that doesn't return anything. The site itself seems to have caches of PDFs an...
by Cosmologicon
Fri Sep 24, 2010 7:39 pm UTC
Forum: Logic Puzzles
Topic: Number Plates [Solutions]
Replies: 13
Views: 2779

Re: Number Plates [Solutions]

The following plates would complete your collection, and would appear roughly left-to-right. There are many other solutions: AR53 NDA PK08 DAH MP61 OTA LF01 TES TH48 KSS PP55 KLH HR02 MNS AH18 OWA UF18 SOR SS55 SSS TW11 LLN TU51 NAN BX72 OHO MW63 ANE Not a bad puzzle. I was satisfied when I got it. :)
by Cosmologicon
Fri Sep 24, 2010 7:25 pm UTC
Forum: Logic Puzzles
Topic: Number Plates [Solutions]
Replies: 13
Views: 2779

Re: Number Plates [Solutions]

Oh snap, I got it. I still have to work out what's missing. I think you should remove this from the puzzle page; it's not even close to true:
Anyone in the world should have the same shot of getting the solution.
by Cosmologicon
Fri Sep 24, 2010 2:38 pm UTC
Forum: Logic Puzzles
Topic: Straw power
Replies: 42
Views: 8797

Re: Straw power

Right, but I think the bottom of the sandbag is actually 4m from the bar, since the bag itself is 1m tall. In that case, the bottle only needs to be 12.7cm = 5.00 inches high.
by Cosmologicon
Thu Sep 23, 2010 5:37 pm UTC
Forum: Coding
Topic: Coding: Fleeting Thoughts
Replies: 9990
Views: 2004250

Re: Coding: Fleeting Thoughts

Berengal wrote:most developers I know never voluntarily sharpen their skills.

Hey that reminds me, why don't we have another coding contest on this message board? :)
by Cosmologicon
Thu Sep 23, 2010 3:16 pm UTC
Forum: Coding
Topic: Coding: Fleeting Thoughts
Replies: 9990
Views: 2004250

Re: Coding: Fleeting Thoughts

What exactly does Chrome do? I'm using Chrome and it only lets me follow a plain-text url if I highlight it and then right-click. So many clicks....
test page
by Cosmologicon
Thu Sep 23, 2010 2:26 pm UTC
Forum: Coding
Topic: Coding: Fleeting Thoughts
Replies: 9990
Views: 2004250

Re: Coding: Fleeting Thoughts

Browsers should recognize non-anchor-tagged links that look like links and add "Open this address" in the context menu when selecting it. Right now Firefox has "Search [Selected Search Engine] for [highlighted text]", but that's still a click away. Are you talking about plain-te...
by Cosmologicon
Wed Sep 22, 2010 7:17 pm UTC
Forum: Logic Puzzles
Topic: The Four Commanders
Replies: 30
Views: 6085

Re: The Four Commanders

You can't distinguish between those two cases. Following the majority vote of the loyal commanders is not a necessary condition for a strategy to be valid.
by Cosmologicon
Wed Sep 22, 2010 2:58 pm UTC
Forum: Logic Puzzles
Topic: The Four Commanders
Replies: 30
Views: 6085

Re: The Four Commanders

The timing issue I was talking about is this: How can you guarantee that all messages have arrived, if you don't have a cutoff for when messages can be sent? Suppose it's known we'll attack or withdraw after day 7, and it takes 1 day to send a message. On day 6, the traitor (D) s...
by Cosmologicon
Wed Sep 22, 2010 1:32 pm UTC
Forum: Logic Puzzles
Topic: The Four Commanders
Replies: 30
Views: 6085

Re: The Four Commanders

Yeah, sounds pretty good to me. I can't see a problem with it. I see where I was getting confused. A commander forwards a message even if he doesn't "believe" it, as long as it's a direct message. So if D tells me to attack, send that vote on to other commanders, but I don't ch...
by Cosmologicon
Wed Sep 22, 2010 11:50 am UTC
Forum: Logic Puzzles
Topic: The Four Commanders
Replies: 30
Views: 6085

Re: The Four Commanders

I believe that's equivalent to Xias's solution. As Corka points out, you still need to specify how the commanders deal with conflicting information. In particular... you can't assume that the traitor is trying to avoid giving himself away. If the other commanders deduce that there's a traito...
by Cosmologicon
Tue Sep 21, 2010 5:21 pm UTC
Forum: Logic Puzzles
Topic: The Four Commanders
Replies: 30
Views: 6085

Re: The Four Commanders

My assumption was that we were trying to prevent the traitor from splitting the armies, not to stop him from generally being a dick. But I'm saying that you can't assume that. The conditions for a correct strategy are given in the OP: If all the loyal commanders decide to attack, they attack, and i...
by Cosmologicon
Tue Sep 21, 2010 3:24 pm UTC
Forum: Logic Puzzles
Topic: The Four Commanders
Replies: 30
Views: 6085

Re: The Four Commanders

That's pretty complicated, and don't understand how it's all supposed to work yet, but let me point out three things: 1. Withdrawing is not a valid option if all three loyal generals want to attack. So just because they know there's a traitor doesn't mean they can withdraw. 2. You need to co...
by Cosmologicon
Tue Sep 21, 2010 1:29 pm UTC
Forum: Logic Puzzles
Topic: The Four Commanders
Replies: 30
Views: 6085

Re: The Four Commanders

Each general sends a message with his name on it and his vote to all 3 generals; he then sends a message reporting the other votes he received from all generals to everyone. I think this should cover everything. Consider this then: Generals A and B state Attack, General C states Withdraw. Traitor D...
by Cosmologicon
Mon Sep 20, 2010 10:23 pm UTC
Forum: Logic Puzzles
Topic: How many possible boards of chess are there?
Replies: 13
Views: 3195

Re: How many possible boards of chess are there?

Is there a name for that notation you're using to specify boards? I'm unable to deduce some of the subtleties.
by Cosmologicon
Wed Sep 15, 2010 4:47 pm UTC
Forum: Coding
Topic: The "IT DOESN'T WORK!" thread
Replies: 1963
Views: 565078

Re: The "IT DOESN'T WORK!" thread

The rounding part is fine, but why round if you're then going to divide by a float? Your result won't be an integer, and it will be discrete with strange values. Also, there are not 12 cm in an inch.

EDIT: I imagine it should have been something like: inches = int(cm / 2.54 + 0.5)
by Cosmologicon
Fri Sep 10, 2010 8:50 pm UTC
Forum: Logic Puzzles
Topic: How many possible boards of chess are there?
Replies: 13
Views: 3195

Re: How many possible boards of chess are there?

There are positions that are very subtly illegal as well. We had a thread of chess puzzles, and one of them asked where the white king could go. There was only one legal space for it to be, even though there were many positions where it wasn't in check. The answer had to do with en passant.
by Cosmologicon
Wed Sep 08, 2010 9:21 pm UTC
Forum: Logic Puzzles
Topic: A sequence puzzle.
Replies: 10
Views: 2139

Re: A sequence puzzle.

Well, I'm also at a loss. The only thing I notice is that: All characters appear in order, meaning the first b appears before the first c, which appears before the first e, etc. Since a, d, and f don't appear before the first g, I'm guessing they never appear in the sequence. The blue letter...
by Cosmologicon
Sun Aug 29, 2010 4:43 pm UTC
Forum: Coding
Topic: Coding: Hacks and Snippets
Replies: 434
Views: 784286

Re: Coding: Hacks and Snippets

I don't know Lua, but I don't see why that's a bug. It sounds like you're saying that nil is an acceptable value for (false or nil), but it's not acceptable for (false xor nil). That seems inconsistent. Shouldn't you also need to replace (x or y) with ((x or y) == true) everywhere you use it, if boo...
by Cosmologicon
Tue Aug 24, 2010 1:58 am UTC
Forum: Coding
Topic: Coding: Fleeting Thoughts
Replies: 9990
Views: 2004250

Re: Coding: Fleeting Thoughts

Yeah, one of those compilers is used for the Death Station 9000. Any undefined behavior results in launching nuclear missiles or worse. Check out the bloopers page:
http://dialspace.dial.pipex.com/town/green/gfd34/art/
by Cosmologicon
Tue Aug 24, 2010 12:11 am UTC
Forum: Coding
Topic: [Unnecessarily-] Compact coding tricks
Replies: 112
Views: 17284

Re: [Unnecessarily-] Compact coding tricks

It's one of the oldest tricks in the book. I used it all the time writing obfuscated C. It's especially handy because sometimes it makes things a character or two shorter (although in Rysto's case, it made it longer).
by Cosmologicon
Sat Aug 14, 2010 3:03 pm UTC
Forum: Coding
Topic: [Unnecessarily-] Compact coding tricks
Replies: 112
Views: 17284

Re: [Unnecessarily-] Compact coding tricks

That's the same thing I did, except I did the mask before shifting, and you did the mask after shifting. The step where I said color & ~0x010101 makes sure that the lowest bit on each of the three fields is 0'd out, so there's no bleeding between them.
by Cosmologicon
Sat Aug 14, 2010 6:07 am UTC
Forum: Coding
Topic: [Unnecessarily-] Compact coding tricks
Replies: 112
Views: 17284

Re: [Unnecessarily-] Compact coding tricks

So, well we're at it, given a hexadecamal representation of a color (0xrrggbb) what's the best why to create a color to use as an outline without disassembling it into three RBG values? It doesn't have to be an exact amount darker or lighter, so long as there's contrast. Right now I'm using (color ...
by Cosmologicon
Fri Aug 13, 2010 7:47 pm UTC
Forum: Coding
Topic: Halting problem coding challenge
Replies: 59
Views: 8375

Re: Halting problem coding challenge

That's right. How did you do that? Did you factor it, or was it something more clever?
by Cosmologicon
Fri Aug 13, 2010 2:51 pm UTC
Forum: Coding
Topic: Halting problem coding challenge
Replies: 59
Views: 8375

Re: Halting problem coding challenge

A less obvious challenge would be: write a short program which you know (and can prove) whether it will halt, but it's hard for others to figure out. Here's one: dsum = lambda x: x if x < 10 else x % 10 + dsum(x/10) k = 1 N = 21666573609157468381289515332720689778000673789829096023276840683761138438...
by Cosmologicon
Tue Aug 10, 2010 8:34 pm UTC
Forum: Logic Puzzles
Topic: Eight problems for intuition in basic classical mechanics
Replies: 59
Views: 11505

Re: Eight problems for intuition in basic classical mechanic

[...]The example I have in mind is a very deep sheer drop, where if the mass is forced to follow the track, will get to the bottom almost instantly,[...] But where would it get the huge amount of kinetic energy it'd take to get to the bottom of the drop almost instantly? I guess it depends on e...
by Cosmologicon
Tue Aug 10, 2010 10:48 am UTC
Forum: Coding
Topic: Epic coding moments
Replies: 127
Views: 22497

Re: Epic coding moments

If short code is your thing, you need to know about the if-else operation. It'll cut three lines out of your program:

Code: Select all

a = a*3+1 if a&1 else a/2
by Cosmologicon
Sun Aug 08, 2010 2:07 pm UTC
Forum: Coding
Topic: Fake Programming Language
Replies: 210
Views: 31295

Re: Fake Programming Language

I don't get it. In both of your examples, calling f as a function neither returns a value nor produces side-effects, so why would you ever call it without new? Why wouldn't you just make f a class constructor? Can you give an example of something you'd want to call both as a function and as a constr...
by Cosmologicon
Tue Aug 03, 2010 10:46 am UTC
Forum: Coding
Topic: Why pass?
Replies: 28
Views: 3537

Re: Why pass?

Well obviously waking up is taken care of in the event handler for the alarm clock. :)
by Cosmologicon
Mon Aug 02, 2010 3:26 pm UTC
Forum: Coding
Topic: Why pass?
Replies: 28
Views: 3537

Re: Why pass?

Another situation is in complicated if statements where one of the conditions appears like it might sometimes be true, but that deeper logical analysis shows that the condition will never be true. Of course, such statements should be explicitly commented. Here's a simplified example : def move_jump...
by Cosmologicon
Fri Jul 30, 2010 5:23 pm UTC
Forum: Coding
Topic: HTML5 + Javascript and collision detection
Replies: 11
Views: 9285

Re: HTML5 + Javascript and collision detection

Hmmm, I haven't looked at your code, but it doesn't sound like it's conserving momentum. I'm assuming the two balls have the same mass? In that case, the sum of the velocities should be conserved, and it looks like it's (1, 0) before the collision and (0.64, 0) after the collision.

Go to advanced search