skysight-inc/HackerNews huggingface dataset:
Ask HN: RPG Inventory Sorting Algorithm?
Dear HN crowd.

I'm currently learning about algorithms, and I decided to think of a problem I encounter that I would like to solve. One such problem is when games (often RPGs) have a 'Tetris' style inventory system, with items of different shapes and sizes.

I have decided I would like to make a sorter for game I play, to help me quickly maximise my storage space.

However, after a preliminary google, I didn't find much in the way of resources for problems like this, so I assume my google-fu is weak.

Would anyone know of any examples, or preferably, underlying math/code to help me grasp this?

Thank you in advance!
But it's a queuing theory problem. The average is not a good indicator. It's how often does it reach a level that is so low you need to charge. Not the averages of the system. And it's not 0%. It's a level low enough that you don't want to bet on the charge rates
This only works if you work someplace that has complicated problems and/or architecture astronauts who like to overcomplicate everything. Every small, mid and even most large-scale tech shops are able to execute on goals using off the shelf software. How do we scale payments at my org? We pay Stripe. How do we scale search? We pay Alogolia. How do we scale our public facing web sites? We pay Amazon. I've been in architects/director roles at multiple orgs for over ten years and everything they ask at FAANG system design interviews is still stuff I've only read about.
This isn't NIH.

There are links between Silicon Valley, Google, Rust and their ideology.
You could argue that SO at least gives you some benefit - there are badges you can earn for popular shared links.
China has been doing something similar to try to slow the spread of the Gobi desert.

https://www.youtube.com/watch?v=pSn6S-H7m-8
https://en.wikipedia.org/wiki/Great_Green_Wall_(China)
This may be related to how much you have communicated with others about your experiences and events vs. how much your wife has. And not only communication, but how much time spent with inner reflection about recent events. This should play an important role in solidifying memories and making them persistent.
Show HN: CashGraphs – A securities portfolio optimizer
Hello,

This is a portfolio optimizer I made to help select portfolios for my clients. I'm a personal financial adviser. I generally put my clients in a mix of low-fee index funds and ETFs and I use this to set an appropriate allocation based on the client's risk tolerance.

I have been working on this as a side project to 1) improve the theoretical underpinnings of my investment recommendations and 2) improve my coding skills with frameworks like Vue and Torch. Here's the repository for the frontend: https://github.com/justinluther502/cashgraphfront.

The frontend site is Vue 2 + Vuetify, and the backend is an AWS lambda function running the Torch optimizer. I am still working out kinks in the backend, particularly cold-start issues because the Lambda function has to load the entire Torch library (~2GB). This occasionally causes the AWS API Gateway to reach max timeout before the Lambda function finishes. Any tips on addressing this would be much appreciated. My first thought is maybe to pare down the Torch library used in the Lambda function because I am only using a small subset of the full library.

The optimizer function itself is designed to overcome several classic shortcomings in Modern Portfolio Theory (MPT) (https://en.wikipedia.org/wiki/Modern_portfolio_theory). Unlike textbook implementations of MPT, this optimizer can utilize non-normal returns distributions, risk metrics besides variance, and can allow the user to specify tail behavior, such as asset correlations behaving normally most of the time but converging to 1.0 in severe downturns. Most of these "fixes" happen during the generation of custom "flavors", or asset selection universes. I have 3 flavors pre-built and there is some information on how they are constructed in the flavor selection page.

Any feedback greatly appreciated!

Justin Luther justinluther@lutherwealth.com https://www.lutherwealth.com
Putin doesn’t live in a communist country.

During communism dignitaries didn’t have much money-wealth, or even true material wealth. But they were powerful nevertheless.
Seems like police spend almost all their time dealing with poor people who own almost no valuable property.
I have the original hardback of this book: yellow cover with a black stripe. Happy memories growing up and trying some of the experiments in it including the flour bomb which was shockingly loud.
It doesn't eliminate the trust requirement for any of those at all.

It's easier to talk about zero trust by identifying the thing it is not. For example, ZT is not "it is sufficient to be inside X" where X is on a host, in a container or not, on a subnet (we are less than ten years way from having to argue with people about "why are we using encryption on our internal connections?"), or some other context, and so on.
You're downvoted, but yea - this post is #2 on my feed while the other Calvin and Hobbes was #1.
I'm curious to hear from people who buy or sell projects on sites like these about how they value the projects. I look at prices on sites like this from time to time, and no two of them seem to be valued according to the same principles. I'd be interested in participating in this market, but when the prices seem arbitrary like that I assume I'll end up a sucker, and stay out.
Why do I feel so pessimistic about this?
I don’t think this is that big of a problem today, after so many privacy leaks people are a bit more aware, at least in my experience. Also tiktok actually shows a popup that the link contains information about your account.
Here is a good way to do it, block the entire domain :)

