Pinball, mountain biking, ultimate, high performance computing, dad.
16 stories
·
0 followers

Probabilistic Uncertainty

4 Comments and 5 Shares
"One popular strategy is to enter an emotional spiral. Could that be the right approach? We contacted several researchers who are experts in emotional spirals to ask them, but none of them were in a state to speak with us."
Read the whole story
roblatham
15 days ago
reply
I feel like this is related to current events in a way I can't quite figure out...
Share this story
Delete
2 public comments
Covarr
15 days ago
reply
Make yourself a plate of wings. Decide after the outcome whether they were comfort wings or celebratory wings.
East Helena, MT
Groxx
16 days ago
reply
The Wagner Principle proves that every chance is 50/50: https://www.youtube.com/watch?v=lalvQQoFvBA
Silicon Valley, CA

The Moon Is Flipped Upside Down in the Southern Hemisphere

8 Comments and 17 Shares

How old were you when you learned that the Moon in the Southern Hemisphere is upside down? I was today years old…this is my head exploding —> %@*&!$. Ok, the Moon isn’t upside down (that’s Northern-ist) but its orientation changes depending on if you’re north or south of the equator.

Moon Flipped

“From our perspective, the Moon and the night sky is actually rotated 180 degrees compared to our Northern Hemispherical friends,” Jake Clark, an astronomer from the University of Southern Queensland in Australia, explained to ScienceAlert.

“In the south we see the Moon’s dark ‘Oceanus Procellarum’ sea in the south-east corner compared to in the north-west corner for a northern observer.”

But why does it look like this? Well, because physically, we’re actually upside down compared to someone standing in the opposite hemisphere.

That makes perfect sense & the explanation is quite simple but it’s still messing with my head. How did I not know this? Here’s how the Moon appears in the Northern Hemisphere (from Wikipedia):

Moon Flipped North

And here’s a photo from Brendan Keene in Australia:

Moon Flipped South

Tags: Earth   Moon   space
Read the whole story
roblatham
2188 days ago
reply
How have I never considered this before?
popular
2189 days ago
reply
Share this story
Delete
7 public comments
llucax
2187 days ago
reply
And how does it looks from the equator? Why people is always discriminating Ecuadorians?
Berlin
ScottInPDX
2187 days ago
I think that as you get closer to the equator, the moon takes a more elevated path across the sky. The farther north or south you travel, the lower in the sky the Moon is, since it orbits over the equator. I'm at about 45 degrees north, so there's always a "top" and "bottom" to the moon because it never goes right overhead. It moves sideways in an arc in the southern sky. At the equator, it still moves sideways, but goes directly overhead so there's no strong visual indication of what pole is top or bottom.
kazriko
2187 days ago
reply
This must be freaky if you're near the equator. The moon travels north and south as it goes around, so you might technically see it both ways different times of year.
Colorado Plateau
dukeofwulf
2189 days ago
reply
Explain that, Flat Earthers.
mareino
2189 days ago
reply
HOW FAST DO I HAVE TO FLY TO SEE IT FLIP
Washington, District of Columbia
ScottInPDX
2189 days ago
reply
Yep, I'm in this camp too. Today years old, just learning this incredibly obvious thing.
Portland, Oregon, USA, Earth
iwhitney
2191 days ago
reply
What? I was In Australia and I did not know this.
Minneapolis, MN
deezil
2191 days ago
reply
I TOO WAS TODAY YEARS OLD.
Shelbyville, Kentucky

How can I conditionally compile based on a preprocessor macro value, while ensuring that the macro is correctly spelled?

1 Share

Continuing on the extremely sporadic topic of stupid C preprocessor tricks.

It is common to have preprocessor macros that control compile-time behavior. C++11 has std::enable_if to conditionally remove functions and template specializations from consideration, and C++17 adds if constexpr to allow statements to removed conditionally. Removing variables is a bit trickier, though. You can probably manage it by wrapping the variable inside a class that itself uses std::enable_if, but that's even more clunky than std::enable_if already is.

