Register a SA Forums Account here!
JOINING THE SA FORUMS WILL REMOVE THIS BIG AD, THE ANNOYING UNDERLINED ADS, AND STUPID INTERSTITIAL ADS!!!

You can: log in, read the tech support FAQ, or request your lost password. This dumb message (and those ads) will appear on every screen until you register! Get rid of this crap by registering your own SA Forums Account and joining roughly 150,000 Goons, for the one-time price of $9.95! We charge money because it costs us money per month for bills, and since we don't believe in showing ads to our users, we try to make the money back through forum registrations.
 
  • Post
  • Reply
Carbon dioxide
Oct 9, 2012



I had to write code to parse some input file the other day that contains durations, aka periods of time.

How do you write a period of 2 hours, 30 minutes and 5 seconds?
Something like 2:30:05 seems sensible, right? That's how times in racing sports are written, anyway.

That's what that input file used.

But nope, to remove ambiguity with clock times, ISO8601 has a completely different format for durations, which looks like 2H30M5S. That's fine and all but turns out the java time parsing library cannot deal with durations written as 2:30 and requires the 2H30 format. So I had to write my own parser for that.

Adbot
ADBOT LOVES YOU

Carbon dioxide
Oct 9, 2012



I mean yes that's basically what I did. I never said it was hard. Just annoying.

Carbon dioxide
Oct 9, 2012



Unperson_47 posted:

I wanna know the WORST way to store data in plaintext.

Real life thing I have dealt with:
Fixed width format with a documentation file that goes "parse chars 1 to 5 as the ID, parse chars 6 to 11 as the date, we have no idea what chars 12 to 35 do so ignore them, 36 - 45 is the description" and so on.
Tbf I heard the application that generates this stuff is a legacy 1980s thing.

Carbon dioxide
Oct 9, 2012



Platystemon posted:

Parsing the FAA’s wind forecasts:

Wind direction and speed get a four‐digit block.

The first two are magnetic azimuth, in tens of degrees. The latter two are speed in knots.

Wind ten degrees west of south at ninety‐nine knots would be 1999.

But wait! What if the wind speed crosses a hundred knots?

I’m glad you asked.

In that case, you subtract a hundred from the wind speed and add fifty to wind direction.

Let’s say the wind direction is still the same, and now it’s a hundred and sixty‐nine knots. Now it’s denoted with 6969.

Wind data can also be encountered six‐digit groups. Surely this must be giving three digits to each component, right?

Wrong. The wind digits are unchanged. Temperature just got appended to it. 696969 is wind ten degrees west of south, blowing a hundred and sixty‐nine knots, with ambient air temperature of sixty‐nine degrees Celsius.

Sixty‐nine degrees Celsius is an unreasonably high temperature. You’d never see it in a real forecast. Except you might, because negative sixty‐nine degrees can be seen at altitude.

That raises the question “how are negative and positive temperatures differentiated?”

Oh. That’s easy. Negative temperatures have a minus sign in front of them. So that 696969 should really be 6969-69.

…except when it isn’t, because the preface to the forecast informed you that all temperatures above FL240 were below zero so they would be omitting all the signs.



What a sensible system.

If there were any positive temperatures, they have plus signs, as seen below in the chart for Colorado and nearby states.



At least Celsius temperatures are unlikely to get lower than -100 or higher than 100, on Earth.

Carbon dioxide
Oct 9, 2012



Platystemon posted:

“We want a V‐shaped recovery.”

The monkey’s paw curls.

There's this new tv show called Snowpiercer.

The first season hasn't fully aired yet but basically, humanity hosed up, the earth froze over, and the only people left alive are those in a big-rear end train (called Snowpiercer) that continuously circles the world. It's year 7 since the train started.

The train is divided into classes with the richest in first class and so on, there's also an agricultural section so they have food, and all the way in the back there's a group of people who started out as stowaways. They're mostly left alone, live in extreme poverty, get scraps of food from the train staff, and the only reason the staff seems to keep them alive is in case they ever need them for tasks.

The train operators will do literally anything to 1. keep the "balance" (amount of food produced, amount of people on board) and 2. to keep the train running, because the train runs on handwavium such that even a tiny reduction in speed causes power outages all over the train. If they go too slow they would stall and everyone would die of the cold.

And because I'm apparently blind to such things, it took me a friend to point it out before I realized this is the most obvious metaphor for modern capitalism ever.

Carbon dioxide
Oct 9, 2012



Please measure me two whisks of whipped cream please.

Carbon dioxide
Oct 9, 2012



Where are you on this one?

Carbon dioxide
Oct 9, 2012



