Search found 7959 matches

by phlip
Wed Dec 14, 2016 4:02 am UTC
Forum: Logic Puzzles
Topic: Infinite Balls and Jugs [solution]
Replies: 611
Views: 50441

Re: Infinite Balls and Jugs [solution]

Defining B n ={n+1,n+2,...10n} L sup = ∩ n≥1 ∪ j≥n B j Every ∪ j will contain all members of B ∞ , therefore the intersection of all ∪ j also contains all members of B ∞ L inf = ∪ n≥1 ∩ j≥n B j ∩ j=∞ B j = B ∞ , therefore the union of all ∩ j≥n B j = B ∞ So the limit of B is B ∞ and I can't see any...
by phlip
Mon Dec 12, 2016 10:41 pm UTC
Forum: Coding
Topic: Coding: Fleeting Thoughts
Replies: 9546
Views: 1341418

Re: Coding: Fleeting Thoughts

Yeah, C's "struct tm" uses a 0-based month number but a 1-based day number. And originally it used a two-digit year, but now out of backwards compatibility it uses "year - 1900". So today is 13/11/116 according to C. It is garbage, and every language that does the same and justif...
by phlip
Sun Dec 11, 2016 9:05 pm UTC
Forum: Logic Puzzles
Topic: Infinite Balls and Jugs [solution]
Replies: 611
Views: 50441

Re: Infinite Balls and Jugs [solution]

(Typing this post on my phone, so forgive me not using as much fancy formatting as I normally use...) For lim_sup you need to evaluate L sup = ∩ n≥1 ∪ j≥n B j But ∪ j≥n B j = {n+1,n+2,...} So L sup = ∩ n≥1 {n+1,n+2,...} Which for any finite limit to n is clearly not {}, and in fact as n increases an...
by phlip
Fri Dec 09, 2016 5:19 am UTC
Forum: Logic Puzzles
Topic: Infinite Balls and Jugs [solution]
Replies: 611
Views: 50441

Re: Infinite Balls and Jugs [solution]

We have differing opinions on whether a fully instantiated infinite set of numbers includes infinite numbers or not. So whatever I answer here will only lead to us going round in circles. If you don't like thinking that N contains these infinite values when it's fully evaluated [...] OK then, let's...
by phlip
Wed Dec 07, 2016 1:18 pm UTC
Forum: Logic Puzzles
Topic: Infinite Balls and Jugs [solution]
Replies: 611
Views: 50441

Re: Infinite Balls and Jugs [solution]

↶ Take an infinite set S ={1,1,1,1,....} Append another 1. Or a hundred of them, or an infinite number. You have the same set. Do that backwards, you have partitioned S into an infinite set and another set. That is not an infinite set. That is a finite set. With one element. That element is 1. This...
by phlip
Wed Dec 07, 2016 9:17 am UTC
Forum: What If?
Topic: What-If 0019: "Tie Vote"
Replies: 57
Views: 11702

Re: What-If 0019: "Tie Vote"

↶ 2.9 × 10^-21 bales is not 29 zeptobales, it's 2.9. So either the text or the calculation result is wrong. :shock: :shock: :shock: According to Wolfram|Alpha it's the calculation result, the correct figure is 2.9×10 −20 bales/second. Probably a typo due to having the "zepto" prefix on th...
by phlip
Tue Dec 06, 2016 12:55 pm UTC
Forum: Logic Puzzles
Topic: Infinite Balls and Jugs [solution]
Replies: 611
Views: 50441

Re: Infinite Balls and Jugs [solution]

↶ It should be pretty clear that f∞ is 1 everywhere, while g∞ is 0 everywhere. Are you sure that g∞ is 0 everywhere? If g i is only defined for finite i then for very large i g has a very large number of 1's. If g is defined for infinite i then I'd argue that g∞ has an infinite number of 1's (for n...
by phlip
Sun Dec 04, 2016 2:30 am UTC
Forum: Logic Puzzles
Topic: Infinite Balls and Jugs [solution]
Replies: 611
Views: 50441

Re: Infinite Balls and Jugs [solution]

↶ I know I mentioned this, when we were talking about the append-0 game vs. the remove balls game. I said that since a_i and r_i (for append step i and remove step i) are the exact same function (not just have the same counts of 1's and 0's), they must have the same limit. It was argued that since ...
by phlip
Sat Dec 03, 2016 2:26 pm UTC
Forum: Logic Puzzles
Topic: Infinite Balls and Jugs [solution]
Replies: 611
Views: 50441

