[ad_1]
| submitted by /u/angmarsilar [comments] |
[ad_2]
/u/angmarsilar
Source link
Humor | ReportWire publishes the latest breaking U.S. and world news, trending topics and developing stories from around globe.
[ad_1]
|
I posted this a long time ago but think it's worth re-posting since I deleted that old acct. My kids are now in their mid 20's (dang, I'm old!). When they were little they made me this menu…it's still a family legend LOL submitted by /u/funkerama |
[ad_2]
/u/funkerama
Source link
[ad_1]
Philipp H was going through some log files generated by their CI job to try and measure how long certain steps in the process took. He took the obvious path of writing code to read the logfiles, parse out the timestamps, and then take the difference between them.
Everything worked fine, until for certain steps, a negative timestamp was reported:
> -1 day, 23:59:59.713529 section cleanup_file_variables
On one hand, having CI jobs finish before they were started was incredibly convenient, and certainly would make their integration much faster. Plus, they could probably get some funding to find the exotic matter which allowed the existence of the wormhole that clearly allowed this inversion of causality.
On the other hand, this was probably a bug.
Here’s a snippet from the logfile:
> 2025-08-18T14:49:40.748000Z 00O+section_start:1755528580:cleanup_file_variables
> 2025-08-18T14:49:40.754100Z 00O+Cleaning up project directory and file based variables
> 2025-08-18T14:49:40.461529Z 00O section_end:1755528580:cleanup_file_variables
The format is a timestamp with nanoseconds, followed by a stream identifier (STDOUT vs. STDERR) followed by the actual message.
If you look at the nanoseconds, you might spot something odd: the third timestamp occurs before the previous ones. The obvious conclusion one could draw is that this is a concurrency issue, and the log entries are getting printed out of order. Philipp’s naive solution won’t work, and he’ll need to sort the timestamps before doing the calculation.
But that conclusion is as obvious as it is wrong. Look more closely at those trailing zeroes. They seem a little odd, don’t they? Something off?
Here’s the Go code which generates the timestamps:
t := now()
t.AppendFormat(l.bufStream[:0], time.RFC3339)
l.bufStream = l.bufStream[:l.timeLen-fracs-additionalBytes]
l.bufStream[len(l.bufStream)-1] = '.'
nanos := t.Nanosecond() / int(math.Pow10(9-fracs))
leadingZeros := len(l.bufStream)
l.bufStream = strconv.AppendInt(l.bufStream, int64(nanos), 10)
leadingZeros = fracs - (len(l.bufStream) - leadingZeros)
for i := 0; i < leadingZeros; i++ {
l.bufStream = append(l.bufStream, '0')
}
l.bufStream = append(l.bufStream, 'Z')
l.bufStream = l.bufStream[:l.timeLen+4]
This appends the timestamp to the stream, then replaces the timezone indicator (Z) with a .. In calculates the number of nanoseconds, then the number of required leading zeros to get the fixed length. Then it appends the nanoseconds, followed by the leading zeroes, making them trailing zeroes. Whoops.
Now, this Go code doesn’t come from some in-house job, but from a major vendor of CI/CD tooling, which is what makes this tiny little bug a WTF. But hey, it’s very well commented.
Philipp writes:
We’re talking about a modern language like Go here and that really make we wonder, if they do not have a built-in function to format integers to strings with left-padding…
While I’m not a Go expert, I can actually answer this question: Go has made the explicit choice to keep the standard library as small as possible, to the point where loads of things you think should be there aren’t. Whether that extends to formatting functions, I’m not certain, but it results of a conscious design choice.
Setting aside whether or not one agrees with this design choice, there’s an argument to be had over it. It’s not, on its face, automatically wrong.
[ad_2]
Remy Porter
Source link
[ad_1]
“Easter 1987 and I’m posing proudly in my ‘sitcom stepdad/time-share salesman’ outfit.”
(submitted by Jeff)
The post Jazzy Jeff appeared first on AwkwardFamilyPhotos.com.
[ad_2]
Team Awkward
Source link
[ad_1]
|
Watch out for… submitted by /u/WishUponDeezNutz |
[ad_2]
/u/WishUponDeezNutz
Source link
[ad_1]
Tags: politics, latest news, donald trump, trump, america
52154 points, 1115 comments.
[ad_2]
[ad_1]
Today we have a true confession from Carl W. It has the benefit of being in R, which means that at a glance, I just assume “eh, looks fine to me.” I guess I’m turning into Jimbo.
But let’s dig into it. Carl’s first snippet is this:
for(kk in 1:length(thematch)) {
if(length(thematch)==0) break
}
“What WAS I thinking?” Carl asks.
You were thinking two things: you were thinking you wanted to iterate across a list, and you were thinking you didn’t want to do anything if the list was empty. That these wires got crossed is natural- but sure, this isn’t something that should end up in production code. The WTF is less the code itself, and more whatever allowed it to get released.
Carl’s next snippet is described as “Yes, let’s invert logicals as many times as possible.”
slice <-rep(0,length(newxx))
slicelog<-as.logical(cuts[j]<=newyy & newyy<=cuts[j+1])
is.na(slice)<-!slicelog
Because R is weird, <- is one of the assignment operators (it also uses =, but for different purposes, and don’t ask me to explain the difference), and because people like to have fun, it also has an -> operator (so the assignee is on the right side of the expression), and <<- and ->> versions which muck with scope in interesting ways.
In this example, the rep function replicates a value (0, in this case) length(newxx) times. So that gives us an array of zeros.
R supports broadcasting operations, so cuts[j] is an array and newyy is also an array (vector, if we’re using R parlance), and by comparing two arrays we get an array of boolean values. Which we then pass to as.logical which converts an array into an array of boolean values.
Finally, in R, the NA value is their version of null. Thus is.na returns an array which is true if the original input held a null at that index, and false otherwise. Which is definitely going to be an array of falses, because slice holds an array of 0s. We just made it. Then we assign to the return value of that function. This is syntactically valid, but as you can imagine, it doesn’t actually make sense- we just discard the result, at least based on me trying this in an R REPL.
Carl writes:
While the function containing these snippets was definitely a victim of “code it and design the requirements later,” I can’t believe that even Beginner Me wrote stuff that horrifying. But, it works perfectly so it ain’t gonna get fixed.
Ah, that last sentence there, that is a dark truth. And it’s important to note, it works perfectly: for now. But the world and runtime environment change. And someday, another developer will receive this code, and wonder, much like Carl, what the hell was going on when it was written.
In any case, Carl, consider yourself absolved. If it’s stupid and it works, well, it’s still stupid, but these WTFs are small and mostly self-contained.
Remember: code is a liability and starts accruing cruft and tech-debt the instant it’s released. The functionality that code delivers is the asset, but that asset is inextricably tied to the code, which encodes assumptions about the world which, even if they were true to begin with, become increasingly false as the world changes.
Also, if you haven’t figured out the headline, and because jokes are funnier when you explain them, this is clearly about a pirate’s second favorite programming language, ARRRR. Why their second favorite? Because their first love will always be the C.
[ad_2]
Remy Porter
Source link
[ad_1]
|
Siri does what itโs told no matter what ๐ submitted by /u/SaltyCaramelPretzel |
[ad_2]
/u/SaltyCaramelPretzel
Source link
[ad_1]
|
After all these years, still gold. (anime is lupin the third) submitted by /u/Chaf_2 |
[ad_2]
/u/Chaf_2
Source link
[ad_1]
Over the past few months, Ellis has been sharing the challenges of the modern job hunt. As I’m one week into my new gig, after a weird and protracted search, I thought I’d add my two cents, because kids: it’s nasty out there, for sure.
So, for starters, I wrapped up my time working on space robots, and have shifted over to farm robots. That’s right, I’m a farmer now. While it may be less glamorous, the business prospects, and thus the prospects of continued employment, are better. That said, I’m working with a startup so I wouldn’t say it’s all that safe. Still, good change for now, and maybe I’ll talk a bit more about what that’s like at some point. But that’s not where I want to focus today.
While my job search was shorter than many folks- about two and a half months- it was still a difficult trek. The biggest thing to my advantage is that embedded software engineers are in low supply relative to their demand. Also, the training data for embedded software remains a very small proportion of AI training sets, so LLMs remain pretty bad at it. It’s a good subfield to be in, right now.
And yet, the market still sucks.
Now, I’m an old person, which means I distribute resumes more as a k-selector than an r-selector. I wasn’t sending out hundreds of resumes, but I did send out dozens, which honestly is much more than I usually do by an order of magnitude. Of the dozens I sent out, I scored four interviews, one of which was a cold call from a recruiter, which we’ll talk about.
One interview was with a company in the railway industry. I spoke with their internal recruiter, and we discussed what kind of work I was doing, and what I’d like to be doing. It went well, and led to a call with the team. And that’s where I found out they were hiring for a management position, not an engineering position. I was wildly unprepared for that conversation, and both sides of the conversation felt weird and awkward about it. Our expectations were misaligned, and by the end of it, neither I nor they wanted to continue the conversation. The commute would have been terrible, so no real loss from my perspective, but boy, am I annoyed with that recruiter.
A second conversation, which I’m not counting as an interview, since I only spoke with the recruiter, was with a local contracting company. They handle a lot of government contracts (up to and including work on nuclear weapons), and were looking to staff up. The conversation with the recruiter went well, she had a number of positions (not involving nuclear weapons) that she wanted to recommend me for. She warned me that, as it was the end of the year, things might not move until early this year. I was fine with that. Things did move, though, right in the middle of the holidays I got an email saying the organization wasn’t going to move forward with my candidacy. No further insight was provided, but given how enthused the recruiter was, I was mildly surprised. But I have a suspicion about what happened, based on two other positions.
One position was for another local robotics company. They had a brand spanking new office, had just matured their main product into something really polished and sell-able, had an on-site cafeteria and were eager to hire. Their interview process was a bit involved with a number of phone screens in addition to the whole day on-site, but everyone was great to work with. They had big scaling plans, and there were going to be plenty of positions behind me to bring on.
“We’re going to get you your offer letter Monday or Tuesday of next week,” their internal recruiter told me. “It’s just our leadership team is at a summit, and we need them back before we send out offers.”
That was a weird thing to hear. It seems to me that you should be able to hire an engineer without clearing it with leadership, but what do I know? Monday came and went. Tuesday came. The recruiter called me back: “So, we’re not hiring anyone for any position at this time.” She was extremely apologetic, related how much the team was disappointed that they couldn’t bring me on, and that if positions re-opened I was at the top of the list for hiring. I found out later that the company did a round of layoffs, and the recruiter (who was great through the whole process) was a victim of them.
A different position came from a cold call from a third-party recruiter. Now, I don’t normally give third-party recruiters the time of day. I think, as an industry, they are parasites and scum, and generally more interested in their commission than making either employees or employers happy. But this position was doing embedded work for high-end audio-visual equipment for broadcasters, and was a massive raise. Oh, and it was 100% remote.
I verified that this company was real, actually shipped products, and had a decent reputation in the industry. So with that, I decided to hear the recruiter out.
“They’re really eager to hire,” he said. “So the plan is this: we’re going to set up one single panel interview for an hour. Everyone who needs to be involved in the decision will be there. After that, they’ll review, and give you a thumbs up thumbs down ASAP.”
That was a terrifyingly short interview, for both sides, but I’ve gotten some great jobs that way, so I was down for it. It went great, everyone was happy. Everyone on the call wanted to move forward with hiring. There was just one problem: not everyone who was supposed to be making the decision was there. A member of their leadership team missed the interview. And they couldn’t move forward without this gentleman’s thumbs up.
This lead to weeks of back and forth with the recruiter. They went from “eager to hire” to the recruiter saying “I don’t know, I can’t get anyone on the phone.”
Once again, the end of the story is that they opted to not hire for any roles, and yes, a round of layoffs ensued.
While we’re talking about recruiter cold calls, I got a cold text from a recruiter. I didn’t particularly like that on its own, but hey, it’s the modern era, everyone communicates via text. Worse, it was a significant down-level and salary decrease. So I replied back that I wasn’t interested.
I understand, and your experience certainly warrants consideration for a higher salary
That was the reply, along with a glaze about my skills and the opportunity for growth. It was obsequious, sycophantic, and unfocused. I exchanged a few more messages and the conversation started to get repetitive. And you know where this is going.
That’s impressive and very relevant! Working on critical systems for guidance and navigation pairs excellently with this role. Here at Smith & Nephew, you’ll need similar rigor developing algorithms for surgical robotics, where precision is key for patient outcomes. Your experience handling highly reliable systems and your background ensures you have what it takes for such critical work. Any platforms or microcontrollers you’re particularly excited about using?
Normally for job-search stuff, I’d conceal the source or be vague. I haven’t named any of the companies that strung me along because they were at least trying to hire me. But Smith & Nephew deserves to be named and shamed. Look at that: that is 100% chatbot. The recruiter can’t even be bothered to do their job, they have to outsource it to a chatbot. And if you’re not convinced, I replied: “This conversation can continue when it’s not with a chatbot.”
I understand your preference for more personal interaction. Thank you for chatting with me! I’ll make sure someone from the senior recruiting team gets in touch with you to continue the conversation on your terms.
I have not heard from someone in the senior recruiting team, which is a shame, because I have many rude things I’d like to say to them. It’s one thing to get a form-letter email, but a cold-text from a bot that just nags you for replies and tries to keep the conversation going is an entirely new level of “I don’t care about the candidate experience at all”.
The process with the farming robots company was about as you’d expect. A few phone interviews, a most-of-the-day on-site. Two separate technical screens looking for different things. A fun exercise was “pretend this is a pull request I submitted to you, do a code review with me.”
After the on-site, the director of operations (who was acting as the recruiter) let me know: an offer is coming, but there’s some paperwork they had to do on their side, so it’d be a few days. And boy howdy, after the job search I’d had up to that point, I expected “needing to do paperwork” to drag out for weeks and then hear they weren’t hiring. But that’s not what happened, and I’ve changed jobs.
While it’s only been a week, it’s so far, so good. There’s certainly a lot of work to do here, and they’ve got plans to expand their embedded footprint that will make me pretty pivotal to their future hardware revisions, and so it’s all exciting.
For those still hunting, and especially those between jobs: good luck. You’re not alone, and you’re not crazy for thinking things are bad out there right now. They’re awful. But you’re great.
[ad_2]
Remy Porter
Source link