WTF Bites
-
@cvi No, you can't. Microsoft must know what you are searching for to improve your user experience. Do you feel your experience improved yet? No? Then network requests will continue until experience improves.
-
@Applied-Mediocrity Reminds me of something else that tends to continue until an improvement happens…
-
@boomzilla said in WTF Bites:
I wonder how many people use the start menu as their default place to search for something on the web.
Still, you can do that without making network requests when opening the menu.
Yeah, would have been nice of them to show the local stuff and then the network stuff as it comes in. Of course as noted elsewhere the local stuff is often bafflingly slow.
-
And besides, how is Microsoft going to monetise you if you don’t go online to get the latest “product recommendations”?
-
@Tsaukpaetra said in WTF Bites:
two
If your cover page is not supposed to be page one, use a section break to logically separate it.
If you look at what Word does when you use "Insert Cover Page" then you'll not that it already does insert a section break. The "connected to previous page" option is also disabled.
-
@Tsaukpaetra said in WTF Bites:
two
If your cover page is not supposed to be page one, use a section break to logically separate it.
If you look at what Word does when you use "Insert Cover Page" then you'll not that it already does insert a section break. The "connected to previous page" option is also disabled.
Hrm. Well that was my only thought.
-
@Tsaukpaetra said in WTF Bites:
@Tsaukpaetra said in WTF Bites:
two
If your cover page is not supposed to be page one, use a section break to logically separate it.
If you look at what Word does when you use "Insert Cover Page" then you'll not that it already does insert a section break. The "connected to previous page" option is also disabled.
Hrm. Well that was my only thought.
if you’re gonna defile the WTF Bites thread with help, at least don’t be incorrect
-
@Rhywden TRWTF is top level statements.
Topless is more like my kind of statement
-
WTF of my day: Page counters in Word. They simply are black magic and only through
trial and errorarcane spells and sacrifice of a goat will you get what you want.Todays example: The page after the cover page was to begin at "1". It didn't, instead opting to begin counting at "2". Telling it through formatting options to begin counting at 1 yielded a 2 still.
Telling it to begin counting at "0" yielded a "0". Almost there!
Told it to begin counting at 1 again and got .... two.
You could fix it with your favorite XML editor and a pair of rubber gloves
Word—when TeX ain't complicated enough and you still need the broken output.
-
@Tsaukpaetra said in WTF Bites:
@Tsaukpaetra said in WTF Bites:
two
If your cover page is not supposed to be page one, use a section break to logically separate it.
If you look at what Word does when you use "Insert Cover Page" then you'll not that it already does insert a section break. The "connected to previous page" option is also disabled.
Hrm. Well that was my only thought.
if you’re gonna defile the WTF Bites thread with help, at least don’t be
incorrectHow meta.
-
incorrect
Hey now! This isn't the Help category, incorrectness of varying types is expected!
-
-
Went to a website "protected" by Cloudflare. They have decided that I am a bot and keeping throwing endless captchas at me.
Tried reciting all the standard magical incantations while standing on one leg under a full moon, but nothing helps, except one thing.
Use Chrome instead of Firefox. No captchas, no complaints about me being a bot.
.
Filed Under: Fuck You Very Much.
-
@Gern_Blaanston said in WTF Bites:
Went to a website "protected" by Cloudflare. They have decided that I am a bot and keeping throwing endless captchas at me.
Tried reciting all the standard magical incantations while standing on one leg under a full moon, but nothing helps, except one thing.
Use Chrome instead of Firefox. No captchas, no complaints about me being a bot.
.
Filed Under: Fuck You Very Much.
Clearly only bots won’t let them set their tracking cookie.
-
Also, does that menu seriously show that he has 10 internetpointzzzz?
Yeah, everyone knows the place to show your internetpointz is Settings!
-
@Gern_Blaanston said in WTF Bites:
while standing on one leg under a full moon
There's your problem. The full moon isn't until Saturday.
-
@dcon Does it come with a lunar eclipse?
-
@BernieTheBernie said in WTF Bites:
@dcon Does it come with a lunar eclipse?
I'd have to check the calendar... No, wait, .
-
I have a helm chart here, and I needed to add an option in it to install some service for itself instead of connecting to a provided one, for testing purposes. So I tried to add a, conditional, dependency. Except
- When there are dependencies, the user installing it (which is the build server) has to call additional command
helm dependency build
before installing. Ok, that's ugly, but it can be added to the deployment script. - The dependency has a registry URL, but the user installing it also has to explicitly do
helm repo add
some-name that-url for each url used in the dependencies. That makes the dependencies totally not an implementation detail any more, right? - If I then turn the condition off, it still renders the dependency.
Fuck helm with a rusty spork!
So I returned to the original plan of installing the dependency by creating a
helm.cattle.io/HelmChart
resource and let the helm controller expand it as a separate install cluster-side.Oh, and then I had a stupid mistake in the values (a configuration object) and of course I missed it and it silently installed it wrong, because there is no verification for them. Well, it somewhat recently learned to check the parameters with a jsonschema, but that means the author of the “chart” has to kill his and actually write such schema and noone does.
Fuck helm with a rusty spork again.
- When there are dependencies, the user installing it (which is the build server) has to call additional command
-
public static String nullSafe(Object object) { return Objects.nonNull(object) ? object.toString() : "empty"; }
-
@Carnage Warum, kurwa‽
-
@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"
.
-
@Carnage People can't start using the C# 8 nullable reference types soon enough.
Filed under: who am i kidding? they won't
-
@Bulb I have, and I've also started using
#pragma warning disable CS0649
to silence the warnings sometimes Not often though.
-
I am trying to get terraform to work here (?). And I am importing resources that were prototyped by hand (?). Currently I am at assigning permissions.
- I would expect a role assignment to be a relation, so fully defined by the three elements (user, role and scope). But no, it's an object with its own ID.
- The ID of the object is not shown in the portal. There is a button to download the list as csv or json though, which is good enough.
- The downloaded list has the UUID of the assignment. But not the full ID.
- But I need the full ID to do the import. Which is the ID of the scope plus
/providers/Microsoft.Authorization/roleAssigments/
plus the UUID. I understand giving it the subscription that is at the beginning, as each subscription probably lives in a separate database or something, but this seems rather excessive.
-
@Carnage Warum, kurwa‽
"empty" - I'd expect null. Empty is wrong in a lot of places.
Objects.nonNull - != null
nullSafe - I'd prefer a better name, like safeToString as suggested.And I'm in general a bit allergic to code that use object, but that's probably just PTSD.
-
@Bulb alas, it is Java so no such luck. But this team has opted out of using kotiin because of the strict null handling.
-
@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.
-
@Carnage Warum, kurwa‽
"empty" - I'd expect null. Empty is wrong in a lot of places.
Objects.nonNull - != null
nullSafe - I'd prefer a better name, like safeToString as suggested.And I'm in general a bit allergic to code that use object, but that's probably just PTSD.
I meant warum kurwa does such function even need to exist. IIRC string formatting will handle
null
(printing something like(null)
or whatever; it is meant for debug purposes only) and anywhere else it is a rather bad code stink.
-
@Bulb alas, it is Java so no such luck. But this team has opted out of using kotiin because of the strict null handling.
That team should be put against the wall.
-
@Bulb alas, it is Java so no such luck. But this team has opted out of using kotiin because of the strict null handling.
That team should be put against the wall.
I have whined about them on these forums a few times.
-
anywhere else it is a rather bad code stink.
What other forms of "no data" do you suggest? Because that line of thinking is what gave us
undefined
...
-
@Applied-Mediocrity For one thing most places should never ever see ‘no data’ and if they do it is a bug and NullPointerException is the right thing to happen. And for the other you shouldn't be converting arbitrary objects to string except for debugging purposes, and for debugging purposes the string formatting is good enough already.
-
@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.
-
@Bulb Hard disagree, on the grounds of the equivalent of assuming ideal gas.
-
@Applied-Mediocrity said in WTF Bites:
@Bulb Hard disagree, on the grounds of the equivalent of assuming ideal gas.
Ideal gas is assumed almost everywhere. I think you're looking for s.
-
@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.
Ouch™
@Applied-Mediocrity said in WTF Bites:
@Bulb Hard disagree, on the grounds of the equivalent of assuming ideal gas.
I am not assuming ideal anything. I know the nulls will get in all the wrong places where they absolutely should not. But when they do I want the thing to crash and burn, because then there is a chance someone will actually notice it needs to be fixed.
-
@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"
.Congratulations, Mr. Object.toString, you've done it.
-
public static String nullSafe(Object object) { return Objects.nonNull(object) ? object.toString() : "empty"; }
Objection sustained. There's
Objects.toString(object, "empty")
right there...
-
I know the nulls will get in all the wrong places where they absolutely should not.
I shall ask again - what are the alternatives?
-
@Applied-Mediocrity I'm just gonna throw an exception because he's not and you're cycling. If you want null elision just say you want null elision.
-
@Applied-Mediocrity I don't want alternative for null. I want:
- compiler support for ‘this was already check for not being a null’ and
- treating nulls where they shouldn't be as irrecoverable errors (so letting the NPE out is OK) because when they do the code is probably well into doing something wrong anyway.
-
compiler support for ‘this was already check for not being a null’ and
That's why I said that bit about ideal gas. What currently cannot be done in the language the piece in question was written is theoretical, irrelevant and does not interest me.
code is probably well into doing something wrong anyway
That is the bit I'm asking alternatives for. I posit that data objects that contain null fields or are nulls themselves are perfectly valid, and there absolutely are moments where no data must be expressed in text, other than debugging - and not only because a debugger itself is one such valid use case.
-
@Applied-Mediocrity said in WTF Bites:
I posit that data objects that contain null fields or are nulls themselves are perfectly valid
In some cases, yes. In some cases, no. Depends on what that field/variable/parameter means in that context.
-
@Gribnit Ah, didn't know this existed since I don't do Java.
-
@dkf Precisely. The code in question is perfectly valid in some contexts. With some being an immeasureable quantity, I might add.
Of course, we shall assume (with some circumstantial evidence even) that the people @Carnage has to work with are blithering idiots who are likely misusing it to hide NPEs and other fuckery. But once the "why does it even need to exist" is raised, I'm going to call it. I'm certainly very, very tired of all the bloody dogmas in this industry.
-
public static String nullSafe(Object object) { return Objects.nonNull(object) ? object.toString() : "empty"; }
Objection sustained. There's
Objects.toString(object, "empty")
right there...Oh, that reminds me, when I suggested they use that instead, I was told that was "less clear"...
From the people that think that Objects.nonNull is more clear than != null, but I have to set up special highlighting rules in the IDE to make it pop out as much as != null...
-
@Applied-Mediocrity said in WTF Bites:
@dkf Precisely. The code in question is perfectly valid in some contexts. With some being an immeasureable quantity, I might add.
Of course, we shall assume (with some circumstantial evidence even) that the people @Carnage has to work with are blithering idiots who are likely misusing it to hide NPEs and other fuckery. But once the "why does it even need to exist" is raised, I'm going to call it. I'm certainly very, very tired of all the bloody dogmas in this industry.
Speaking of hiding NPEs:
public static <T> T nullSafe(Provider<T> provider) { try { provider.get() } catch (NullPointerException npe) { return null; } }
String value = nullSafe( () -> fooData().getBar().getBaz());
Poor mans ?. operator.
Edit: Now, I feel I have to clarify that I haven't seen this in this code, probably only because they aren't skilled enough to write it.
-
Speaking of hiding NPEs:
This won't.
It postpones it a bit, I guess.
Edit: hold on, I hadn't realized that method takes a lambda. That changes... little, actually. It will still return a null which can cause NPEs further along. But at least it will contain the ones in that one chain, yes.
-
Speaking of hiding NPEs:
This won't.
It postpones it a bit, I guess.
It has the potential to hide NPEs, especially if you start wrapping larger lambdas with lots of code going on in there.