Re: Infinite Balls and Jugs [solution]

↶ If you want to model the game using sets of entities that have a mysterious knowledge of their past then you can do that too, but then they are no longer numbers and you can't treat them as such. I think it's worth reiterating that the limit we're looking at here is a pointwise limit. That is, to...
by phlip
Mon Nov 28, 2016 12:13 pm UTC
Forum: Coding
Topic: Coding: Fleeting Thoughts
Replies: 9546
Views: 1341418

Re: Coding: Fleeting Thoughts

Polish notation (either normal or reverse) isn't too hard to extend to add operators that take any fixed number of parameters... but adding functions that take a variable number of parameters is a whole other ballgame. Chances are, just doing "eat the whole stack" isn't actually what you w...
by phlip
Thu Nov 17, 2016 2:31 pm UTC
Forum: General
Topic: ANGRY NATTERINGS
Replies: 28220
Views: 2042399

Re: ANGRY NATTERINGS

)
by phlip
Thu Nov 10, 2016 11:22 am UTC
Forum: Logic Puzzles
Topic: Infinite Balls and Jugs [solution]
Replies: 611
Views: 50441

Re: Infinite Balls and Jugs [solution]

↶ It, and the infinite other balls were put in at the stroke of midnight. Why would you assume such a thing, when the puzzle pretty explicitly only describes us doing things strictly before midnight? At midnight, we're doing nothing except checking to see what's left in the jug. If you are prepared...
by phlip
Wed Nov 09, 2016 11:39 pm UTC
Forum: Logic Puzzles
Topic: Infinite Balls and Jugs [solution]
Replies: 611
Views: 50441

Re: Infinite Balls and Jugs [solution]

↶ They were put in during the infinite number of infinitesimally short steps that happened on the stroke of midnight. "During" a number of steps? Be specific. At what specific time was this ball: ↶ How many steps had been taken when midnight arrived? That number plus one will tell you the...
by phlip
Mon Nov 07, 2016 2:47 am UTC
Forum: Coding
Topic: Coding: Fleeting Thoughts
Replies: 9546
Views: 1341418

Re: Coding: Fleeting Thoughts

Code: Select all

' Some assertions to verify maths is still working
¼ = 0.25
½ = 0.5
¾ = 0.75
' OK, everything seems good

Sub t()
    x = 2
    If x * ½ = 1 Then MsgBox "Multiplication still works as expected"
End Sub
by phlip
Mon Nov 07, 2016 2:38 am UTC
Forum: Coding
Topic: Coding: Fleeting Thoughts
Replies: 9546
Views: 1341418

Re: Coding: Fleeting Thoughts

jeanrenaud wrote:
I'm just not sure why my post got here. I made a separate post for it...

Yeah, I merged it in... I thought it made a better fit in here (and would probably get more traction)
by phlip
Fri Nov 04, 2016 9:19 am UTC
Forum: Science
Topic: Some help me with Calculation of impact speed please
Replies: 4
Views: 1232

Re: Some help me with Calculation of impact speed please

If you're close enough to the surface that you can treat the acceleration as effectively constant, then you can just use the standard equations of motion ... specifically, the one you want is: v² − u² = 2as (Where s is your displacement, a is your acceleration, u is your initial velocity, v is your ...
by phlip
Wed Nov 02, 2016 1:00 pm UTC
Forum: News & Articles
Topic: In other news... (humorous news items)
Replies: 13564
Views: 1581464

Re: In other news... (humorous news items, etc)

↶ "What do you do for a living?" "I fokk horses" "Pardon?" "Yes, Paarden". Can someone explain this to me? Google Translate, the only way we true Americans can understand other languages, was useless. Google Translate was able to figure it out for me ...
by phlip
Sun Oct 30, 2016 10:49 pm UTC
Forum: General
Topic: ITT: We make xkcd slightly worse.
Replies: 8533
Views: 1198465

Re: ITT: We make xkcd slightly worse.

Monika wrote:
WHEN OTHERS.
WRITE: / 'None of the above'.

