Search found 3636 matches

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: 4243

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: 2165

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: 3679

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: 2165

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: 9878
Views: 1795345

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: 9878
Views: 1795345

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: 4243

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: 4243

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: 90038
Views: 8011114

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: 8202

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: 3154

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: 1782

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...
by PM 2Ring
Sat Jul 11, 2015 7:07 am UTC
Forum: General
Topic: Thoughts for ships
Replies: 90038
Views: 8011114

Re: Inspirations

Echo244 wrote:I think they're invasive in Australia, and a bit tricky to get rid of.

They are. Also, blackberries can harbour rabbits, another invasive species.
by PM 2Ring
Sat Jul 11, 2015 6:57 am UTC
Forum: Mathematics
Topic: Math: Fleeting Thoughts
Replies: 382
Views: 124683

Re: Math: Fleeting Thoughts

Maybe something based on the inverse hyperbolic tangent?
Eg y = ln((7-x)/(x-1))/2
by PM 2Ring
Tue Jul 07, 2015 2:48 am UTC
Forum: Science
Topic: Is the bee problem fixed now?
Replies: 37
Views: 6896

Re: Is the bee problem fixed now?

There's a little bit of info at Insect flight obeys aerodynamic rules, Cornell physicist proves . As Neil said, at the small scale of typical insect wings & bodies air viscosity is much more significant than it is for typical birds & fixed-wing aircraft. In fact, when researches test large s...
by PM 2Ring
Sun Jun 28, 2015 8:28 am UTC
Forum: Coding
Topic: Coding: Fleeting Thoughts
Replies: 9878
Views: 1795345

Re: Coding: Fleeting Thoughts

"There are only two hard problems in computer science: cache coherence, naming things, and off-by-one errors." Sig'd. :) To whom may I attribute this quote? According to http://skeptics.stackexchange.com/questions/19836/has-phil-karlton-ever-said-there-are-only-two-hard-things-in-computer...
by PM 2Ring
Wed Jun 03, 2015 8:34 am UTC
Forum: Computer Science
Topic: Deliberately bad algorithms
Replies: 120
Views: 47770

Re: Deliberately bad algorithms

hotaru wrote:

Code: Select all

factorial = product . enumFromTo 1
isPrime n = factorial (n - 1) `mod` n == n - 1


<voice="Tom Hanks">Wilson!</voice>
by PM 2Ring
Wed Jun 03, 2015 7:59 am UTC
Forum: Mathematics
Topic: Combinations algorithm and property
Replies: 19
Views: 3079

Re: Combinations algorithm and property

Is there an algorithm generating combinations C(n,k) such as the ouput order has this property : each k-uplet shares exactly (k-1) elements with its 2 neighbours. Yes, there is. It's Algorithm 452: enumerating combinations of m out of n objects by C. N. Liu and D. T. Tang. Here's an implementation ...
by PM 2Ring
Mon Jun 01, 2015 7:54 am UTC
Forum: Coding
Topic: Fast multiple input bitwise XOR?
Replies: 12
Views: 2880

Re: Fast multiple input bitwise XOR?

FWIW, here are some StackOverflow links related to bit counting in various languages. Java: Optimizing Long.bitCount C: How to count the number of set bits in a 32-bit integer? Python: fast way of counting bits in python . As that page mentions you can do a fast popcount in Python, even on long inte...
by PM 2Ring
Mon Jun 01, 2015 7:40 am UTC
Forum: News & Articles
Topic: In other news... (humorous news items)
Replies: 14950
Views: 2350237

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

But yeah, if you just renamed the 12 hour as 0, then the system would make a lot more sense... ticking over from 11:59:59 am to 0:00:00 pm. That's how I remember which is which: 12 should really be 0, but we call it 12 because it's a carry-over from Ancient Times, before zero was invented. For bonu...
by PM 2Ring
Sun May 31, 2015 5:21 am UTC
Forum: News & Articles
Topic: In other news... (humorous news items)
Replies: 14950
Views: 2350237

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

