MurphyA/hacker-news huggingface dataset:
by koladev32 | 2025-05-11 20:24:14+00:00
Hey everyone, I've been working on some projects using Django for about five years now. But when I discovered DRF, I've decided to focus on building backend API applications without dealing much with the frontend. But about a year or two ago, I started to build APIs for some SaaS projects, and I realized I needed a robust API key management system.

I initially used https://github.com/florimondmanca/djangorestframework-api-ke... which is fantastic and has everything you need for API key systems, including great authorization and identification based on Django's password authentication system. I will say this library shines if you only need API keys for permissions and nothing more. However, when I wanted to push the package further, I hit some limitations. I needed features like key rotation, monitoring, and usage analytics to help with billing per request and permissions and better performances as the package use passwords hashing algorithms to create api keys.

So, I decided to create my own package. I've been working on it for about nine months to a year now, and it's come a long way. Here are some of the key features:

- Quick Authentication and Permission System: You can easily implement authentication and permissions, for example, for organizations or businesses.

- Monitoring and Analytics: There's a built-in application to track the usage of API keys per endpoint and the number of requests made, which is great for billing or security measures.

- API Key Rotation: This feature took some time to perfect. Because the package use Fernet to encrypt and decrypt the api keys, you can smoothly rotate API keys. If you have a leak, you can start using a new Fernet key while phasing out the old one without any service interruption. You can choose between automatic and manual rotation. The old Fernet key will be used to decrypt api keys, while the new Fernet key will be used to encrypt new api keys. This gives you time to send messages about an ongoing key migration to your users. https://cryptography.io/en/latest/fernet/#cryptography.ferne...

The package is currently at version 2.2.1. I initially released version at 1.0 in the beginning, but quickly realized I should have started with a lower version number. I'm continuously working on improvements, mostly on versioning. For instance, typing is not yet fully implemented, and I'm working on enhancing the documentation using Nextra in the next few weeks.

I'm looking for feedback to make this package even better. Whether it's about security measures, missing features, or any other suggestions, I'd love to hear from you. You can find the package https://github.com/koladev32/drf-simple-apikey. Thanks for your time and any feedback you can provide!
by jemmyw | 2025-05-11 20:25:33+00:00
Nice site, I found some interesting stories.

I do find it a little annoying that when we have these discussions about vanilla vs frameworks people hold up an example and I go there and see a news site of articles rather than a complex application, and I think to myself yeah I wouldn't have used a framework in this situation anyway. It's annoying from 2 directions: the first that people ARE using frameworks for sites that shouldn't have ever had them in the first place, and I can bring to mind a couple of news sites I visit regularly where this is obviously the case because of the silly ways they work. Secondly that this is then held up as an example, because most of my work is on very interactive sites so I end up thinking well yeah but that's not going to work for me is it. My feeling is that I could do vanilla but would end up with something like a site specific framework.

My current approach is to use a framework and consistent patterns but to try and use as few other dependencies as possible.
by insin | 2025-05-11 20:26:27+00:00
If I'm just adding sprinkles of interactivity to a statically-rendered page for something that vanilla is good enough for (i.e. minimal-to-no display logic), I use the expando giving an element an `id` adds to `window`:

<textarea id="userNotes"></textarea> <button type="button" id="copyButton">Copy</button> <script> copyButton.addEventListener('click', () => { navigator.clipboard.writeText(userNotes.value) copyButton.innerText = 'Copied' setTimeout(() => copyButton.innerText = 'Copy', 1000) }) </script>
by nickpsecurity | 2025-05-11 20:26:43+00:00
Most top scientists were deists or Christians at one point. Newton's Principia Mathematica was even written to glorify God. Clearly, neither atheists nor evolutionists found the number of people making that claim to be good enough to ignore another claim.

Scientists tell us all ideas, whether a proposal or dissent, are evaluated strictly on evidential merit. Yet, evolution as origin of life had little evidence, many flaws, was forced on people anyway, and dissenting papers aren't allowed.

