First Blog Post

Finn’s first blog post for CSCI 0451.
Author

Finn Ellingwood

Published

February 15, 2023

This is my first post to my official blog for CSCI 0451. I am testing out some things and will be working on implementing the perceptron algorithm in python to draw a line between two clouds of points.

Frontmatter

Running Python Code

To run Python code, place your code in a Python code block inside your notebook. You can run the code block inside VSCode (or JupyterLab) using the keyboard shortcut ctrl + Enter. You’ll see the result of your computation below the code, including the value of the most recent statement.

"CSCI" + " 0451"
'CSCI 0451'

We’ll have lots of opportunities to make data visualizations in this course. These also display inside the notebook, and get converted into your blog post:

from matplotlib import pyplot as plt
import numpy as np

x = np.linspace(0, 2*np.pi, 1001)
y = np.sin(x)
fig = plt.plot(x, y)
xlab = plt.xlabel("x")
ylab = plt.ylabel("y")
title = plt.gca().set(title = "My Fancy Plot")

Another thing we’ll often do is implement an algorithm in a source file (i.e. a .py file) and then use it in a notebook. To do this, just place the .py file in the same directory as the notebook. For example, the file source.py in the same directory contains a custom function (which prints a message). I can use like this:

import source 
source.my_custom_function()
I implemented this function in the file source.py

Markdown

You can use Markdown syntax to write text in Markdown cells. Markdown allows you to create simple text formatting like bullets, italics, and section headers. The Quarto description of markdown basics has everything you need to get started.

Math

In addition to regular text using the Markdown specification, you can also write mathematics, enclosed between dollar signs. The syntax for writing math is very similar to the syntax used in the \(\LaTeX\) markup language. For example, $f(x) \approx y$ renders to \(f(x) \approx y\). To place complex mathematical expressions on their own lines, use double dollar signs. For example, the expression

$$\mathcal{L}(a, b) = \sum_{i = 1}^n (ax_i + b - y_i)^2$$

renders to:

\[\mathcal{L}(a, b) = \sum_{i = 1}^n (ax_i + b - y_i)^2\;.\]

Behind the scenes, math is powered by the MathJax engine. For more on how to write math, check this handy tutorial and quick reference.