« first day (5049 days earlier)      last day (122 days later) » 

00:00
If a thing's worth doing, it is worth doing badly. -- G.K. Chesterton (source)
 
7 hours later…
07:09
goat moaning
07:30
o7
@Michael how does the xkcd explained thing work? Does it check on a schedule for a new post, or wait until a defined time or something? The first version of the explained is usually pretty crap but the one available a bit later is usually much better
 
1 hour later…
@ntohl Every zero seconds. However, the actual value used by the running bot is PT30M for every 30 minutes.
08:56
private final Duration timeToWaitBetweenWikiChecks = Duration.ofMinutes(15);
this.timeToWaitBeforeFirstWikiCheck = Duration.parse(timeToWaitBeforeFirstWikiCheck); // which is "PT0S"
I follows some logic, but it's not well documented. The P is mandatory in that format but the T is optional. Seems like T is to separate time units. Not sure when exactly you'd need it, though. Probably to resolve some ambiguities but I'm not sure I see ambiguities.
maybe T states time and not date?
@ntohl It's "PT0S" in the tests.
@ntohl It separates time and date values. P2DT3H4M is 2 days then T for time. and lists 3 hours and 4 minutes.
But presumably P2D3H4M would parse the same.
@VLAZ oh. Yeah
@VLAZ fascinating
09:10
Does it do months too? Maybe the T is there so you can separate months vs. minutes if you need to?
Like P3M might be 3 months while PT3M might be 3 minutes?
09:29
Hey folks, fun discussion on the ISO-8601 duration format! Quite a bit different from what we deal with in C#. If you need similar functionality in C#, you would work with `TimeSpan` for time intervals. Here's a quick code snippet to convert a TimeSpan to an ISO 8601 string:

var timeSpan = TimeSpan.FromMinutes(15);
string iso8601Duration = XmlConvert.ToString(timeSpan);
Console.WriteLine(iso8601Duration);  // Outputs: PT15M

