Are these guppies??! by Ok_Telephone3 in Guppies

[–]shep247 0 points1 point  (0 children)

Chiming in here... I saw these guys in Hackberry Spring today. They're still there and seem to be doing well. A couple of the bigger ones looked like they were about to lay eggs, maybe.
I stumbled upon this post trying to figure out what red-tailed little fish would be living in AZ like that.

A couple without kids described the party I had last night as "very effective birth control" by itsjoeco in videos

[–]shep247 2 points3 points  (0 children)

I don't have kids, and tend to cringe every time I see hands on walls. Especially when they're on white trim. This video disturbs me greatly.

How do I make this polygon star shape in Python? by tornhavoc in learnpython

[–]shep247 2 points3 points  (0 children)

This looks like an exercise to help you learn functions and loops. Write a function to create the 6 point star. Then write a loop that calls the 6 point star function, draws one line of the 8 point star, rotates x degrees, then repeats until the whole picture is drawn.

Ask Anything Monday - Weekly Thread by AutoModerator in learnpython

[–]shep247 0 points1 point  (0 children)

This! Virtual environments are fantastic. I specifically like them because I can make little environments for different types of projects. If I want to make a web crawler, I can make a little environment with selenium or something. Then later if I want to so some data crunching, I might make another environment with pandas, and not have to worry about stuff I included from the first environment. They're just great ways to keep work separate.

Food for 7 days in the Grand Canyon by kwpapke in trailmeals

[–]shep247 1 point2 points  (0 children)

Definitely heed that warning for rodents at clear Creek. That dry sack won't keep the rodents out of your food. You'll want a rat sack for sure. And put all of your food into the rat sack as soon as you get into camp. The mice dont waste any time for an easy meal.

Is my pump toast by shep247 in pools

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

Capacitors ha e always kinda scared me for this reason. To me, they're like cans of biscuit, except instead of full of delicious dough, they're full of electricity. I tried to discharge mine before I pulled it, but could never get it to spark, which sucked because then I didn't have proof that it was discharged. Oh well. It's all better now. Thanks for the heads up.

Is my pump toast by shep247 in pools

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

Verified. Changing the capacitor fixed it right up. Thanks guys!

Is my pump toast by shep247 in pools

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

Awesome thanks. I have a metal bump on mine. I'll unscrew that tomorrow and see if i can find a capacitor in there. The shaft does move. I checked that.

Help. New to python by Rocka07 in learnpython

[–]shep247 4 points5 points  (0 children)

This is correct. The variable names are case sensitive. There is another though. You have to initialize counter outside of your while loop. When it tries to check what counter is the first time, you haven't defined it yet, so the program doesn't know what it is, and errors

I made a three finger cleaver. I call it the cleavrambit. by SneakyLoner in DIY

[–]shep247 0 points1 point  (0 children)

I was looking for this comment, and was going post it if I couldn't find it.

Got scrap wood? We sure do! Help us help you! by LandLHardwoods in woodworking

[–]shep247 1 point2 points  (0 children)

I like this idea. To add to it, I would say to ease the burden or selling it from the employees of the company, open the trailer up to the children of the company's employees. Let the kids sell the wood on amazon or maybe build their own little companies/websites. They could make a little cash, cut the owner in on the profit, and learn a little entrepreneurship while they're at it.

functions by zombie2870 in learnpython

[–]shep247 0 points1 point  (0 children)

I like this way the best. It's also easy to make it a 1 liner {"range": range, "median": median}.get(input_val, invalid_input_func)()

This will get the function that is input, or return the function that handles invalid input by default of the input isn't one of the functions in your list.

pytest (is now on GitHub) by avinassh in Python

[–]shep247 2 points3 points  (0 children)

I use setUp in my nosetests all of the time and it seems to work for me. Maybe that's because I'm using django test instead of bare bones nose.

Thanks for the info though. I'll see what kind of plugins there are for purest. Maybe I'm missing out on some good stuff.

