TIL (about the Dark Arts of HTML)
-
@cartman82 And running your unit tests after every tiny change isn't?
-
@RaceProUK said in TIL (about the Dark Arts of HTML):
@cartman82 And running your unit tests after every tiny change isn't?
I think you misunderstand what @cartman82 means with TDD.
TDD means that you write a test/some tests that fails first (because of a bug you're going to fix or a feature that you're going to implement). You run the test(s) (and only that/those test(s)!) to verify failure. You fix the bug or implement the feature, running the test(s) almost every time you've changed, added or deleted a line to verify that what you thought you did is actually what you did.
When all the tests pass, you've successfully fixed the bug or implemented the new feature.
You can do something similar when refactoring: run the tests of the part you're refactoring after almost all code changes to see that you didn't change the functionality of the code.Running all the tests in the test suite is something you'd usually only do right before publishing a release, to test for regressions and to check you didn't inadvertently introduce any spooky interaction at a distance-like bugs.
When developing that way, 15 seconds to run a single test is a showstopper.
The screencasts of Destroy All Software (of Javascript WAT talk fame) are a very good and hands-on introduction to TDD, but alas they're not free.
-
@OffByOne said in TIL (about the Dark Arts of HTML):
You can do something similar when refactoring: run the tests of the part you're refactoring after almost all code changes to see that you didn't change the functionality of the code.
I tend to rely on this methodology during refactoring or performance work, cherry-picking key parts of tests to run after every change, and running the full suite over lunch or overnight - the full suite takes about 3 hours if the farm isn't busy, and longer if it is.
Unfortunately, we have never had significant coverage of small unit tests. We have larger component and full-chain tests, but those tend to take longer, especially in environment setup. Those tests do provide significant coverage, and the framework makes it easy to add new tests if new problematic situations pop up.
-
@PleegWat said:
I tend to rely on this methodology during refactoring or performance work
It's a vital technique for maintenance programming (i.e., bug fixing). Indeed, TDD is arguably taking what was good practice for bug fixing and applying it earlier in the development process.
-
@dkf Yeah, but not easily applicable in our case. All of those full-pipeline tests tend to work like 'here's some config, here's 2mb of input data, now check if the correct 2mb of output comes out'.
And I wouldn't know how to get started with true unit tests on this global-heavy chunk of C code. We've got the small CLI tools covered, but with all the stuff moving into the big daemons...
-
@PleegWat said in TIL (about the Dark Arts of HTML):
And I wouldn't know how to get started with true unit tests on this global-heavy chunk of C code. We've got the small CLI tools covered, but with all the stuff moving into the big daemons...
That's a problem. If you want to write good tests, the code you want to test needs to be written with easy testability in mind...
You could refactor the code for testability as you go, but without good tests to check if your refactoring doesn't break anything, that's kind of a circular problem.@RaceProUK: great work on the reply attribution! Lovin' it!
-
@PleegWat said:
And I wouldn't know how to get started with true unit tests on this global-heavy chunk of C code.
-
@OffByOne said in TIL (about the Dark Arts of HTML):
You could refactor the code for testability as you go, but without good tests to check if your refactoring doesn't break anything, that's kind of a circular problem.
Well, I guess I start on the parts that have little to no dependency on the global objects. I'm not sure, but a lot of the global-heavy parts should be mostly configuration parsing and business logic, and the latter of those is hard to test in isolation anyway.
What's been stopping me from even getting started is that currently all my tests are bash scripts. Under the current setup I'd have to create separate entry point binaries for all of my tests, which is tedious, so I mostly haven't done that.
Anyone got any good docs on how to setup unit tests in a c-on-linux environment? We're on handwritten makefiles. I'm unlikely to be able to get approval for non-trivial amounts of open source library.
-
TIL that though in a vacuum, the attenuation of an electromagnetic wave is proportional to distance2, in real environments that exponent is even larger, generally distance2.5, and can go up to distance6 ! And the exact value is impossible to predict and tends to change chaotically due to multipath interference (everything is causing reflections that all add up or subtract with each other).
This might explain why I have wifi reception on one end of my bed but not on the other one (seriously).
After reading about the numbers involved in radio transmissions, the idea that a tiny phone can reliably communicate with an antenna many km away just seems ridiculous.
-
https://www.youtube.com/watch?v=QvBmyw2wY44
TIL the early prototypes of Portal 2 didn't have portals at all. Instead they used a mysterious mechanic called "F-stop". The only thing we know about it is that everyone really liked it, especially Gabe Newell, and they "still might want to use it in a game some day".
Oh, Valve. You're such a tease.
-
@anonymous234 said in TIL (about the Dark Arts of HTML):
TIL the early prototypes of Portal 2 didn't have portals at all.
That's like making a film with no cars in it at all and calling it 'Cars'
-
@RaceProUK Apparently the general reaction to the game was "it's good, but why is it called Portal?".
They could have just changed the name. Something like "Valve Software presents: an all-new computer-powered interactive adventure through the wacky world of Aperture Science"
-
@cartman82 Unit tests are a standard project type in VS. No idea what you're smoking.
-
@Magus said in TIL (about the Dark Arts of HTML):
Unit tests are a standard project type in VS. No idea what you're smoking.
Find me a mocking library that works with UWP, then we can talk.
-
@cartman82 Oh I see, you're one of those. You could be right. I mean, you must have tried Fakes, since that's first party, before making this claim, so I don't really know. Mocks aren't that difficult, though...
-
I was wondering who here was familiar with the Greek text in my .sig... for those of you who aren't up their Classical literature (and I'll admit, I can't read Attic myself, and never finished any translations of Homer either), it's from The Odyssey: when Odysseus travels to Hades to consult with the shade of the prophet Tiresias about how to escape from Aeaea, he finds Elpenor, a young crewman who had gone missing at Circe's house the night before. Surprised to see the midshipman had died, he asked what had happened; Elpenor explained that "I came to this fate through bad luck and too much wine." It turns out that the night before, Elpenor got drunk, climbed up on the roof; the next morning he woke up, he slipped and fell to his death when he tried to climb back down. No one had seen this when it happened, and by the time they realized he was missing they were busy plotting.
He begged Odysseus to find his body and bury it (with the necessary obol in his mouth) so he can pay Charon; Odysseus said he would, and when he returns to the mortal lands has him buried with full honors before they make their getaway.
-
-
@r10pez10 said in TIL (about the Dark Arts of HTML):
I think you've just found a new interview question.
-
Where this notation goes wrong is 7 and 8 flip when you go to 10^2 and 10^3. Also it's impossible to represent numbers > 10^4-1
-
@JazzyJosh said in TIL (about the Dark Arts of HTML):
Also it's impossible to represent numbers > 10^4-1
Just use more than one character. It's base-10000. Also,
|
could be used for 0.
-
@JazzyJosh said in TIL (about the Dark Arts of HTML):
7 and 8 flip when you go to 10^2 and 10^3
Everything flips when you go to 10^2 and 10^3.
10^1 is horizontally mirrored from 10^0.
10^2 is vertically mirrored from 10^0.
10^3 is both horizontally and vertically mirrored from 10^0.
-
TIL Ambient is a genre of music and not just a descriptor.
-
@Yamikuronue said in TIL (about the Dark Arts of HTML):
TIL Ambient is a genre of music and not just a descriptor.
I read that as Ambien and thought of:
-
@anotherusername Yeah, but the others flip in a way that isn't ambiguous which number they represent.
-
@JazzyJosh said in TIL (about the Dark Arts of HTML):
ambiguous
Please explain the ambiguity, because I'm not seeing it. With what other numbers can they be confused?
-
@OffByOne said in TIL (about the Dark Arts of HTML):
When developing that way, 15 seconds to run a single test is a showstopper.
Correct me if I'm wrong but this is because the test runner is being run from VS. You won't be constantly changing the tests, right? If not, build the test runner whenever you do change it, and then run it from a desktop shortcut or whatever, when you need to do a test. It should take several seconds extra the first time you run it, like .Net apps frequently do, and after that, you should not have the startup lag.
-
@HardwareGeek 7 and 8 can be confused for one another when they are flipped. None of the other ones can be.
-
@JazzyJosh said in TIL (about the Dark Arts of HTML):
7 and 8 can be confused for one another when they are flipped
Only if you're already confused.
-
TIL 'coffea' doesn't taste that bad.
Coffea is what you get when you drop a fresh teabag into your general-purpose mug without checking that it was empty, and rather than empty it out and tacitly admit your mistake by going back to your desk for another teabag you just add hot water to the dregs of the coffee you had earlier.
I'm not saying I'd make it on purpose, even if no-one was around to witness, but it's a blandly pleasant savoury sort of taste.
-
@CarrieVS said in TIL (about the Dark Arts of HTML):
it's a blandly pleasant savoury sort of taste.
Your taste buds are dead. Seek help.
-
@Yamikuronue said in TIL (about the Dark Arts of HTML):
Your taste buds are dead. Seek help.
That's objectively untrue. I have evidence amassed over the years that my sense of taste is above average at least.
I would add that the mixture in this instance was almost a full mug of tea with about a centimetre of coffee, and I added a generous amount of milk. I was about to suggest that, in the spirit of enquiry, I try out different proportions, but I decided that knowing, in this case, is not worth the trouble.
-
TIL You Spin Me Round (Like a Record) was inspired by the Flight of The Valkyries.
-
TIL that one of my colleagues has adopted a rescue fox. She has a really good video of it, but it's not shared publicly so I'm stuck with reporting the fact here…
-
@dkf said in TIL (about the Dark Arts of HTML):
TIL that one of my colleagues has adopted a rescue fox. She has a really good video of it, but it's not shared publicly so I'm stuck with reporting the fact here…
Lounge! Lounge! Lounge!
-
TIL:
My favorite tweeter browser extension, "Tweet This Page", has been snuffed out like 2 years ago, after it was taken over by some kind of spammer.
Whether due to my ad blocker or lack of updates, I have zero problems with it. It still works as flawlessly as it always has, no banner adds popping up or anything.
I just went through the competition, and NOTHING is as good. Always some little thing missing.
Fuck... Adware or no adware, I think... I'll just keep using it?
"DIED FOR CONVENIENCE" will be my epitaph.
-
@cartman82 said in TIL (about the Dark Arts of HTML):
Lounge! Lounge! Lounge!
I can't. It's not that the video is anything that needs the Lounge, it's that she has never put the video online. I watched it on her laptop…
-
@dkf said in TIL (about the Dark Arts of HTML):
I can't. It's not that the video is anything that needs the Lounge, it's that she has never put the video online. I watched it on her laptop…
I mean, really, if you aren't even willing to sneak into her apartment while she's asleep, put some chloroform over her mouth and download the video from her laptop, how can this community ever trust you again?
-
@cartman82 said in TIL (about the Dark Arts of HTML):
I mean, really, if you aren't even willing to sneak into her apartment while she's asleep, put some chloroform over her mouth and download the video from her laptop, how can this community ever trust you again?
That sounds like serious effort. What do you take me for, a moderator?
-
@dkf said in TIL (about the Dark Arts of HTML):
That sounds like serious effort. What do you take me for, a moderator?
Really? That's it? You're just gonna leave us with cute fox blue balls like that?
You won't even wait for her after work, put on a ski mask, hold her up at knife point and steal her laptop, then secretly download the fox video as you run away, then leave the laptop with a local homeless junkie (ensuring he gets the blame), then later at work comfort her and help her get over her traumatic experience, and in general put moves on her, while secretly sharing her cute fox video in the lounge?
You monster.
-
TIL that @cartman82 either has way too much time on his hands or a very dark imagination.
Oh, who am I kidding, it's both.
-
@cartman82 said in TIL (about the Dark Arts of HTML):
cute fox blue balls
-
-
TIL Wikipedia has an article on Waking up early
-
@anonymous234 Related - Pre Industrial Revolution it's believed we used to sleep in 2 distinct blocks with an hour of waking overnight.
...adults typically slept in two distinct phases, bridged by an intervening period of wakefulness of approximately one hour. This time was used to pray and reflect, and to interpret dreams, which were more vivid at that hour than upon waking in the morning. This was also a favorite time for scholars and poets to write uninterrupted, whereas still others visited neighbors, engaged in sex, or committed petty crime.*
In his 1992 study, "In short photoperiods, human sleep is biphasic", Thomas Wehr had eight healthy men confined to a room for fourteen hours of darkness daily for a month. At first the participants slept for about eleven hours, presumably making up for their sleep debt. After this the subjects began to sleep much as people in pre-industrial times had. They would sleep for about four hours, wake up for two to three hours, then go back to bed for another four hours. They also took about two hours to fall asleep.
-
@Boner said in TIL (about the Dark Arts of HTML):
@anonymous234 Related - Pre Industrial Revolution it's believed we used to sleep in 2 distinct blocks with an hour of waking overnight.
whereas still others visited neighbors, engaged in sex
I hate it when I get visitors during sexy time.
-
@Jaloopa said in TIL (about the Dark Arts of HTML):
@cartman82 said in TIL (about the Dark Arts of HTML):
cute fox blue balls
.... DO NOT WANT!
-
@accalia said in TIL (about the Dark Arts of HTML):
@Jaloopa said in TIL (about the Dark Arts of HTML):
abstard
-
@ben_lubar The ladies will be all up ons.
-
-
I hate it when I get visitors during sexy time.
Try turning your headlights off.