It's not just DST and distance from your time zone's central meridian that affects the time of true noon (aka apparent noon) i.e., the time when the Sun is highest in the sky that day, when the length of the shadow of a vertical pole is at its minimum for that day. The average time period from one t...
by PM 2Ring
Fri May 29, 2015 7:53 am UTC
Forum: General
Topic: Thoughts for ships
Replies: 90038
Views: 8011114

Re: To Mess With Friends

lengthMustBeBetween3and30Chars wrote:humans are the apex predator on planet Earth
[citation needed ]
by PM 2Ring
Wed May 27, 2015 6:58 am UTC
Forum: Mathematics
Topic: A game of dice patience
Replies: 6
Views: 2505

Re: A game of dice patience

Nice work, phlip!
by PM 2Ring
Mon May 25, 2015 11:30 am UTC
Forum: Mathematics
Topic: "Late math"
Replies: 1
Views: 1208

Re: "Late math"

I'm sure there are quite a few more, but your mention of the Weaire-Phelan structure reminded me of:
by PM 2Ring
Mon May 25, 2015 11:11 am UTC
Forum: Mathematics
Topic: A game of dice patience
Replies: 6
Views: 2505

Re: A game of dice patience

TL; DR: The probability of winning in the original 6D6 game is a little over 0.52. The 1D1 and 2D2 games are trivial. 1D1 is an immediate win with probability 1, 2D2 is an immediate win with probability 0.5. The Markov chain analysis for 3 3-sided dice is easy enough to do. There are 3^3 = 27 possib...
by PM 2Ring
Sun May 24, 2015 6:35 am UTC
Forum: Mathematics
Topic: Can the arctangent series be derived without calculus?
Replies: 2
Views: 1418

Re: Can the arctangent series be derived without calculus?

I doubt it. I suspect that any such derivation would correspond to performing calculus by stealth, i.e., doing essentially the same things as what you'd do using calculus. Plenty of people before Leibniz and Newton played around with various infinite geometrical constructions and infinite series. As...
by PM 2Ring
Sat May 23, 2015 1:49 pm UTC
Forum: Fictional Science
Topic: fictional planetary system
Replies: 15
Views: 9610

Re: fictional planetary system

I'm trying to imagine a fictional planetary system with multiple life bearing planets and moons. Due to some constraints travel and communication between these planets would only be possible when the planets are closest to each other. [...] What I'm thinking of is a system where one planet has inte...
by PM 2Ring
Sat May 23, 2015 10:02 am UTC
Forum: Science
Topic: Miscellaneous Science Questions
Replies: 2870
Views: 647615

Re: RELATIVITY QUESTIONS! (and other common queries)

Not relativity question, but not big enough for a new thread: Am I right in thinking that spin doesn't change through an interaction? I can't really find anything to explain this or give an answer either way. I know that spin behaves in a few ways like a quantum analog to angular momentum, and I kn...
by PM 2Ring
Fri May 22, 2015 6:18 am UTC
Forum: The Help Desk
Topic: Windows 7 starting to run crappy.
Replies: 11
Views: 5044

Re: Windows 7 starting to run crappy.

I guess it's a little late now, but for future reference adwcleaner may be able to find & remove stuff that MBAM misses.
by PM 2Ring
Thu May 21, 2015 11:24 am UTC
Forum: Science
Topic: Miscellaneous Science Questions
Replies: 2870
Views: 647615

Re: RELATIVITY QUESTIONS! (and other common queries)

In SR, all observers agree on the spacetime interval between events, s^2=(Δx)^2+(Δy)^2+(Δz)^2-(cΔt)^2. What they may disagree on is how much of that separation is spacelike, Δ r = sqrt((Δx)^2+(Δy)^2+(Δz)^2), and how much is timelike, Δt. But if s^2 is positive, all observers agree that it's positiv...
by PM 2Ring
Thu May 14, 2015 1:06 pm UTC
Forum: Individual XKCD Comic Threads
Topic: 1524: "Dimensions"
Replies: 79
Views: 12865

