2019-08-02 00:44:58.573564

I'm super excited sports fans. Today I learned so much stuff. Like this nice tidbit that will make me sound super bad at JavaScript but here we go.

You cannot have your src="" class/attribute/parameter/thingy inside the same <script> tag as the actual script you're running, which you need to run in separate <script></script> tags.

So I have this pretty awesome book that's also online right here

and I was just following along in one of the tutorials and there are literally no troubleshooting docs on what to do because I think people don't nonsensically try to combine different script tags. Right? Well I hope I'm not alone out there looking for that error, because I was entirely looking for the wrong thing and just happened to notice something strange when staring down the less than 10 lines of code inside the html, wondering what the heck was wrong after the past day or two.

So welcome to

day 7

1 whole week and I seriously can't believe how much I know about so many things this week already. I've been literally watching coding tutorials like people watch content that doesn't contribute to their life in any positive way. I've been watching talks here, doing things there. I've been tracking my work and managing my time.

A lot of the days I have had the chance to work on something pretty fulfilling but I didn't really spend a lot of time on one thing in particular. I worked on many things. I'm just started reading this "Miracle Math" book that is going to help me be a mental math wiz or something.

I approached the problem, like any problem I approach these days. Making any excuse to start a project I definitely do not know how and if I can finish. I mean, is software ever done? Yeesh.

hey this is Chris but on day 9 I was doing a lot of things on day 7 that I didn't even get around to finishing the blog post about it. Bad on me. Bad for you too. Anyway. Below this is the start for day 8 and this whole thing is going to be the post for day 9. Enjoy the rest of the post.

In [3]:
import BeautifulSoup4 # I'm so lazy.
---------------------------------------------------------------------------
ModuleNotFoundError                       Traceback (most recent call last)
<ipython-input-3-7baa49e87c3d> in <module>
----> 1 import BeautifulSoup4 # I'm so lazy.

ModuleNotFoundError: No module named 'BeautifulSoup4'
In [6]:
from bs4 import BeautifulSoup
In [8]:
soup= BeautifulSoup(open("./untitled.html"), "html.parser")
In [10]:
soup =BeautifulSoup(open("./untitled.html"),"html.parser")
In [11]:
soup = BeautifulSoup(open("./untitled.html"), "html.parser")
In [12]:
soup=BeautifulSoup(open("./untitled.html"), "html.parser")

...

umm

In [13]:
print(soup)
<!DOCTYPE html>

<html lang="en">
<head>
<meta charset="utf-8"/>
<title>test graph</title>
</head>
<body>
<!--page content here-->
<div id="chart" style="width:600px; height:300px"></div>
<script src="./js/flotr2.min.js" type="text/javascript"></script>
<script>
	
	var wins = [
		[ [2006, 13], [2007, 11],[2008, 15], [2009,15], [2010, 18], [2011, 21], [2012,28]
		]

	];

		window.onload = function() {
			Flotr.draw(
				document.getElementById("chart"),
				wins,
				{
					bars: {
						show: true
					}
				}
			);
		};
	</script>
</body>
</html>

nice. look how pretty that is. I laid out my javascript JUST like the book. Alright so JavaScript (I'll camel case it sometimes but probably stopping soon. That's why I have a column for describing the stuff I'm using so... hope that gives me leeway to be lazy and say "js" in my blog posts.

Moving along.

))

Alright so here's the code below that was the error ridden code. I thought I could get two things done with one bird

BUT

I was also looking at this same bunch of code for like two(and a half) days being like ...uh i dunno...

That happens. I didn't step away from it either. I just stared and stared. Like, searching google for everything. Looking at scripts, finding that blog post I referenced. I couldn't see it and maybe you'll empatheize and hire me to you data science team as an intern on a trial basis and then start bringing me in regurlarly and sending me around the world to talk to clients and POC "robust" data pipelines OR maybe you'll think I'm a dumb dumb head BUT if you do you'll have to tell me how to prevent myself from having this issue again.

I hope I spelled all of that correctly. Welcome to another shameless career plug on

Day 8

In [18]:
untitled_html = './untitled.html'
soup=BeautifulSoup(open(untitled_html), 'html.parser')
In [19]:
print(soup)
<!DOCTYPE html>

<html lang="en">
<head>
<meta charset="utf-8"/>
<title>test graph</title>
</head>
<body>
<!--page content here-->
<div id="chart" style="width:600px; height:300px"></div>
<script src="./js/flotr2.min.js" type="text/javascript"> <!-- https://upload.wikimedia.org/wikipedia/commons/f/f2/Coccinella_magnifica01.jpg -->
	
	var wins = [
		[ [2006, 13], [2007, 11],[2008, 15], [2009,15], [2010, 18], [2011, 21], [2012,28]
		]

	];

		window.onload = function() {
			Flotr.draw(
				document.getElementById("chart"),
				wins,
				{
					bars: {
						show: true
					}
				}
			);
		};
	</script>
</body>
</html>

DO YOU SEE IT? DO YOU SEE THE HAPPY LADY BUG WAVING AT YOU?

Alrighty. I'm glad to have made that apparent. If you don't see it, here's the rule from the js lord that allows you the gift of sight and opportunity to make DOPE visualizations.

  • one shall not combine your script source tags with script tags that carry code. that's dirty. stop. just stop.

Except this error does not render an error message or anything in the console because it's like, an error that works really well at the error it produces.

I'VE FOUND IT. THE ANOMALY IN THE MATRIX

Also yes I changed the value of soup again. Today was actually a lesson in variables.

A funny gif would be funny here but I had trouble implementing that and I have other things to do so don't click on everything you see on the internet.

end of day 8

beginning of day 9

that's all of it. I've been spending a great deal of time avoiding posting this because it wasn't ready but then I remembered that these are just blog posts and mine, so my excuse for the employers-the minimum requirement for #100DaysOfCode is an hour of code and a tweet. And asking people to join you.

sometimes the coding actually gets in the way. most of the time I'm working on scripts for my job (not because I'm a programmer for my gig but because I use programming so I won't have to do repetitive boring work (also because if I can finish those automation scripts I can justify not doing the work I was doing))

finding that balance is key and sometimes I should just realize that my brain is fried and I have nothing to write about or have the ability to come up with anything to write about.

I'm sure I was going somewhere with this but I have forgotten. Again.

In [ ]: