Search found 3664 matches

by PM 2Ring
Mon Nov 30, 2015 8:13 am UTC
Forum: Coding
Topic: Coding: Fleeting Thoughts
Replies: 9944
Views: 1910569

Re: Coding: Fleeting Thoughts

On a totally unrelated note, I have now learned bash, sed, and awk thoroughly and using them all the time. Nice. I hope you're quoting your bash parameter expansions (except when you do explicitly want word splitting etc). :) Just in case you don't know about it, here's a link to the Shellcheck she...
by PM 2Ring
Mon Nov 30, 2015 7:13 am UTC
Forum: Science
Topic: convert bits to J/K -- and more entropy mischief
Replies: 14
Views: 3141

Re: convert bits to J/K -- and more entropy mischief

I guess it's just a coincidence that it's within an order of magnitude of Avogadro's number: To clarify, it's not a coincidence at all: the boltzmann constant is defined as R/N A . So that 0.17 must be some combination of ln2 and the gas constant (in J/K/mol). Ah, of course. :oops: R = 8.3144598 jo...
by PM 2Ring
Fri Nov 27, 2015 7:42 am UTC
Forum: Science
Topic: convert bits to J/K -- and more entropy mischief
Replies: 14
Views: 3141

Re: convert bits to J/K -- and more entropy mischief

FWIW, Google Calculator can do that calculation: (1 joule / kelvin) / (ln(2) * boltzmann constant) 1.04494013 × 10 23 I guess it's just a coincidence that it's within an order of magnitude of Avogadro's number: ((1 joule / kelvin) / (ln(2) * boltzmann constant)) / (avogadros number) 0.173516388 whic...
by PM 2Ring
Sat Nov 21, 2015 10:34 am UTC
Forum: Mathematics
Topic: Least numbers discarded when dealing cards
Replies: 30
Views: 6346

Re: Least numbers discarded when dealing cards

Unfortunately, converting those digit sequences to card sequences is a little tedious, and (AFAICT) you have to generate the whole 20 digit sequence before you can decide that it's invalid. Actually, you don't have to generate the whole sequence before you can decide that it's invalid; I should kno...
by PM 2Ring
Fri Nov 20, 2015 11:42 am UTC
Forum: Mathematics
Topic: Least numbers discarded when dealing cards
Replies: 30
Views: 6346

Re: Least numbers discarded when dealing cards

Am I missing something or are people way overthinking this? Just put the numbers 1 through 52 in an array and shuffle it. Dealing cards is as simple as pulling out elements starting from the first index and working your way down. The problem is that the OP's TRNG (true random number generator) only...
by PM 2Ring
Wed Nov 18, 2015 10:40 pm UTC
Forum: Coding
Topic: Coding: Fleeting Thoughts
Replies: 9944
Views: 1910569

Re: Coding: Fleeting Thoughts

Inside the electrons are quarks, [...] In the Standard Model, electrons, like all leptons , are fundamental particles in their own right, they aren't composed of quarks. Quarks (and gluons), and particles composed of quarks, feel the strong nuclear force, but leptons are oblivious to that force. Ho...
by PM 2Ring
Sat Nov 14, 2015 4:18 pm UTC
Forum: Mathematics
Topic: Numbers are cool. Is there a proof/theorem for this?
Replies: 2
Views: 1407

Re: Numbers are cool. Is there a proof/theorem for this?

This is related to the topic of perfect numbers and aliquot sequences . If we continue your sequence that starts with 62447, the next number after 15505 is 5807, which is prime, so it must be followed by 1. If we start at a perfect number, eg 6 or 28, then the next number is the same number we start...
by PM 2Ring
Fri Nov 06, 2015 7:45 am UTC
Forum: Science
Topic: Miscellaneous Science Questions
Replies: 2912
Views: 684548

Re: RELATIVITY QUESTIONS! (and other common queries)

If quantum field theory in curved space could be reasoned about successfully with fractions, I'd have gotten my PhD in fourth grade. :D If you want to know what Hawking radiation looks like to an infalling observer rather than one at infinity, just do the Bogolyubov transformation for that intrepid...
by PM 2Ring
Fri Nov 06, 2015 6:41 am UTC
Forum: News & Articles
Topic: In other news... (humorous news items)
Replies: 15114
Views: 2530681

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

Here's a pertinent quote from Yes, Minister (Series One, Episode Six: The Right to Know): Sir Humphrey : Minister, I have something to say to you which you may not like to hear. Jim Hacker: Why should today be any different? Sir Humphrey: Minister, the traditional allocation of executive responsibil...
by PM 2Ring
Wed Oct 28, 2015 10:31 am UTC
Forum: Mathematics
Topic: hard geometry homework problem
Replies: 7
Views: 2765