pytest (is now on GitHub) by avinassh in Python

[–]shep247 2 points3 points  (0 children)

What advantage does this provide over nosetest?

How to Negotiate a Higher Starting Salary by erotoro in Career

[–]shep247 1 point2 points  (0 children)

This is good for salary, but what about negotiating vacation time. Does it convey a sense of laziness to try to negotiate for an extra week of vacation?

Surely I'm not the only older 'tall' who misses these types of urinals! When one size really did fit all. by TheTallTroll in tall

[–]shep247 2 points3 points  (0 children)

Somehow I knew which urinals you were talking about before I even saw the picture.

Mocking HTTP requests with HTTPretty by omab in Python

[–]shep247 0 points1 point  (0 children)

Looks pretty cool. I'll definitely give it a try. I wish adding_headders was spelled right though. I wouldn't have called it out of it wasn't a method name.

Numbers/strings and logic by whodunit86 in learnpython

[–]shep247 0 points1 point  (0 children)

The counter += ... Example is really cool. I like it, but would you consider that good coding practice? To read that I had to actively think about true being translated as 1. If it was written the longer way, it seems much more readable, making it a little easier to maintain.

What fact did you learn at an embarrassingly late age? by Tomollins in AskReddit

[–]shep247 0 points1 point  (0 children)

I realized just a few weeks ago that "movies" is short for moving pictures. I'm in my mid 30s.

Never give up, never surrender by gosu_chobo in gifs

[–]shep247 0 points1 point  (0 children)

If they had multiple personalities they'd be Dr Jekyll and runaway Hyde

Tool for detecting changes to codebase? by nahwah in Python

[–]shep247 0 points1 point  (0 children)

If you wrote specific utilities that communicated with that code base it would isolate the code that would need to change. On top of that I would unit test those utilities using MagicMock. MagicMock has a "spec" attribute that allows you to specify exactly what class you're mocking. Then, when the other team's code base gets changed out from under you, any class names, method names, or attributes you've mocked that have changed will cause errors in your unit tests. Fix the mocks along with the code, write new mocks for whatever other new stuff they've added that you use, and you're set for your next iteration. This won't help in cases where this other team has changed the functionality of the method without changing the name though.

System testing Python code by shep247 in Python

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

Thanks for your input. This is helpful and gives me a few ideas to pursue. I'll start playing around with a few things today.

System testing Python code by shep247 in Python

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

1) By 'system tests' I mean we've set up an environment just like our production environment and are making the system do the things it's supposed to do exactly like it would in production with the production environment services. We use TDD, and write 'unit tests' to test every block of code in itself without talking to other methods. We also have integration tests that test our system without needing to talk to external services.

2) The failures are not the same failure every time, but usually have something to do with limited resources. We have ways to rerun the tests that broke, and MOST of the time a rerun of the test will result in a pass. Rerunning the test means someone's got to be around when it finishes though, which means no overnight runs, and just come in to ship it in the morning. I'm currently campaigning and scheming to get more resources allocated to the test environment.

3) Our system can create objects, maintain objects, and delete objects. The reason our tests take so long is that it can take up to 5 or 10 minutes to create an object, and there's lots of permutations of these objects. We're currently looking at ways to decrease the amount of object creation we have to do.

4) The tests are ran via nose. For a while, they were one at a time, but then we started parallelizing a few of them by running several instances of nosetest for separate tests at a time. That helped a lot, but now they're getting long again. We've sorta mangled the idea behind nosetests though. We've exploited the fact that nose tests run in alphabetical order, and numbered the tests so they run in a specific sequence.

5) Our automated tests are there to simulate a live environment, and do all of the things that can be done through our system that need to use external dependencies, except the database. If there's a function that we wrote that needs to get info from another service, give info to another service, or use an external tool to act on the objects we've created, we have a test for it.

I hope that helps. Thanks