WTF Bites
-
@Tsaukpaetra said in WTF Bites:
Have I mentioned they program like it's plain old C? For example, all variables are declared at the top of the class, with prefixes. There are almost no local variables. This means functions where only once is used still have dangling variables in the class.
FWIW, you don't need to do that in C and haven't for quite a long time now.
FWIW C does not even have classes!
Read it again. It does not say he puts local variables to the top of the function like old-style C. It says he lifts them out to the containing class!
-
@Tsaukpaetra said in WTF Bites:
For example, all variables are declared at the top of the class, with prefixes. There are almost no local variables.
That's not like plain old C. That's like plain old retard.
-
It does not say he puts local variables to the top of the function like old-style C. It says he lifts them out to the containing class!
Well that's just a level of dumb that my brain tends to autocorrect to something saner.
-
FWIW, you don't need to do that in C and haven't for quite a long time now.
Did C ever really require that?
I know that before 1999 you had to put declarations at the beginning of a block, but was there ever a version of C where you couldn't just open a new nested block wherever?
-
@Tsaukpaetra said in WTF Bites:
@Tsaukpaetra said in WTF Bites:
What the fuck.
Status: Thanks Jeremy. Your necessity has apparently turned into permanent crutch.
Nothing is more permanent than a temporary solution.
-
FWIW, you don't need to do that in C and haven't for quite a long time now.
Did C ever really require that?
I know that before 1999 you had to put declarations at the beginning of a block, but was there ever a version of C where you couldn't just open a new nested block wherever?
Possibly in pre-ansi it had to be in the top of the function? I know having to declare at the top of the function is still in our style guide because most code is that way anyway and it works better in GDB.
-
I know that before 1999 you had to put declarations at the beginning of a block, but was there ever a version of C where you couldn't just open a new nested block wherever?
I think most code stylists would consider having blocks everywhere just for scoping to be a bigger . Though I don't really understand why ... but I've had code rejected on review for using block scoping in case clauses for example.
-
Did C ever really require that?
I suspect that pre-C89 code did, at least with some compilers; there was pretty wide variation before standardisation. I believe that was relaxed in C89 so that variables could be declared at the top of any block, and in C99 that was relaxed further (mirroring what C++ does, though with less impact as C doesn't have constructors or destructors for anything).
-
@bobjanova said in WTF Bites:
I've had code rejected on review for using block scoping in
case
clauses for example.Some code reviewers need a damn good smack upside the head.
-
@Tsaukpaetra said in WTF Bites:
@Tsaukpaetra said in WTF Bites:
What the fuck.
Status: Thanks Jeremy. Your necessity has apparently turned into permanent crutch.
Nothing is more permanent than a temporary solution.
Corollary: the uglier, the more permanent the temporary solution is.
-
@bobjanova said in WTF Bites:
I know that before 1999 you had to put declarations at the beginning of a block, but was there ever a version of C where you couldn't just open a new nested block wherever?
I think most code stylists would consider having blocks everywhere just for scoping to be a bigger . Though I don't really understand why ... but I've had code rejected on review for using block scoping in case clauses for example.
case
clauses, on their own, do not have blocks. The usual convention only creates a block for theswitch
statements and not for the individualcase
clauses. Without additional blocks, a variable declared in one case clause is still in scope for the next.
-
Without additional blocks, a variable declared in one case clause is still in scope for the next.
Yes, I know. But I wanted a local to be scoped only to the case, so I put a block inside it for that exact reason, to keep the scope close.
-
FWIW, you don't need to do that in C and haven't for quite a long time now.
Did C ever really require that?
I know that before 1999 you had to put declarations at the beginning of a block, but was there ever a version of C where you couldn't just open a new nested block wherever?
Possibly in pre-ansi it had to be in the top of the function? I know having to declare at the top of the function is still in our style guide because most code is that way anyway and it works better in GDB.
According to my (pre-ansi) book on C from 1987, variables have to be declared at the start of the block, not necessarily a function.
It may be false though, because I remember the book was chockful of errors being a 0th edition for proofreading.
-
@PleegWat Depends on the language. C#, for example, doesn't allow for
case
statement fall-through (unless empty), but it does require explicit termination (break, return or throw). So they're in an ugly superposition. They're logically blocks, but they pretend they're not. Eric Lippert once wrote a lengthy blog post - but of course he did - on why exactly that decision was invariably the only correct one.
-
@Applied-Mediocrity said in WTF Bites:
Depends on the language.
The context was C. Or maybe C++.
That said, I could live with fallthrough requiring an explicit statement. Doesn't C# also allow
goto case 1
to jump to any case label in the current switch statement?
-
@Tsaukpaetra said in WTF Bites:
@Tsaukpaetra said in WTF Bites:
Status: This fucking idiot developer took a list, split the items out according to a property on the items (into separate holding variables), then passed the individual variables as parameters to another object, which simply puts them back into a list.
What the fuck.
Insufficient . Programmer started churning the code before thinking what is actually needed and how to do it with least typing.
Have I mentioned they program like it's plain old C? For example, all variables are declared at the top of the class, with prefixes. There are almost no local variables. This means functions where only once is used still have dangling variables in the class.
Amazing.
That's how us old timers roll.
-
The context was C.
Well yes, but "here in Poland... fuh-fuh-fuh"
Doesn't C# also allow
goto case 1
Unfortunately it does. The
switch
couldn't decide whether it wanted to be sane or C-like, so it ended up being both.
-
This post is deleted!
-
@nerd4sale said in WTF Bites:
According to my (pre-ansi) book on C from 1987
I wonder what ever happened to my 1st edition K&R.
-
-
@HardwareGeek said in WTF Bites:
@nerd4sale said in WTF Bites:
According to my (pre-ansi) book on C from 1987
I wonder what ever happened to my 1st edition K&R.
(looks) Hmm. Not where I expected it to be... Maybe it was actually a work book that I had to leave behind at some previous employer...
-
Virtualbox cannot into multiple screens. It used to, but not anymore. 2020 really is the worst.
Previously I've had Virtualbox 5.2 on Windows 7 host and with Arch Linux guest using Xfce desktop environment. Now I'm using Virtualbox 6.1 on Windows 10 host and with Ubuntu guest using Gnome desktop environment. In both cases, guest additions were installed.
When I enable 2 screens in VM settings, I can configure 2 screens in system settings and set resolution. But resizing either window closes the second screen immediately. Making it basically unusable.
-
When I enable 2 screens in VM settings, I can configure 2 screens in system settings and set resolution. But resizing either window closes the second screen immediately. Making it basically unusable.
Don't resize those windows.
There, I fixed it.
-
-
@HardwareGeek said in WTF Bites:
What the hell is going on there? Who’s behind this and what’s the intention?
include cabbage, broccoli, kale, celery, coriander, cilantro
-
Who’s behind this
I'm not saying it's Winnie. But I'm also not saying it's not Winnie.
and what’s the intention?
Given that most of these seeds are harmless, introduction of invasive species by overwhelming the system. If it doesn't work out, it costs practically nothing. If it does... feed me Seymour.
-
Virtualbox cannot into multiple screens. It used to, but not anymore. 2020 really is the worst.
Previously I've had Virtualbox 5.2 on Windows 7 host and with Arch Linux guest using Xfce desktop environment. Now I'm using Virtualbox 6.1 on Windows 10 host and with Ubuntu guest using Gnome desktop environment. In both cases, guest additions were installed.
When I enable 2 screens in VM settings, I can configure 2 screens in system settings and set resolution. But resizing either window closes the second screen immediately. Making it basically unusable.
Get rid of the guest additions. Those have only caused me trouble. Meaning crashes, mostly. I'm still on 6.0, though.
-
@Tsaukpaetra said in WTF Bites:
a shift in one block shouldn't affect the rest unless it shifts into another block
Not if it's using a CBC encryption mode where the value of each block depends on all previous blocks
-
@boomzilla said in WTF Bites:
Virtualbox cannot into multiple screens. It used to, but not anymore. 2020 really is the worst.
Previously I've had Virtualbox 5.2 on Windows 7 host and with Arch Linux guest using Xfce desktop environment. Now I'm using Virtualbox 6.1 on Windows 10 host and with Ubuntu guest using Gnome desktop environment. In both cases, guest additions were installed.
When I enable 2 screens in VM settings, I can configure 2 screens in system settings and set resolution. But resizing either window closes the second screen immediately. Making it basically unusable.
Get rid of the guest additions. Those have only caused me trouble. Meaning crashes, mostly. I'm still on 6.0, though.
Can you copy+paste in and out of the VM without them? And does on the fly resizing work?
-
@boomzilla said in WTF Bites:
Virtualbox cannot into multiple screens. It used to, but not anymore. 2020 really is the worst.
Previously I've had Virtualbox 5.2 on Windows 7 host and with Arch Linux guest using Xfce desktop environment. Now I'm using Virtualbox 6.1 on Windows 10 host and with Ubuntu guest using Gnome desktop environment. In both cases, guest additions were installed.
When I enable 2 screens in VM settings, I can configure 2 screens in system settings and set resolution. But resizing either window closes the second screen immediately. Making it basically unusable.
Get rid of the guest additions. Those have only caused me trouble. Meaning crashes, mostly. I'm still on 6.0, though.
Can you copy+paste in and out of the VM without them? And does on the fly resizing work?
I cannot copy+past but on the fly resizing works once I'm logged into the guest OS, which is Kubuntu 18.04. I only very occasionally miss the copy+paste ability because I do almost nothing in the host OS.
I have it set to have two screens which I put on my two external monitors. I don't bother with the laptop's screen, which is off to my left and out of normal sight anyways.
-
This post is deleted!
-
@boomzilla said in WTF Bites:
I only very occasionally miss the copy+paste ability because I do almost nothing in the host OS.
I guess you’re in more of a “IT doesn’t let me install a real OS” situation?
-
@boomzilla said in WTF Bites:
I only very occasionally miss the copy+paste ability because I do almost nothing in the host OS.
I guess you’re in more of a “IT doesn’t let me install a real OS” situation?
Yes.
When I need to go back and forth I either email myself or have port forwarding set up so that I can sftp stuff across the host / guest threshold. But having to actually do any of that is very rare for me.
-
No idea why, but this just popped up on my work computer:
-
-
@Tsaukpaetra said in WTF Bites:
a shift in one block shouldn't affect the rest unless it shifts into another block
Not if it's using a CBC encryption mode where the value of each block depends on all previous blocks
Isn't that bad for random access though? That's extremely important because the pak files are essentially really-shitty disk images...
-
@Mason_Wheeler said in WTF Bites:
No idea why, but this just popped up on my work computer:
Run!
That would've been a useful advice 13 days ago.
-
@Tsaukpaetra said in WTF Bites:
Isn't that bad for random access though?
Yes. It's more secure for streams, but can't do random access at all. That's why use case matters a lot when choosing the encryption method suite.
-
@dkf CBC is more secure though, especially in the case where blocks might be duplicated
-
@dkf CBC is more secure though, especially in the case where blocks might be duplicated
I believe I mentioned that "more secure" probably wasn't the reason for encryption?
Anyone can unpack the pak file, after all. They'd have to, otherwise the game couldn't run.
-
@Tsaukpaetra said in WTF Bites:
Anyone can unpack the pak file, after all. They'd have to, otherwise the game couldn't run.
Encryption to defend against the person who has legitimate use of the file is rather a fig-leaf anyway. Anyone sufficiently determined can probably reverse engineer the decryption method and key. It's probably a pain to do, but it's definitely possible. (But it will work for stopping casual poking around.) If you must stop cheating, you have to have a component in the system which the user truly does not control, and for that component to hold the definitive copy of the state of the world. Cloud servers are pretty good for that sort of thing, and that in turn means that what users buy is the client and access to the service.
OS-level encryption of the disk is different. In that case, most users do not have access to the module responsible for the encryption and decryption, and the net result is much more secure. However, that's probably not using CBC as filesystems and the files they want tend to want random access.
-
If you must stop cheating, you have to have a component in the system which the user truly does not control, and for that component to hold the definitive copy of the state of the world. Cloud servers are pretty good for that sort of thing, and that in turn means that what users buy is the client and access to the service.
Yeah, that's why I was rolling my eyes when people were suggesting I make the Hypatia server's available to run by users. Lol no!
-
Users? What users?
-
-
@Tsaukpaetra said in WTF Bites:
Isn't that bad for random access though?
Yes. It's more secure for streams, but can't do random access at all. That's why use case matters a lot when choosing the encryption method suite.
You can actually decrypt a random block quite easily - you simply decrypt it and then xor the resulting plaintext with the ciphertext of the previous block to get the final plaintext: CBC Decryption
-
@turingmachine TIL… except that only works for random reads. Random access in general needs writes of arbitrary blocks as well.
-
FFS, why does updating VisualStudio (2019) require a reboot of Windows? I thought we were past those dark ages already.
(Ok, minor WTF on my part. I didn't pay attention to the popup from the VS updater/installer. It had a single button "Restart", which I assumed would restart Visual Studio. Only realized that wasn't the case when I got to the "Rebooting..." screen of Windows. Guess that teaches me to not carefully read the popups.)
-
On Slashdot:
My first thought upon reading that is that the thing they're probably most famous for sucks balls and has for a decade or more: I don't know of many online retailers with a more shitty webpage than Amazon.
(Not to mention their super aggressive tendencies to direct you at their branded crap, and the fact that the place is overrun by suspect cheap knockoffs.)
-
Woo. Tripple post! Speaking of sucking for a decade or (much) more:
1> [CMake] D:\Program Files (x86)\Microsoft Visual 1> [CMake] Studio\2019\Community\MSBuild\Microsoft\VC\v160\Microsoft.CppBuild.targets(354,5): 1> [CMake] error MSB3491: Could not write lines to file 1> [CMake] "x64\Debug\external_VulkanMemoryAllocator\external.AC5CFC30.tlog\external_VulkanMemoryAllocator.lastbuildstate". 1> [CMake] Path: 1> [CMake] x64\Debug\external_VulkanMemoryAllocator\external.AC5CFC30.tlog\external_VulkanMemoryAllocator.lastbuildstate 1> [CMake] exceeds the OS max path limit. The fully qualified file name must be less 1> [CMake] than 260 characters.
-
@cvi https://docs.microsoft.com/en-us/windows/win32/fileio/naming-a-file#enable-long-paths-in-windows-10-version-1607-and-later