Piece of s**
One of my biggest complaints about Ruby is that that it’s so much harder to drop into a debugger. In python it’s as easy as import pdb; pdb.set_trace(), but for ruby (at least the versions on our build systems), you need to figure out how to add the dependency for pry/byebug first which is non trivial.
Whenever I'm about to start a bash script, I have to say "shebang" in my head to remember which goes first: the "#" or the "!".
I wish r/kroger and r/antiwork would intersect more, it's so sad to see the experiences people post in the former
We haven't reported 2 consecutive qtrs of negative growth.
That analogy is poor because we don’t know of a good alternative to democratic governments. But there is an obvious alternative to unions that many workers do prefer.
Forget all of it and use Go :)
Cows have much larger brains than dogs and are quite intelligent, and so are pigs. The "dogs are special" argument is a familiarity thing or perhaps a statement that dogs evolved to more effectively manipulate human emotions.
Really deep down, i.e. at the level of hunger and what looks tasty to your body, eating animals is very right. They are a fantastic source of nutrition.

However, we also like to domesticate animals, as companions and helpers. Hence the conflict.

We eat way too much meat, but strict vegetarianism and especially veganism does not scale to the whole population of the planet - animals are simply too efficient at converting what we can grow everywhere but can't eat (grass mostly) to what we can eat. Simply, an exclusively plant based diet would require the elimination (by starvation?) of who knows, 90% of the world population?

Of course, strict vegetarianism and especially veganism is not much more than social signalling for a particular and narrow demographic - the cultural preferences and tribalism you allude to.
https://en.wikipedia.org/wiki/Knapsack_problem

much room for a cool game there; good luck!
I think this also contributes to men more aggressively seeking career advancement. I’ve worked with talented women who passed on direct opportunities to move up in the organization because they were secondary breadwinners and didn’t want the added stress.
Why rails buckle in Britain
> The only visible difference as a consumer is there are less (or no) automated checkout lanes.

...Really? That's a straight detriment in my book, as a customer.

I would generally prefer to support a union shop, but I'm extremely fond of self-checkout—and, in fact, further upstate, Wegman's has introduced a self-scan app that you can use to tally up your total as you shop, and just scan a code at the self-checkout register with your phone on the way out to pay.

One of the worst things unions can do is try to "protect jobs" at the expense of technological advancement, customer service, or improved product.
Please share that list with everyone.
Curious how you know you had more fun than others?
Stop the cross-site script kiddies from pwning you
Compensation levels in tech are still higher than most other places. It'd be pretty difficult to change careers into something tech-adjacent later in life and still maintain the same compensation. More likely you'll have to traverse the ladder again and this time with worse compensation. Relative compensation is a different story.

>Leaving tech is not the same thing as leaving work

Article would have to follow up on this either way. Where did the women leaving tech go off to?

