-
Posts
25528 -
Joined
-
Last visited
-
Days Won
133
Content Type
Profiles
Forums
Events
Everything posted by Strange
-
Python code to extract specific lines in a textfile
Strange replied to Jo27's topic in Computer Science
There is a neat program called re2c which generates C source code from regular expressions. For my example it produces this: Over 100 lines. But compilers make a very good job of case statements so it should be pretty efficient. -
The fact that fluorine is so reactive means that it forms very stable compunds so it would take more than a weak acid like carbonic to separate it from NaF.
-
The pension system is the biggest evil ever invented.
Strange replied to georgi_zlatev's topic in Other Sciences
Not really, but it sounds implausible. For example, the UK government has just introduced an "opt out" scheme for pensions; i.e. you will be automatically enrolled in a pensions scheme and you have to choose not to. Because there were too many people who, even if they new they should have a pension, hadn't bothered to arrange one. -
Yes. If expansion continues, the universe will continue to get cooler and less dense. Eventually it will be impossible for more stars to form and that will be Game Over. Hawking radiation is created (just) outside the event horizon and hence it can escape.
-
I'm not sure there is a single definition but NASA used the heliopause, I think: http://news.nationalgeographic.com/news/2013/13/130911-voyager-interstellar-solar-system-nasa-science-space/ The thing that will stop a black hole absorbing all the matter in the universe is simply that most of it is too far away (and getting further away because the universe is expanding). I still don;t see why you think there is a connection between black holes and the expanding universe. They have no more effect on that than any other object of the same mass. Well, they certainly don't have an infinite amount of matter. They may have the mass of a few hundred or even million suns. But definitely not infinite. The maths of GR predicts an infinite density at the centre. But that is generally thought to be because GR no longer applies under these extreme conditions. A quantum theory of gravity will probably give a different (better) description. For example, string theory predicts this: https://en.wikipedia.org/wiki/Fuzzball_%28string_theory%29 It doesn't go anywhere. The black hole has the mass of all the matter (and energy) it absorbs. I don't think many people think wormholes have any physical reality either. They are often talked about in popularizations because they are exciting concepts (even if they don't exist). I do not agree that they are a consequence of GR. "The theory of general relativity predicts that a sufficiently compact mass can deform spacetime to form a black hole.[2][3]" https://en.wikipedia.org/wiki/Black_hole Again, citation needed. This appears to be purely your interpretation. I have no idea what it is based on. It is not really clear what you are asking. But the CMB is homogeneous and isotropic, indicating that the universe is the same everywhere and has cooled by the same amount. I don't really know what stars have to do with it. But anyway, we can observe stars and galaxies billions of light years away. We don't need to leave the solar system to do that. Hawking radiation is created at (not within) the event horizon and can therefore escape.
-
I have never heard this before. Can you provide a reference to support/explain this? No. There is no reason to think that. It stays inside the black hole. In the classical (non-quantum) description all matter is compressed to infinite density at the central singularity, but it is generally agreed that that is not realistic. As far as is know, there is no such limit. They are, as you said at the start, a consequence of general relativity. So that seems the ideal thing to describe them. What would you suggest? The "logical" description is the mathematics of GR. (Unless you are using the popular definition of logic meanining "it must make sense to me".) From measuring the CMB, mainly. And, I suppose, the consistent observation of the distance vs red-shift relationship. We can observe stars without leaving the solar system, so I don't know why that is relevant. Incidentally, Voyager 1 left the solar system a couple of years ago.
-
It will only affect evolution if it matters. It only needs to provide a small benefit to cause a change in frequency (in the population) over several generations.
-
I don't know why you think this is relevant to the question of God, but it is wrong: https://en.wikipedia.org/wiki/Black_hole#History
-
It isn't at all obvious that fundamental particles have intelligence. Quite the reverse, in fact. Why does it require a God to start it? In the big bang model, time does not start. That doesn't make much sense in the big bang model; there is no "before". It is a bit like asking what is further north of the North Pole. It isn't expanding into anything. While that is true, it is also true of the invisible pink unicorns that live in the forest near here. As there is no evidence for either, I wouldn't waste any time on the question.
-
It is because there is natural variation in the colour among the population. Those with genes for the darker fur are more likely to survive and reproduce. So it isn't that the genes change to what is required, just that the proportion of the "good" genes gets increased by selection.
-
The pension system is the biggest evil ever invented.
Strange replied to georgi_zlatev's topic in Other Sciences
That is a good thing, then. And what about people who are not able, for whatever reason, to manage their money like that? Why? Some people might. Some people might be intimidated by the idea and either not do it or make a mess of it. Some people will just pay someone else to do it. From that will arise companies specialising in this service. (They will probably call themselves "pension companies".) These companies might, eventually, make agreements with employers to take money directly from employee salaries. Then in order to encourage this positive behaviour, the government will off take benefits to these "pension companies". And we are back where we are now. Do you have any evidence for that? And why is not having children irresponsible (in a world where overpopulation is a problem)? Do you have any evidence that is the case? -
Python code to extract specific lines in a textfile
Strange replied to Jo27's topic in Computer Science
OK. If you write the code to find all words with the 5 vowels in alphabetic order (and no other vowels) then I will compare it with this: '\<[^aeiou]*a[^aueio]*e[^aeiuo]*i[^aeiou]*o[^aeiou]*u[^aeiou]*\>' -
Python code to extract specific lines in a textfile
Strange replied to Jo27's topic in Computer Science
Only if you write your code as an NDFA. Which will be hard for anything except the most trivial examples. And then the code will be almost incomprehensible and unmaintainable. I thought anyone who understood programming would know this. But apparently not. -
You have been given several reasons why it makes no sense. For example... It doesn't say anything like that. Which is why it can't be compared to a white hole. The universe is, and always has been, completely full of matter distributed quite homogeneously. As almost everything you say is wrong and you provide no math or evidence to support it, I can't see things changing.
-
is very nonsense., but sorry.
-
Python code to extract specific lines in a textfile
Strange replied to Jo27's topic in Computer Science
I imagine that would be about the same performance, as I assume strstr is optimised to use a similar algorithm that a regex engine would for a single string. But now imagine that you need to search for 100 variations of your "some string". A regex will be much, much faster. Very funny. -
Python code to extract specific lines in a textfile
Strange replied to Jo27's topic in Computer Science
Speaking from both the development tools side and as a user, this is not always true. A regex can often be much more efficient than equivalent conditional code. You wonder why your program with GUI, progress bars, logs, etc. was so slow...? I don't think it is anything to do with regular expressions! And, apart from anything else, you replaced it with a program that did less work. So that might account for the performance difference. Also, did you compile the regex? Or maybe the .NET compiler just handles regular expressions very poorly. I don't know. But condemning regular expressions on the basis of a single example is ridiculous. -
Yes. The amount of matter in (and being absorbed by) black holes is minute on galactic scales, and insignificant on the scale of the universe. I don't see any connection. The universe is expanding because that is a natural consequence of the FLRW metric (which describes the universe). The rate of expansion is affected by the mass of the universe, but that is not changed by the presence or number of black holes. You will need to demonstrate that General Relativity is wrong, for one thing. There is also no need for matter to be created for the universe to expand. And the continuous cooling of the universe (as seen in the CMB, for example) shows that the amount of matter in the universe is constant. In fact, the continuous creation of matter was a last gasp attempt to rescue the steady state model - by providing a mechanism whereby galaxies could recede from one another, but there would always be new galaxies to replace them. This has been shown not to work (in various ways). No, it wasn't. It has nothing in common with a white hole. For one thing, a white hole is an objects that exists in space. The big bang was the expansion of space.
-
It definitely can't be a scientific theory. That needs to make testable (i.e. quantitative) predictions and therefore requires mathematics. In fact, to be a theory, those predictions have to have been tested, multiple times, and not shown to be wrong. There is no evidence of that happening. That is the usual way that black holes are formed. It has nothing to do with black holes exploding, not with white holes.
-
Python code to extract specific lines in a textfile
Strange replied to Jo27's topic in Computer Science
A serious answer to this is flexibility. We have assumed that the numeric entries all begin with a digit. But what if there are also negative numbers? Or if some of the numbers are written with no digits before the decimal point? Or there are spaces before the number? And the spaces could be tabs and/or other white space? Or there are blank lines to be skipped? Or there are comment lines to be ignored as well? As the solution becomes more complex (i.e. more realistic) then the conditional code becomes increasingly complex, while the RE approach remains the same. And for anything more complex than the initial example, a compiled RE will quickly become more efficient than the conditional code. -
How do you reduce voltage and make a current last longer?
Strange replied to MWresearch's topic in Engineering
A fuse will blow and simply stop the circuit working if the current exceeds some limit. A charge regulator will ensure that the battery is charged with constant voltage or constant current as required by the battery (or whatever charging curve it requires). It will also stop the charging process when the battery is fully charged to prevent damage. A fuse can't do any of those things. -
Well, the evidence proves you wrong, then. Gravity falls off with an inverse square law. So it never stops, just gets weaker and weaker. A singularity is where the curvature of space-time becomes infinite. It doesn't really have anything to do wormholes. It is also generally assumed to be because our theories no longer apply at that point, rather than representing a real thing. It doesn't change "where in time" you are (whatever that means. But it does change the (relative) rate at which time passes. The big bang was not a white hole and there is no reason to think that white holes exist. There is no known limit to the mass of black holes. I think you need to master the mathematics of general relativity before trying to come up with theories like this.
-
That is a fundamental part of the mathematics of relativity. No, it really isn't possible. "Your theory" seems to be just a slightly confused description of relativity.
-
The point is you don't have any detail at all. You certainly don't have a (scientific) theory. You just have a vague "what if".
-
Python code to extract specific lines in a textfile
Strange replied to Jo27's topic in Computer Science
Fiveworlds seems to swerve continuously between almost sensible posts and complete nonsense. I recommend people ignore everything he says, just to be on the safe side.