diff --git a/.gitignore b/.gitignore index 13c659c19..fd0a96515 100755 --- a/.gitignore +++ b/.gitignore @@ -5,4 +5,5 @@ *Thumbs.db* .project .tm_properties -.gitmodules \ No newline at end of file +.gitmodules +www/* diff --git a/Makefile b/Makefile new file mode 100644 index 000000000..d505919a4 --- /dev/null +++ b/Makefile @@ -0,0 +1,15 @@ +.PHONY: site copy + +PANDOC=pandoc --from markdown --to html --fail-if-warnings course.md --metadata title="title" --metadata-file=config.json +SOURCES=index.html course/ cur/ glossary/ topic/ +EXTRAS=img llab.js llab/css/ llab/fonts/ llab/html llab/img/ llab/lib llab/script llab/loader.js + +# Copies the existing content into the www/ folder subdirectories. +copy: + cp -r --parents ${SOURCES} ${EXTRAS} www/bjc-r/ + +# Processes each HTML file as a template. If any template markers are present +# in the file, they will be replaced with data from config.json. Otherwise they +# will be unchanged. +site: copy + find ${SOURCES} -name "*.html" | xargs -I {} -n 1 ${PANDOC} --template {} -o www/bjc-r/{} diff --git a/config.json b/config.json new file mode 100644 index 000000000..1114d3105 --- /dev/null +++ b/config.json @@ -0,0 +1,8 @@ +{ + "css": [ + "/bjc-r/llab/lib/bootstrap/dist/css/bootstrap.min.css", + "/bjc-r/llab/lib/bootstrap/dist/css/bootstrap-theme.min.css", + "/bjc-r/llab/css/default.css" + ], + "js": ["/bjc-r/llab/loader.js"] +} diff --git a/course.md b/course.md new file mode 100644 index 000000000..e69de29bb diff --git a/course/cs10_sp21.html b/course/cs10_sp21.html index 66c159929..71efb7357 100644 --- a/course/cs10_sp21.html +++ b/course/cs10_sp21.html @@ -2,9 +2,14 @@
(For Mac - in the code below you can also replace 'python3' with 'python' if you have an older version)
-Alonzos-Laptop:~ alonzo$ python3 -m pip install moviepy
+Alonzos-Laptop:~ alonzo$$ python3 -m pip install moviepy
(For Windows)
-Alonzos-Laptop:~ alonzo$ py -m pip install moviepy
+Alonzos-Laptop:~ alonzo$$ py -m pip install moviepy
That is all that is necessary to get the MoviePy Library onto your device! Next you will need to download diff --git a/cur/programming/python/csed_python/open_python.html b/cur/programming/python/csed_python/open_python.html index e58c3033c..ca2b349f1 100755 --- a/cur/programming/python/csed_python/open_python.html +++ b/cur/programming/python/csed_python/open_python.html @@ -48,7 +48,7 @@
>>>
, the command line window has an active python interpreter open. That means we can't do commands like cd
, or ls
, because the program is expecting Python code. To leave the python interpreter, type the exit command exit()
and press enter
.
>>> exit()
-Alonzos-MacBook:~ alonzo$
+Alonzos-MacBook:~ alonzo$$
Any functions or variables created in the python interpreter are erased when the exit()
command is run.
diff --git a/cur/programming/python/finding_a_bar.html b/cur/programming/python/finding_a_bar.html
index f3bb9614e..8e835990b 100755
--- a/cur/programming/python/finding_a_bar.html
+++ b/cur/programming/python/finding_a_bar.html
@@ -18,7 +18,7 @@
Now it's time to seriously write some code. Start by right clicking on this link and select save as. Make sure to save this file to the PythonLab1 directory that we made earlier. Head back to the shell and enter the ls
command to make sure that the file made it into our PythonLab1 directory.
-Alonzos-MacBook:PythonLab1 alonzo$ ls
+Alonzos-MacBook:PythonLab1 alonzo$$ ls
virus.py
@@ -31,13 +31,13 @@
Head back to the shell and you can try running this file by entering python3 virus.py
as shown below:
-Alonzos-MacBook:PythonLab1 alonzo$ python3 virus.py
+Alonzos-MacBook:PythonLab1 alonzo$$ python3 virus.py
Next try running the first exercise by entering python3 virus.py first_even_nums 5
(if it's working this should print the first 5 even numbers, starting with the number 2):
-Alonzos-MacBook:PythonLab1 alonzo$ python3 virus.py first_even_nums 5
+Alonzos-MacBook:PythonLab1 alonzo$$ python3 virus.py first_even_nums 5
2
4
6
@@ -47,7 +47,7 @@
Uh oh...it looks like we've only printed the first 4 even numbers. Head back to Sublime and edit the function called first_even_nums
so that we get the correct behavior:
-Alonzos-MacBook:PythonLab1 alonzo$ python3 virus.py first_even_nums 5
+Alonzos-MacBook:PythonLab1 alonzo$$ python3 virus.py first_even_nums 5
2
4
6
diff --git a/cur/programming/python/hug_text_processing/python_basic_files.html b/cur/programming/python/hug_text_processing/python_basic_files.html
index 0175987bf..09abf7dd9 100644
--- a/cur/programming/python/hug_text_processing/python_basic_files.html
+++ b/cur/programming/python/hug_text_processing/python_basic_files.html
@@ -30,7 +30,7 @@
Run this file and you should see something mysterious that looks something like:
- $ python word_analyzer.py
+ $$ python word_analyzer.py
<_io.TextIOWrapper name='horse_ebooks.txt' mode='r' encoding='UTF-8'>
@@ -47,7 +47,7 @@
Try running word_analyzer.py, and you should get a print out of the contents of the file "horse_ebooks.txt".
- $ python word_analyzer.py
+ $$ python word_analyzer.py
Fruits and Vegetables and Vegetables on a Budget and Vegetables at a Store and Vegetables to Clean Fruit and Vegetables
If we look to the Python code, f.read()
is the important part. read
is a function that is built into every file object (just like .append
is built into any list and .join
is built into any string). Here, we're telling the file object to give us the information in the file for which it is responsible (horse_ebooks.txt). Note that this was not possible in Snap!, given the restrictions that our web browser places on the Snap! interpreter.
diff --git a/cur/programming/python/hug_text_processing/python_language_games.html b/cur/programming/python/hug_text_processing/python_language_games.html
index 2a5f32f52..ba4ac92ce 100644
--- a/cur/programming/python/hug_text_processing/python_language_games.html
+++ b/cur/programming/python/hug_text_processing/python_language_games.html
@@ -41,7 +41,7 @@
Pig Latin
Try running word_analyzer.py, and you should get:
- $ python word_analyzer.py
+ $$ python word_analyzer.py
Ellohay
-izzle Speak
@@ -117,7 +117,7 @@
Higher Order Manipulation
text = read_file("text_processing/gettysburg.txt")
print(apply_language_game(text, izzle))
- $ python word_analyzer.py
+ $$ python word_analyzer.py
Foizzle scorizzle izzle sevizzle yeizzle agizzle oizzle fathizzle broizzle ...
\ No newline at end of file
diff --git a/cur/programming/python/hug_text_processing/python_text_processing_intro.html b/cur/programming/python/hug_text_processing/python_text_processing_intro.html
index be8c4e74c..1ffeb2286 100644
--- a/cur/programming/python/hug_text_processing/python_text_processing_intro.html
+++ b/cur/programming/python/hug_text_processing/python_text_processing_intro.html
@@ -35,11 +35,11 @@
Download the data for this lab from this link.
Unzip this file into the datalab folder. You can unzip this file through the command line by using the unzip
command.
- $ unzip text_processing.zip
-$ ls
+ $$ unzip text_processing.zip
+$$ ls
text_processing.zip text_processing
-$ cd text_processing
-$ ls
+$$ cd text_processing
+$$ ls
beatles.txt nietzsche.txt
democratic_debate_2015.txt presedential_debate_2016.txt
ee_cummings.txt republican_debate_2015.txt
diff --git a/cur/programming/python/hug_text_processing/python_top_words.html b/cur/programming/python/hug_text_processing/python_top_words.html
index 62907888d..e0f1cea4f 100644
--- a/cur/programming/python/hug_text_processing/python_top_words.html
+++ b/cur/programming/python/hug_text_processing/python_top_words.html
@@ -52,7 +52,7 @@
-$ python word_analyzer.py
+$$ python word_analyzer.py
['on', 'Budget', 'to', 'Fruit', 'Clean', 'Fruits', 'Store', 'at', 'a', 'and', 'Vegetables']
diff --git a/cur/programming/python/introduction-to-the-terminal.html b/cur/programming/python/introduction-to-the-terminal.html
index 9bfe2b92f..034552add 100644
--- a/cur/programming/python/introduction-to-the-terminal.html
+++ b/cur/programming/python/introduction-to-the-terminal.html
@@ -23,7 +23,7 @@ Opening a Terminal
If you're on one of the lab computers or on your own Mac, search for the application Terminal and open it. If you're using Windows, search for cmd.exe instead. After you open the program, you should have a window that has something like this in it:
-Alonzos-MacBook:~ alonzo$
+Alonzos-MacBook:~ alonzo$$
The little bit of text that's already in the window is called the prompt. It gives you a bit of information about the computer that you're on. When you type commands, they appear to the right of the prompt.
@@ -36,7 +36,7 @@
ls
: listing contents of a directory
To see what's in the current directory, we can use the command ls
(use dir
instead if on Windows). The ls
command lists the contents of our current directory. To use a command, type it in the terminal, then press 'enter'. Try it out. You should see something like this:
-Alonzos-MacBook:~ alonzo$ ls
+Alonzos-MacBook:~ alonzo$$ ls
Applications Downloads Pictures
Library Public Music
Desktop Movies Documents
@@ -46,8 +46,8 @@ cd
: navigating to another directory
We can see that the home directory has some other directories in it, such as Documents
and Desktop
. If we want to go into one of those directories, we can use the command cd
, followed by that directory's name. Try it out by using the command cd Documents
.
-Alonzos-MacBook:~ alonzo$ cd Documents
-Alonzos-MacBook:Documents alonzo$
+Alonzos-MacBook:~ alonzo$$ cd Documents
+Alonzos-MacBook:Documents alonzo$$
Now you're in the Documents
directory. We can use ls
again to see the contents of Documents
.
@@ -56,23 +56,23 @@
cd
: navigating to another directory
How can we get back to the home directory from here? cd ..
moves us upward one directory, which puts us back in home. The "dot dot" always means "parent directory". This means we can use cd ..
to go to upward one directory. Try it out!
-Alonzos-MacBook:Documents alonzo$ cd ..
-Alonzos-MacBook:~ alonzo$
+Alonzos-MacBook:Documents alonzo$$ cd ..
+Alonzos-MacBook:~ alonzo$$
mkdir
: making a new directory
Okay, now that we've tried that, let's go back to Documents
. (If you're in home
, use the command cd Documents
). You're probably used to making new folders on your computer by using a menu action like "File > New Folder", or a keyboard shortcut like "shift-cmd-N". To make a new directory (folder) using the terminal, we can use the command mkdir
followed by the name we want for the new directory. Try the command mkdir PythonLab1
.
-Alonzos-MacBook:~ alonzo$ cd Documents
-Alonzos-MacBook:Documents alonzo$ mkdir PythonLab1
+Alonzos-MacBook:~ alonzo$$ cd Documents
+Alonzos-MacBook:Documents alonzo$$ mkdir PythonLab1
Nice! now use ls
to confirm that your directory has been created! We can use cd PythonLab1
to go into our new directory.
-Alonzos-MacBook:Documents alonzo$ cd PythonLab1
-Alonzos-MacBook:PythonLab1 alonzo$
+Alonzos-MacBook:Documents alonzo$$ cd PythonLab1
+Alonzos-MacBook:PythonLab1 alonzo$$
diff --git a/cur/programming/python/open_python.html b/cur/programming/python/open_python.html
index 286adf0b7..33e4eb361 100755
--- a/cur/programming/python/open_python.html
+++ b/cur/programming/python/open_python.html
@@ -30,7 +30,7 @@
Running Python
The first step is to open the Python interpreter. On the command line in your terminal, use the command python3
. If you see something like "command not found", then use the command python
instead. You should see something similar to the following:
-Alonzos-MacBook:~ alonzo$ python3
+Alonzos-MacBook:~ alonzo$$ python3
Python 3.4.0 (v3.4.0:04f714765c13, Month DD YYYY, HH:MM:SS)
[GCC X.X.X] on darwin
Type "help", "copyright", "credits" or "license" for more information.
@@ -50,7 +50,7 @@ Running Python
If the text cursor is on a line beginning with >>>
, the command line window has an active python interpreter open. That means we can't do commands like cd
, or ls
, because the program is expecting Python code. To leave the python interpreter, type the exit command exit()
and press enter
.
>>> exit()
-Alonzos-MacBook:~ alonzo$
+Alonzos-MacBook:~ alonzo$$
Any functions or variables created in the python interpreter are erased when the exit()
command is run.
@@ -68,4 +68,4 @@
Running Python
-