From the male side of the perspective, GP is absolutely correct. Men have far more incentive to tough it out in tech than women do once at the point of gaining the financial benefits of living together, for quite a few reasons. Wouldn't be too farfetched to assume this causes tech to further optimize towards men, too, even if not intentionally sexist.
The fact that ruby makes this possible means the community will take advantage of it, to the point of abusing it sometimes. This hurts understandability of the code base. Too many times I would open a ruby code base and spend significant amount of time tracing where things are defined (mostly relying on suboptimal searching) because of the lack of explicit imports/requires.
Agreed, in complicated Ruby packages with layers and layers of dependencies it quickly becomes a nightmare to identify which class comes from which import, where it’s defined, etc. Never an issue in python
I do think unions had some (modest) benefit but the role of raw economic growth in improving worker rights is often understated.
I feel (especially in construction) that unions missed a chance to become a "guarantee of quality" - basically, certify that their members perform to a baseline, and if you have an issue with work they did, the union (or the company) will make it right. Basically self-policing.
So glad all these programs have gotten men into nursing and solved the problem. There's a lot of money in solving problems once and for all, unlike non-problems that can never be solved, but will always be just a little bit of funding or "social awareness" from being fixed. /s

My comment was not made in ignorance, but in full awareness of the futility and stupidity of such an approach. It's less "ranting" and more "mocking stupidity," which I will continue to do so long as busybody mid-wits keep thinking they are brilliant for upholding attempts to plan society as if they have discovered some novel brilliant plan on a moral crusade to save us from making our own choices.
Add to that it will be marketing tool for B2B market - "we support SSO and Zero Trust", your users will seamlessly login to our solution and after they login we check at each step if they have access to the resources they want to access.
For what it's worth that's also been my experience with some Ruby projects I have. Usually bum-simple Jekyll web sites in response to a dependabot warning.

It's almost always a fight to get going again and it seems so needless. Like just reinstall the gems from scratch if you need to, jeez, this isn't even a CI I don't need the gems to be literally identical to what was here a year ago, I just need "bundle exec jekyll serve" to actually do something...

That all said I still like Ruby as a language, it brings the good stuff over from Perl while being as expressive as Python and pretty damn fast to boot. And I recognize Python also has similar dependency challenges. But this is very irritating.
The behaviour of facebook and google for the past ten years suggests that revenue from tracking based ads must be multiple times that of plain old contextual ads, hence the continued push down this path?

You don't suddenly decide to stop doing evil for just a few percentage points after all.
We are proud to officially join the team at Playstation
Fair point, though serfdom largely ended much sooner than mass immigration to America and abject poverty by the standards of the time wasn’t that common.

EX: “In England, the end of serfdom began with the Peasants' Revolt in 1381. It had largely died out in England by 1500 as a personal status and was fully ended when Elizabeth I freed the last remaining serfs in 1574.[6] Land held by serf tenure (unless enfranchised) continued to be held by what was thenceforth known as a copyhold tenancy, which was not completely abolished until 1925 (although it was whittled away during the 19th and early 20th centuries). There were Scottish born serfs until the Colliers and Salters (Scotland) Act 1775 prevented the creation of the status, and 1799, when coal miners who had already been kept in serfdom prior to the 1775 Act gained emancipation.[7] However, most Scottish serfs had already been freed.“ https://en.wikipedia.org/wiki/History_of_serfdom#Great_Brita...
3x deeper - Louisville got 2” trenches. This went as well as you’d expect.
> You shouldn't need to use lock files if you're using semver properly.

You mean "if all your dependencies are using semver properly". Yes, you're right, and you've found the problem.
"Does anyone think Republicans / conservatives actually give a shit about unborn babies? I don't."

That begs the question. Beware of trying to fit and squeeze every phenomenon in the world into your own prejudices.

My experience with the pro-life crowd is that they really consider abortion on par with murder and that is what motivates them to fight on. Even in a country like mine, where abortion is widely accepted and pro-life positions won't help you electorally or socially at all.
Everyone would get 213 dollars a year extra if just their CEO didn't receive any compensation. Amazon employs approximately 1 million people in the United States and Andy Jassy received 213 million total comp in 2021.
At least in Venice we still eat, for example, frayed dry horse meat ("sfilacci di cavallo"), which is more difficult to find in Rome, where I now live.

