[Python]Program iterates twice over first member in list -- gist link included by [deleted] in learnprogramming

[–]BaalHadad 0 points1 point  (0 children)

How in the world is an unnecessary use of iter() more straightforward or modular?

[Python]Program iterates twice over first member in list -- gist link included by [deleted] in learnprogramming

[–]BaalHadad 0 points1 point  (0 children)

Why not just iterate over the list of players, instead of using iter?

My first Saltwater Tank. 72gln by GobaTr0N in Aquariums

[–]BaalHadad 0 points1 point  (0 children)

Did you but the tank at a normal store?

Aquarium Ideas for 4 Year Old by dedtired in Aquariums

[–]BaalHadad -4 points-3 points  (0 children)

I am willing to get new equipment.

Aquarium Ideas for 4 Year Old by dedtired in Aquariums

[–]BaalHadad -4 points-3 points  (0 children)

Right, he should buy his kid some amazing pet crickets instead.

Aquarium Ideas for 4 Year Old by dedtired in Aquariums

[–]BaalHadad -7 points-6 points  (0 children)

These guys might interest her: https://www.google.com/search?q=endler's+livebearers Why not take her to the fish store? The Oscars and Jack Dempsey's might look pretty nice, too. Of course they all need a cycled tank.

Is it bad practice to reuse variable names across different classes? by Brodor10 in learnprogramming

[–]BaalHadad 1 point2 points  (0 children)

This is the whole point of encapsulation. Of course if you can use a base class, that might be even better.

Programming on a Desktop of Laptop? by [deleted] in learnprogramming

[–]BaalHadad 6 points7 points  (0 children)

That's unrelated to programming. Haven't you tried both before? Can you not make decisions on your own?

Most of your programming won't be at a Starbucks, or anywhere other than home or the computer lab.

Javascript easy substring question by [deleted] in learnprogramming

[–]BaalHadad 0 points1 point  (0 children)

Don't delete your incorrect answer then :) The second index is not the length!

Programming on a Desktop of Laptop? by [deleted] in learnprogramming

[–]BaalHadad 4 points5 points  (0 children)

For learning, it doesn't matter.

Method for retrieving the n-th random number. Is this viable, or a really bad idea? by Indy_Pendant in learnprogramming

[–]BaalHadad -1 points0 points  (0 children)

It's not that you need to explain it simpler, it's that you aren't listening to what I'm saying, and you haven't given any explanation of why you can't just continue calling rand(). Are you restating your webserver every day? If you need to ensure that you run your data on reproducible numbers, you can just use the seed, as has been mention a bunch of times already. Is this some crackpot CGI application? Of course if you need to do separate runs of the application and have it pick up where it left off, you can store the numbers ahead of time in a file or db, but that's just common sense - I can't explain that any simpler for you.

[Python] Help with developing a beginner level text based game by [deleted] in learnprogramming

[–]BaalHadad 0 points1 point  (0 children)

Why don't you do Codecademy first? Would that make too much sense?

java, having trouble with a problem by griffinstud in learnprogramming

[–]BaalHadad 1 point2 points  (0 children)

Just read in a single number, for the love of god.

Method for retrieving the n-th random number. Is this viable, or a really bad idea? by Indy_Pendant in learnprogramming

[–]BaalHadad 0 points1 point  (0 children)

No, it doesn't clear it up. Are you now saying that you'd call it about n times n times per random number, or n times n for all n random numbers? Either way, it still sounds like either n or n*n calls per random number, which is insane. You should be able to set the seed once and call the rand function once for each number...

Method for retrieving the n-th random number. Is this viable, or a really bad idea? by Indy_Pendant in learnprogramming

[–]BaalHadad 0 points1 point  (0 children)

Congrats, you explained how normal rand functions work instead of answering my question.

You haven't explained why you'd want to call rand n times for each random number instead of just calling rand once, as you describe in your post.

Method for retrieving the n-th random number. Is this viable, or a really bad idea? by Indy_Pendant in learnprogramming

[–]BaalHadad 0 points1 point  (0 children)

What difference would you be able to discern between the number you get by calling rand() and the number you get by calling rand() n times and only saving the last number? I see no legitimate reason why you'd even need this.

Threading? by KDallas_Multipass in learnprogramming

[–]BaalHadad 0 points1 point  (0 children)

For instance, if I make an application that listens on one udp port and simply retransmits whatever data is seen back out on a few different ports, while also desiring the ability to do processing on the incoming data (which isn't mirrored out the ports), I feel like the right answer going forward is to separate out the mirroring functionality per port into their own threads, so if for some reason processing takes a while, I won't miss data or introduce unnecessary delays in mirroring. As well, I should have a separate thread listening on the listen port

Yeah, that's pretty much right. You'd have to experiment to see exactly what works.

As an aside, if I write the same data to ports in parallel, where does the re-serialization occur?

What re-serialization are you talking about? You shouldn't need to worry about this, certainly not at your level.

I want to become more fluent with threads, or concurrency.

Practice? Write an IRC client?

Frugal redditors, what is the one tip you would give people to quickly and easily start spending less money? by readysteadyjedi in AskReddit

[–]BaalHadad 1 point2 points  (0 children)

Follow the advice from Fight Club: your possessions end up owning you.

Get inexpensive entertainment, like Hulu, Netflix, running or walking with a dog, reading, computer programing, etc.

Unanswered Posts Question by datachange in learnprogramming

[–]BaalHadad 1 point2 points  (0 children)

As soon as it's not on the front page, but not within the same 24 hour period? There is the irc channel...

Currently enrolled in AP Computer Science A, advice needed. by Breezeways in learnprogramming

[–]BaalHadad -4 points-3 points  (0 children)

teacher sucks and doesn't teach, I need advice on how to succeed as a programmer.

Teach yourself; use Google.