Anyway, for whatever reason, you might want to use the preprocessor's #if directive to perform your tests. Maybe you are preprocessing something for a purpose other than compilation by a C or C++ compiler.

But you're also worried that somebody might misspell your symbol.

// The FEATURE_BLAH macro is defined either as 0 or 1

#if FEATURE_BLUH
... do stuff with feature Blah ...
#endif

Oops, they misspelled FEATURE_BLAH, but the preprocessor doesn't know that, so it happily says, "Nope, it's not defined, skip the body of the #if."

How do you catch this typo?

You can use your adversary's power against him.

Since undefined symbols are treated as having the value zero, you can use an expression that blows up if the value is zero.

// The FEATURE_BLAH macro is defined either as 1 (off) or 2 (on)

#define GET_NONZERO_VALUE(x) (0/(x) + (x))

#if GET_NONZERO_VALUE(FEATURE_BLAH) == 2
... do stuff with feature Blah ...
#endif

The GET_NONZERO_VALUE macro first tries to divide by its parameter. If the parameter is not defined or is defined with the value zero, then that results in a division by zero and you get a compiler error. If the parameter is defined with a nonzero value, then the result of 0/(x) is zero, and adding that to x yields x.

The last wrinkle is using the defined preprocessor pseudo-function to distinguish between an undefined macro and a defined macro whose value is zero.

// The FEATURE_BLAH macro is defined to 0 or 1
// The FEATURE_BLAH_OPTION macro is some value

#define GET_FEATURE_VALUE(x) (0/defined(FEATURE_##x) + (FEATURE_##x))

#if GET_FEATURE_VALUE(BLAH)
#if GET_FEATURE_VALUE(BLAH_OPTION) == 1
... do stuff with feature Blah and option 1...
#elif GET_FEATURE_VALUE(BLAH_OPTION) == 2
... do stuff with feature Blah and option 2...
#else
#error Unknown option for FEATURE_BLAH_OPTION.
#endif
#endif

If FEATURE_BLAH is not defined, then the defined(FEATURE_BLAH) will evaluate to zero, and then you get a divide by zero error in the preprocessor. If it is defined, then defined(FEATURE_BLAH) evaluates to 1, and the expression 0/1 + FEATURE_BLAH reduces to just FEATURE_BLAH.

This is an abuse of the preprocessor, but it may come in handy in a pinch.

Read the whole story
roblatham
2263 days ago
reply
Share this story
Delete

Grab For the Stars

1 Comment

Comic

Read the whole story
roblatham
2824 days ago
reply
It's still a punch in the gut.
Share this story
Delete

Photo

1 Comment and 12 Shares


Read the whole story
roblatham
2848 days ago
reply
popular
2848 days ago
reply
Share this story
Delete
1 public comment
fxer
2848 days ago
reply
"Forgive me, I must let out a German scream"

https://www.nbc.com/saturday-night-live/video/weekend-update-angela-merkel-on-donald-trump/3438960?snl=1
Bend, Oregon

My Priorities for the Next Four Years

4 Comments and 12 Shares

Like many, I was surprised and shocked by the election of Donald Trump as president. I believe his ideas, temperament, and inexperience represent a grave threat to our country and world. Suddenly, all the things I had planned to work on seemed trivial in comparison. Although Internet security and privacy are not the most important policy areas at risk, I believe he -- and, more importantly, his cabinet, administration, and Congress -- will have devastating effects in that area, both in the US and around the world.

The election was so close that I've come to see the result as a bad roll of the dice. A few minor tweaks here and there -- a more enthusiastic Sanders endorsement, one fewer of Comey's announcements, slightly less Russian involvement -- and the country would be preparing for a Clinton presidency and discussing a very different social narrative. That alternative narrative would stress business as usual, and continue to obscure the deep social problems in our society. Those problems won't go away on their own, and in this alternative future they would continue to fester under the surface, getting steadily worse. This election exposed those problems for everyone to see.