To parse an ISO 8601 duration string back to `TimeSpan`:
string duration = "PT0S";
09:46
Why is it all code formatting?
In multiline messages, SO chat lets you either format the whole message, or none of it. So I guess it now formats the whole thing instead of not at all.
I think oak outputs all multi lines as code style
@VLAZ I can't stress enough how much I absolutely loathe this format
It's possibly one of the least intuitive formats for representing a period of time ever seen
And to think this is part of the same spec which gives us the 8601 date format is wild
Morning.
Morning.
like what the fuck does P3Y6M4DT12H30M5S mean
10:00
@CaptainObvious I'm with you. No idea how they came up with it.
@VLAZ Hi with you, I'm Oak!
its always morning when I open this chat tab. no matter the time of the day
Not Oak, Yoda you are
Apparently it represents three years, six months, four days, twelve hours, thirty minutes, and five seconds, not that that is intuitive in any way
Still morning 👍
Even more so in UTC which is the only time zone that matters
@CaptainObvious It's...not. It's BST. Which is UTC+1
10:03
👍
You have to wait for the winter
No I mean it's more morning in UTC than it is here
Ah, misunderstood. You're right - it's utcMorning
Or morningUTC?
How do we express that in the weird ISO format?
@CaptainObvious I mean, it's basically the thing jira uses too, although jira adds spaces of course because it's not a string but human input.
I don't use jira lmao
10:14
@Squirrelkiller But Jira is unambiguous. You only mean one thing. And you have a shortcut for calculating the time 2d 3h will be 8*(length of day configuration) + 3 hours. If you configure 1d = 6h than it's 2*6+3. If a day is defined to be 10 hours then it's 2*10+3.
The period can be negative.
You can also do stuff like "an hour less than one day". Which makes some sense in some cases but does make it more cumbersome as an expression.
Damn. I know why I book all my stuff via jira assistant.
Also I still don't get the T there. Why you'd want to include it or not.
1 hour ago, by Squirrelkiller
Does it do months too? Maybe the T is there so you can separate months vs. minutes if you need to?
if you include the T you need to add time units. But if you include time units, you don't need the T.
I think it's like the date format
You can use T or not
10:18
@Squirrelkiller OK, that would make sense. M is indeed defined as both "months" (if in the date part) or "minutes" (in the time part". And P1Y2M might be one year and 2 months or 1 year and 2 minutes. But couldn't that have been made unambiguous in another way?
M is months, m is minutes
Unless it's different between dates and duration which would be STUIPID
It also means that P3M30S could be 3 minutes and 30 seconds or 3 months and 30 seconds.
Looking at the duration thing - we actually have a much more stupid version of it defined in our system. Honestly, we should have used the ISO thing. Because ours looks like 1.2.3.4.5.6.7 - it's 1 year, 2 months, 3 days, 4 weeks, 5 days, 6 hours, 7 minutes. Although, TBH, the week/day might also be in the opposite order. It's just a custom string we persist for duration that has to be parsed to be useful. And the rules are simple but you'd need to look them up because it's an irregular format.
It could have just been a subset of the ISO format. Then no extra tooling needed to parse and work with it. And you'd know what the numbers mean without having to look them up.
@VLAZ Gotta make sure to confuse AI.
I don't even know how much code we have that handles this. Because it's used in different systems, there are custom validators, serialisers, deserialisers for each all over the place. I mean, sure, it's simple. Could have been simpler.
10:40
OK, I think I get the format now. I was initially confused by the examples where sometimes they'd use T sometimes not and it seemed random. Well, because it was - the examples just showed different variations. So the format is just P[number of years]Y[number of months]M[number of days]DT[number of hours]H[number of minutes]M[number of seconds]Sthe numbers themselves could be positive, negative, or even fractions, e.g., 0.5D for half a day (12 hours).
You can also use weeks but that's a different template, it's P[number of weeks]W and it's not within the year/month/day/hours/minute/seconds format.
You can omit the T but it's ambiguous between months/minutes. Basically, I can never see a reason to omit it. Unless you're omitting the full time part - so you just use years/months/days.
@Squirrelkiller I guess because the standard is stupid and inconsistent
You can also use an analogous format to ISO8601: P0001-02-03T04:05:06 is the same as P1Y2M3DT4H5M6S
You can also do like an "interval from" 2003-02-15T00:00:00Z/P2M is "start the 15th of February 2003 and end two calendar months later" and covers the period to the 15th of April.
11:37
@VLAZ If there is any Markdown code block formatting in a message, Oak removes it and formats the whole message as SO Chat monospace
@Michael mono Oak is strong in this meta
Since multi-line messages can't contain any formatting in SO chat
yes lol
@VLAZ I thought the T was required for all time units after days
@Michael I mean, it does make an awful lot of sense. But also "-P6H3M" -- parses as "-6 hours and -3 minutes" is an example given in the JavaDoc for Duration.parse() which does run counter to the text before it:
> The ASCII letter "T" must occur before the first occurrence, if any, of an hour, minute or second section. At least one of the four sections must be present, and if "T" is present there must be at least one section after the "T".
Although, also the way it's written might mean "there must be a T before the time section" or also "if a T exists, it must be before the time section". Which are not the same statement, the latter allows P6H as there is no T, therefore, doesn't need to obey the rules. The former mandates the format to be PT6H because it contains a time section.
When I use this format in the future, I'd just never omit the T for simplicity. Except if there is no time section.
Must have been a typo. They seemed to have corrected it in later Java versions lol
OK, then the newer version does make a lot more sense.
Related, Oracle should really invest in some SEO for the Java documentation. I keep googling for "java <some class and/or method>" and hit random other sites that don't really explain it. Usually GeekForGeeks or Baeldung or similar where there might be an example of how to use the thing but no real good explanation.
So, I end up adding "api" to the search. Which usually gives me the Java 8 documentation.
11:51
Which is still not great considering Java 8 is like 50 years old lol
But apparently a lot of companies still use it
Yep. Which is the current Java version, like 42?
(slightly joking)
@Michael *waves* Granted, we have a single product in Java 8 and it's in the process of being decommissioned.
24 I think
Well...it's a multi-year process. Not sure exactly when it's going to be dead. We're building a system to replace the old system. But it'd take a while to take over all the features.
So...never? lol
But there is basically no dev-work for the old product. The last update was when there was the Log4j issue. Then we updated the product to not use Log4j to prevent any problems.
11:56
What did you replace it with? The native Java logging?
@Michael I mean...I hope not. But, here's the thing, I started in this company in 2018 as the sole developer of the product. It's <X>4 as the 4th version of that product. Then years later found out that there was an <X>3 still running. Apparently because there were, like, 4-5 users of that system not migrated to version 4. Because the old one had 1-2 features that only those customers used.
@Michael Actually, just no logging... It was supposed to be done ASAP, so the easiest was to just implement the same Log4j interface as a no-op
We didn't lose much, TBH. The logging was horrendous at the best of times.
Not quite, but sort of, related - until I took over the project, I had never seen somebody use Java as if it was JavaScript. Some times conversions from number to string were done as "" + num
Overall, it was written poorly... the logging being weird was just par for the course.
@VLAZ That's totally fine to do lol. Just as efficient as Interger.toString()
It's not even great in JS. Just...popular but bad. But I find it even stranger in Java.
12:36
I was working on a codebase converted from VB 6 to C#. There was a wrapper around I don't know. Object? Which kept some VB horrific features
like it was supporting someDateTime + 1 being add 1 day
13:20
Well in JavaScript, you wouldn't even need to do that because it would convert it to a string automatically when needed lol
@ntohl Does it create 1-based arrays too?
14:05
@Michael it was totally mixed. But it wasn't handled by the wrapper I think. It was like depending on the source code file
 
2 hours later…
16:23
"oopsie poopsie, ur cloud all gone" youtube.com/watch?v=3GOAUyipnM4
^my favorite comment
@MikeAsdf Didn't that happen a while ago?
Ah, right. The description says "In May 2024"
this guy's vivid reenactment graphics take time
At any rate - the old 3, 2, 1 rule for backups still applies: at least 3 copies, at least 2 different media, at least 1 off-site.
16:38
yeah, sadly we have a couple hundred TB of azure blobs that thwart non-azure offsite backup approaches, and I'm pondering what the heck can be done
it's not the sheer data bulk that's the problem, but the fact that there's over 5 million itty bitty files
And azure has yet to give us an elegant copy-entire-storage-account dump api
Lol, OK - the video does mention the 3, 2, 1 rule
in song! 🎵🎵
But also seem they didn't actually have a disaster recovery plan for those backups.
It does seem backups existed. But apparently it took about two weeks to recover those and get the service operational again.
TBH, I heard of the incident before. I just didn't dig too deep into it at the time.
 
2 hours later…
18:18
this heat though
x_x
18:30
🔥_🔥
18:47
Hi all
I've got VS solution with an ASP.NET MVC project which calls a C# library project. This library needs to read a PDF file in a subfolder. Using this, it doesn't find the file while debugging,
var path = $"{AppDomain.CurrentDomain.BaseDirectory}{filePath}"
Where filePath is Resources\myFile.pdf
I looked into using this in the library project: System.Web.Hosting.HostingEnvironment.MapPath("~/Resources");
19:03
In Debug, it's missing the bin folder in the path
19:39
Solution: AppDomain.CurrentDomain.RelativeSearchPath ?? AppDomain.CurrentDomain.BaseDirectory

« first day (5049 days earlier)      last day (122 days later) »