@Zerosquare Why do the power port logos have a bitrate?
Posts made by Medinoc
-
RE: WTF Bites
@Tsaukpaetra said in WTF Bites:
I've made the reverse function: nullIfEmptyOrWhitespace
So have I. Very useful when you want to use
??
somewhere down the line.
But the use cases are different:safeToString
is for debugging purposes, whereasnullIfEmptyOrWhitespace
is for business logic. -
RE: WTF Bites
@Bulb The string formating isn't good enough in .NET when the object in question is already a string: Null strings are output as empty ones, which usually loses a piece of information you wanted to have if you're debugging.
-
RE: WTF Bites
@Carnage People can't start using the C# 8 nullable reference types soon enough.
Filed under: who am i kidding? they won't
Gotta admit, I haven't quite jumped on that bandwagon yet. Probably because I mainly work on existing codebases.
-
RE: WTF Bites
@Carnage Frankly I've done this kind of thing in the past. The only part that really irks me is the name
nullSafe
(I'd have called the methodsafeToString
instead, and perhaps added a parameter, string defaultString="empty"
).Edit: Oh, and on second thought I'd use
"null"
instead of"empty"
. -
RE: UI Bites
@Tsaukpaetra said in UI Bites:
@HardwareGeek said in UI Bites:
when I just want to position a window at the top of the screen.
I really wish there was a modifier you could press to temporarily disable it for this one drag event....
Sadly, my Microsoft Feedback post got obliviated.
And also disabling the "Shake a window = minimize all others". Because whenever I hesitate where to put a window, it procs.
Then you have to shake it five times harder just to get them back.
I inadvertently triggered it just the other day, and had to thrash the mouse so vigorously that somebody nearby questioned what was going on.
Wow, I didn't know you could get them back. Thanks!
-
RE: UI Bites
@Tsaukpaetra said in UI Bites:
@HardwareGeek said in UI Bites:
when I just want to position a window at the top of the screen.
I really wish there was a modifier you could press to temporarily disable it for this one drag event....
Sadly, my Microsoft Feedback post got obliviated.
And also disabling the "Shake a window = minimize all others". Because whenever I hesitate where to put a window, it procs.
-
RE: WTF Bites
What would you call an S-Bahn in English? I know it's technically "light rail" but I haven' heard that in regular use.
I was under the impression S-Bahn was the abbreviation of Strassenbahn (tramway).
-
RE: WTF Bites
@Zerosquare said in WTF Bites:
Before I plug into any public USB port, I use one of these:
I like their illustration picture implying it's high-tech:
In reality, it looks like this:
Good on them. I can sort of trust a plug where I can see that the data pins simply have no connections; the upper version by itself looks less trustworthy than your average public USB outlet.
AFAIK it's because charge power is negotiated through data, so if you use one with just the power lines it will charge very slowly. Therefore the "electronic" one needs to act as a proxy/firewall that allows the negotiation while blocking everything else.
-
RE: WTF Bites
Comment on blog post: Why did they ruined the audio instead of making proper isolation for hard drives though? Filtering out frequencies from the audio without user’s consent because of crappy hardware is a very ugly workaround. And laptops can still be crashed by malicious actor using other audio devices.
My thoughts exactly.
-
RE: WTF Bites
@Bulb This is pretty much me, I use two VMs for the same reasons.
-
RE: WTF Bites
What happens if the value is assigned on all control paths but the compiler can't prove that? Compilation Error?
I think so, yes. AFAIK it works on a "better safe than sorry" basis, just like it does for "uninitialized" variables.
-
RE: WTF Bites
@Benjamin-Hall said in WTF Bites:
Barfs because converting a UUID to an INT produces... -1.
Makes sense to me. C-esque hex parsing function that returns -1 when it chokes on something, and then it either chokes on the non-initial minus signs, or detects overflow.
Of course, having your function return -1 when it chokes is a bad idea in most languages that support exceptions, but that's a detail: If the parsing function threw an exception instead, you'd still have the problem of "UUID can't be parsed asint
". -
RE: WTF Bites
@Benjamin-Hall Wait, I thought database BIGINTs were not "big integers" as we know them, but merely 64-bit integers... How can you store an UUID, which is a 128-bit integer, in one?
-
RE: WTF Bites
Actually, the server will return
200 OK
with an HTML document describing the error (instead of the usual JSON or XML or whatever format). Because of course it does.We've had this same problem recently. And since it was an API for retrieving a raw file from a repository, I had to add some kludgy code to detect if the reply is HTML, and not accept it if it is (thankfully the repository is not supposed to contain genuine HTML files).
Good news is, I've made a pull request for a change that would cause it to return the actual error code. Bad news is, the machine turns slowly... -
RE: WTF Bites
@Tsaukpaetra said in WTF Bites:
I know! We'll use a parallel data stream addressable by the
filenameinode!What is this "filename" thou weakest of?
Uhm, I was under the impression that the filesystems with inodes are also the filesystems that don't support alternate data streams...
Or at least, operating systems that commonly use such filesystems don't, which to me is the main obstacle to programmers ever getting a standardized API to list and access them. -
RE: A fool and his not-really-money are soon parted
@loopback0 said in A fool and his not-really-money are soon parted:
We don't take Itchy & Scratchy money.
-
RE: PANTONE® dictates the colour of 2022!
@Shoreline said in PANTONE® dictates the colour of 2022!:
It's #6667ab. 2022's colour is #6667ab.
It is indeed mostly blue, but also it's red. In trivia, it's slightly more green than red, but I guess we're not talking about that.
That's a lot more green than I was expecting, especially for a violet.
-
RE: WTF Bites
@remi I wonder how this is implemented on the C++ side. Usually a cache for some long-to-compute value (that doesn't involve modifying the rest of the object) is one of the
twothree prominent use-cases wheremutable
member variables make sense (the otheronetwo being synchronization objects and intrusive reference counters). -
RE: WTF Bites
@dkf I would write it as
Windows's
as well.
Just to be sure I havent't lost my touch, it'sMr Jones's car
for one guy butThe Joneses' car
for the whole family? -
RE: WTF Bites
@sebastian-galczynski said in WTF Bites:
Our client was struggling to make a request to our API. Eventually he asked for a code snippet to make it work. In PHP.
Ok, I wrote a small library, packed it into a composer package and sent the repo URL.'It doesn't work with our version of PHP'
'What's your version?'
'5.6'That's the same client who requested we don't write anything in PHP, because it's not prestigious enough.
Context for those who like me, don't follow PHP: A quick Google search on PHP version says this:
PHP version 7.4 is the most used version.
Stable release 8.1.7 / 9 June 2022So 5.6 is hilariously obsolete even by old PHP standards.
-
RE: WTF Bites
UK is rather special in the regard that people tend to use postal codes for general purposes. In most countries people use just city (+ quarter if needed) + street + number and only bother with postal codes, where they even exists, when actually sending stuff via post.
In France we tend to use postal codes as a shorthand to the city (for mail and for statistical purposes: for example, stores often ask for your postal code if you register for their "repeat business discount" program).
You'll never actually see a letter with only the postal code and no city name, but on most French websites where you're prompted to type in an address, the site will fill the "city" field automatically once you type in a postal code.
-
RE: WTF Bites
@Benjamin-Hall And I bet there's still no arrow keys for when you need more precise movement than having to zoom waaaay in and try to click precisely with your finger?
-
RE: A fool and his not-really-money are soon parted
@Atazhaia So they're finally putting the "coin" in bitcoin?
-
RE: WTF Bites
variant called JSONC
variant, called JSON5The superset called YAML seems to be winning.
Except it has its own problems for config files (let's see if I can find that link), and I can't stand a language that demands leading spaces and chokes on tabs.
Edit: Found it: https://www.arp242.net/yaml-config.html
-
RE: WTF Bites
Imagine if you had to write a large JSON file by hand to configure a system because there’s no installer package because the devs are too (something) to write one.
Imagine if that before you had the JSON configuration file you had an ini file. But now it’s much more better because the devs have less code and can “nest configuration so it’s easier to find”.
Configuration files written in a language that doesn't support comments or trailing commas? Brilliant, this sounds like a Microsoft* idea.
*though I learned recently they apparently use a variant called JSONC that allows comments; I've also learned of another variant, called JSON5, that's apparently actually usable for config files.
-
RE: WTF Bites
@Atazhaia Once again they come in a decade after the English words have entered common parlance to impose inferior, unpronounceable-in-any-reasonable-time replacements.
-
RE: WTF Bites
Most OS-APIs expect nul-terminated strings; few take pointer+length.
The OS APIs that tend to need performance take pointer and length. You don't need that much performance for the others; the cost of listing a directory far exceeds the cost of copying the (directory) filename used to start the reading.
The OS APIs that take pointer and length tend to use them for output strings; input strings tend to still be NUL-terminated, with most exceptions being in APIs dedicated to string manipulation.
-
RE: A fool and his not-really-money are soon parted
@DogsB Not something I'd laugh at. People losing everything to the point of suicide is not funny if they don't deserve it, and no amount of "gullible" will make them deserve it.
-
RE: UI Bites
@Tsaukpaetra Are you sure you haven't blocked cookies, or set them to be auto-removed on close?
-
RE: Helpful error message
@topspin said in Helpful error message:
@Medinoc good lord, what is this?
Are these 16 bit controls inside of a kinda-looks-like-but-not-quite Windows 7 window?These look like the bad old Java Swing controls to me. Or at least, that's what they remind me of, but I haven't looked at a Java app with a Swing-based-GUI in ages.
-
RE: Helpful error message
Today I tried uninstalling Oracle Client 11g to update it, and got this magnificent error message. And before you ask, no, Ctrl+C in the messagebox does not work.
-
RE: A fool and his not-really-money are soon parted
@PleegWat This is an April's Fools, right? Poe's law strikes again.
-
RE: UI Bites
Just a little shout-out to Microsoft for deciding that most people don't actually want to easily know where a window ends and the neighboring one begins, a making that an optional feature disabled by default.
Ok, what is the option, where is it, and how do I change it? (Since I'm not running Win11 yet, I need to record all the little shitty things that need tweaking)
Settings -> Personalization -> Colors -> Show accent color on the following surfaces -> Title bars and window borders
-
RE: UI Bites
Just a little shout-out to Microsoft for deciding that most people don't actually want to easily know where a window ends and the neighboring one begins, a making that an optional feature disabled by default.
-
RE: WTF Bites
@Applied-Mediocrity TIL 1 horsepower =745.699872 watts (thanks Google)
Which means... 560-Watt GPU? That's more than my comp's entire PSU is rated for! -
RE: Internet of shit
@hungrier This would almost be acceptable if they used a website instead of an app. And to add insult to injury, I bet the app is a glorified website anyway...
-
RE: WTF Bites
Non-C programs don't exactly do better in this regard though.
They do. By not modifying arguments halfway through the function. The only other language I'm aware of where argument shifting is the convention is Bash, and as would put it, everything in Bash is terrible.
It's not quite "halfway through the function" if it's right at the start. It's a statement that says, "For this program, the only arguments left are the ones not processed yet".
But you're right in that this practice is quite associated to Bash (and other, similar shells). I think in Shell programming, it's even taught this way. -
RE: A fool and his not-really-money are soon parted
@kazitor Well, at least they're telling you upfront that they'll just take the money and use it, so it's not a scam.
-
RE: A fool and his not-really-money are soon parted
@PotatoEngineer said in A fool and his not-really-money are soon parted:
@Medinoc said in A fool and his not-really-money are soon parted:
@topspin What does "funge" mean?
At the risk of : "fungible" means "able to be swapped for an equivalent." So money is fungible, because it doesn't matter which $100 you have, as long as you have $100, because all $100 bills are equivalent. Commodities are generally fungible (modulo, say, expiration dates); that's what makes them commodities: it doesn't really matter which you have, as long as you have twenty pounds of rice that can be made into a very large blackjack on short notice. The most important thing about fungible items is that they can be broken into parts, sold piecemeal, and it's not a problem (they retain about the same value as 1/N of the whole). So you can break your $100 into five twenties, you can take your twenty pounds of rice and divide it among ten socks to make more reasonably-sized blackjacks, etc.
NFTs are not fungible in that they cannot be broken into parts and sold piecemeal: they are one thing, in the same way that a piece of art is a thing: it's unique, it's not equivalent to other art pieces, it can't be broken into 4 parts and sold as the equivalent of 1/4 of a thing each, etc.
It's not really interesting, but it does use a fancy word that's uncommon in common parlance. So that's something.
Sincere thanks.
-
RE: WTF Bites
@BernieTheBernie said in WTF Bites:
You're missing the "only" after the number.
Yeah, weird. Long ago, a customer gave me a check to bring to my employer. It was a large sum, something like
One hundred forty-six thousand two hundred ninety two Pounds onlyPerhaps the "only" meant there were no cents/pence/etc.
-
RE: WTF Bites
@Vault_Dweller Same here. I was somewhat surprised to see @Medinoc refer to euros and checks in the same sentence.
Fixed.