News for hackers. Stuff that matters.
Re:Show HN: I had issues organizing my favorite recipes, so ... by swalsh on Sunday October 06, 2019 @07:40PM (#21176020)
I ended up building my own solution to this problem too (though mine is not open to public)

The main thing I wanted to optimize was menu planning. So I wrote a genetic algorithm which will generate a menu, add the score, mutate the menu in some way, and iterate. In my database I have a rough price per ingredient, and my families enjoyment of the recipe (though I have kind of a lagging gradient which reduces the score per recipe to prevent duplication). I also have included in my algorithm what I call slots. So something like a lasagna will take 4 slots where as a stir fry will be 1 slot. I sync my schedule and break it down to slots. This allows the algorithm to fit the recipe to the time available. I dont score slots though otherwise short recipes always win.

Since the algorithm optimizes based on the week, but keeps a running inventory it's pretty good at maximizing my grocery bill and family enjoyment. My average grocery bill is between $40-$60 a week. And I cook 5 times a week.

Re:Show HN: I had issues organizing my favorite recipes, so ... by 0xfaded on Monday October 07, 2019 @03:42AM (#21178384)
I've done this as well using scraped recipes from a website that conveniently labeled all ingredients with data tags for their referral program.

Although my goal was to find recipes that shared ingredients to cut back on wastage. I used a constraint solver (https://developers.google.com/optimization) and asked it to produce 5 recipes requiring the minimum number of ingredients, and was rather amused that the first run included such classics as "boiled egg", "butter potato" and "toast".

Re:Show HN: I had issues organizing my favorite recipes, so ... by fastturtle on Monday October 07, 2019 @04:43AM (#21178678)
That sounds like a fun project, where did you get the data from?
Re:Show HN: I had issues organizing my favorite recipes, so ... by 0xfaded on Monday October 07, 2019 @05:31AM (#21178915)
Don't really want to say because of legality of scraping, but it was a big one with convenient data attributes on the ingredient elements. Shouldn't be too hard to figure out.
Re:Show HN: I had issues organizing my favorite recipes, so ... by KurtMueller on Monday October 07, 2019 @08:17AM (#21179882)
C'mon now... talking about data attributes on a html element is not illegal.

allrecipes.com has data attributes on their ingredient list. seriouseats.com has css classes on their ingredients. those are two that i just checked on the spot.

Re:Show HN: I had issues organizing my favorite recipes, so ... by inferiorhuman on Sunday October 06, 2019 @08:24PM (#21176178)
I ended up building my own solution to this problem too (though mine is not open to public)

Me too, although I'm solving a different problem: organization. I'm not so concerned with cost or nutritional value. In the end I went with a somewhat simpler route: LaTeX (well xelatex). I built a couple document classes, one creates a letter sized document and one creates a 4x6 index card sized document. I used the former to concatenate all the recipes into a master PDF as well. This "master" PDF contains the recipes as well as indexes (by author, by ingredient).

I've tried tablets in the kitchen, but ultimately for me the most convenient thing was to just tape a printout onto a cabinet door and go from there.

YMMV.

Re:Show HN: I had issues organizing my favorite recipes, so ... by roel_v on Monday October 07, 2019 @08:03AM (#21179790)
You mind sharing? My home grown solution also focuses on generating physical documents, but I'm not so happy with my Markdown + custom formatting engine solution.
Re:Show HN: I had issues organizing my favorite recipes, so ... by x86mitch on Sunday October 06, 2019 @07:51PM (#21176053)
This sounds like something I would use if it were public. It would be awesome If I could swap recipes from the plan. For example, if I didn't feel like having stir fry I could swap it out for a meal with similar points.
Re:Show HN: I had issues organizing my favorite recipes, so ... by swalsh on Sunday October 06, 2019 @07:54PM (#21176067)
I've thought about making it public, but it's highly optimized for me... also therea no gui. It's just a command line app in python. I could make it open source though. It would be neat to see how other people modify it.
Re:Show HN: I had issues organizing my favorite recipes, so ... by karanbhangui on Sunday October 06, 2019 @08:57PM (#21176367)
Agree with the others, please consider making this open source. Would love to use and contribute to it!
Re:Show HN: I had issues organizing my favorite recipes, so ... by LeonB on Sunday October 06, 2019 @09:53PM (#21176645)
Maybe find some people from this list that you can try to present with a private alpha version - no polish no bells and whistles - less than an mvp. See what happens from there.
Re:Show HN: I had issues organizing my favorite recipes, so ... by vcavallo on Sunday October 06, 2019 @11:09PM (#21177001)
Re:Show HN: I had issues organizing my favorite recipes, so ... by workthrowaway on Monday October 07, 2019 @06:51AM (#21179356)
kudos! i got similar problems with optimizing recipes & groceries, but i never got past google keep and apple reminder.

anyway, a word of caution about open sourcing. people are quick to scream that you make the source available. but what about this? an article/blog describing in more details how you solved the problem instead? few people ever ask that.

what i saw with open source is, once you put the code out there, people will start requesting features, making you carry the burden of maintenance, etc. but ofc there are good things too. i just haven't seen it with small niche projects.

my 2 cents.

Re:Show HN: I had issues organizing my favorite recipes, so ... by swsieber on Sunday October 06, 2019 @08:01PM (#21176091)
I would love to see it even if only to see how that algorithm works.
Re:Show HN: I had issues organizing my favorite recipes, so ... by Centaurefox on Monday October 07, 2019 @05:41AM (#21178987)
I would also love to see it ! Please make it opensource if you can, thanks
Re:Show HN: I had issues organizing my favorite recipes, so ... by dba7dba on Sunday October 06, 2019 @10:04PM (#21176697)
Please make it open source if possible. I would love to be able to use it.
Re:Show HN: I had issues organizing my favorite recipes, so ... by x86mitch on Sunday October 06, 2019 @08:12PM (#21176133)
Would love to see it. Please reach out to me if you do open source it.
Re:Show HN: I had issues organizing my favorite recipes, so ... by ahnick on Sunday October 06, 2019 @11:31PM (#21177113)
Add me to the list of interested parties. :-)
Re:Show HN: I had issues organizing my favorite recipes, so ... by Sindrehan on Monday October 07, 2019 @12:54AM (#21177625)
I'm interested as well!
Re:Show HN: I had issues organizing my favorite recipes, so ... by blue_devil on Monday October 07, 2019 @05:34AM (#21178936)
I've a different take. I use a voice diary app that I built (originally for hiking trips) - I take a picture of the ingredients, then record the cooking instructions, and replay this when cooking (the picture shows as background when you play the recording). I add notes about the ingredients, or tags to the recording.

It's easier for me to "listen" to a recipe and pause as needed, vs. to look it up. It's a more casual approach though - no constraint optimisation, or anything like this, but I find it works great for me. Also I can share a recipe this way with someone else by just sharing the recording p2p.

Re:Show HN: I had issues organizing my favorite recipes, so ... by Mathnerd314 on Sunday October 06, 2019 @11:23PM (#21177072)
Sounds like https://www.eatthismuch.com/ but with a different algorithm
Re:Show HN: I had issues organizing my favorite recipes, so ... by Elof on Sunday October 06, 2019 @11:19PM (#21177056)
Would also love to check out an open source version.
Re:Show HN: I had issues organizing my favorite recipes, so ... by dba7dba on Sunday October 06, 2019 @10:01PM (#21176682)
I have been thinking about building something like this also. I work from home and so I open the fridge throughout the day for 3 meals, snack, lunch for kids etc.

And I noticed how much is thrown out despite attempts to not do so, because different items have different shelf life.

Re:Show HN: I had issues organizing my favorite recipes, so ... by Hypergraphe on Monday October 07, 2019 @07:12AM (#21179496)
Wow this looks like an app i could pay for. How do you score the candidates ? Manually ? How do you not end up with the same reciepies recommended all over again, i.e, do you always use a new mutation to try ?
Re:Show HN: I had issues organizing my favorite recipes, so ... by koolba on Sunday October 06, 2019 @09:13PM (#21176456)
How many people can you feed on $60 a week? Is this in the USA?
Re:Show HN: I had issues organizing my favorite recipes, so ... by swalsh on Sunday October 06, 2019 @09:48PM (#21176613)
I live in MA. This is for 2 adults, 1 4-year-old, 1 almost 2-year-old. I should mention, this price does not include the cost of lunches (The school provides lunch, my wife buys lunch at work, and I usually snack throughout the day instead of eating lunch). Next, I don't buy processed or pre-made foods. So I'll snack on nuts instead of chips. It started as a health thing (they're always filled with sugar, and stuff) but i've found it's also saves a bunch of money. I make my own stocks, and sauces. I cook a lot of chicken, and usually I'll buy bone-in thighs. It started as a flavor thing (I find breast meat flavorless) but it's super cost effective. A family pack costs $.99 a pound, so for less than $5 I can get 2 meals worth of chicken, some bones for stock, and some fat for schmaltz. The rest of the savings come from efficiency. My program groups like ingredients, so I have less waste. A cart full of fresh vegetables, some dairy products, a couple family sized proteins, the occasional staple, and a few bonus treats for the kids is super cheap.

My bill also doesn't include alcohol. I've given up drinking mostly to boost my night-time productivity, but I'll buy wine in bulk which I mostly use for cooking, though I might have a glass with dinner.

Re:Show HN: I had issues organizing my favorite recipes, so ... by fouc on Sunday October 06, 2019 @09:47PM (#21176607)
You can feed a family of 4 on $60/week in the USA. Especially if you buy staples and raw ingredients and cook everything from scratch.

Rice, flour, beans, lentils, etc should be the bulk of your staples. They are also dirt cheap. Remainder of the money can be used on fresh vegetables.

Re:Show HN: I had issues organizing my favorite recipes, so ... by Infernal on Monday October 07, 2019 @07:39AM (#21179624)
I would love to use something like this, sounds incredible.