Last Christmas I bought by mistake a horse sopressa[0] thinking it was pork and bought it down to Rome. My in-laws were surprised to say the least :)

[0] https://en.wikipedia.org/wiki/Sopressa
Hold on just to be clear: do you think the problem in Detroit is that the unions weren't powerful enough?
Cowboy Bebop had a really good soundtrack, but on a quick google I couldn't find anything that noteworthy that she's done besides that. What are you referring to?
> Animals that are both higher intelligence in our perception and closer to us day to day will fall into the category of disgust, imo.

Think in general this holds to animals seen as pets. Like in the West with adorable little guinea pigs, which in the Andes Mountain regions are a food source. And it makes sense too if you live high in the mountains that get snowed in in the winter, to have a bunch of them living in your home.
If Amazon wasn't such scum, I'd spend a lot more with them...
FB also claims their tracking is beneficial, they can show you more relevant ads this way.

Perhaps there are benefits to everything; is the cost, i.e. losing privacy, worth it?
also:

> - None of the ReSTish philosophical questionings

Adding to this,

- If you ever -do- need to drop to something else (i.e. GRPC, websockets) you're not having to re-translate all of your restishness into commands.
Would you rather end-users continue to get stuck with applications that ignore important things like accessibility, that can block some people from getting or keeping a job, so as not to kill some developers' motivation? I'm glad Raph is talking about the difficulties so they (hopefully) won't be ignored or clumsily bolted on afterward this time.

Edit to add:

"Those who cannot learn from history are doomed to repeat it." --George Santayana

I think the time for recklessly moving fast and breaking things in software, without taking into account known complexity and avoiding the mistakes of the past, is over. Our impact on the world, and the resulting responsibility, is simply too great for that.
Honestly it's mostly a novelty for me, I did it for bragging rights and out of curiosity.

1Gbps to 10Gbps has some tangible benefits like downloading large games in a fraction of the time, or doing super fast backups.

However when you have 25Gbps, you have a pipe twice as large as is common in standard hardware. You usually see yourself limited by 10Gbps peering links or by endpoints with only 10Gbps NICs.

And of course 25Gbps is faster than most conventional storage, you need very high-end NVMe or RAID to keep up.

If I'd have had to pay a bit extra every month, I probably wouldn't have done it. But since it was just the price of the hardware plus installation, I thought it was worth trying.
> I am severely limiting my meat intake, both from environmental as well as animal welfare pov. But what you express is an entirely cultural opinion.

I think claims about environmental damage and animal welfare are objective, not opinion.

> Humans are by nature omnivore animals. They always ate meat. But we do it now on industrial scale, eating way too much.

This is just naturalistic fallacy. We do lots of things in our modern lifestyles the last 100 years we never used to and stopped doing things we used to commonly do before that. Humans don't require meat to thrive any more plus climate change is a new problem we have to adapt to.
Love the hardware, wish I can run other another OS on it
Based on your "model everything as a table" sensibility, you might enjoy https://www.visidata.org/. It basically treats everything (CSVs, Excel files, the filesystem, SQLite files, etc) as tables and then lets you interact with them through a uniform table manipulation interface.
Ask HN: Venv, virtualwrapper, pipenv, poetry, pdm, oh my
Dependency and package management has seen a lot growth and attention in the Python community even in the last couple years. Everyone has their opinions on what to use, but for enterprise code bases, what is the recommended approach?

Ideally responses would include size of user base, number of package dependencies, any issues arisen, etc.

Thanks y’all. Needless to say, the most recent pipenv post on the front page has led to more confusion than I’d like to admit.
There are plenty of people out there who share Bill Watterson's beliefs about art or their creations. You just don't hear about it because obviously they aren't interested in shilling.
I do, however, wish that blatant self-promotion was more frowned-upon by our culture. It's hard to tell when the creator is motivated by sincerity or a cynical desire for personal gain.
I personally believe, though, that we don't live by money (or prestige) alone. I take comfort from the fact that for thousands of years others have shared this belief.
Your use case might be different from mine, but I find that usually there is some parameter needed for the command, usually a filename or sometimes the output from another command. Even if you're not accepting hostile data over the network, you probably want it to work correctly for any valid filename.

