Hacker News new | past | comments | ask | show | jobs | submit | bauble's comments login

That's downright ironic.


ZZ if you're musically inclined.


ZZ and then afterwards `top` just to make sure you really quit


I had a unit tests for a Java LocalDate that was being increased by one year. It checked whether the month and day were the same, and failed because the current day (29) didn't equal the year-hence one (28). I changed it to check that the difference between the days was less than two.


Previously your unit test was broken one day every four ish years. Now it's broken every day :)


A unit test shouldn’t even be depending on the current date in the first place


This is a hard-earned lesson, but it's true.

Instead of doing

  def do_something_with_date():
      now = datetime.now()
      return now - timedelta(days=2)
you should do

  def do_something_with_date(now):
      return now - timedelta(days=2)
and explicitly pass in edge-case dates into the `now` param in your unit tests.

Alternatively, if you're using Python, use the freezegun library to fix the current time in tests: https://github.com/spulec/freezegun


Right, fixed such test today


I thought it was a good reference. In both cases, the manufacturer placed illicit, hidden code that that could (and probably should) get it in trouble with the law.


I think the issue is that they tried to separate the input into a list of tokens, like ["5", "nine"], and work from there, which doesn't work on something like "oneight".


I didn't have that issue at all; I just looped through the 20 different tokens and found first and last instances of all of them, and compared the very first and very last of all instances.

https://github.com/xdavidliu/advent-of-code/blob/main/2023/d...


But a simple replace if you do it like this .Replace("one", "on1e") or .Replace("eight", "eig8ht")

Not elegant but still do the job.


It's funny how all of us used the `oneight` as the edge case to test our code on...


I used "eightwo"


I don't understand the reluctance to hire a system administrator. If you have two or more technical folks, at least one of them should be a sysadmin (or "devops" if you prefer). Pretending that it's an unskilled role that anyone should pick up reflects a poor understanding of the industry.


e^i*tau = 1 is pretty elegant, too.


Leadership.


*Better leadership.


Usually, people asking me questions don't want to hear "I don't know.". They want me to dedicate myself to solving their issue.


Unless there's something particularly special going on, presumably you could tell them the truth as it is initially (ie you don't know at that point) and not have that jeopardise dedicating yourself to solving their issue as soon as possible, when you'll give them a final answer.


"I'll find that out for you"


Sloppy reporting? In MY mainstream media?!

Currently the linked story, from TechCrunch, doesn't call it a "kitchen" sink. Kudos to them.


It's just a really bad pun on Elon's part. I don't think you can blame the mainstream media for that. I certainly didn't realize what he meant by it until I saw something explaining "let that sink in" because it was never my perspective about this whole thing


Join us for AI Startup School this June 16-17 in San Francisco!

Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: