Hacker Newsnew | past | comments | ask | show | jobs | submit | WolfCop's commentslogin

> In the case of Maduro, the operation cost around $300 million so a $400,000 payout isn’t providing a financial incentive.

It is if you are spending someone else’s $300 million, and getting the $400,000 yourself.


Or if you're the military commander with the option to disobey the illegal order (to go to war without congressional authorization) or take the bribe and execute the order. "Unmarked cash" (which this is) has pretty different purposes from official funds.

I think there's a pretty good chance the person who took that money was opportunistic, this time, but $400k isn't a trivial sum of money, it's not impossible it was the difference between this happening and not.


Does anyone maintain a programmatically accessible list of holidays for their company? Similar to the HOLIDAYS.txt in the article, but it would allow for things like “don’t run this the day before or during a company holiday.”

I work at a company with different holidays in certain countries, which would complicate things, and require something more structured than a list of dates. But having that accessible could be useful.

Has anyone tackled that, or come across a solution?


At our company we have enough systems reliant on holiday dates that we have a Holiday system that emits events when there are changes.

This happens surprisingly often, given that religious dates change and there are holidays/closures for storms in some regions.


Not sure what do you mean. I.e., what exactly is supposed to be the tricky part. Yes, I've dealt with quite a few processes like that, but I never tried, or would ever want to to put this into crontab. In fact, I don't know how the author intended his article, but if you consider doing that for production, I strongly advice you not.

What you do instead, is you schedule the cronjob for the most generic case, e.g. each day. And if it does not need to run 3 days before holidays with crescent moon when wind is blowing from the south, it is just the part of business logic of the process, which you write in the any proper programming language that you prefer (or that the system is written in anyway).

Now, how do you manage the list itself depends on the details and I've done all sorts dirty things that one probably shouldn't do (cutting corners), but in the most flexible case it is just some CRUD-type page in your back-office system, with a real UI, and there is a person (usually in the bookkeeping department of the company) who has it among his responsibilities to maintain the schedule. You store it in some proper SQL database and cache it aggressively, so the the myriads of cronjobs don't bother it more than necessary.


I think this could be solved quite similar to the OP and better done with systemd. Spitballing, but I think the best thing to do would be to write the timer in a standard file but have the activation time be written in an override file. That way you can ensure you are just editing that file with your scraper (should be able to hit the API if it is something like a google calendar or outlook).

I think the systemd timer would give you the benefit here as you can write the time in varying formats. Timezones, UTC, local, or whatever. That should give you the structure you need, if I'm understanding your problem correctly.

While systemd has more boilerplate than cron I think it has a lot of advantages that make it worth it. Best to just have a skeleton of these jobs (I keep some in my dotfiles) and then you have it. Or have the LLM write it (ironically one of the few instances I'll advocate for letting the AI write the code). You can do everything in the article and so much more.

https://man.archlinux.org/man/systemd.time.7


I've been at several companies that have tried.

One just did it with code where all the processes had holiday.json which would be checked at each launch, if it was holiday, it would do no work and exit.

Other one is operator that would monitor if it was supposed to be a holiday and either change systemd or Kubernetes to suspend the jobs.

I'd recommend code over messing with the system, much more flexible.


The GOV.UK website has a list of UK bank holidays on it. If you add a .json to the end of the URL you get this, a thing of beauty.

https://www.gov.uk/bank-holidays.json


Neat, what does bunting mean in this context?


I think it exists to power this easter egg?: https://github.com/alphagov/calendars/issues/678 The value I guess depends on whether its appropriate to put up decorations ie a 'celebratory' holiday. It looks like the only non-bunting holidays on there right now are Good Friday (which is more solemn) and Orangemens' Day (which is pretty sectarian), but apparently in the past the Queen's funeral was another non-bunting holiday: https://news.ycombinator.com/item?id=37789437


Ruby has https://github.com/bokmann/business_time but when I looked at it, custom code was needed to calculate holidays that were offset because they are on the weekend.


I had something come up recently that I think sounds similar. That project needs several time-sensitive jobs. When any one of them runs, the first thing it does is check a holidays.json file.

It parses the file using jq and compares its entries with the current time according to GNU date. At the root is the names of the jobs. Each job has its own list of holidays. Each of these holiday items in the job's respective list has keys for the display name of the holiday, the formatted date to compare to, and in a few cases the ISO day-of-week and a string containing a modulo arithmetic function (e.g. don't run the friday before Christmas, etc.).

Sorry, yes that means I call eval on that string and yes that means some of these are repeated in the same file under the arrays for the other jobs. Also, such lists will have to be maintained and the exact observed dates cannot always be known ahead of time beyond about a year since people can change their minds for various reasons (think bank holidays). Depending on your use case you may also want to define a start time and end time for a window of when this should or shouldn't run (i.e. business hours).

I don't know if that helps. I know it's hacky, but I don't think there's a nice way to handle things like "second monday after 4th of july, but if the 4th also happens to be monday then it should instead be the second tuesday". God help you if you also need to handle each holiday being observed in different timezones. At least at the end of the day none of this would be much code, just very terse code dense with meaning.


There was a good GDC talk about the car physics in Rocket League: https://www.gdcvault.com/play/1024972/It-IS-Rocket-Science-T...

Disclaimer: I worked on Rocket League, but not on the game client.


(2009)


It's Go we're talking about. Other than 64-bit the dominant word size, nothing much has changed.


The interface layout has changed since the article (although this specific article doesn't mention interfaces, a later article in the series does). Additionally Go now has generics.

It's true that little has changed, but very little is changing in the data representation of any language, really. Even ones that are evolving rapidly.


This is a truth that's easily overlooked; most languages are several levels beyond basic types to the point that people forget about the low level constructs involved. This is one reason why I like Go, it exposes and educates on fairly low-level mechanisms that are not unfamiliar to anyone who's studied computer science, but at the same time you don't have to worry too much about the lower level stuff like memory, pointers, zeroing, etc. I think it's a good tradeoff.


[flagged]


HN is not primarily a news site though, despite the name.


Streaming data, there was no error but also no new data available.


That is an error :)


I can’t recall ever seeing the contraction “who’re” before. For obvious reasons I suppose.


Currently reading the Dune series so this was a nod to Herbert's odd contractions. :)


Really? It's a quite common contraction even taught in schools last I remember.


It was named after a man called Pink. https://en.wikipedia.org/wiki/Pink_Anderson


Okay. Not named after a band member named Pink.

Unlike Pink, which is the stage name of the artist.


Looks cool, but getting an error in Safari after clicking "Deal with it!".

Unhandled Promise Rejection: Error: Unsupported MIME type: application/xml

On this line:

Q = await getGlassesImages(p, D, O);

This is a 2020 M1, Safari 17.6.


Yup, that's a regression I caused last night - see https://github.com/klimeryk/dealwithit/issues/38. Should be fixed now.


Does it run Doom?


It can


Where’s the source of this info? I can’t find it in the article.


Only for the A17 processor sold in their Pro line.


I might be missing it, but I don’t see a link to that info from Apple in the article.

But I did just find this, which confirms what you’re saying. https://www.apple.com/apple-intelligence/


iPhone 15 Pro Line


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

Search: