Search found 3603 matches

by PM 2Ring
Fri Apr 14, 2017 4:52 pm UTC
Forum: Site/Forum issues
Topic: Incorrect encoding on JSONP API
Replies: 5
Views: 4982

Re: Incorrect encoding on JSONP API

It's still there. In https://xkcd.com/1824/info.0.json we have

Code: Select all

alt": "Be careful—it's breeding season, and some of these can be *extremely* defensive of their nests.",


BTW, this bug was mentioned on Stack Overflow Meta.
by PM 2Ring
Tue Apr 11, 2017 9:22 am UTC
Forum: Coding
Topic: Getting the most recent comic
Replies: 24
Views: 80411

Re: Getting the most recent comic

FWIW, I just posted a Python 2/3 script in the General thread Date for a comic? which fetches the JSON of a comic and prints its title and publication date.
by PM 2Ring
Tue Apr 11, 2017 9:14 am UTC
Forum: General
Topic: Date for a comic?
Replies: 3
Views: 1555

Re: Date for a comic?

You can get the date of a comic from the JSON feed. For that comic, the JSON is at http://xkcd.com/1425/info.0.json . Your browser may have an extension that formats JSON data nicely. Or if you have Python and you aren't afraid to use the command line, you can use the following script to fetch the J...
by PM 2Ring
Mon Apr 03, 2017 4:13 pm UTC
Forum: General
Topic: Lucky Ten Thousand (TIL)
Replies: 13176
Views: 1183881

Re: Lucky Ten Thousand (TIL)

WibblyWobbly wrote:Sorry, don't mean to harp on typos, but this one might cause confusion - it's "Verlet", isn't it?

Oops! Thanks for that!
by PM 2Ring
Mon Apr 03, 2017 12:47 pm UTC
Forum: General
Topic: Lucky Ten Thousand (TIL)
Replies: 13176
Views: 1183881

Re: Lucky Ten Thousand (TIL)

[edit]good news everyone, with RK4 implemented it is wonderfully stable. Even if I drop the plane from 1km, it just sinks through the ground (the spring really is more like a rubber sheet at 1m height and the ground is just a hologram) and comes back up.[/edit] Yay! You might also like to take a lo...
by PM 2Ring
Thu Mar 30, 2017 5:40 pm UTC
Forum: Science
Topic: The Reverse of how colors work: how would it look?
Replies: 6
Views: 1959

Re: The Reverse of how colors work: how would it look?

Here are a pair of images that approximately illustrate what you're asking about. The colours of one image are the RGB complement of the other image, so the hues of corresponding pixels are 180 degrees out of phase, but they have the same saturation and value (brightness). Well, sort of :) for the r...
by PM 2Ring
Wed Mar 22, 2017 5:16 am UTC
Forum: General
Topic: Whetstones and Sharp Knives
Replies: 12
Views: 2459

Re: Whetstones and Sharp Knives

You may find this recent Cooking Stack Exchange question of interest: Do magnets dull knives?
by PM 2Ring
Sun Mar 19, 2017 3:52 pm UTC
Forum: Coding
Topic: Coding: Fleeting Thoughts
Replies: 9730
Views: 1524794

Re: Coding: Fleeting Thoughts

Actual coding question: I'm working with a class that wraps two dictionaries -- one that maps a unique value ("A") to a non-unique value ("b"), and one that maps that non-unique to a set containing all the unique values that are mapped to it. In other words, as one dictionary ma...
by PM 2Ring
Mon Mar 13, 2017 2:03 am UTC
Forum: Language/Linguistics
Topic: Miscellaneous language questions
Replies: 481
Views: 42033

Re: Miscellaneous language questions

ObLink: My Old Man's A Dustman - Lonnie Donegan.

Another old term from the days of coal ash is "ashcan".
by PM 2Ring
Fri Mar 10, 2017 7:19 am UTC
Forum: Computer Science
Topic: A Compact Sized "Why?-BOOM" machine.
Replies: 7
Views: 2402

Re: A Compact Sized "Why?-BOOM" machine.

I've read a few stories where computers were wrecked / frozen by setting them impossible or difficult tasks, eg, some version of the Liar Paradox , find the last digit of pi, prove Goldbach's conjecture, etc. One memorable short story in this genre is The Monkey Wrench by Gordon R Dickson. Spock use...
by PM 2Ring
Fri Mar 10, 2017 6:50 am UTC
Forum: Science
Topic: Free Will
Replies: 161
Views: 11730

Re: Free Will

Here are some other threads on Free Will and Determinism from the Science forum.

Is there randomness to the universe?
Wait, can free will exist?
Does it matter whether God plays dice?