Nice.
by phlip
Sun Oct 30, 2016 10:30 pm UTC
Forum: Computer Science
Topic: Deliberately bad algorithms
Replies: 103
Views: 22119

Re: Deliberately bad algorithms

Surely, for consistency with other command-line single-file compression utils, this should by default delete the original file after compression...
by phlip
Sat Oct 29, 2016 1:53 am UTC
Forum: General
Topic: ITT: We make xkcd slightly worse.
Replies: 8533
Views: 1198465

Re: ITT: We make xkcd slightly worse.

↶ • there's a quirk that cin >> has that would make all these comparisons fail if they worked as intended. Oh, right, it like stops at the first whitespace or something, doesn't it? I straight-up never use cin>> or scanf or any of that whole variety of input methods because I know they neve...
by phlip
Fri Oct 28, 2016 9:35 am UTC
Forum: General
Topic: ITT: We make xkcd slightly worse.
Replies: 8533
Views: 1198465

Re: ITT: We make xkcd slightly worse.

- Semicolon after one of the ifs [edit] never mind, you already had that one and I didn't see it [/edit] - "=" instead of "==" (instead of strcmp) in one of the ifs - Unicode directional quote marks - "Copy-and past" - No fallback else case - No newline bef...
by phlip
Fri Oct 28, 2016 9:15 am UTC
Forum: Individual XKCD Comic Threads
Topic: 1752: "Interplanetary Experience"
Replies: 47
Views: 3133

Re: 1752: "Interplanetary Experience"

PhRX wrote:
Still in denial about Pluto ?!

Not unless you take this as claiming that the Moon and Titan are also planets...
by phlip
Fri Oct 28, 2016 5:54 am UTC
Forum: General
Topic: ITT: We make xkcd slightly worse.
Replies: 8533
Views: 1198465

Re: ITT: We make xkcd slightly worse.

Also, writing to a pointer that hasn't been initialised, which will segfault if you're lucky...

I love the sorted-pixels one, though.
by phlip
Tue Oct 18, 2016 1:20 pm UTC
Forum: Coding
Topic: faster function than 1/x?
Replies: 18
Views: 2482

Re: faster function than 1/x?

... I don't fully understand what you're trying to say? In some places you're calling f() with two arguments, and in others you're calling it with one, and it seems like you're talking about different functions in different places? But from what I think it sounds like you're saying, it's something l...
by phlip
Wed Oct 12, 2016 1:02 pm UTC
Forum: Individual XKCD Comic Threads
Topic: 1745: "Record Scratch"
Replies: 45
Views: 4351

Re: 1745: "Record Scratch"

↶ What aesthetic is this comic trying to mimic? It's a trope of TV sitcoms. There's a party, or somesuch... music is playing in the background, there's a lot of people partying, no-one is really paying attention to the main character. Then the character does something particularly embarassing. All ...
by phlip
Mon Oct 10, 2016 7:43 am UTC
Forum: Religious Wars
Topic: VLC vs. Media Player Classic
Replies: 10
Views: 2221

Re: VLC vs. Media Player Classic

I basically live in the command line these days, and I CBA to organise a media library when I have a perfectly good filesystem that can handle all that anyway, so mpv is my media player of choice for most circumstances. Before I learned about that project sometime last year, I used its predecessor M...
by phlip
Tue Sep 27, 2016 2:38 pm UTC
Forum: Coding
Topic: Coding: Fleeting Thoughts
Replies: 9546
Views: 1341418

Re: Coding: Fleeting Thoughts

I remember trying to do something that scraped pages off a site, that returned 200 for every url, but had some random HTTP header that was set to "404" if a page didn't exist. Still able to be used, but a bit head-scratching... [edit] Oh, I remember which site it was... phlip@boris:~$ curl...
by phlip
Wed Sep 21, 2016 1:42 pm UTC
Forum: Coding
Topic: Coding: Fleeting Thoughts
Replies: 9546
Views: 1341418

Re: Coding: Fleeting Thoughts

Naturally, the only things worth checking in a code-review are things that could be fixed by a pre-commit hook.
by phlip
Wed Sep 21, 2016 1:40 pm UTC
Forum: Coding
Topic: faster function than 1/x?
Replies: 18
Views: 2482

Re: faster function than 1/x?

