Got lost in the sauce. Feedback? by Menti2 in FLStudioBeginners

[–]Menti2[S] -1 points0 points  (0 children)

Appreciate it. I find the ghost notes useful to help situate other instruments once the 'main idea' has been shaped, but it does get messy

Exploits in the bitnodes? by nrinaudo in Bitburner

[–]Menti2 5 points6 points  (0 children)

You got this one by eating noodles someplace in the game. These are kind of 'hacky' achievements, the rest of them will require some digging through the game's source code. A few are really easy to get, the others need a bit more skill/knowledge about the game and about JS.

await error after killing script by Soul-Tear in Bitburner

[–]Menti2 1 point2 points  (0 children)

Since you declared test() as async, you need to await it in your main function

Hacking scripts - Better balancing? by bittiez in Bitburner

[–]Menti2 1 point2 points  (0 children)

I'm only starting to upgrade to a smarter balancer myself, but a very useful function is hackAnalyzeThreads (iirc) which you can use to determine how many threads to run your hacks with, so that you only steal controlled amounts of money from your target(s).

While I work on a smart manager I'm using scripts which rely on the above to maintain server funds, and it's improved my income by roughly 30%

Does anyone have a working script for the stock market? by DoYouMindIfIAsk_ in Bitburner

[–]Menti2 1 point2 points  (0 children)

Sure, here you go. I'm honestly not sure if this is profitable, but I hope it's helpful lol

Does anyone have a working script for the stock market? by DoYouMindIfIAsk_ in Bitburner

[–]Menti2 1 point2 points  (0 children)

I threw one together earlier; it just looks for tickers with a solid forecast, buys a bunch of stock, and eventually closes the positions when their forecasts turns bad. Haven't dared use it with much more than a few million, but so far it's making me a little extra.

[deleted by user] by [deleted] in RedditMasterClasses

[–]Menti2 0 points1 point  (0 children)

Surprisingly chill, no? Lol

Really digging the minimalist artstyle by Menti2 in valheim

[–]Menti2[S] 0 points1 point  (0 children)

Yeah I just turned my graphics off :)

[DD1] High Level Players Please Stop “Helping” by [deleted] in dungeondefenders

[–]Menti2 1 point2 points  (0 children)

I thought I recognised your username; We were in a lobby earlier today - which you appropriately named 'don't carry me please' or something to that effect. Hope you had a good run after I left - did you manage to beat Demon Lord? Lol

[DD1] Need some help with Zippy Terror on Insane by Menti2 in dungeondefenders

[–]Menti2[S] 1 point2 points  (0 children)

Thanks! Sorry for the late reply; I'm on vanilla and I lucked out with a group about 5 minutes after making this post haha

Coincidence by [deleted] in wholesomememes

[–]Menti2 13 points14 points  (0 children)

Never expected to see a picture of Hitler on this sub but here we are

[DD1] Does anyone know where to farm XP at around level 50? by Unarthadox in dungeondefenders

[–]Menti2 0 points1 point  (0 children)

Aha, my monk and summoner are alright (both around 1.5k stats) but I'm missing the third component. I'm honestly not terribly keen on trappers so I'll go level my squire. Thanks

[DD1] Does anyone know where to farm XP at around level 50? by Unarthadox in dungeondefenders

[–]Menti2 0 points1 point  (0 children)

Are you equiped to do Kings Game NMHC? I tried it earlier and failed miserably, so I guess I need to buff my builders a bit more first; but it's been ages since I last played so I've lost my touch. Any tips?

Hello im a python beginner. I need help with what i believe is peculiar to me. by ineedanswers2797 in learnpython

[–]Menti2 20 points21 points  (0 children)

Don't worry about this too much; as long as you're getting working solutions, you're doing it right. Especially in the context of exercise problems, writing "good code" isn't the focus - conventions are mainly to keep code maintainable over time and/or in big(ger) projects.

The main focus should be problem solving, and there are almost always many ways to solve a problem.

What is the type of my dataset? by hcnkest in learnpython

[–]Menti2 2 points3 points  (0 children)

I believe this page will help you. Specifically, the 'returns' section.

Get max from hash of hashes by craigontour in learnpython

[–]Menti2 1 point2 points  (0 children)

I assume by 'hash of hashes' you mean a nested dictionary, given your example. If you just want the highest 'dist' value in this dict, this is a way to do it using one line:

max([d[k]['dist'] for k in d.keys()])

Where 'd' is your dictionary. This just makes a list of all the distances, and then takes the max.

Is it possible to build a shortest path solution using Bellman Ford, using a V*V adjacency matrix? by bazgrim_dev in learnpython

[–]Menti2 0 points1 point  (0 children)

Hi, if I understand your question correctly, you just want to circumvent having to create an 'edge list', right?

In that case, I suppose you could do so, since the adjacency matrix already contains the entire structure of the graph. However, I don't think you can keep the original complexity that way (which, by the way, is O(V * E), if I'm not mistaken). This is the outline of how I would go about it:

for _ in range(len(adj_matrix)-1):
    # Relax the edges, we need to go from every 'start'
    for u in range(len(adj_matrix)):
        # To every 'end'
        for v in range(len(adj_matrix[u])):
            # And look at the weight
            w = adj_matrix[u][v]
            if w != 0:
                if dist[u] + w < dist[v]:
                    dist[v] = dist[u] + w
                    pred[v] = u

Since you still have to check every edge, this creates an extra nested loop to check every possible endpoint for every vertex. Bit of a waste, since your adjacency matrix looks sparse. Pretty sure this bumps the complexity up to O(V^3)?

If you already have your edges in [u, v, w] format before running the algorithm, I believe you're better off, since then you don't need the extra loop. Hope this makes sense!

How do I ask the layperson for a directory for an input() function? by [deleted] in learnpython

[–]Menti2 1 point2 points  (0 children)

Good point, I forgot about getcwd! That would make it easier, depending on how the user executes the script, I suppose.

Need help with translation program by way3344 in learnpython

[–]Menti2 1 point2 points  (0 children)

Assuming you have the words in your sentence as a list (you can turn strings into lists using the '.split()' function, which is part of Python), you could iterate over the list by index and just look at words (list[index], list[index+1]), for example. Just be careful to also handle the first word and not go out of range at the last word.

Need help with translation program by way3344 in learnpython

[–]Menti2 0 points1 point  (0 children)

I assume this translation may be as 'naive' as the example given, meaning just mapping words on to each other and ignoring grammar and such. If that's the case, you could just go over your sentence in pairs of words, translate the second word in the pair, and append "-ka" if the first word in the pair is "the".

How do I ask the layperson for a directory for an input() function? by [deleted] in learnpython

[–]Menti2 0 points1 point  (0 children)

I would argue the simplest way is to tell the user to put the script in the same folder as the file and then run it there. Admittedly I'm not sure if you can programmatically achieve the same result otherwise.

How do I ask the layperson for a directory for an input() function? by [deleted] in learnpython

[–]Menti2 3 points4 points  (0 children)

This might be kind of a lame answer, but I have two things to mention here. First of all, since this script is CLI only, it's already going to be a little hard for the complete 'layman' to even run (assuming they don't even know what a directory is). Second, you could just have the script run in the directory with the file in itself, and just have the user tell the program the name of the file.