Re: hard geometry homework problem

Yes, it is a tough one. And I was about to start writing some GeographicLib code before I noticed that this question is 5 years old. :) The OP mentioned Vincenty's formulae, which are commonly used for ellipsoid geodesic calculations. However, for the benefit of other readers who might find this thr...
by PM 2Ring
Tue Oct 27, 2015 6:01 am UTC
Forum: Individual XKCD Comic Threads
Topic: 1595: "30 Days Hath September"
Replies: 132
Views: 26358

Re: 1595: "30 Days Hath September"

This is the integer division thing I was talking about. I love the way it seems to make sense to begin with, with recognisable numbers like 52 and 365... but then you start getting crazy shit like 306 and 10. All division is integer division, operator % is modulus. Given integer y, m, d, calculate ...
by PM 2Ring
Fri Oct 16, 2015 6:21 am UTC
Forum: Coding
Topic: Coding: Fleeting Thoughts
Replies: 9944
Views: 1910569

Re: Coding: Fleeting Thoughts

New to OOP - quick question. [...] What is the canonical way to implement a function that is identical in a bunch of unrelated classes? And does python implement this? Just a quick note on terminology. A function that's defined inside a class is called a method. As Flumble said, if these classes al...
by PM 2Ring
Mon Oct 12, 2015 10:17 am UTC
Forum: Coding
Topic: Coding: Fleeting Thoughts
Replies: 9944
Views: 1910569

Re: Coding: Fleeting Thoughts

What phlip said. It's definitely a much better strategy these days to learn Python 3. You should start with the official Python tutorial , since it's aimed at people who already know how to program. If you want to be able to read old code &/or use old libraries properly you will eventually need ...
by PM 2Ring
Sat Oct 10, 2015 6:20 am UTC
Forum: Mathematics
Topic: Set of particular numbers
Replies: 14
Views: 2723

Re: Set of particular numbers

Are those sequences related to any other problem in number theory? Probably not. As Conman said earlier, sequences like this don't usually reveal anything particularly deep about the numbers involved because the results depend on the base you're using to represent the numbers. There's nothing of pa...
by PM 2Ring
Wed Oct 07, 2015 7:17 am UTC
Forum: Science
Topic: Miscellaneous Science Questions
Replies: 2912
Views: 684548

Re: RELATIVITY QUESTIONS! (and other common queries)

FWIW, Greg Egan created some nice diagrams, images, and a Java applet illustrating the neighbourhood of a pure GR Schwarzschild black hole to accompany his short story the Planck Dive . I guess it'd be nice to have graphics that somehow illustrated Hawking radiation, but it's not exactly easy to see...
by PM 2Ring
Mon Oct 05, 2015 6:52 am UTC
Forum: Mathematics
Topic: Composite numbers and polynomials
Replies: 9
Views: 2685

Re: Composite numbers and polynomials

If we can build a diophantine equation giving all the prime numbers even if it is not workable then why not trying to build functions or sequences or polynomials giving ONLY all the composite numbers. I started some ideas to find such way to solve this problem using some binary partition. A much si...
by PM 2Ring
Fri Oct 02, 2015 8:35 am UTC
Forum: Fictional Science
Topic: Superpower gives control over water - can they fly?
Replies: 42
Views: 12310

Re: Superpower gives control over water - can they fly?

Conservation of momentum is very native and natural to us, much moreso than conservation of energy. So in fiction, conservation of energy often goes out the window but conservation of momentum will be preserved to a degree, since things would look strange without it. I guess so. OTOH, it's because ...
by PM 2Ring
Fri Oct 02, 2015 8:21 am UTC
Forum: Mathematics
Topic: Composite numbers and polynomials
Replies: 9
Views: 2685

Re: Composite numbers and polynomials

I don't believe that it's possible to do what you want with a finite degree polynomial without overlapping: the structure of the primes is too rich for that. On a closely related note, there is the Diophantine Representation of the Set of Prime Numbers by James P. Jones, Daihachiro Sato, Hideo Wada ...
by PM 2Ring
Thu Oct 01, 2015 7:01 am UTC
Forum: Science
Topic: Speed of waves in water
Replies: 8
Views: 5499

Re: Speed of waves in water

I'm used to the concept that, say, sound waves and light waves travel at a constant speed in a constant medium, unaffected by either frequency or amplitude That's not true: wave speeds in a given medium generally are dependent on frequency / wavelength. One well-known manifestation of this is the d...
by PM 2Ring
Fri Sep 18, 2015 10:50 am UTC
Forum: Coding
Topic: Best password improver
Replies: 62
Views: 10618

Re: Best password improver