The memcpy version: float fastinvert3(float x) { uint32_t asint; memcpy(&asint, &x, 4); asint ^= 0x7FFFFFFF; memcpy(&x, &asint, 4); return x; } compiles with GCC identically to the pointer-casting version, even without optimisation (which makes sense, if you unroll the memcpy call th...
by phlip
Wed Sep 21, 2016 7:09 am UTC
Forum: Coding
Topic: faster function than 1/x?
Replies: 18
Views: 2482

Re: faster function than 1/x?

↶ In C, it is not UB -- rather, it just produces a perhaps-partially-un specified result. Ah, I do sometimes get undefined and unspecified mixed up. I think I remembered seeing it in the list in J.1 but misremembered what the list was. In which case, sure, this is safer: float fastinvert(float x) {...
by phlip
Wed Sep 21, 2016 12:01 am UTC
Forum: Coding
Topic: faster function than 1/x?
Replies: 18
Views: 2482

Re: faster function than 1/x?

I'm pretty sure using a union is also undefined behaviour? That reading from a field of a union that's not (a compatible type of) the one you wrote to isn't strictly allowed. Or something like that, it's been a while since I read the standard. Point being that if we're talking strict by-the-standard...
by phlip
Tue Sep 20, 2016 12:50 pm UTC
Forum: Coding
Topic: faster function than 1/x?
Replies: 18
Views: 2482

Re: faster function than 1/x?

↶ The fastest way would be to roll your own bit level hacks. Floating points are of the form m * 2^e, where 1 < m < 2, so if you negate both the exponent and the mantissa separately, it might work. Construct a floating point number that reads (2-m) * 2^(-e), which can be done using nothing but bit ...
by phlip
Mon Sep 19, 2016 11:22 am UTC
Forum: General
Topic: Random natterings
Replies: 89478
Views: 4865881

Re: Random natterings

Something something Real Media.
by phlip
Thu Sep 15, 2016 1:28 pm UTC
Forum: News & Articles
Topic: Police misbehavior thread
Replies: 5241
Views: 619705

Re: Police misbehavior thread

I believe most style guides say to use the apostrophe when pluralising single letters. It doesn't make a lot of logical sense, but it just reads a lot easier.

Um... which is why the police are terrible. Yes.
by phlip
Wed Sep 14, 2016 11:52 pm UTC
Forum: Coding
Topic: Coding: Fleeting Thoughts
Replies: 9546
Views: 1341418

Re: Coding: Fleeting Thoughts

↶ Suffice to say, the first time I heard of Node was the Great leftpad Debacle. That pretty well encapsulated everything I needed to know about it. Having never used npm, the most interesting thing I learned from some of the stories from the leftpad stuff: there is a module called "is-positive...
by phlip
Wed Sep 14, 2016 6:06 am UTC
Forum: News & Articles
Topic: Police misbehavior thread
Replies: 5241
Views: 619705

Re: Police misbehavior thread

I had a double-take before I realised they didn't mean 57 gigadollars...
by phlip
Wed Sep 07, 2016 2:26 pm UTC
Forum: Coding
Topic: Coding: Fleeting Thoughts
Replies: 9546
Views: 1341418

Re: Coding: Fleeting Thoughts

Sure, that lets you find the .bar elements that are children of any .foo elements. But how to find the .bar elements that are children of a specific .foo element? Specifically, the one I have in this variable here? There's Element.querySelector when you're looking specifically for descendants, but n...
by phlip
Wed Sep 07, 2016 1:53 pm UTC
Forum: General
Topic: The "I can't find a particular XKCD comic" thread
Replies: 142
Views: 76017

Re: The "I can't find a particular XKCD comic" thread

I'mOkWithThis.jpg
by phlip
Wed Sep 07, 2016 7:05 am UTC
Forum: General
Topic: The "I can't find a particular XKCD comic" thread
Replies: 142
Views: 76017

Re: The "I can't find a particular XKCD comic" thread

I don't think there's anyone I know who tells stories like the first panel of that one...
by phlip
Wed Sep 07, 2016 12:00 am UTC
Forum: General
Topic: Random natterings
Replies: 89478
Views: 4865881

Re: Random natterings

A significant number of my aborted posts are when I'm replying to a thread to add extra detail or context, or clarify something someone else already posted... and then I read it back when I'm done and I realise I haven't actually added anything, everything I've said is already covered in the previou...

Go to advanced search