With a bash script, or shell commands as strings in general, I can usually with some work be reasonably sure that I'm handling filenames with spaces correctly, so that it doesn't explode when it encounters something unusual... mostly, probably, in most places ... I hope. But what about filenames with newlines? Probably not as correctly. Etc.

With a parameterized API, this all just works and is correct for all cases, so you don't have to think about arcane quoting rules.
> if they are earning 2%-4% profit margins

They're not (depending on the product).

My wife used to work in Halloween costume design for a wholesaler (and some of her costumes did end up in Target and Walmart, which was cool to see), and the retailers' margins on those were at least 50%.

As I said, the margin does depend heavily on the product, but do not assume that across-the-board average margins are anywhere near that razor-thin.
No, but many people use the whole ecosystem while they're at it.
Makes reading ruby so much more difficult. Also optional return statements. If you need to refactor a function, it’s not always obvious that it’s relying on an implicit return and super easy to break things IMO
More likely that we've been disconnected from the realities of the food chain; in general people didn't eat horses because they're more valuable as work animals vs meat.

Farmers et al who deal with animals day in and day out don't seem to have much problem also eating them.
I also like the term "Onion Approach to Security"
The pay is why the employees don't quit en mass.
I’m planning on buying an M2 Air. That leaves my mid 2012 Air running Catalina (poorly).

I don’t want to continue running the old Catalina system.

Is there a way to install Linux on that bare metal? What’s the best approach - direct install, or use something like QEMU underneath?
I am going to introduce a 2nd param - valuation (calculated by the team) which would be calculated by the algorithm. Buyer would have a choice if they want to consider our valuation or user's.

This is the rough idea tough, will try to get feedback on the same and improve it further.
Can't we have prime and have people paid sufficiently too?
ASP.NET Core defaults to Kestrel even on Windows
Thanks, I'll give it another try some day and try switching to local gems. I used the exact command you suggest and it didn't work, but I don't remember why. Unfortunately I didn't keep all the logs, so I don't remember exactly what all the errors were, but I think Passenger was the cause of about half of my woes and I'll look into replacing it.

Bundler was pretty damned useless though, I've had a much worse experience with that than I've ever had with yarn, pip or npm. It really shouldn't be necessary to nuke the whole Ruby installation to do a clean install from a Gemfile, and the errors it produces are extremely misleading and unhelpful.

I'm not really a Ruby dev, I just inherited an ancient Rails project and had to make it work (upgrading from Rails 4 to 7 in the process), so the project setup is less than ideal. I'm sure a lot of my problems were self-inflicted ;-)
The best hands-on practice was when I had to build my own, nobody to tell me to cut corners and time to do things right. It's important to do it right to know how to do it wrong (most company will prevent you from doing things right because of time/budget constraints).

Ask yourself:

- What constitute a _good_ infrastructure?

- Something flexible/adaptable ?

- Something predictable ?

- Something resilient ?

- Something easy to monitor ?

- Something else ?

- How do you prioritize these, who gets to decide which one matters most...

Architecture is asking a lot of questions, inviting others who will benefit/use your work into the decision making process.

One thing that I learned that is still helpful to me today is try to push as many decisions as possible to later, keep the door open for futur choices. Every system architecture is part invention, part discovery. As you put together your foundation, new requirements/restrictions will appear and you'll be happy to have the freedom to make some of your decisions then.
Valuation is a hard topic, at least four well know methods with lots of fuzzy parts. Sites like this require you do do your own diligence - which itself is hard work. It takes a lot of practice.
In the US at least there's a perception of it being "lower quality/class" meat, so that may also play into it (especially in media, etc).