Your password page could have an embedded client-side password hasher, eg Xanthir's SHA-1 password hasher , (maybe with a slightly simplified, more user-friendly UI), with clear instructions on how to use it. And I guess you could include a brief explanation of why it's secure: it does its calculati...
by PM 2Ring
Sat Sep 12, 2015 9:25 am UTC
Forum: Computer Science
Topic: A formula based approach to Arithmetic Coding
Replies: 4
Views: 7064

Re: A formula based approach to Arithmetic Coding

siara wrote:By the way, how were you able to post URL in the reply? I couldn't.

The answer to that question can be found in the xkcd Forum Rules, along with other useful information.
by PM 2Ring
Fri Aug 28, 2015 6:57 am UTC
Forum: Science
Topic: A million years
Replies: 59
Views: 8826

Re: A million years

BlackSails wrote:Positions of planets cant be accurately predicted to more than a few tens of millions of years.

p1t1o wrote:Not necessarily, as linked above.

I suspect that you misread BlackSails's post, p1t1o. :)
by PM 2Ring
Tue Aug 04, 2015 5:14 am UTC
Forum: Individual XKCD Comic Threads
Topic: 1559: "Driving"
Replies: 142
Views: 20554

Re: 1559: "Driving"

If a car gets a signal to pick someone up, but is blocked by other self driving cars, it could transmit a "I need to leave now" signal to nearby cars, which would then move out of the way, then shuffle back into the available parking space. The image of a parking lot stuffed full of self-...
by PM 2Ring
Tue Aug 04, 2015 4:32 am UTC
Forum: General
Topic: Thoughts for ships
Replies: 90128
Views: 8707422

Re: Inspirations

Trying to read Ulysses [...] Kinda reminds me of Deva and addams' posts. Na-Uh! No! No Way! Deva and I are both easier to read than Ulysses is. oh, dear God! That's what you see when I post?? I should seriously consider Not posting. The world is difficult enough to understand. It is Wrong to needle...
by PM 2Ring
Mon Aug 03, 2015 7:48 am UTC
Forum: Science
Topic: Salty Brine State Beach explosion
Replies: 4
Views: 2029

Re: Salty Brine State Beach explosion

[...]Water, on the other hand, can hold quite a bit of hydrogen. (They call it hydrogen peroxide, you know.)[...] Not quite. Hydrogen peroxide is H 2 O 2 . Hydrogen peroxide is a powerful oxidizing agent and somewhat unstable due to the O-O (peroxide) bond. FWIW, when it decomposes it tends to give...
by PM 2Ring
Sat Aug 01, 2015 7:57 am UTC
Forum: Mathematics
Topic: Favorite math jokes
Replies: 1452
Views: 478249

Re: Favorite math jokes