I spent the last month both coming to terms with this reality, and thinking about the future. Here is my new agenda for the next four years:

One, fight the fights. There will be more government surveillance and more corporate surveillance. I expect legislative and judicial battles along several lines: a renewed call from the FBI for backdoors into encryption, more leeway for government hacking without a warrant, no controls on corporate surveillance, and more secret government demands for that corporate data. I expect other countries to follow our lead. (The UK is already more extreme than us.) And if there's a major terrorist attack under Trump's watch, it'll be open season on our liberties. We may lose a lot of these battles, but we need to lose as few as possible and as little of our existing liberties as possible.

Two, prepare for those fights. Much of the next four years will be reactive, but we can prepare somewhat. The more we can convince corporate America to delete their saved archives of surveillance data and to store only what they need for as long as they need it, the safer we'll all be. We need to convince Internet giants like Google and Facebook to change their business models away from surveillance capitalism. It's a hard sell, but maybe we can nibble around the edges. Similarly, we need to keep pushing the truism that privacy and security are not antagonistic, but rather are essential for each other.

Three, lay the groundwork for a better future. No matter how bad the next four years get, I don't believe that a Trump administration will permanently end privacy, freedom, and liberty in the US. I don't believe that it portends a radical change in our democracy. (Or if it does, we have bigger problems than a free and secure Internet.) It's true that some of Trump's institutional changes might take decades to undo. Even so, I am confident -- optimistic even -- that the US will eventually come around; and when that time comes, we need good ideas in place for people to come around to. This means proposals for non-surveillance-based Internet business models, research into effective law enforcement that preserves privacy, intelligent limits on how corporations can collect and exploit our data, and so on.

And four, continue to solve the actual problems. The serious security issues around cybercrime, cyber-espionage, cyberwar, the Internet of Things, algorithmic decision making, foreign interference in our elections, and so on aren't going to disappear for four years while we're busy fighting the excesses of Trump. We need to continue to work towards a more secure digital future. And to the extent that cybersecurity for our military networks and critical infrastructure allies with cybersecurity for everyone, we'll probably have an ally in Trump.

Those are my four areas. Under a Clinton administration, my list would have looked much the same. Trump's election just means the threats will be much greater, and the battles a lot harder to win. It's more than I can possibly do on my own, and I am therefore substantially increasing my annual philanthropy to support organizations like EPIC, EFF, ACLU, and Access Now in continuing their work in these areas.

My agenda is necessarily focused entirely on my particular areas of concern. The risks of a Trump presidency are far more pernicious, but this is where I have expertise and influence.

Right now, we have a defeated majority. Many are scared, and many are motivated -- and few of those are applying their motivation constructively. We need to harness that fear and energy to start fixing our society now, instead of waiting four or even eight years, at which point the problems would be worse and the solutions more extreme. I am choosing to proceed as if this were cowpox, not smallpox: fighting the more benign disease today will be much easier than subjecting ourselves to its more virulent form in the future. It's going to be hard keeping the intensity up for the next four years, but we need to get to work. Let's use Trump's victory as the wake-up call and opportunity that it is.

Read the whole story
roblatham
2896 days ago
reply
"cowpox, not smallpox"
popular
2896 days ago
reply
Share this story
Delete
3 public comments
cdupree
2888 days ago
reply
Excellent points on how to survive and resist.
San Francisco Bay Area
kazriko
2895 days ago
reply
I can get behind what he's saying here. Especially with his comment about how his list would be the same under a Clinton administration. These are things we should remember regardless of which authoritarian we have as figurehead.
Colorado Plateau
acdha
2896 days ago
reply
QFT: “Suddenly, all the things I had planned to work on seemed trivial in comparison”
Washington, DC
Next Page of Stories