Skip to main content

Universe Expected To Decay Much Sooner Than Previously Thought

2 months ago
Dutch researchers have recalculated the timeline for cosmic decay via Hawking-like radiation and found that the universe may end much sooner than previously thought -- around 10^78 years, rather than 10^1100. Phys.Org reports: The research by black hole expert Heino Falcke, quantum physicist Michael Wondrak, and mathematician Walter van Suijlekom (all from Radboud University, Nijmegen, the Netherlands) is a follow-up to a 2023 paper by the same trio. In that paper, they showed that not only black holes, but also other objects such as neutron stars, can "evaporate" via a process akin to Hawking radiation. After that publication, the researchers received many questions from inside and outside the scientific community about how long the process would take. They have now answered this question in the new article. The researchers calculated that the end of the universe is about 10^78 years away, if only Hawking-like radiation is taken into account. This is the time it takes for white dwarf stars, the most persistent celestial bodies, to decay via Hawking-like radiation. Previous studies, which did not take this effect into account, put the lifetime of white dwarfs at 10^1100 years. Lead author Heino Falcke said, "So the ultimate end of the universe comes much sooner than expected, but fortunately it still takes a very long time." The findings have been published in the Journal of Cosmology and Astroparticle Physics.

Read more of this story at Slashdot.

BeauHD

CodeSOD: Exactly a Date

2 months ago

Alexandar sends us some C# date handling code. The best thing one can say is that they didn't reinvent any wheels, but that might be worse, because they used the existing wheels to drive right off a cliff.

try { var date = DateTime.ParseExact(member.PubDate.ToString(), "M/d/yyyy h:mm:ss tt", null); objCustomResult.PublishedDate = date; } catch (Exception datEx) { }

member.PubDate is a Nullable<DateTime>. So its ToString will return one of two things. If there is a value there, it'll return the DateTimes value. If it's null, it'll just return an empty string. Attempting to parse the empty string will throw an exception, which we helpfully swallow, do nothing about, and leave objCustomResult.PublishedDate in whatever state it was in- I'm going to guess null, but I have no idea.

Part of this WTF is that they break the advantages of using nullable types- the entire point is to be able to handle null values without having to worry about exceptions getting tossed around. But that's just a small part.

The real WTF is taking a DateTime value, turning it into a string, only to parse it back out. But because this is in .NET, it's more subtle than just the generation of useless strings, because member.PubDate.ToString()'s return value may change depending on your culture info settings.

Which sure, this is almost certainly server-side code running on a single server with a well known locale configured. So this probably won't ever blow up on them, but it's 100% the kind of thing everyone thinks is fine until the day it's not.

The punchline is that ToString allows you to specify the format you want the date formatted in, which means they could have written this:

var date = DateTime.ParseExact(member.PubDate.ToString("M/d/yyyy h:mm:ss tt"), "M/d/yyyy h:mm:ss tt", null);

But if they did that, I suppose that would have possibly tickled their little grey cells and made them realize how stupid this entire block of code was?

[Advertisement] Utilize BuildMaster to release your software with confidence, at the pace your business demands. Download today!
Remy Porter