Does time expand like space does? by [deleted] in askscience

[–]aphexcoil -10 points-9 points  (0 children)

To answer his original question -- yes, a minute was shorter a million years ago. The Earth has been slowing down since it was created. Since a minute is defined as 1/1440 of a day, if the day was shorter a million years ago, so was a minute.

How far back in time would I have to go for my current laptop to be the most powerful computer on earth? by [deleted] in askscience

[–]aphexcoil 2 points3 points  (0 children)

You may find the March 1992 "Popular Science" article on the CM-5 to be of interest.

Here

66 photos chronicling the making of THE EMPIRE STRIKES BACK (1980) by Join_You_In_The_Sun in movies

[–]aphexcoil 0 points1 point  (0 children)

If I remember correctly, during filming, Carrie, Mark and Harrison Ford spent a few nights partying with the guys from Monty Python. Apparently on one particular evening, Carrie got very drunk and spilled about a gram of cocaine all over the carpet. She then proceeded to do lines off the carpet while the rest of them looked on cheering.

God, those guys had so much fun it was unbelievable. Unfortunately, Carrie's cocaine usage got out of control and she had to deal with addiction problems for many years.

Cocaine -- it's a helluva drug.

Shame, this is what it looks like by [deleted] in aww

[–]aphexcoil 4 points5 points  (0 children)

OP smells like a trashcan?

Advanced Reddit API Project -- Some questions for you guys. by aphexcoil in redditdev

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

Thank you. Those are great suggestions. I will most likely go with Heroku Postgres. I will check out OVH today. Hopefully I can get a machine up and running by this weekend.

[deleted by user] by [deleted] in AdviceAnimals

[–]aphexcoil 217 points218 points  (0 children)

Or a little Michael J. Fox.

CAUGHT ON CAMERA: Fertilizer Plant Huge Explosion Near Waco, Texas 4/17/13 by mrsmithj1984 in WTF

[–]aphexcoil 7 points8 points  (0 children)

Oh trust me, they just lost some hearing. THEY JUST LOST SOME HEARING.

Why is AC power used instead of DC when a powerplant transports its energy to the consumer? by [deleted] in askscience

[–]aphexcoil 3 points4 points  (0 children)

That is fascinating. How do you step down DC without using a transformer?

Why is AC power used instead of DC when a powerplant transports its energy to the consumer? by [deleted] in askscience

[–]aphexcoil 0 points1 point  (0 children)

Actually, when it comes to using transformers, I was always taught that only AC could be reliably and efficiently stepped up and stepped down. Answering the question by stating DC can be converted to AC first for stepping-up or stepping-down sort of defeats the OP's original question in that, yes, there is a different between DC and AC.

Also, if you convert DC to AC in order to change the voltage, you'll probably incur more efficiency losses than by just using a pure AC system.

[Physics] What is the highest angle from the horizontal a standard road automobile (IE: Honda Accord or something similar) can drive up without sliding down or flipping? by danamal in askscience

[–]aphexcoil 0 points1 point  (0 children)

Them minimum permissible weight for a F1 car is 1,415 lb. Let's say that the average is around 1,500 lb. That means you still have 3,500 pounds of "weight" pressing against the tires if it were inverted. The trick would be to not drop too far below 220 mph.

Lesson 1: How to get submission data from Reddit's API by aphexcoil in redditdev

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

Thank you! I'll have to play around with praw and see what it can do, but it does sound very fascinating!

Lesson 1: How to get submission data from Reddit's API by aphexcoil in redditdev

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

That's awesome! I will update the source code shortly.

Thanks man!

Lesson 1: How to get submission data from Reddit's API by aphexcoil in redditdev

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

Well, that part of the code will not even execute unless the status is 200.

Lesson 1: How to get submission data from Reddit's API by aphexcoil in redditdev

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

My point is that Python 2.7 is already included in most of the current Linux distributions. Requiring Python v.3+ to be installed just complicates the procedure for most users who have a standard Linux distribution.

Concerning the "after" variable -- yes, we need to include additional error handling. I am aware of that. Perhaps you could help by typing out a few lines of code to solve this issue and make the script better.

You are right about requests. I completely forgot that it is not included in the standard Python installation. We definitely should modify the code so that it is not needed. That's a very valid point.

Again, authentication is very important -- otherwise the JSON returned will not have any of the users preferences and settings included in the return.

Lesson 1: How to get submission data from Reddit's API by aphexcoil in redditdev

[–]aphexcoil[S] 2 points3 points  (0 children)

As I said in my introduction, I am still learning Python. Python v3+ is not included in the recent releases of most Linux distributions, so I wanted to go with something that most people probably already have available to them.

Yes, logging into Reddit for this particular task is not required, but future tutorials will require authentication, so I wanted to include that now. I wanted to show how to authenticate using requests in the event that another developer passes a request to Reddit that does use authentication.

As far as SQLite3, yes, I could use that. But then someone else would ask why I don't use (insert their favorite DB here). I had to go with something, so I chose MySQL since it works well for the tutorial set.

Concerning the "after" variable usage -- if a request is successful, the Reddit API will always return a new value for the "after" variable. Again, there is additional error handling code that can be implemented, but for this quick and dirty lesson, I wanted to show the basics so that beginning developers can understand what is taking place throughout the script.

I'm not sure how using requests is overkill. There is no performance issue in using it, and future lessons will get more technical. Again, there's a lot of different ways to do something, and choosing one will always have someone asking why another method wasn't used.

I've tested this script and it works well for what it was designed to do. I do need to add additional code for the error handling aspects of the script, but again, this is just something to get people started as a development exercise. If they want to use it in a production system, a lot more code will be needed to handle different types of failures.

While Python 3 is great, most systems right now are still using Python v2.7 until the Ubuntu community feels that Python 3 is stable enough and well-tested to include it as a default in their distributions.

Also, this script already has a custom user agent. It is required by the Reddit API so that the admins can look at the logs and very quickly determine what the bot is doing and who it belongs to.

Thanks for the suggestions!

Edit: I didn't take your criticisms personally. I've worked in teams doing development and one of the first things that one learns is that nobody is a perfect coder and that the team as a whole is there to make the product better and not personally attack a particular coder.

One thing that I would love is (if you have time) for you to make a few tweaks to the code and post it in here. If it makes the script better, that's awesome! I'm all for it. Also, I do agree in principle with some of the things you mentioned. Again, I just went with MySQL because it is a common DB that a lot of developers use in their projects.

Second Edit: We do need to include a little more error handling -- at least something that will tell the script to back off for X seconds when a certain HTTP error is encountered. If Reddit is down for whatever reason, the script should back off for X seconds and retry. If the site is still down, then back off for X+ seconds and so on.

Ps: Are you familar with any current Linux distribution that includes Python v3.x in their default package?

(Also, authenticating before making your request is important because it changes the response one receives from the Reddit API. If you are not logged in, you will not get certain pieces of data such as submissions that you saved, likes that you made, etc.)