HackerTrans
TopNewTrendsCommentsPastAskShowJobs

0xc0der

no profile record

Submissions

Attacking the knapsack problem

dev.to
1 points·by 0xc0der·2 года назад·0 comments

[untitled]

1 points·by 0xc0der·2 года назад·0 comments

[untitled]

1 points·by 0xc0der·2 года назад·0 comments

Show HN: Xuijs is A JavaScript library for creating reactive user interfaces

github.com
2 points·by 0xc0der·2 года назад·0 comments

Functions and inverses with 2 insightful examples

dev.to
1 points·by 0xc0der·2 года назад·0 comments

A simple JSON parser using pari

github.com
3 points·by 0xc0der·2 года назад·0 comments

Pari: More than a simple parser combinator

github.com
2 points·by 0xc0der·2 года назад·0 comments

comments

0xc0der
·2 года назад·discuss
> Your solution is not an exact solution to the knapsack problem, but a (relatively well known) greedy heuristic approach towards the problem.

can point me to where to find more about this.

> For a counterexample, imagine you have a ton of items that have a weight of 10^-20 and value of 1, and a single item that has the weight of whatever is the capacity of the knapsack (so it’s only thing that fits if it’s inserted to the knapsack) and the value of +infinity.

that is rather an extreme example. i do not see the how it affects the validity of the solution in most cases.

> I would recommend finding an open course on algorithm design and analysis and going through the lessons while trying to extrapolate approaches to problems instead of just solutions to them.

implementing solutions is the concrete result of extrapolating approaches and choosing the best one to implement. and that is the pragmatic approach.
0xc0der
·2 года назад·discuss
I have been recently thinking about the NP-complete class of problems particularly the knapsack problem (it is easy to understand and attack). And I think it is really solvable in polynomial time. I actually tried and posted my solution here. https://news.ycombinator.com/item?id=41341608 a bit of feedback would be really helpful.
0xc0der
·2 года назад·discuss
you are stuck; over analyzing your life. I mean it's not bad to be self aware of what is wrong with you. but the point is "what's next?". yes you know all this about yourself. what are you going to do do about it?

don't try very hard because you'll probably fail. 0.01% percent improvement every day is enough. read one page, walk 100 meters, ... you get the idea.

never victimize yourself. it's a self fulfilling prophecy.

your problem is that you are unable to fix your problem. if the solution can not come from yourself why not seeking help from others?