There are also various threads in Serious Business.
by PM 2Ring
Thu Feb 16, 2017 8:28 am UTC
Forum: Mathematics
Topic: "There is an Exception to every rule"
Replies: 32
Views: 5267

Re: "There is an Exception to every rule"

This got me thinking - 18 is a really boring, uncool number. Like, unusually so, so much that nothing could be more boring or uncool. I'd definitely choose 18 as an ususual example of a number of unparalleled uncoolness. In other words, 18 is a prime odd perfect square. Here's a reasonably cool pro...
by PM 2Ring
Fri Dec 30, 2016 7:58 am UTC
Forum: Mathematics
Topic: Combinatoric commanders
Replies: 6
Views: 1723

Re: Combinatoric commanders

I'll represent the colors by their initials, except I'll use the printers' convention of using K for black, so our colors in color-wheel order are WBKRG. The official convention is to use B for black and U for blue. Ah, ok. I'm not really into Pokémon I don't know much about M:tG. If you want t...
by PM 2Ring
Thu Dec 29, 2016 12:23 pm UTC
Forum: Mathematics
Topic: Combinatoric commanders
Replies: 6
Views: 1723

Re: Combinatoric commanders

I'll represent the colors by their initials, except I'll use the printers' convention of using K for black, so our colors in color-wheel order are WBKRG. The 5 four-color cards are BKRG WKRG WBRG WBKG WBKR The 15 two-color cards are WB BK KR RG GW WK KW WR RW BR RB BG GB KG GK For each color there a...
by PM 2Ring
Thu Dec 29, 2016 9:59 am UTC
Forum: Coding
Topic: Coding: Fleeting Thoughts
Replies: 9730
Views: 1524794

Re: Coding: Fleeting Thoughts

[...] why would IEEE create a function whose ostensive purpose is to calculate which integer is less than or equal to.... and not actually return an integer? Because a machine integer is not big enough to hold all possible results of floor . Of course, double can't represent very large integers exa...
by PM 2Ring
Wed Dec 28, 2016 7:40 am UTC
Forum: Coding
Topic: Coding: Fleeting Thoughts
Replies: 9730
Views: 1524794

Re: Coding: Fleeting Thoughts

Don't think of // as integer division: it's floor division. Shouldn't floor return an integer, though (like it does in Haskell)? (At least, if you have bigints and don't have to worry about floor(1.0e308) not being representable as an int; but I'm pretty sure Python does have bigints.) I'd expect 3...
by PM 2Ring
Wed Dec 28, 2016 7:29 am UTC
Forum: Computer Science
Topic: Deliberately bad algorithms
Replies: 120
Views: 32451

Re: Deliberately bad algorithms

A classical bad algorithm for Fibonacci's numbers: ulong Fibonacci(uint x) { if(x==0) return 0; else if(x==1) return 1; else return Fibonacci(x-1)+Fibonacci(x-2); } Okay, it computes the value exactly by definition, but... That algorithm got a mention back on page 1. Also see Xanthir's sig. Actuall...
by PM 2Ring
Wed Dec 28, 2016 6:40 am UTC
Forum: Coding
Topic: Coding: Fleeting Thoughts
Replies: 9730
Views: 1524794

Re: Coding: Fleeting Thoughts

>>> 3 // 2 1 >>> 3.0 // 2 1.0 Python, do you really have to be like that? It's so close, but worse than not close. Trying to maintain compatibility between Python 2.7 and 3 is a pain the arse when you don't have a proper environment for the latter set up. Don't think of // as integer division: it's...
by PM 2Ring
Fri Nov 25, 2016 8:06 am UTC
Forum: Coding
Topic: Efficiency of prime sieve
Replies: 7
Views: 3773

Re: Efficiency of prime sieve

If you're interested in storing primes, note that all primes > 30 are of the form 30n + {1,7,11,13,17,19,23,29}. There are 8 numbers in that set, so you can use a single byte to indicate all the primes in a block of 30 numbers. It's not too hard to write sieve algorithms so that they store the sieve...
by PM 2Ring
Fri Nov 25, 2016 6:12 am UTC
Forum: Science
Topic: Miscellaneous Science Questions
Replies: 2846
Views: 551450

Re: RELATIVITY QUESTIONS! (and other common queries)

As usual QM seems to be crashing the party . But at least it fixes those awful singularities and other problems. That Scharnhorst effect is interesting, but it only appears problematic if you define c to be the speed of light in a normal vacuum. If you use the more fundamental definition that it's ...
by PM 2Ring
Tue Oct 25, 2016 3:54 am UTC
Forum: Mathematics
Topic: Primes under different moduli
Replies: 4
Views: 1776

