Ten years ago I found a comment in Excel's code base preceding a function over 1000 lines long that seemed to be parsing dates:
// I just cleaned up the code. I have no idea what this fn does. Here is
// what the comment said earlier for your reference!
// --> BUG!! - this code is a crime against nature and has absolutely no
// --> redeeming value (other than the amazing fact that it works)
Amazon Prime web player uses it but does not force keyboard focus on the place where it can detect it, so many times you have to click first before it will pause on space bar.
Focus handling is generally terrible in web apps, but few instances infuriate me like this one.
Space bar handling in media players is a particularly hard problem because space bar is also the key that users expect to trigger the currently focused button. Some users rely entirely on keyboard focus.
So it starts to intersect with some non-obvious accessibility issues.
This is true as an explanation why it happens. I would expect the focused control to be visible and obviously marked (highlight, rectangle, etc). When all that's visible on the screen is the movie, or when the last thing you did was hit something to play the movie, the app should switch focus to whatever control needs to have it for space to play/pause. This is already a solved problem, many console video players do this, Netflix does it, etc. It drives me nuts that something so trivial in an area of an app that is (comparatively) so simple, remains broken for so long. It is not really important, but it destroys the potential for the app to feel natural and (in Apple parlance) beautiful to use.
Disney Plus doesn't either, most annoying thing ever. Has me wondering why there's no open source 'streaming website' the only value add is the content.
Roughly equivalent: why do people shop at Whole Foods when they can get the same food cheaper at a farmer’s market? The produce is washed, curated for imperfections, and marked up.
These streaming platforms are not perfect as no product since Unix has been, but to think altruistic programmers working for free can do an equivalent job is hubris. These interfaces take years of iteration and optimization in subtle ways like Netflix A/B testing thousands of generated cover photos.
I think you’re mistaken, YouTube (in all the forms I use it with a keyboard at least) supports spacebar as a pause key.
Your browser might try to pop you down half a page if the thing that is selected or highlighted on the page is not the video player itself though. But it works 100% of the time in fullscreen.
YouTube's keyboard handling is Insanely Intuitive™, I must absolutely agree.
Usefully, the up/down keys don't change the volume unless the player is also focused.
What's incredibly sad is that j/k/l were agreed upon to rewind/pause/forward the video, and these generally work unless you're in a textbox... but dedicated keys were not similarly approved to control the volume.
YouTube Music (https://music.youtube.com/)... which uses a different set of fundamental keyboard shortcuts to YouTube. [;]=pause, [j]=next, [k]=prev, [l]=forward, [h]=rewind.
There are two disasters here.
The first is that <YouTube/pause> == <YouTube Music/rewind to beginning>. "Nooooo! I was 2 hours?? and how many seconds??? into this video... >.<". Naturally, in this situation, I ReWoUnD ThE ViDeO To ThE BeGiNnInG MySeLf, so YouTube's "last play position" indicator can't help me here. YAYYY.
The second disaster is that it's obvious a Vim user clearly argued successfully for Music to use Vi-style hjkl, but both the key choices and how they are presented in the UI could not be less intuitive, regardless of whether the user also uses Vim or not.
I copied above exactly how the UI (in the [?] popup) lists the sequence. Specifically, the whole thing is shifted left by 1 position, wrapping [h] around to the right. Fixing that to show the sequence how a Vim user would expect, it looks like: [h]=rewind, [j]=next, [k]=prev, [l]=forward.
But then, any Vim user is going to be utterly confused by this sequence, not only because of the mild readjustment of assigning up/down to prev/next and left/right to seeking - but because Vim "up" [j] is assigned to "next", and Vim "down" [k] is assigned to "prev".
Upside down playlist much?!?!
I no longer use YouTube Music, solely because of the number of long videos I have rewound and lost my position in.
I'm also incidentally trying to passively commit hjkl to memory (you know, the whole spaced repetition thing), and all the above was just too confusing.
Not sure if whether it is intended, or a weird combination of my browser and extensions, but right now, if I click on the play/pause button on Youtube video page, it becomes focused (with a visual clue of a blue box), and then pressing space bar starts and stops (or stops and starts) the video in rapid succession because it is considered a keyboard command and a button activation at the same time.
Actually, not quite at the same time, and that returns us to the old question of viability of reinventing GUIs in Javascript. I guess that even around 1990 window messages of some kind appearing with such a delay from a single action would mean the GUI is based on wrong principles, or the programmer doesn't know how to use it.
It's even funnier to imagine what happens when you press and hold space. The button icon is mostly in in-between animation state from all the repeated presses, but the video starts or stops only on first press and on release. Guess how much fun people have programming window system inside a virtual machine inside a browser using window system inside real machine.
Edit: I've wondered whether the Dance Dance Revolution on-screen arrow order https://en.wikipedia.org/wiki/Dance_Dance_Revolution#/media/..., which I also have deep in my muscle memory, is somehow also related to the hjkl arrows (as it also goes ← ↓ ↑ → horizontally).
Wait, a mouse driven application is using the right hand keys for shortcuts? Yes, that sounds very handy for a left hand mouse user.
I prefer to be able to set my keys myself. I use the left hand WASD keys together with ctrl+shift for most things so I can control the music in any application (with winamp). No need to find buttons, the hand is already there even if I'm using the mouse with the right hand.
Youtube itself changed the space bar behavior from context specific (pause if player in focus, scroll of comment in focus) but they rolled that back so space is always pause.
I like the context sensitive behavior and wrote a grease mo key script to restore it.
Run into a strange behavior though. When I pause the video with the mouse (and consequently, leave the pointer above the play button), and later try to continue the play with space, it will double-press the play button and pause the video again.
The play button is focused, and pressing Space activates a button. So it resumes playback. Then the key handler kicks in, and recognises that Space should pause playback, so it does that.
(I don’t know which order the two things happen in, but clearly they should make sure both don’t happen.)
Thank you for pointing that out since it seems to explain why the space bar behaves erratically. I far prefer the space bar to hunting down the k-key when trying to relax.
Ahh, stack overflow. Hugely popular thread with a lot of engagement? Lets lock it. Wouldn’t want to encourage behavior that doesn’t match our narrow minded “vision” for the site. Still though, an improvement over the early years where they just outright deleted countless pages with countless contributions. In the end it’s their site and they can run it however they want, but it’s sad to see such massive potential squandered through a policy promoting deletionism. Hindsight is 20/20 though and it’s not like I’ve gone and coded a better one, so I should probably just delete this comment and move on.
I do like that they are focused on being a collaborative Q&A site, nothing more and nothing less. Some sites care so much about "engagement" that they try to be all things to all people and end up simply becoming yet another generic forum.
I have other issues with SO but having a USP and sticking with it isn't their problem, IMHO.
I do that too! I try to block all kinds of Related/Hot/Recommended stuff on websites. Those can be more distracting than real ads if you ask me. Most useful has been to block the end card recommendations after YouTube videos.
It's not always that simple. Half of the time when I run into errors, there's no one solution that either works or 100% applies to my case so it's a lot of trial and error. I'm also not the most skilled developer and manuals are often way too verbose and difficult to parse if they don't contain very clear examples.
Sometimes, we just need someone to help translate our needs into a different wording and everything clicks into place. I'm sure that this causes a lot of repeated questions, but that's why when someone links a relevant question, it might be enough to solve the issue.
I think a lot of people's frustration comes from questions where it's abundantly clear that the asker searched neither SO nor the web first.
It only takes a few dozens of "why is [insert programming language]'s {addition, multiplication, subtraction, division} broken?!?!" questions that are all pointed to What Every Programmer Should Know About Floating Point Numbers before you lose all faith in humanity and get cranky. It's quite understandable.
If you can take the time to make an SO account and write a title and question body, why not Google that title first?
Another class of almost offensive questions is exemplified by this question on the front page for me right now: https://stackoverflow.com/questions/64087844/programming-tiv... . The user states what he wants, then completely useless debugging information, then a wall of code that in no way complies with the SO guidelines of reducing your code to a minimal working example, and finally an all-caps expression of personal feelings. Come on – nobody would feel sorry for someone acting like this in the real world. There are a few basic rules for social interactions.
Or, even more annoyingly, when you Google something and the first result is the exact problem you have, with the answer being someone pointing out that the solution can easily be found by googling...
People like you seem to forget that not only the question-asker profits from an answer, but future people as wel...
YouTuber Barnacules, use to work for Microsoft and he did tell a story on his live stream about ridiculous comments MS developers use to put in their code, I am sure they still do
Looking it up, I still have no idea what it means. The best I can gather is its beautifully wholesome. Other sources say beauty, but it seems like such a specific word for a form of beauty.
Yes, it comes directly from the latin pulchritudo which my dictionary gives as "beauty, excellence" and which is quite common in Latin texts.
To me, pulchritude is such an ugly sounding word I can always remember the meaning as being the opposite of how it sounds.
(Funny enough, I was just looking up to see if there is a name for words that sound opposite to their meaning and found this [0] discussion on the English stack exchange, which gives pulchritude as its example!)
"Pulcritud" and "pulcro" are not everyday words in Spanish, but pretty frequent. Mostly used to describe something that has been cared for and set up in a deliberately clean and orderly way.
A guy with an unshaven face, wild hair, casual or wrinkled clothes, etc would never be described as "pulcro", even if they otherwise look very handsome, beautiful, or attractive.
Understandable. The meaning is easy to grasp intuitively if you've studied Latin for a semester or two and happen to know the word "pulchra." If not, I'm having trouble thinking of any cognates in English that are in any kind of common parlance.
Have never come across the word before either. Makes you think - did the person say the word to convey some kind of meaning? Or to sound super-smart to their peers?
It could just be that the developer’s native language happens to be English, reads books, and he/she used a familiar word without thinking twice about it. Because this is, in fact, a fairly common word.
I’ve read at least several hundred books in English, and probably hundreds of thousands of news stories and blog posts, and don’t recall encountering it before. It seems to appear mostly in searches for its definition and gre prep...
I’m not sure what you’re trying to say here; pulchritude twice as rare as disharmonious, which is relatively rare. It’s an order of magnitude rarer than effervescent, as an example, which is a word I would consider uncommon but in most people’s vocabularies. And given how much more common pulchritude is - surely physical beauty is one of the most common subjects in any language - while disharmony and effervescence are more complex and rarer in practice, I think it speaks to how little the word is used. Its synonym, beauty, is used 2000x as often.
Except that pulchritude beats disharmonious for over a hundred years. And even now, it’s half as common as disharmonious, which is a commonplace word. But if you think that a word like “disharmonious” is in any sense rare, then I don’t think I can convince you with data.
When compared to "harmony" usage of the other words is basically zero. Harmony is a common word, and it is the root which makes "disharmonious" easy to understand despite its extreme rarity.
Even "disharmony" is far more common than "disharmonious."
Disharmonious just seems common because it sounds similar to a word we're familiar with. Most times I can recall, a writer would craft a sentence using the word 'disharmony' instead, which is many times more common than either. What led you to pick disharmonious as a comparison point, anyway?
It is a pretty rare word to come across in modern writing.
"And a sea of pulchritudinous models would have served as a lesson on how not to choose words: the ugly pulchritude sounds like the opposite of what it means, and it is one of those words that no one ever uses unless they are trying to show off.” https://www.goodreads.com/work/quotes/40167209-the-sense-of-...
A Redditer notes that a similar word is common in Spanish. For speakers of Latin-derived languages (French, Spanish, and of course Italian), English vocabulary quizzes are generally a bit more easy because English took its literary words from old French and Latin. Thanks William The Conqueror for that.
That said, as a french speaker I would have had no idea what this word means if I did not took Latin in high-school.
I learned this word (actually, it was pulchritudinous) from the DOS game Hyperspeed last year when I streamed a blind playthrough of it. To date, this is only the second usage I have ever seen of it.
"pulcher" is a fairly elementary piece of Latin vocab. It's in Book I of the Cambridge Latin Course, for example. This is much the same in other courses. So anyone, Indian or not, who has done basic Latin in school is likely to have encountered it and hence be aware of "pulchritude".
One of the ugly hacks you do in SAP to make it work is reading/changing variables and structures inside the SAP standard code because there is no API exposing them.
It is blessed officially as doing a "dirty" assign.
If there's no API exposing them but there's a way to make use of the internals with a dirty assign then sounds like the internals are now part of the API.
The bug here is in media player to listen on key-up events.
Mouse-button-up makes sense because the user can move the mouse to
cancel the click. But key events should be on key-down and
that's how it is done most of the time. So if you use key-up you
run into these problems.
I like how keyup is less ambiguous: it avoids the question “what do I do if the user is holding the key down?”
I also like being able to hold the key down to cue up a command and then at the right time, pull my hand away to execute crisply. For video editing mainly.
I’m not saying keyup is the only answer. Just that there isn’t one obvious answer.
Because of the reported bug in this example (which I also encountered quite often):
- user hits ESCAPE
- my window gets key-down/ESCAPE and closes itself
- your window (which happens to be the next in the focus-order) gets key-up/ESCAPE and closes itself
> I also like being able to hold the key down to cue up a command and then at the right time, pull my hand away to execute crisply
Ok, but if your window wants to support this behavior (which is
not very common) you have to watch for key-up AND key-down like the
bug-report suggests.
That's your mouse button, not a keyboard key. Although modifier keys occasionally are used, what's important here is the state of those keys (ctrl for copy, shift/alt or whatever for shortcut); nothing happens when you release them.
You can do it with arrow keys, too. I remember doing this all the time back on Windows 3.1 and I'm sure it's still used now especially by people with disabilities.
Anyway, there's a way to fix this: send a reference to the key-down event when you send the key-up event. Then the receiving window can determine if it cares about it or not. If this is a security hole, send a reference to the window where the key-up event was sent instead.
Keydowns have the physical button analogue: when you press a physical button, it immediately closes the contact, it doesn't wait until you lift your finger again.
Not saying key down is better than key up, there are certainly arguments for both.
Your experience of physical buttons is limited. There are many sorts. To pick an apposite example: The "Pause" button on old tape players used to be press-and-release to change state. Because it was a direct mechanical linkage and not motorized on some players/recorders, this made it possible to perform quite accurate editing with very basic kit: pressing and releasing pause to pause, pressing it again and keeping it held down, and releasing exactly when one desires to un-pause.
Should they, in general? If you want to press a key combination, you never press the two keys at exactly the same time. So, if key events were on key-down, you would have to press modifiers before letters to type capital letters, use keyboard shortcuts, etc. I think that would be annoying and slow typists down.
It also rules out using bare modifier key presses as input methods, but that is less of an impact.
I've never seen a system where you can press modifiers _after_ letters, what are you using? Letters are definitely inserted on key down on all windows/linux/macos I've used
There is the case of a sustained key press, where holding down the key might be part of navigation and only on key-up is the navigation finished, is it possible on platforms like Windows to distinguish between the sustained key up vs a normal key up?
What is the best library to use these days for developing in Visual C++? I had to write some VCpp code a few days ago using the Winhttp api and it was a nightmare. I'm not sure if its because I've been spoiled rotten by python where you can do a get/post request with a few lines of code, and that this is just how CPP is, but most of the complications are to do with calling and using the (not very well) documented API itself. Is there usually a easier way to do this? I'm just doing simple post and get requests, and I couldn't even do a file upload post properly by passing the binary data in, had to convert to base64 text in the end for it to work.
Eh, I've seen similar stuff in the Linux/UNIX world. Whenever different software components interact there's a chance you need some stupid stuff to get them to play nice. As some issues get fixed over time, new ones arrive since something gets swapped out for the next big thing. The interaction of X, the display manager, logind and dbus on session start comes to mind. There's been stupid stuff in Xsession.d et al over the years while these evolved.
xscreensaver also comes to mind; Jamie likes to keep all the legacy crap in the source code for operating systems and X extensions long gone, including rants about how they're broken under certain conditions, even if the bug is long fixed, just in case someone wants to compile the current version on their 1996 HPUX workstation.
> If you add some obscure code such as below, to this or any other app, even if it has only the teeniest chance of being less blindingly obvious to someone else than it is to you at the time of writing, please please please add a fing comment.
This rings as true now as it did then and its my favorite comment so far out of this whole leak. I've reached a point where my comments are there to remind myself why I did a thing, because more often than not I'm the poor bastard who's stuck fixing what past me did, and past me was either a sadistic asshole or a blithering idiot.
I watched Adam13531 on Twitch a lot, and the way he comments is very extensive, but complete. Ever since I started doing the same. Quite helpful to yourself.
It was removed from Microsoft code too. This is an old snapshot of the code, almost two decades old.
Since the 2002 TWC initiative, anything from easter eggs to things like that are all very strongly banned, and actively get removed as they're discovered.
Afaik easter eggs got banned because MS wanted to gain certification for government/military use, and in order to get that, all functions/features must be documented and previously specified..
Not surprising. No fun is allowed anywhere anymore. just dull flat interfaces with grey and black colors. people can say what they want about windows xp and vista but they had soul. todays OSes are souless. Looking at you windows 10..
I dunno. I certainly keep my comments family-friendly and clear, but these comments resemble my own in their dry wit. I also use emojis as icons in internal tools, since they don't require finding images, but this had the side effect of people reporting "sad cat" errors and the like.
Indeed. One of the first things I did after adopting a package was remove a well understood and unnecessary exploitive. One person noticed and gave it the looking eyes emoji.