From the top of my head, the 1.4 figure is per square km.

Carbon dioxide
Oct 9, 2012



Sininu posted:

Fuuuck. I'm not a native speaker and now I'm concerned about how often I mess the adjective order up.

https://www.youtube.com/watch?v=50OXJ5AT3ms#t=8s

Carbon dioxide
Oct 9, 2012



A cunning linguist once explained to me that basically, there are two common ways to quickly figure out the "role" of a word in a sentence, like is it the direct object, indirect object, subject, so on.

The first way is by having a set order for these words in a sentence. The second way is to change the article based on what role a word takes.

So, according to them, that's the basic choice: do you only have people learn a single set of articles but make the word order inflexible, or do you make the word order flexible but have people learn a gazillion articles?

As for word gender, really the only advantage to that is that when you say something like "My book sits on the shelf and I like looking at it", in languages with gender, if 'book' happens to be feminine and 'shelf' happens to be masculine, you can say "My book sits on the shelf and I like looking at her" vs "My book sits on the shelf and I like looking at him", where the former means you like looking at the book and the latter means you like looking at the shelf, without ambiguity.

Carbon dioxide
Oct 9, 2012



Supposedly that rail map has all cities on it that have a subway system, with random lines drawn between them, and supposedly that's why Africa has less stuff - because it has less subway systems.

I have no idea if that's true though.

Carbon dioxide
Oct 9, 2012



vivat virtute posted:

Just Solve the Traveling Salesman Problem, idiots

The Vehicle Routing Problem is more appropriate here, that's a generalisation of the TSP but for n vehicles (or n salesmen I guess).

quote:

The vehicle routing problem (VRP) is a combinatorial optimization and integer programming problem which asks "What is the optimal set of routes for a fleet of vehicles to traverse in order to deliver to a given set of customers?"

Although the VRP often assumes all vehicles start from some central location, I don't know where that'd be in this case.

Carbon dioxide
Oct 9, 2012



Carbon dioxide
Oct 9, 2012



Those who've been with this thread from the beginning know I originally made it as a spin-off from the Politically Loaded Maps thread because we felt funny graphs deserved their own thread.

Politically Loaded Maps lives in the D&D subforum but really, it's kind of its own little subcommunity.

With all the stuff going on right now, the folks over there made their own Maps, Charts and Flags Discord, and I'd like to invite you all as well.

I consider it one of many lifeboats so we have a place to continue sharing stuff if SA goes down the drain entirely.

As I type this, the Discord is still very barebones but I understand the admin will clean it up and introduce channels and stuff when they have a bit of time later today.

https://discord.gg/ED8Fxg

Carbon dioxide
Oct 9, 2012



Hippie Hedgehog posted:

Invite seems to have expired already, care to post another?

https://discord.gg/XyqcYHe

Carbon dioxide
Oct 9, 2012



Adhemar posted:

Little known fact is there’s a small pile of those poopy bags deposited carefully next to the American flag on the moon. The flag is there so future astronauts won’t step on the poop.

Well that failed, Buzz Aldrin admitted a couple years ago that the flag actually toppled over from the blast of the moon lander taking off.

Carbon dioxide
Oct 9, 2012



TinTower posted:

https://twitter.com/stephenkb/statu...020535501332480

The replies to this are pretty interesting, being split mostly between limited nuclear exchange, solar flare knocking out the internet, or no-deal Brexit.

Trump showing what he can do in preparation for re-election.

Carbon dioxide
Oct 9, 2012



Inspector 34 posted:

Yeah that 2016 data is pretty damning, thanks Obama! Luckily we now have an administration that works for the people and holds corporations accountable for their fair share.

That's not the hint.

The hint is that around that time in France, they had a very effective solution to stop the unfair distribution of wealth.

It was known as the guillotine.

Carbon dioxide
Oct 9, 2012



Subjunctive posted:

How do you get lost in a labyrinth? Just keep walking.

Carbon dioxide
Oct 9, 2012



Carbon dioxide
Oct 9, 2012



Someone tell me what high schools do to people to make them think pH can't go negative. I've heard that myth quite often, it's really weird.

I think the same people believe it can't go over 14 either?

Carbon dioxide
Oct 9, 2012



I don't know if it's related, but in Dutch, constant complainers are sometimes referred to as "vinegar pissers".

Carbon dioxide
Oct 9, 2012



DarkHorse posted:

I think it's just the limitations of the typical definition of the pH calculation

log(x) is undefined or doesn't exist for x < 0, so it would be easy to think pH is as well since that function is used to calculate it (and it's unlikely anyone would have experience with superacids or bases to know better)

But that's not true at all.

The simplified version of the pH calculation is the negative of the base-10 log of the H+ concentration in moles per liter. I'll just write "log" for base-10 log from now on. If we take -log(0.1) for a 0.1 M concentration, we get pH of 1. If we put in the formula for a 1M concentration, it's -log(1) = 0. And if we take the formula for a 10M concentration, it's -log(10) = -1.

As you can see I get to zero and negative pHs without ever plugging in negatives in the log formula. You're swapping things around. It's not like you need to use a weird version of the formula for that, it works for the base formula. And it's not even that hard to get to these values with regular strong acids such as sulfuric or hydrochloric. Just get a big enough concentration and it will happen naturally. No weird superacids needed.

There is actually a hard limit, by the way: the amount of water molecules in a liter of water (at STP) is 55 mol. That means a concentration of > 55 M in water is literally impossible, by that time you would've replaced all the water molecules with the solvent (the real number would be a bit different because of density changes when you dissolve stuff but let's not make it too complicated here). That means the lowest possible pH using the standard formula would be -log(55) = -1.74 (at STP). If you see any number below that it can't possibly be an actual pH. It's probably the result of a specialized formula to compare superacids or something. And as you can get the pH of a basic solution by using the same formula for the OH- concentration and substracting that from 14, the upper limit for pH would be 14 - - 1.74 = 15.74 (at STP).


Edit: like the previous poster said, these numbers are only valid when we work in a watery solution. It's possible to have an acid/base balance in many other solvents but then things get complicated because your notion of "neutral" shifts. For instance, a "neutral" solution in ammonia as solvent is what we'd normally consider very basic, and would probably burn you if you stick your hand in it. One use for this shifted notion of neutral is that it gives you an experimental way to find out the acidity constants of strong acids and strong bases (that by definition all fully dissolve in water, so in water they're impossible to compare).

Carbon dioxide has a new favorite as of 12:12 on Aug 29, 2020

Carbon dioxide
Oct 9, 2012



Brunch?

Carbon dioxide
Oct 9, 2012



Similarly, lots of people don't seem aware that while in the US, CNN is reasonably leftist, CNN World / CNN Europe or whatever it's called tends to be much more neutral.

For charts like that you really need to add from what country you accessed some media, it may change things around quite a bit.

Carbon dioxide
Oct 9, 2012



Carbon dioxide
Oct 9, 2012



mobby_6kl posted:

How many holes does a Klein bottle have?

Oof.



What we think of as a Klein bottle, the glass bottles you can buy from Cliff Stoll, are just a three-dimensional projection of a four-dimensional structure. To make this work in 3D, you need to add this circled 'intersection'. If we analyze the 3D glass object as-is, including the intersection as intended part of the design, well you have the opening in the 'bottom', you can use to pour water in if you juggle it enough, but that's equivalent to the opening to the top of a vase so it's not a hole. Then there's the part where the 'neck' loops around to get to the intersection, and that looks equivalent to a donut hole to me. I'm not a topologist but I'd say the number of holes for the 3D projection of a Klein bottle is one.

To get a more correct answer you'd need to look at the actual 4D structure, in which a Klein bottle can exist without such an intersection. There's no way you can do that in just 3D.

And now we run into a problem. I have literally no idea how to even define a hole in 4D.

Usually to think about 4D, it's helpful to think about going from 2D to 3D first.

I'm not sure what a "hole" would be in 2D. What does it mean to go "through" a 2D object? I'm not sure. A flatlander could try to drill a hole through a square or something but he'd end up in cutting the square in half and that doesn't happen when you make a hole in something in 3D. You could take a circle and and cut out an inner circle or something, but that just feels like a 2D projection of a torus, and won't allow the flatlander to go through the circle and end up on the other side.
I don't think it is possible to have a hole in the topological sense in 2D.

So, holes cannot exist in 2D. There's a clear, single definition for a through-hole in 3D, in the topological sense.

... And I'm no closer to understanding 4D. If that trend continues there might be multiple valid ways to define topological holes in 4D. And since I don't know how to do that, I don't even know how to start answering the question of how many holes a true, 4D, Klein bottle has. But it was quite interesting to think the problem through up till this point.

Adbot
ADBOT LOVES YOU

Carbon dioxide
Oct 9, 2012



ultrafilter posted:

The math questions thread says that it has two. That's the 4-dimensional Klein bottle, mind you, and not the 3-dimensional representation you're used to seeing.

Did they give an explanation? And if so, do you have a link?

  • 1
  • 2
  • 3
  • 4
  • 5
  • Post
  • Reply