2019-07-26 00:09:54.447005
Today was one of those days where I see all the first rounders of #100DaysOfCoders (check them out, ain't they wonderful people?) hanging their heads publically on Twitter. One of those days we all have where we decide to work on the smallest thing. The SMALLEST thing ever. I'm gonna work on this thing and it's going to do wonders for me. It's gonna be SO cool (I keep remembering that I can write in .md
).
Yep. I had one of those days. I have these little alias' (alias's? aliasi? I dunno) on my command line that make me feel super coder and load up my workspaces (literally, I type in "loadup" and everyone is thrilled and claps their hands as Jupyter Notebook loads up onto my screen.
I wanted to make it do a new trick. Which I am sure is soooooo easy. But it wasn't going to work today. I even pivoted to something seemingly easier harder. It was actually harder.
(i wish i knew markdown in middle school)
I didn't spend the whole day learning nothing at all. No. I spent the whole day researching ways that don't work.
Process of elimination. That's all it is. Good old fashioned sleuthing.
Anyways I empathize. We all have this day. I ended up doing some cool s#!t anyway and I managed to stay aware of that fact all day.
oops..got lost looking at a stack overflow question. here's some code considering something I looked up today but this post is gonna be short. take care!
import requests
from bs4 import BeautifulSoup
# I literally had to reinstall a few things just now so that
# was weird
r = requests.get("https://en.wikipedia.org/wiki/Earth%27s_orbit")
r
print(r.text[0:100], r.text[-100:-1])
I even found the ending and starting <html>
tags.
parsed_html = BeautifulSoup(r.text)
in tutorials I read (for fun) people usually initialize the BeautifulSoup() object (that's what <- that is) to
soup = BeautifulSoup(blarg.text)
I have no idea why. It's like either everyone before them did that and didn't understand it themselves and then the next ones carried on the tradition or doesn't get that soup isn't that great of an analogy here.
Take your pick. But give people the benefit of the doubt.
str(parsed_html.p.text)
whoa..we travel 584 million miles in one year. Which means that..
total_miles = 584000000
total_days = 365
mile_per_day = total_miles / total_days
mile_per_day
1,600,000. 1.6 MILLION miles in a day. I hope my next maths are correct
hours_in_day = 24
miles_per_hour = mile_per_day / hours_in_day
miles_per_hour # thereabouts
miles_per_hour / 60 / 60
18 miles in a second? How can I confirm this?
minutes_in_an_hour = 60
seconds_in_a_minute = 60
print(str(seconds_in_a_minute) + ' seconds in a minute multipled by '
+ str(minutes_in_an_hour) + ' minutes in an hour multiplied by '
+ str(hours_in_day) + ' equals '
+ str(seconds_in_a_minute
*minutes_in_an_hour
*hours_in_day)
+ ' seconds in a day')
# and
18.5 * 86400
dang. 18.5 miles a second. I guess next time I'm having a slow day I'll just try to remember this.