Re: Primes under different moduli

Using mod 30 is nice because you can use one byte to hold the 8 potential primes in each block of 30 numbers (apart from the first block). I wrote a segmented sieve in C using this technique many years ago, when RAM and HD space was much smaller than it is today.
by PM 2Ring
Mon Sep 05, 2016 2:56 pm UTC
Forum: Individual XKCD Comic Threads
Topic: 1729: "Migrating Geese"
Replies: 33
Views: 5447

Re: 1729: "Migrating Geese"

I was hoping for a Hardy–Ramanujan reference for this one. Oh well.
by PM 2Ring
Fri Sep 02, 2016 1:32 pm UTC
Forum: Individual XKCD Comic Threads
Topic: 1727: "Number of Computers"
Replies: 35
Views: 5622

Re: 1727: "Number of Computers"

Going sorta off topic, I've always wondered why you couldn't take radioactive waste, mix it with a lot on concrete, and pump it back into the mine it came out of (or any other conveniently depleted mine for that matter). I mean, it was just as radioactive overall before you took it out of the groun...
by PM 2Ring
Fri Sep 02, 2016 3:20 am UTC
Forum: Mathematics
Topic: How to Calculate Pi without a Calculator?
Replies: 66
Views: 8104

Re: How to Calculate Pi without a Calculator?

Yeah, I'm on my phone (and was between classes at that point), so it would be faster for you to just google "square root long division algorithm" than for me to do it and then go to the resulting page, copy the url, and try to paste it here (I say "try" because my phone often ha...
by PM 2Ring
Wed Aug 31, 2016 12:42 pm UTC
Forum: Individual XKCD Comic Threads
Topic: 1727: "Number of Computers"
Replies: 35
Views: 5622

Re: 1727: "Number of Computers"

Adjusting the frame of reference yields hurling Jupiter into the Sun. This does not particularily help. We've discussed that too. Would it be possible for humans to pollute the sun? As that thread mentions, if you could somehow collect the entire solar output for 2 billion years or so it would be e...
by PM 2Ring
Wed Aug 31, 2016 6:55 am UTC
Forum: Individual XKCD Comic Threads
Topic: 1727: "Number of Computers"
Replies: 35
Views: 5622

Re: 1727: "Number of Computers"

What Pfhorrest said. FWIW, here's an old thread about just how hard it is to throw stuff into the Sun: Sun as final storage for radwaste?.
by PM 2Ring
Mon Aug 29, 2016 2:50 am UTC
Forum: Individual XKCD Comic Threads
Topic: 1720: "Horses"
Replies: 55
Views: 7376

Re: 1720: "Horses"

Mahnarch wrote:I first read that as "safety feathers", and now I'm picturing a car crashing and it looking like a bird exploding from it. :D

Horse Feathers
by PM 2Ring
Sat Aug 27, 2016 6:04 pm UTC
Forum: Mathematics
Topic: Goahead52's Math Posts
Replies: 148
Views: 11583

Re: Goahead52's Math Posts

The philosopher / mathematician / poet Giordano Bruno, who promoted & extended the Copernican theory, was burned at the stake.
by PM 2Ring
Thu Aug 25, 2016 4:32 pm UTC
Forum: General
Topic: Lucky Ten Thousand (TIL)
Replies: 13176
Views: 1183881

Re: Today I Learned

Today I learned: My peach tree is a nectarine tree. Peach are fuzzy. Nectarine are bald. They are the same species, fuzziness is controlled by a single allele (gene) which can signify either the fuzzy or the non-fuzzy type. The fuzzy type is dominant, so if the DNA of the tree has a pair of genes f...
by PM 2Ring
Tue Aug 23, 2016 2:23 am UTC
Forum: Mathematics
Topic: How to Calculate Pi without a Calculator?
Replies: 66
Views: 8104

Re: How to Calculate Pi without a Calculator?

A convenient way to calculate decimal digits of pi without a calculator is to use the Taylor series for arctangent with formula 24 on the Mathworld page of Machin-like formulas : pi / 4 = 8 atan(1/10) - atan(1/239) - 4 atan(1/515) This formula is nice to work with for manual calculation because of t...
by PM 2Ring
Mon Aug 22, 2016 3:50 am UTC
Forum: Language/Linguistics
Topic: Words you think English should have or bring back.
Replies: 643
Views: 112089

Re: Words you think English should have or bring back.