If it is dogmatic, and dissent isnt allowed, it is not science at all. Just a godless religion or political domination done with scientific wording in their papers. A consensus by people who force everyone to think one way isnt a scientific consensus. A theory whose rebuttals aren't even allowed in scientific journals isnt a scientific theory.

Until alternatives are allowed, and a real debate happens, I reject macro-evolution as either the truth or even a scientific consensus. I'll throw in some example counters, most being strong, which I wasn't taught in high school or college.

https://www.epm.org/resources/2010/Oct/3/ten-major-flaws-evo...

https://www.icr.org/article/four-scientific-reasons-that-ref...
by MrJohz | 2025-05-11 20:26:46+00:00
Could you explain what you mean by "storing it in a variable"? It's perfectly fine to store data in a variable (that's what most frameworks do in the end), but that state needs to be reactive in some way — updating that state needs to trigger the necessary UI changes (and ideally in such a way that the entire component isn't being regenerated every time the state changes). This is what makes state management so hard.
by HPsquared | 2025-05-11 20:26:55+00:00
Ah interesting, I wonder if Tesla is an exception and if their systems do in fact follow ISO 26262. Standards are not necessarily legal requirements, and not necessarily checked by external people.

It sounds like their ABS system wasn't designed as carefully as conventional systems if there was such poor braking performance. Reading around, it might have been related to the emergency brake assist functionality not being calibrated properly.
by hirvi74 | 2025-05-11 20:27:59+00:00
In my city, there is a relatively large, man-made lake not too terribly far from the downtown area. Apparently, there are still buildings, cars, etc. at the bottom of the lake. Instead of clearing out the area, the city just decided to flood the entire area over. In times of drought, some of the building foundations can still be seen from an arial view.

I doubt the environmental impact was positive, but the point I am trying to make is that I wouldn't be surprised if current infrastructure was just left to be swallowed by the sea.
by super_ar | 2025-05-11 20:28:15+00:00
Great question! RMT can work well when eventual consistency is acceptable and real-time accuracy isn't critical. But in use cases where results need to be correct immediately (dashboards, alerts, monitoring, etc.), waiting on background merges doesn't work.

Here 2 more detailed examples:

Real-Time fraud detection in logistics: Let's say you are streaming events from multiple sources (payments, GPS devices, user actions) for a dashboard that should trigger alerts when anomalies happen. Now you have duplicates (retries, partial system failure, etc.). Relying on RMT means incorrect counts until merges happen. This situation can lead to missed fraud, later interventions, etc.

Event collection from multi-systems like CRM + E-commerce + Tracking: Similar user or transaction data can come from multiple systems (e.g., CRM, Shopify, internal event logs). The same action might appear in slightly different formats across streams, causing duplicates in Kafka. ClickHouse can store these, but it doesn't enforce primary keys, so you end up with misleading results until RMT resolves.
by fallingknife | 2025-05-11 20:29:26+00:00
Universities are the main gatekeepers of the class based oppressive system you complain about. The current bureaucratic governing structure of the US has been created by the liberals during the period from the New Deal through the early 90s when Democrats had almost unbroken control of congress. So, regardless of whether conservative complaints are valid, liberals are the correct people to complain about if you are unhappy with the current system because they are the ones who built it.
by bitwize | 2025-05-11 20:29:51+00:00
Hell to the yes!

int PASCAL WinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance, LPSTR lpszCmdLine, int nCmdShow);

If you know, you know.

I'm to understand that entire divisions of Microsoft itself no longer know how to code anywhere near this level, which is why many of their flagship applications (looking at you, Microsoft Teams (work or school)) are Electron monstrosities you can watch draw themselves like Windows 1.0 apps -- on modern multicore hardware.

EDIT: more correct function sig
by JumpCrisscross | 2025-05-11 20:30:16+00:00
> at least in the US, that the costs to mitigate sea-level rise would not be shared across the US, at least in those places with significant population?

Probably. Despite our partisan poisoning, our coastlines are split across red states and blue states. A unified coastal defence bill probably has political purchase. (Though not under MAGA/DOGE.)
by coolcase | 2025-05-11 20:30:39+00:00
He brushes over ethical concerns of BNPL but draws the line at sports betting.

