# Wait... what?

• Found in legacy code.

``````#define gdrv30sec    29700 // millseconds
``````

I don't even... how did they get that?

• It's a typo, it should be `grdb30sec`, which stands for "god d*** right before 30 seconds".

• It's a typo, it should be `grdb30sec`, which stands for "god d*** right before 30 seconds).

Seems plausible.

• maybe they have 300ms overhead and that's the appropraite delay to space something out every 30 seconds with a 300ms overhead?

• maybe they have 300ms overhead

This.

We have code in our codebase akin to:

``````while (true){
time_start = now();
dostuff();
domorestuff();
sleep_until(time_start+1000/*ms*/);
}
``````

to do this sort of thing.

• sleep_until(time_start+1000/ms/);

Will it blow up if that's in the past or does it just keep going?

• Nope, no 300ms overhead. It's in the vehicle system simulation code, so its run every 16ms, give or take a handful of milliseconds.

I've only found one spot that uses it, though, and it's supposed to be dealing with 'average velocity over 30 seconds', but it doesn't actually track velocity. instead we track if the velocity has been over n kph for gdrv30sec or more. I guess your pretty safe in assuming that the average over the last 30 seconds has been more than n kph if you've been over n kph for 29.7 seconds.

A comment on why it wasn't 30000 would have been nice. At least they were nice enough to state the units.

• Will it blow up if that's in the past or does it just keep going?

If it's in the past, it's effectively a `NOP` and breezes through. But if you're at the point where the loop is taking longer than the length of time you're expecting one iteration to take, you have larger problems....

• if you're at the point where the loop is taking longer than the length of time you're expecting one iteration to take, you have larger problems....

If you have hard real-time requirements, sure but if it's only occasionally late or whoever picked the delay didn't actually profile and it always takes 1200ms or something, you might be OK. Or you just have to wait for Moore's law to catch up.

• 29.97 was the standard "30 FPS" FPS in North America, after black-and-white TV but before HD.

Maybe they were going for that and typoed.

• how did they get that?

By using an embedded system with no filesystem whose "millisecond" timer actually runs at 990Hz?

• 29.97 was the standard "30 FPS" FPS in North America, after black-and-white TV but before HD.

Maybe they were going for that and typoed.

The word (cuss-word?) you're looking for is "NTSC" (yes, I know that's not a word, but you know what I mean, right?), aka Never Twice the Same Color. Normal NTSC is notionally 60 fields per second where two consecutive interleaved fields make a full frame, for a notional 30 frames-per-second (beware of "fps" when talking about NTSC and PAL SD television, because it could stand for "fields per second"), but the fields-per-second is slightly slower giving 29.97 frames-per-second, as you say.

Normal 625-line PAL is exactly 50 fields-per-second, and in order to get clean encoding of normal films (24 frames-per-second), films on PAL VHS (and DVDs, perhaps) are encoded at PAL speed with one film-frame per PAL-frame, and the sound compressed to accommodate the increased speed (+4.1666... %). That causes the music to sound sharp by about two-thirds of a semitone if you don't apply a frequency correction...

• The word (cuss-word?) you're looking for is "NTSC" (yes, I know that's not a word, but you know what I mean, right?), aka Never Twice the Same Color.

I typed exactly what I wanted to type. Note it did not contain two parentheticals in one sentence.

• Note it did not contain two parentheticals in one sentence.

I don't (always) type parenthetical remarks (but when i do (they are always (nested to (ridiculous (degrees)))))

• I don't (alwayth) type parenthetical remarkth (but when i do (they are always (nethted to (ridiculousth (degreeth)))))

LTFY

Lisped that for you

• Lisped that for you

<abbr title="..."> is a thing round here...

• I knew there was something like that but couldn't find a mention in the FAQs. Without knowing the name of the tag, it's hard to look it up, so all I found was that <aside> wasn't what I was looking for

• <abbr title="..."> is a thing round here...

That needs to respond to click for mobile users.

• That needs to respond to click for mobile users.

Not sure how to get it to do that...

``````/* Show abbr contents on mobile */
abbr[title]:after
{
content: " [" attr(title) "]";
}
``````

• that would work for me.

• Seems to be the coveted "only response on the Google first page that works"1, for search term "abbr tag mobile"

YMMV, all links guaranteed wrong or your money back, etc etc etc.

And besides, can you even inject custom JavaScript with the /admin toolkit anyway?

1OK, OK, so the actual first link is the CSS :after rule you're using currently. This is the only other link on the first page that seems to match what we want, and it's the only one that isn't inserting a psuedo-element inline.

• abbr tag mobile

[abbr title mobile] gave me this as the second link: http://aurelio.audero.it/blog/2013/12/23/enhancing-the-abbr-element-on-mobile/ which is what I used as a reference.

(First was Bootstrap)

• Yeah, your link is what I'm referencing in my (possibly Hanzo'd) footnote that I edited in. I think it's probably better than the JS hack (that, at least in the reference code, relies on agent detection, which is apparently a NO NO these days...)

• I think it's probably better than the JS hack

Less likely to go wrong...

• What, giving us'all a potential XSS injection vector via JS alerting the contents of an abbr title might be a problem?

• What, giving us'all a potential XSS injection vector via JS alerting the contents of an abbr title might be a problem?

.... i'd personally be happier if those badges don't have to be handed out again....

• <abbr title="..."> is a thing round here...

I was wondering how people were doing that.

• View raw?

• Too lazy.

• It would be nice if there was a way to get to raw without manually changing the URL. Guess that's not happening without writing a plugin though

• or one could always use @onyx's userscripts.... someone had a link to them in their usercard for a while. I thought it was @aliceif but either she's removed the link or my memory id playing tricks on me (again)

• Too bad there's not an option to make it work for tablets in Desktop mode.

• Too bad there's not an option to make it work for tablets in Desktop mode.

hmmmm

``````jQuery.on("click", "abbr", function(){
var abbr = jQuery(this);
var txt = abbr.text();
if (abbr.data('showAbbr'){
abbr.text(abbr.attr('title'));
abbr.attr('title', text);
abbr.data('showAbbr', false);
} else {
abbr.text(abbr.attr('title'));
abbr.attr('title', text);
abbr.data('showAbbr', false);
}
});
``````

would something like that work?

@PJH would have to figure out how to get it into the site footer somehow but i think that would work.

NOTA BENE: i haven't tested that at all. just whipped it together from the jquery docs (and verified that jquery is loaded for discourse)

• I'm sure if I wasn't laying in bed thanks to whatever I have, but was instead at work and bored, I would've tried whipping something up to see if it could work.

Maybe it should become a Discourse plugin <that they can break at random or break and never bother to fix>.

• ``````jQuery.on("click", "abbr", function(){
var abbr = jQuery(this),
txt = abbr.text();
abbr.text(abbr.attr('title'));
abbr.attr('title', txt);
});
``````

Simplified. this should work just as well. swapps text and title text every click.

won't preserve any nested tags of course, but not bad for just pulling something out of my sit-upon

• Or you could just quote to see the raw

• Not as fun on iPad when this is what happens:

Then click into the editor (or the full quote button, which gives the editor focus):

Dumps you at the bottom of the page (and if you weren't already at the end of the thread, you're stuck in a loop of the posts loading then the editor jumping to the bottom). Also, trying to upload images on an iPad is frustrating unless you know to tap in the white space on the box before clicking the "choose file" button.

• jQuery.on("click", "abbr", function(){
var abbr = jQuery(this);
var txt = abbr.text();
if (abbr.data('showAbbr'){
abbr.text(abbr.attr('title'));
abbr.attr('title', text);
abbr.data('showAbbr', false);
} else {
abbr.text(abbr.attr('title'));
abbr.attr('title', text);
abbr.data('showAbbr', false);
}
});

No, because you've declared `txt` but used `text` ;P

But if you fixed that it would work. It would always skip the redundant else-block*, but it would work (if my mental VM isn't failing me)

*Until someone outside set abbr.data('showAbbr') to something truthy, under which case case the else-block would run and set abbr.data('showAbbr') back to false.

Filed under: reading too much into this

• beware of "fps" when talking about NTSC and PAL SD television, because it could stand for "fields per second"

Or if there's a chance someone still works with actual film, where it might stand for "feet per second".

• I'm sure if I wasn't laying in bed thanks to whatever I have, but was instead at work and bored, I would've tried whipping something up to see if it could work.

Maybe it should become a Discourse plugin plague.

That's how I read it the first time, and was like "WUT?"

my memory id playing tricks on me (again)

You're not alone - my ID is doing that too, apparently.

• How about making film with one field per frame per foot?

• This is really a browser problem. Ask Google and Apple to add it as a feature and they should have it by the next version.

Bwahaha sorry I was just joking, they'd never pay attention to a puny mortal like us. Javascript workarounds for everyone.

• How about making film with one field per frame per foot?

Film doesn't have fields, so that would be hard to do

• The film could encode data other than just images. For example, you could use colors to represent different values of bytes.

• The film could encode data other than just images. For example, you could use colors to represent different values of bytes.

"Dwarf Fortress: The Movie"?

• see my slightly later respoinse where i just do:

``````jQuery.on("click", "abbr", function(){
var abbr = jQuery(this),
txt = abbr.text();
abbr.text(abbr.attr('title'));
abbr.attr('title', txt);
});
``````

• "Dwarf Fortress: The Movie"?

This time, it's personal!

• I thought it was @aliceif but either she's removed the link or my memory id playing tricks on me (again)

The latter.

• The latter.

it does that a lot it seems.

apologies for the incorrect summons.

• Since * got WONTFIX because there's workaround in form of `___\*___`, I can see `<abbr>` on mobile getting WONTFIX because there's workaround in form of `hack URL in order to switch to raw view`.

Too lazy to fix cut out text.

Looks like your connection to What the Daily WTF? was lost, please wait while we try to reconnect.