Why do people call their motorcycle a bike? Shouldn't they call it a moke? No, because this is a Moke. https://upload.wikimedia.org/wikipedia/commons/thumb/1/1f/Moke02.png/280px-Moke02.png The name comes from "Mini"—the car with which the Moke shares many parts—and "Moke", which...
by PM 2Ring
Thu Aug 11, 2016 4:05 pm UTC
Forum: Mathematics
Topic: Math: Fleeting Thoughts
Replies: 378
Views: 99050

Re: Math: Fleeting Thoughts

(I promise I won't ask about properties of these constructions in non-Eucledian space :P ) Oh, in hyperbolic space it's a piece of cake. Remember that in non-Euclidean geometries the angle sum of a triangle isn't constant but instead is a linear function of the area. In hyperbolic space the sum is ...
by PM 2Ring
Wed Aug 10, 2016 2:22 pm UTC
Forum: Mathematics
Topic: Math: Fleeting Thoughts
Replies: 378
Views: 99050

Re: Math: Fleeting Thoughts

Well done, jaap!

Flumble wrote:No worries, I also know brain farts.

:) Thanks for reminding me of the Goat Problem; I've just added some diagrams to that thread.
by PM 2Ring
Wed Aug 10, 2016 2:19 pm UTC
Forum: Mathematics
Topic: Trickier problem than it seems. (goat in a circular paddock)
Replies: 19
Views: 3376

Re: Trickier problem than it seems. (goat in a circular paddock)

I've created a diagram in SVG for this puzzle. Here's the SVG code. Just save it to a file with the .svg extension and you can view it in your browser. <?xml version="1.0" encoding="UTF-8" ?><svg xmlns="http://www.w3.org/2000/svg"    xmlns:xlink="http://www.w3.org/1999/xlink"    width="400" height="...
by PM 2Ring
Sun Aug 07, 2016 2:00 pm UTC
Forum: Mathematics
Topic: Math: Fleeting Thoughts
Replies: 378
Views: 99050

Re: Math: Fleeting Thoughts

For the 3D case, the segments are unit vectors in the X, Y, and Z directions, and the oppositely-directed unit vectors -X, -Y, -Z. I think the OP is asking for the more general case where the segments are not necessarily axis-aligned. indeed (wait, am I "OP"? after 9 pages?) Ah, right. :o...
by PM 2Ring
Sun Aug 07, 2016 5:40 am UTC
Forum: Mathematics
Topic: Math: Fleeting Thoughts
Replies: 378
Views: 99050

Re: Math: Fleeting Thoughts

But does it also work for odd numbers n=2k+1>4? My gut feeling says no for at least n=5, but I can't prove it (at this time). Also, does adding dimensions have any effect? Your gut feeling is correct, and adding more dimensions doesn't help. For the 3D case, the segments are unit vectors in the X, ...
by PM 2Ring
Fri Jul 22, 2016 9:26 am UTC
Forum: Mathematics
Topic: Trickier problem than it seems. (goat in a circular paddock)
Replies: 19
Views: 3376

Re: Trickier problem than it seems. (goat in a circular paddock)

We can simplify the equation for r a little. There's a simple relation between the two angles because they are in an isoceles triangle, so we can eliminate one of the cos -1 calls. Specifically, cos -1 (1 - r 2 /2) + 2cos -1 (r/2) = π Using 1 for the radius of the field, the equation for r , the tet...
by PM 2Ring
Thu Jul 21, 2016 5:45 pm UTC
Forum: General
Topic: Thoughts for ships
Replies: 89736
Views: 6132393

Re: Random natterings

Does anyone know why Kali Linux is so popular all of a sudden? [...] Kali Linux is popular with wannabe hackers. (In the break-into-systems sense, not good coders). FWIW, the vast majority of questions from Kali users on the Stack Exchange Unix & Linux site are so abysmal that they get rapidly ...
by PM 2Ring
Fri Jul 01, 2016 8:13 am UTC
Forum: General
Topic: [SAFESPACE] LGBTIQQA Thread - Queer Support!
Replies: 8193
Views: 1052846

Re: [SAFESPACE] LGBTIQQA Thread - Queer Support!

On a different topic, it strikes me that this might be a good place to ask something I was just wondering yesterday. I would like to be less hairy more often and am not really ready for big costly medical hair removal treatments or anything, but goddamn is shaving everything an enormous pain in the...
by PM 2Ring
Wed Jun 15, 2016 7:56 am UTC
Forum: Science
Topic: Relativistic Lorentz force
Replies: 34
Views: 5178

Re: Relativistic Lorentz force

It's a bit like angular momentum. There's not a completely separate 'angular momentum' from 'linear momentum', you pretty much just get angular momentum whenever linear momentum is different between two bodies; just like there's not a separate B field from the E field; and in fact the maths are som...

Go to advanced search