But BNPL by design encourages you to buy things you can't afford and complicates your finances with more timed bills to pay. It makes it more likely people don't budget well and form buffers.

A PNBL would be better, add 10% tithe to every purchase that goes to a checking account. Once that reaches $1k it overflows to an index fund.

He says it won't be like 2008 bundling this stuff up and that might be right or wrong. To be 2008 you need 2 ingredients: combined gambling and banking operations at the banks (a legalised FTX of sorts) and some liars in the system misrepresenting the risk. Maybe a 3rd ingredient is a crazy/frenzy driving up the gambling into the bubbled asset.
by mtlynch | 2025-05-11 20:30:56+00:00
Thanks for sharing, OP!

It's probably too late, but this qualifies for "Show HN" if you update the title to have the prefix "Show HN: ".[0]

I think the size of the source is actually more impressive than the size of the binary. I'm impressed that you can implement the whole thing in what looks like about 1 KLOC in just four .c files.

[0] https://news.ycombinator.com/showhn.html
by hanlonsrazor | 2025-05-11 20:31:05+00:00
There is value, yes. However, things are rarely so black and white as the commenter above you sees it wherein one could simply disconnect entirely. The reality of it is within our current zeitgeist the digital world is unavoidable - be it in the workplace, the condensation of our activities (incl. unavoidable ones- banking, etc) into apps on our phones.

Of course this is barring the idea of withdrawing all ones savings and moving onto a farm and living off the land :D.
by alwillis | 2025-05-11 20:31:15+00:00
> I would want to set it for all <a> elements, without adding `class="alib-link"` all the time.

a { /* the code from the alib-link class */ }

If you need to style anchor links depending on where they point to, you could use an attribute selector:

a[href*="news.ycombinator.com"] { /* more css */ }

No preprocessing necessary.
by MrJohz | 2025-05-11 20:31:16+00:00
Yeah, I think the original question was a bit weirdly worded which made people focus on web workers rather than complex data in general.

You can use properties (as opposed to attributes) as I demonstrated, and you can use methods like you suggest, but these are both verbose and limited, and add an extra "the component has been created but the props haven't been fully passed" state to the component you're writing. Imagine a component with maybe five different props, all of which are complex objects that need to be passed by property. That's a lot of boilerplate to work with.
by SOLAR_FIELDS | 2025-05-11 20:31:37+00:00
This treatise, from someone obviously in the industry, is merely another payday loan shark attempting to justify the existence of their clearly predatory products. How many of the consumers of this product are even remotely able to comprehend the piece as-is described? The article describes a "complete market". Yes, a market that is completely able to extract as much money from an exploited, uneducated populace as possible. Is that the kind of market efficiency we should be advocating for?

The part of the "free market" that these fat cats always gloss over is that a cornerstone of a free market is that the consumers of the market are able to make educated decisions about the products that are available to them. If the populace is incapable of doing so in the way the products are presented to them, is that really a free market?
by ARama | 2025-05-11 20:31:47+00:00
We use to do this by making use of the cloudtasker gem.

However we've recently just migrated to Sidekiq. We regularly found that the time to enqueue a job with cloud tasks was anywhere from 200-800ms. We often have workflows from users where they need do something that would involve a batch of say 100+ jobs. The time to process each job was minuscule, but actually enqueuing them took a long time.

Time to enqueue with Sidekiq / redis was brought down to under 20ms. We can also make use of bulk enqueuing and enqueue all 100+ jobs in one redis call.

However when we were first starting out, it was a godsend. Made our infrastructure significantly more easy to manage and not have to worry.
by AStonesThrow | 2025-05-11 20:32:58+00:00
Well, it may surprise you to know that surnames such as "Cook" and "Butler" are occupational and actually derive from men, centuries ago, who were actually cooks or butlers and eventually coined a newfound surname from that occupation (which may often be passed down father-to-son.)