Then you can prove that zeta(1)=infinity, without assuming that there are infinitely many primes. (though that's hard, and the usual easy proof uses the fact that there are infinitely many primes) Huh? The usual easy proof of the divergence of zeta(1) is Nicole Oresme's proof using comparison of th...
by PM 2Ring
Thu Jul 30, 2015 8:33 am UTC
Forum: Individual XKCD Comic Threads
Topic: 1556: "The Sky"
Replies: 53
Views: 13422

Re: 1556: "The Sky"

[...] the light source here (gigantic ball of explosion far older than life on this planet, not shown) [...] The Sun's not as explosion-y as you might think. The Sun's atoms certainly have a lot of kinetic energy , and sure, it has nuclear fusion reactions happening in its core, but those reactions...
by PM 2Ring
Thu Jul 30, 2015 7:39 am UTC
Forum: The Help Desk
Topic: What's your virus/security procedure?
Replies: 33
Views: 9801

Re: What's your virus/security procedure?

FWIW, I have XP on this machine for those very rare occasions when I need Windows, but since XP was discontinued I turn off my ADSL modem before booting into XP. Another useful anti-malware program that still works on XP is AdwCleaner - it can occasionally find things that MBAM misses. Obviously, I ...
by PM 2Ring
Sat Jul 25, 2015 10:51 am UTC
Forum: Coding
Topic: Python - Best way to turn string of digits into list of ints
Replies: 11
Views: 4401

Re: Python - Best way to turn string of digits into list of

I wouldn't call a 10% difference negligible, but YMMV. But do I agree that 25 microseconds is negligible. The relative speed difference of the two methods depends on the speed of the computation inside the list comp / gen exp: if that computation is slow it may dominate the total time, hiding the di...
by PM 2Ring
Fri Jul 24, 2015 12:14 pm UTC
Forum: Mathematics
Topic: Newtonian equation of motion for New Horizons
Replies: 5
Views: 2214

Re: Newtonian equation of motion for New Horizons

How about 4π² AU³/yr² ?

But what's a minor constant of proportionality between friends? :)
by PM 2Ring
Thu Jul 23, 2015 12:15 pm UTC
Forum: Science
Topic: N-Body Simulation questions
Replies: 19
Views: 3752

Re: N-Body Simulation questions

One problem with Runge–Kutta methods is that they don't conserve energy, and that could be killing your filaments. Try using a symplectic integrator like Verlet, or Leapfrog . I generally use the synchronized version of Leapfrog (for doing simple orbit sims) but the standard version's probably adequ...
by PM 2Ring
Thu Jul 23, 2015 11:49 am UTC
Forum: Mathematics
Topic: Newtonian equation of motion for New Horizons
Replies: 5
Views: 2214

Re: Newtonian equation of motion for New Horizons

A minor correction: G is normally called the gravitational constant ; the term "gravitational parameter" or standard gravitational parameter normally denotes the product GM. In celestial mechanics, the standard gravitational parameter μ of a celestial body is the product of the gravitation...
by PM 2Ring
Tue Jul 21, 2015 7:14 am UTC
Forum: Coding
Topic: Coding: Fleeting Thoughts
Replies: 9944
Views: 1910569

Re: Coding: Fleeting Thoughts

ETA: yep, it's perfect. Thanks! No worries. When you're done, it'd be great if you could let us know what you think of svg_stack. OTOH, since your SVG files are all nearly identical it probably wouldn't be too hard to write a bit of Python to do the tiling yourself, assuming that the files were bui...
by PM 2Ring
Mon Jul 20, 2015 8:43 am UTC
Forum: Coding
Topic: Coding: Fleeting Thoughts
Replies: 9944
Views: 1910569

Re: Coding: Fleeting Thoughts

I have a large amount of SVG files (all nearly identical) which I want to put on a single page in a simple rectangular tiled layout. I assume you want to tile all these files into a single SVG file, rather than into a HTML / XHTML Web page. If so, svg_stack may be helpful. svg_stack combines multip...
by PM 2Ring
Fri Jul 17, 2015 9:01 am UTC
Forum: Coding
Topic: Python - Best way to turn string of digits into list of ints
Replies: 11
Views: 4401

Re: Python - Best way to turn string of digits into list of

I wasn't aware that list comps create their own scope, now. Lots of people have been bitten by the "scope-leaking" of Python 2 list comps. Most of us just learned to live with it, but enough people complained that it was changed for Python 3, even though it makes list comps slightly less ...
by PM 2Ring
Thu Jul 16, 2015 12:20 pm UTC
Forum: Coding
Topic: Python - Best way to turn string of digits into list of ints
Replies: 11
Views: 4401

Re: Python - Best way to turn string of digits into list of

@MostlyHarmless What they said. Generators (including generator expressions) run slightly slower than list comprehension and take more setup time, so list comprehensions will beat them for stuff like this unless you're processing ridiculously huge strings of digits. BTW, in general, don't use `chr` ...
by PM 2Ring
Thu Jul 16, 2015 10:54 am UTC
Forum: General
Topic: Thoughts for ships
Replies: 90128
Views: 8707422

Re: Inspirations

You could do a Death Star cake and if someone asks which moon it is your SO can reply
"That's no moon".
:)
by PM 2Ring
Mon Jul 13, 2015 6:42 am UTC
Forum: Mathematics
Topic: Wanted: Elegant proof of sin(x)/x limit
Replies: 49
Views: 8624

Re: Wanted: Elegant proof of sin(x)/x limit

FWIW, the Wikipedia article on the Fermat point (the point such that the total distance from the three vertices of the triangle to the point is the minimum possible) invokes without proof "the dogleg rule" which asserts that if a triangle and a polygon have one side in common and the rest ...
by PM 2Ring
Mon Jul 13, 2015 6:36 am UTC
Forum: Science
Topic: Problem about travelling backwards
Replies: 15
Views: 3250

Re: Problem about travelling backwards

As I've mentioned before, I'm rather fond of Cramer's Transactional Interpretation of quantum mechanics. Roughly speaking, Cramer postulates that the normal past-to-future causality is complemented by future-to-past causality, so when atom A emits a photon that's absorbed by atom B, the actual traje...
by PM 2Ring
Mon Jul 13, 2015 6:16 am UTC
Forum: Science
Topic: Conductors and Motors/Generators
Replies: 7
Views: 1832

Re: Conductors and Motors/Generators

Speaking of liquid conductors & motors, check out the mercury "motor" . It's not very practical, but it is rather cute. WRT Carbon: it conducts, but rather poorly. Try running an electric current through a stick of pencil lead and see what happens! True, but graphite is a great lubrica...

Go to advanced search