Best posts made by LB_
-
RE: Google wants to make e-mail more "interactive" - what could possibley go wrong?
I don't want the content of my emails to change, ever. That's what literally every other form of digital communication is for. Emails are for archival and "I'll get to it later" communication.
-
RE: ⏱ You know you've been spending too much time on TDWTF when...
You know you've been spending too much time on WTDWTF when the forum is taking a while to load so you open WTDWTF in another tab to kill time while WTDWTF loads in the background.
-
RE: What are the benefits/drawbacks of keeping all the code in one file?
Benefits: your office stays warm in the winter while the file is open in your IDE.
-
"I'm marinating a bitcoin in a Node.js brine"
Highlights from a public chat room, reposted with permission:
-
RE: WTF Bites
Steam temporarily had a bug where it discriminated against users with profiles names that were shorter than 3 characters:
If, like me, you had a profile name with less than 3 characters, you got it renamed to
< blank >
and the old name got added into your past name history, with no way to set it back to what it was. Then a couple hours later they fixed it and restored the profile names, but didn't remove the entry from the past name history. I didn't used to have a past name history, but now I do and the one name in it is the same as my current profile name, so I guess I'm just special now because it's not possible to do that normally to my knowledge. -
If you like your watch, you can keep your function watch() { [native code] }.
Apparently there is a messaging app called Voxer, and it has some weird issues, as a friend of mine recently discovered. It apparently replaces words that are names of methods on JavaScript objects with the actual methods themselves. Now, normally method names like toString and hasOwnProperty don't appear in normal conversation, but "watch" does...
Until now I hadn't even heard of this app, but I find it strange that it runs on a mobile phone and is somehow involving JavaScript. Maybe the developers need to learn the true function valueOf() {
[native code]
} code reviews... -
RE: WTF Bites
Twitch has had the ability to upload videos like YouTube for over a year now, and many people have been uploading to both platforms for various reasons. Twitch Uploads worked fine, you could set a video as private, public, or scheduled, and you could even type in the time down to the exact minute as opposed to YouTube's half-hour intervals. Everything worked fine, email notifications and notification bell messages for uploads worked, it was easy to upload videos, you only had to set information once, etc. Life was good.
So then today Twitch decided that it wasn't complicated and buggy enough.
https://blog.twitch.tv/new-video-producer-tools-available-today-947ee17c5a24
From now on, all videos you upload to Twitch have to be "premiered", which means that they are livestreamed as if you are streaming. ALL uploads, no exception. This in and of itself is annoying enough, especially for people reuploading from other platforms. But it gets worse.
You have to set the title, thumbnail, and description when you upload the video initially, and I also take note of the video URL for my spreadsheet. Then to "premiere" the video, you have to set the title, thumbnail, and description AGAIN, except this time the thumbnail MUST be a jpeg or it rejects it. You can only choose from half-hour increments, no immediate publish.
For the actual premiere, it defaults to inserting a 30 second countdown before the video. Then it literally streams the video. This means the video is encoded three times: once on your system, once when you upload it to Twitch, and then again when it streams for the Premiere. The reduction in quality is very noticeable compared to the original upload quality. Then when it's all said and done, it literally deletes the original upload, and the triple-encoded stream archive is all that remains, including the countdown at the start of the video. This also means that the URL I wrote down earlier is no longer valid and I now have a different URL to use.
Once the premiere has ended, you have to set the thumbnail again - yes, that's three times you have to set the thumbnail. In effect, the original title, description, and thumbnail you set when you first upload the video are completely irrelevant and never used or seen by anyone but you. Not sure how that got past testing.
Overall, it's a big mess. They also seem to have removed the "Send Feedback" link, at least I can't find it where it used to be.
-
RE: Firefox 41-50 is well and truly fucked
@Lorne-Kates said in Firefox 41-50 is well and truly fucked:
free-after-use bug
Do you mean use-after-free bug? Because otherwise that isn't a bug to free memory after you're done using it.
-
Windows 10 display arranging sucks, so I fixed it by setting the pixel positions manually
In Windows 10, the only way to arrange displays is with this user interface:
You click and drag and it snaps and shoves the displays around seemingly at random with no real intention of actually getting your displays aligned in any useful manner. As a result, you'll always have weird misalignments like this:
I did a lot of googling and I guess my google-fu is terrible because I could find maybe only a few people complaining about this and no solutions. Not even AMD's driver software would allow me to do anything about it, it just opens Windows 10's interface.So, I did what any programmer would do, and coded my own (lazy) solution:
#include <cassert> #include <Windows.h> int main() { DISPLAY_DEVICEW info0 {sizeof(DISPLAY_DEVICEW)}; DISPLAY_DEVICEW info1 {sizeof(DISPLAY_DEVICEW)}; DISPLAY_DEVICEW info2 {sizeof(DISPLAY_DEVICEW)}; DISPLAY_DEVICEW info3 {sizeof(DISPLAY_DEVICEW)}; { auto const result0 = EnumDisplayDevicesW(NULL, 0, &info0, EDD_GET_DEVICE_INTERFACE_NAME); assert(result0 != 0); auto const result1 = EnumDisplayDevicesW(NULL, 1, &info1, EDD_GET_DEVICE_INTERFACE_NAME); assert(result1 != 0); auto const result2 = EnumDisplayDevicesW(NULL, 2, &info2, EDD_GET_DEVICE_INTERFACE_NAME); assert(result2 != 0); auto const result3 = EnumDisplayDevicesW(NULL, 3, &info3, EDD_GET_DEVICE_INTERFACE_NAME); assert(result3 != 0); } DEVMODEW mode0 {{}, {}, {}, sizeof(DEVMODEW), 0}; DEVMODEW mode1 {{}, {}, {}, sizeof(DEVMODEW), 0}; DEVMODEW mode2 {{}, {}, {}, sizeof(DEVMODEW), 0}; DEVMODEW mode3 {{}, {}, {}, sizeof(DEVMODEW), 0}; { auto const result0 = EnumDisplaySettingsExW(info0.DeviceName, ENUM_CURRENT_SETTINGS, &mode0, EDS_RAWMODE); assert(result0 != 0); auto const result1 = EnumDisplaySettingsExW(info1.DeviceName, ENUM_CURRENT_SETTINGS, &mode1, EDS_RAWMODE); assert(result1 != 0); auto const result2 = EnumDisplaySettingsExW(info2.DeviceName, ENUM_CURRENT_SETTINGS, &mode2, EDS_RAWMODE); assert(result2 != 0); auto const result3 = EnumDisplaySettingsExW(info3.DeviceName, ENUM_CURRENT_SETTINGS, &mode3, EDS_RAWMODE); assert(result3 != 0); } mode0.dmFields = DM_POSITION; mode0.dmPosition.x = 0; mode0.dmPosition.y = 0; mode1.dmFields = DM_POSITION; mode1.dmPosition.x = 1920; mode1.dmPosition.y = 0; mode2.dmFields = DM_POSITION; mode2.dmPosition.x = 1920; mode2.dmPosition.y = -1080; mode3.dmFields = DM_POSITION; mode3.dmPosition.x = 0; mode3.dmPosition.y = -1080; { auto const result0 = ChangeDisplaySettingsExW(info0.DeviceName, &mode0, NULL, CDS_GLOBAL|CDS_UPDATEREGISTRY, NULL); assert(result0 == DISP_CHANGE_SUCCESSFUL); auto const result1 = ChangeDisplaySettingsExW(info1.DeviceName, &mode1, NULL, CDS_GLOBAL|CDS_UPDATEREGISTRY, NULL); assert(result1 == DISP_CHANGE_SUCCESSFUL); auto const result2 = ChangeDisplaySettingsExW(info2.DeviceName, &mode2, NULL, CDS_GLOBAL|CDS_UPDATEREGISTRY, NULL); assert(result2 == DISP_CHANGE_SUCCESSFUL); auto const result3 = ChangeDisplaySettingsExW(info3.DeviceName, &mode3, NULL, CDS_GLOBAL|CDS_UPDATEREGISTRY, NULL); assert(result3 == DISP_CHANGE_SUCCESSFUL); } return 0; }
I just stepped through in the debugger, figured out what values I needed to use, and then ran it to completion. After some display stuttering, success!
Pixel perfect alignment. Here's hoping this helps someone else...Documentation links (that might be invalid soon knowing Microsoft):
\https://docs.microsoft.com/en-us/windows/desktop/api/winuser/nf-winuser-enumdisplaydevicesw
\https://docs.microsoft.com/en-us/windows/desktop/api/wingdi/ns-wingdi-_display_devicew
\https://docs.microsoft.com/en-us/windows/desktop/api/winuser/nf-winuser-enumdisplaysettingsexw
\https://docs.microsoft.com/en-us/windows/desktop/api/wingdi/ns-wingdi-_devicemodew
\https://docs.microsoft.com/en-us/windows/desktop/api/winuser/nf-winuser-changedisplaysettingsexw -
Example username: team00
I just remembered an old story from a few years ago when I was in high school. In the computer science club, our coach would have us compete in competitive programming competitions (the kind with a written test and then a free response where you are given multiple problems that you have to write code for and then submit the code to an automated judge). These events were typically hosted by other high schools in their computer labs, and the setups varied from 'we have no idea how to run an event' to 'we only had a couple issues running the event this time'. Oh, and pretty much everyone uses Java, though some events let you pick a different language if you want for the free response section.
At one of these competitions, the info sheet telling us how to login wasn't personalized per each team - it just had the example username and password - team00 - and said to replace 00 with your team number. (Pretty typical login setup for these events). Well, it just so happened that the team I was on actually was team 0, so we logged in as team00 with password team00.
So we log in, start working on the dry-run problem and suddenly the IDE blurts out that the file has been changed elsewhere and prompts us to reload it. Doing so shows entirely different code. We start panicking as we have just lost the (insignificant) amount of code we had written and all the while it keeps asking us to reload the changes. Also, files and folders are appearing on the desktop and documents - folders that look like IDE projects...
As you probably guessed, multiple other teams had misread the instructions and logged in as team 0, and started modifying our files over the network - because apparently this site had network mapped user folders and allowed multiple simultaneous logins of the same user.
We let the event staff know of the issue and they had to get us a new unused team number and go around and find all the teams that logged in as team 0 to tell them off. It ended up cutting into our time and we never got to submit the dry run to the judge. Oh well, these are just high school kids claiming to be good with computers, what do you expect?
I don't remember anything else from that event, but I did learn two things: one, don't make the example login details actual login details, and two, high school students who are supposedly programmers can't even read an info sheet properly. I'm not sure how they expected to read the free response problem statements correctly, let alone the questions and answers of the multiple choice written portion.
-
RE: Frontpagify this code snippit and win a prize!
I haven't done this style of writing before, it feels really awkward.
Alice A. was hired on as a consultant for Winston & Turner Facilities to "smooth out" production issues. It sounded off, but she needed the money. W&TF provided various rentable facilities for various purposes, and it was important to be able to search for the kind of facility you needed near the place you needed it. It just so happened that that particular functionality was broken, and Alice's first task of the day was to fix it. She logged in, checked out the code, and ran the application. All the search result descriptions were correct, but the search result titles were duplicated in pairs of two.
"Hmm," she thought, running the SQL query. Nothing wrong there.
"Hmm", she thought, running the client side code that called the query. Nothing wrong there.
Then she noticed a warning being emitted from the area of the code she was investigating:
com/wtf/facilities/search.cpp:9042:32: warning: non-standard extension -fincrement-rvalue used
On a whim, Alice disabled the feature:
com/wtf/facilities/search.cpp:9042:32: error: lvalue required as increment operand for (int i=0; i < 2*limit; ++i++) { ^
"It's going to be a long week," she thought.
-
RE: Python 3 angst 2016 edition
Couldn't find a good thread to post this in so here have this:
New features planned for Python 4.0
With the release of Python 3.8 coming soon, the core development team has asked me to summarize our latest discussions on the new features planned for Python 4.0, codename "ouroboros: the snake will eat itself". This will be an exciting release and a significant milestone, many thanks to the hard work of over 100 contributors.
- After heated debate on the mailing list, the 79-character line limit prescribed by PEP8 will be updated. IDE users all over the world will now be able to take advantage of their 30" ultra-wide 4K monitors, as the recommended line length will be increased to 89.5 characters (this was a compromise with the 100-character lobby, the decision being to split the difference).
- All new libraries and standard lib modules must include the phrase "for humans" somewhere in their title.
- Finally, a new string-type for the masses, Python 4.0 will feature "
z
-strings": C-style NULL terminated bytestrings. Just prefix your string like so,z'my string'
and Python will automatically ensure it is NULL-terminated. Note: the newz
-strings cannot be used with any of the existing APIs that take string arguments - they must first be decoded to unicode strings or cast tobytes
. - Type-hinting has been extended to provide even fewer tangible benefits. This new and "nerfed" type hinting will be called type whispering.
- Fuck it we're going to just vendor libuv to provide the event loop for
Twistedasyncio. - You can now use the
async
keyword before every single other keyword in the Python language, and we encourage you toasync do so
. There's nothing wrong with cargo-culting some magic keywords all over the place -- you want to go fast, don't you? - In addition to
namedtuple
anddataclasses
(3.7), Python 4.0 will include several new thousand line decorator-hacks to implement simple struct types. - The GIL has been removed.
- Just kidding! Instead we've been focusing all our effort on making it easier to juggle multiple interpreter data-structures within a single thread. No, no, you can thank us later!
- The
bytes
-vs-str
thing kept many of us employed as we had convinced our companies they needed to upgrade to Python 3. In the same spirit, we are excited to announce that there will now be twoint
types --int
will be a 32-bit signed integer, andlong
will be a 64-bit signed integer. But before you say, "hey, they did that in Python 2!", we'd like to add that you can no longer useint
anywhere, and will need to convert them all tolong
. - Based on the overwhelming success of the
2to3
utility, we plan to release a3to4
tool that will automatically convert your code to utilize these exciting new features.
With much sadness, the following features did not make the cut:
- After attempting to rewrite portions of the interpreter with Rust, nobody could figure out how to disable the borrow-checker, so we gave up.
- No
switch
statement (and yes, yes, I know you can use adict
to do dispatching). concurrent.Pasts
andconcurrent.Present
will not be merged in time for this release, but hey, we've got futures, haven't we?- Since nobody understands how
twistedasyncio works, we are unable to offer any improvements at this time. The PSF now recommends all new projects to usegevent
. - Unfortunately we will not be able to offer any improvements to the packaging "situation".
We look forward to this release, and will do everything in our power to ensure it takes us several minor versions before it is even remotely usable.
Take heart! Remember the python motto:
What is dead can never die
I found it quite amusing, anyway.
-
RE: Website Certificate Revoked (jquery.com, theguardian.com, kinja-img.com, ...)
The 🔒https:// key is a definite improvement over the Caps Lock key.
-
RE: WTF Bites
the fundamental architecture of PGP is such a pain to use that when Ars' Lee Hutchinson e-mailed PGP creator Phillip Zimmermann in PGP format, Zimmermann refused to read the message that way—because his PGP key was not on his phone:
-
RE: WTF Bites
C++ : https://godbolt.org/g/vwf3p6
#include <cstddef> int main(int const argc, char const *const *const) { std::size_t i = 123; if(argc > 3) { std::size_t j = 1; static_assert(sizeof(i) > 4); j <<= 32; i += j; } return i; }
-O3 -std=c++17 -Werror -Wall -Wextra -pedantic
main: # @main mov eax, 123 ret
It took me longer than I'm willing to admit to figure this out due to the context of the original code, but what's happening here is that clang (and gcc) sees that
return i;
casts from unsigned 64bit to signed 32bit and therefore all the bits in positions 32 and beyond don't matter, and it doesn't issue any warning despite using-Wall -Wextra -pedantic
. If you want it to error out you have to usereturn {i};
or-Wconversion
or-Wshorten-64-to-32
.Guess what? MSVC issues two warnings at the default warning level (
/W3
):main.cpp(13): warning C4267: 'return': conversion from 'size_t' to 'int', possible loss of data main.cpp(13): warning C4365: 'return': conversion from '::size_t' to 'int', signed/unsigned mismatch
clang and gcc? This is probably why I see so many "possible loss of data" warnings in very popular libraries when compiling them for 64bit in MSVC: the developers work primarily on linux and have no idea their code is performing implicit lossy casts like this. If you use clang or gcc you may want to try
-Wconversion
or-Wshorten-64-to-32
as they are not included in-Wall
or-Wextra
. -
RE: WTF Bites
So I'm checking out this new mobile send/receive payments thing in my bank's mobile app. I get to the screen where you can request money from someone and it asks to enter the amount. Once you do that, well, there was no way I could see to move forward. Top right was "Cancel", top left was a back arrow, bottom left was a clear entry button, and bottom right was backspace. It used its own in-app keyboard rather than using the Android keyboard of your choice (probably as a sort of security measure, since it won't let me take screenshots). Then I discovered that I had to scroll the screen down to see the blue button labeled "Review" which was conveniently 2px off the bottom of the screen. I wasn't expecting that because it looked like everything fit on one screen what with the giant numpad and all.
-
RE: WTF Bites
Right clicking on symlinks in Windows 10 will duplicate context menu entries:
I noticed it on my system because, well...
-
RE: WTF Bites
If you've ever used the YouTube app with a Chromecast or smart TV or device which can act as a cast target, you'll know that to remove a video from the cast queue, you have to tap the triple dots menu and choose 'remove from queue'. Well, apparently, as my mom discovered, if you own the video, it will add an extra option that simply says 'delete'. She wanted it out of the queue, and deleting it from the queue made sense at first thought. So, now that video has been permanently deleted from her account. Thankfully she still has another copy, but why is that option in that menu!?
-
RE: UI Bites
YouTube is doing another survey. The previous question asked me how much I used these services and I put Never for the three obvious ones. Now it won't let me continue unless I lie and say "actually, never mind, I do use these services after all!"
-
RE: WTF Bites
So let's say you copy a text string to your clipboard like "he||o" and then paste it into a file or folder name on Windows. It removes the illegal characters for you and shows a tooltip explaining invalid characters, as expected, but it also changes the contents of your clipboard at the same time.
-
RE: WTF Bites
I have Cortana installed on my Android phone. Someone changed an event time in Google Calendar without sending emails, and Cortana detected it and made a notification. Cool! I'll just tap it and see what's changed...
It's stayed on this screen for over a minute before I closed it. When I manually open the app and view my schedule, it does show the time change - not sure why tapping the notification was too much. -
RE: WTF Bites
This is something I've never seen before, YouTube video embeds are broken everywhere, even on YouTube...
-
RE: Recruiting Giants
This whole PDF seems like it is a lesson on how to exploit and drain people as inhumanely as possible.
-
GitHub has a forum now
- The GitHub Platform Forum which provides a direct communication channel between ecosystem developers and GitHub engineers.
-
RE: EU Copyright Directive/Article 13
@topspin said in EU Copyright Directive/Article 13:
How about you fucking read it before voting on it.
Maybe they wanted to take the US approach and decide they have to pass the bill in order to find out what's in the bill.
-
RE: EU wants to filter code
@antiquarian That's pretty much what I've been wanting copyright to be like for a while now, and here I find out that's how it was originally before it was perverted.
-
RE: WTF Bites
So is the survey full, or can I just click Next and take it anyway?
Let's click Next! Oh...
I feel like that's sarcastic...EDIT: Another Microsoft email directed me here...
My best guess is that something happened -
RE: WTF Bites
@RaceProUK said in WTF Bites:
@cartman82 Why was he trying to submit a bug through customer service instead of through the proper channels?
He didn't know.
Still, customer support should be able to tell you "use the feedback feature from within the application". -
RE: WTF Bites
@cartman82 said in WTF Bites:
An "SEO expert" sent this pitch video to superuser.com, offering advice on how to "fix" their site. She has NO idea what the site is about, it's hilarious.
The funny thing is that all the recommendations in that video are things that make me avoid companies and websites and never return.
-
RE: Netflix allows downloading of videos. Sort of. Maybe. As long as you don't expect it to actually work in a useful way.
@ben_lubar I have still yet to understand what backwards APIs such applications are using that they can't comprehend symlinks. The OS is supposed to lie to the application unless the application specifically asks "is this a symlink?" so unless Steam is specifically checking for symlinks and erroring out intentionally, I'm clueless. At least in my tests, symlinks appear as 'real' to my code.
-
RE: Child abuse imagery found within bitcoin's blockchain
@ben_lubar Everyone who routes internet packets doesn't keep an entire copy of the internet downloaded, though.
-
RE: WTF Bites
Visual Studio 2017 suddenly removed the filename of a source file tab. Hovering over it still showed the path, but I could no longer save changes to the file. When I tried to exit Visual Studio I got this message with 10+ gigs of unused RAM available...
And it won't let me exit...EDIT: I Ctrl+Z'd the changes until the asterisk went away and it decided to stop holding me hostage and finally exit.
-
RE: Google C++ Style Guide
their employees are too stupid to write decent C++ code.
I believe that actually, their employees are not allowed to write decent C++ code.