So if a modern fellow is named "Jon Cook" it may indeed be a regression hearkening back to one or more of his ancestors and how they were named.

I am more accustomed to "nominative determinism" being associated with a person's given name, and how they grow up to take on a given role.
by shaboinkin | 2025-05-11 20:33:38+00:00
Sure, but we’re talking about hundreds of miles of coast line all being affected, within various regions as the article points out, at relatively the same time. Thousands of coastline if we want consider a worst case rate of increase. The leaching of whatever is soaking into the water will likely occur in localized areas at similar rates. It seems reasonable to me it’ll introduce shock to the ecosystem if considered in geological timescales.
by Dwedit | 2025-05-11 20:35:06+00:00
When you include "No tools" in your requirements, you're locking yourself out of WebAssembly. WebAssembly still requires that you have a C compiler that can target WebAssembly binary format. Zig works well as a compiler for this purpose, even if it's just building C code.

WebAssembly doesn't need to be bloated, I've written a C program that imports nothing, and the resulting WASM file is under 3KB in size, and there's under 10 lines of code to load it up.
by hengheng | 2025-05-11 20:35:27+00:00
I have been wondering the same, but slightly differently.

Tier 1 suppliers have enough resources in both know-how and manpower that I have been wondering if they could do a platform car. Provide a basic frame that passes crash, provide a basic engine that passes emissions, provide basic safety, etcetera.

Then invite other parties to upgrade components. Package lots of air between components to simplify compatibility.

I suppose the only way to get this going in the real world is a big military contract, but I am wondering if it wouldn't be smart play for everyone involved. It would be deadly for a bunch of traditional automakers, but they can't do anything preventing it.
by kjkjadksj | 2025-05-11 20:35:34+00:00
The tijuana situation is pretty untenable when you view it less along internatial border lines and more along metro region lines with SD and TJ being part of one megacity. They very much are a megacity in practice.

Now imagine the flack that would happen if you say took the Bronx and subject it to border security checkpoints and let the people have materially significantly worse sewer and other living conditions. People would call it a travesty and a dark mark on nyc as a whole for allowing such a thing to happen to its own people.

Yet over in SD that very situation happens with all the commuters and trade that goes on between there and TJ. And people don’t bat an eye to it, if only to blame TJ for the sewer situation.
by JumpCrisscross | 2025-05-11 20:35:52+00:00
> Including this data in one of those sets would demonstrate that there are plenty of times in history where the sea level changed the amount it has in the last 50 years

In history? No. Sea levels have never been higher in the written record.

In geologic history? Of course. No serious scientist argues otherwise. The point is returning to those levels means abandoning Baltimore, Houston, much of Los Angeles and most of Miami and multi-trillion dollar projects to protect San Francisco, New York and Boston.
by ChuckMcM | 2025-05-11 20:35:54+00:00
From the article: "Evidence of that dichotomy is not hard to find. As automakers have introduced vehicles with more advanced computing and electrical architectures, they have also struggled to deliver bug-free software on time."

This was something that really hit me when the Internet allowed game developers to ship a game that wasn't done. You got the game, and the first thing you did was download a "patch" that was at least as big as the CD the game came on (several hundred MB). I've got "released" Windows98 games on CD that are essentially unplayable because what was shipped on the CD was unplayable and without the update server on the network sending out those critical fixes, its never gonna work. For game archivists that means finding a fully patched install and then preserving that.

This is a shitty experience that serves manufacturers but not their customers. I don't expect it to get better any time soon but I wish it would.
by crystal_revenge | 2025-05-11 20:36:00+00:00
> This stinks of circular reasoning. It's bad logic because climate deniers use it and climate deniers are wrong because they only ise bad logic.

That would be a good point, if that was what I was arguing but it's clearly not. I am pointing out that this is a common form of argument used by climate deniers, and then, independent of that fact, demonstrating why it's poor logic. My argument regarding why the logic is poor has nothing to do with the fact that's it's a commonly used line of reasoning in climate denial. However the classification of the logic as such is useful to help people quickly identify the common set of erroneous methods used that show up very frequently in online discussions (and sadly, very commonly on HN).

Climate denial arguments do tend to use faulty logic in a similar vein to the way creationists tend to use faulty logic, because the evidence in favor of the alternative hypothesis is so much greater the easiest way to "attack" that hypothesis is through poor use of logic. But clearly that does not imply that all logic employed by people in these camps is inherently faulty.
by rchaud | 2025-05-11 20:36:06+00:00
This is the primary positioning tactic used across the startup industry . Uber isn't a taxi app, it's actually the "future front end for millions to access autonomous transport". Doordash isn't a delivery app, it's an "on-demand logistics" platform.

Similarly, Klarna isn't a shady payday loan company, it's an "AI-first consumer finance play".
by perlgeek | 2025-05-11 20:36:26+00:00
Some features I've found useful:

* giving me the current fuel and battery levels in the app

* giving me an ETA on when charging is finished

* locating my car

* telling me if the car has been sitting there for a few minutes with ignition off but doors unlocked, giving me the option to lock them remotely

* telling me about open windows, giving me the option to close them remotely

None of them is really crucial, but for a hybrid or EV, getting the ETA for when the charge is finished is pretty useful.
by darkwater | 2025-05-11 20:37:15+00:00
> Picture Alice, who forgets a $25 installment on her $100 DoorDash transaction. She’s hit with a $7 late fee, tacked onto her next payment. Annoying, but it probably won’t push her down a debt spiral.

This is so disconnected from reality that it's not just worrisome but despicable. Why did Alice missed a 25$? Maybe, just maybe, because she struggles to make ends meet, so if she had problems paying 25$, now she will have MORE problem paying 32$. Yes, she could have not chosen to use Klarna and she could have not chosen to buy something at all, but hey, who is gonna pay that IPO now?
by atoav | 2025-05-11 20:37:25+00:00
Maybe there is this disconnect, but half of the react developers I personally met used react: "because it is good on resumes and I don't understand how to work without a framework". So I am not entirely sure we have the whole picture here.

I also write more complex webapps using vanilla webtech (with a strong server-side solution like flask, django or similar). I checked out react it just hasn't clicked yet for me in combination with my serverside style.
by DiscourseFan | 2025-05-11 20:37:40+00:00
I am not sure why kids need to be in school. As long there are good labor protections in place they’d probably find it more valuable to work and make their own money rather than get yelled at by parents and teachers all day while they goof off doing unproductive labor like scrolling through instagram or playing fortnite or whatever it is kids do these days to waste time.
by dismalaf | 2025-05-11 20:37:58+00:00
> curious about Odin, I'm mostly a go dev so getting something without the GC and go schedule that writes similarly is really interesting to me.

It's very pleasant. Reminds me a lot of Pascal, but modern and even nicer to write. There's some Go inspiration but I'd say it's more like Pascal than Go. More full featured than Pascal or C, simpler than C++ or Rust. C bindings are super easy to use. Has array maths, Fortran style... I use it whenever I have an excuse to (not often enough). Super fun, just missing a large ecosystem (but it's also got bindings to enough stuff for a young language).
by evantbyrne | 2025-05-11 20:38:02+00:00
Maybe I'll write a blog post on it someday. It depends on the exact method you use to build the calendar my man. You could just change classes and attributes. Or you could use a variable within the scope of where you initialize the component. I wouldn't re-render the whole thing to apply changes, but that's up to you. The nice thing about using vanilla APIs is you don't typically have to worry about thrashing the DOM with unnecessary renders because that's rarely (perhaps never?) the easiest way to patch changes to it, unlike in React where useMemo is prevalent.
by gibbitz | 2025-05-11 20:38:22+00:00
I don't like that title of this article as the article is really showing that Buffet's track record and investment strategy are proof that US markets are irreparably broken due to the lax enforcement of anti-trust in the last 30+ years. It's not that Buffet is encouraging this or actively fighting a free market, he set a very conservative strategy of investing in monopolies and then all sectors fell to monopolies. He figured out how to beat the house and the house didn't care. Good for him, bad for non-billionares...