Re: 1524: "Dimensions"

(Veering off-topic) Several years ago I tried "inventing" a variant on noughts-and-crosses, played in four dimensions. From (hazy) memory it had a 3x3 grid of the usual 3x3 grid, so "lines" could be completed horizontally, vertically or diagonally on a single grid, by using the ...
by PM 2Ring
Tue May 12, 2015 5:01 am UTC
Forum: Science
Topic: Equilibrium and Thermodynamics
Replies: 3
Views: 1615

Re: Equilibrium and Thermodynamics

Firstly, the Maxwell-Boltzmann distribution doesn't apply to a liquid. It describes the energy distribution in an ideal gas where the gas particles do not interact with each other, apart from transferring kinetic energy via collision. But it doesn't work so well when the particles have other interac...
by PM 2Ring
Fri May 08, 2015 5:49 am UTC
Forum: General
Topic: Post your LEGO!
Replies: 19
Views: 7303

Re: Post your LEGO!

I don't have any real Lego, but I've created some basic virtual Lego bricks in POV-Ray. A single brick: http://i2.photobucket.com/albums/y43/PM2Ring/LegoG2_zps5def69d5.png A base plate with a few blocks: http://i2.photobucket.com/albums/y43/PM2Ring/LegoH0_zpsf5fb881e.png I suppose I should do more w...
by PM 2Ring
Fri May 08, 2015 5:36 am UTC
Forum: Fictional Science
Topic: Time Travel and the Anthropic Principle
Replies: 13
Views: 5600

Re: Time Travel and the Anthropic Principle

Please don't meddle with pi. FWIW, I've read a couple of stories that did that and it annoyed the hell out of me. As others have said, pi is defined in terms of an ideal Euclidean circle, so it's the same in any consistent conceivable universe, unless you can conceive of a consistent universe where...
by PM 2Ring
Thu May 07, 2015 1:46 pm UTC
Forum: Mathematics
Topic: Dice Probabilities in any order.
Replies: 7
Views: 1539

Re: Dice Probabilities in any order.

I guess you don't know about Stars and Bars.
by PM 2Ring
Thu May 07, 2015 1:35 pm UTC
Forum: Science
Topic: Why does light move at the speed it does?
Replies: 83
Views: 13159

Re: Why does light move at the speed it does?

I've heard that this "conversion rate" thing and the idea of tipping between dimensions is a heuristic. Is this description of simply tilting a bit into the time axis of a 4-D graph actually physically accurate? Well, all physics is models, so what does it even mean to ask "is it rea...
by PM 2Ring
Wed May 06, 2015 11:36 am UTC
Forum: Science
Topic: Why does light move at the speed it does?
Replies: 83
Views: 13159

Re: Why does light move at the speed it does?

Saying that moving c changes things is a bit misleading. Only dimensionless constants are meaningful when it comes to things like distinguishing between universes. This includes things like the ratio of the proton-electron masses, things like the fine structure constant or even any quantity express...
by PM 2Ring
Wed May 06, 2015 10:58 am UTC
Forum: Science
Topic: Universal Gravitational Constant Question
Replies: 15
Views: 2701

Re: Universal Gravitational Constant Question

It's complicated. They're certainly independent in Newton and cannot be proven not to be in SR. SR does distinguish between spacelike and timelike intervals which are separated by the lightcone but the angle of this cone (which depends solely on the speed of light) is arbitrary. Whilst geometricall...
by PM 2Ring
Wed May 06, 2015 10:45 am UTC
Forum: Science
Topic: Why does light move at the speed it does?
Replies: 83
Views: 13159

Re: Why does light move at the speed it does?

I was idly wondering today if there might be a relationship between the mass of the universe and C (nice if there was, since we could then calculate with certainty what that mass is). (BTW, lightspeed should be written with a small "c", but you can italicise it if you wish). The large-sca...

Go to advanced search