diff --git a/Makefile b/Makefile index ff05f9436..0a403a4d4 100644 --- a/Makefile +++ b/Makefile @@ -25,7 +25,7 @@ default: server @# tail and awk work together to extract Jekyll regeneration messages @# When a _notebook is detected in the log, call make convert in the background @# Note: We use the "if ($$0 ~ /_notebooks\/.*\.ipynb/) { system(\"make convert &\") }" to call make convert - @(tail -f $(LOG_FILE) | awk '/Server address: http:\/\/0.0.0.0:$(PORT)\/$(REPO_NAME)\// { serverReady=1 } \ + @(tail -f $(LOG_FILE) | awk '/Server address: http:\/\/127.0.0.1:$(PORT)\/$(REPO_NAME)\// { serverReady=1 } \ serverReady && /^ *Regenerating:/ { regenerate=1 } \ regenerate { \ if (/^[[:blank:]]*$$/) { regenerate=0 } \ @@ -56,7 +56,7 @@ default: server # Start the local web server server: stop convert @echo "Starting server..." - @@nohup bundle exec jekyll serve -H 0.0.0.0 -P $(PORT) > $(LOG_FILE) 2>&1 & \ + @@nohup bundle exec jekyll serve -H 127.0.0.1 -P $(PORT) > $(LOG_FILE) 2>&1 & \ PID=$$!; \ echo "Server PID: $$PID" @@until [ -f $(LOG_FILE) ]; do sleep 1; done diff --git a/README.md b/README.md index 0794b445e..8b3bf059c 100644 --- a/README.md +++ b/README.md @@ -18,66 +18,10 @@ Deployment Cycle. In the deplopyment cycle, `sync-github-action-review`, it is ### WSL and/or Ubuntu installation requirements - The result of these step is Ubuntu tools to run preview server. These procedures were created using [jekyllrb.com](https://jekyllrb.com/docs/installation/ubuntu/) -- Run scripts in scripts directory of teacher repo: setup_ubuntu.sh and activate.sh. Or, follow commands below. -```bash -## WSL/Ubuntu commands -# sudo apt install, installs packages for Ubuntu -echo "=== Ugrade Packages ===" -sudo apt update -sudo apt upgrade -y -# -echo "=== Install Ruby ===" -sudo apt install -y ruby-full build-essential zlib1g-dev -# -echo "=== Install Python ===" -sudo apt-get install -y python3 python3-pip python-is-python3 -# -echo "=== Install Jupyter Notebook ===" -sudo apt-get install -y jupyter-notebook - -# bash commands, install user requirements. -echo "=== GitHub pages build tools ===" -export GEM_HOME="$HOME/gems" -export PATH="$HOME/gems/bin:$PATH" -echo '# Install Ruby Gems to ~/gems' >> ~/.bashrc -echo 'export GEM_HOME="$HOME/gems"' >> ~/.bashrc -echo 'export PATH="$HOME/gems/bin:$PATH"' >> ~/.bashrc -echo "=== Gem install starting, thinking... ===" -gem install jekyll bundler -head -30 ./teacher/scripts/activate.sh -echo "=== !!!Start a new Terminal!!! ===" -``` +- Run scripts in scripts directory of student repo: setup_ubuntu.sh and activate.sh. Expected name of the repository to run these scripts is 'student'. ### MacOs installation requirements -- Ihe result of these step are MacOS tools to run preview server. These procedures were created using [jekyllrb.com](https://jekyllrb.com/docs/installation/macos/). Run scripts in scripts directory of teacher repo: setup_macos.sh and activate_macos.sh. Or, follow commands below. -```bash -# MacOS commands -# brew install, installs packages for MacOS -echo "=== Ugrade Packages ===" -brew update -brew upgrade -# -echo "=== Install Ruby ===" -brew install chruby ruby-install xz -ruby-install ruby 3.1.3 -# -echo "=== Install Python ===" -brew install python -# -echo "=== Install Jupyter Notebook ===" -brew install jupyter - -# bash commands, install user requirements. -export GEM_HOME="$HOME/gems" -export PATH="$HOME/gems/bin:$PATH" -echo '# Install Ruby Gems to ~/gems' >> ~/.zshrc -echo 'export GEM_HOME="$HOME/gems"' >> ~/.zshrc -echo 'export PATH="$HOME/gems/bin:$PATH"' >> ~/.zshrc -echo "=== Gem install starting, thinking... ===" -gem install jekyll bundler -head -30 ./teacher/scripts/activate.sh -echo "=== !!!Start a new Terminal!!! ===" -``` +- Ihe result of these step are MacOS tools to run preview server. These procedures were created using [jekyllrb.com](https://jekyllrb.com/docs/installation/macos/). Run scripts in scripts directory of student repo: setup_macos.sh and activate_macos.sh. Expected name of the repository to run these scripts is 'student'. ### Preview - The result of these step is server running on: http://0.0.0.0:4100/teacher/. Regeneration messages will run in terminal on any save. Press the Enter or Return key in the terminal at any time to enter commands. @@ -122,3 +66,41 @@ bundle install ```bash make convert ``` +### Meta Data (Front Matter) +- Meta data also known as front matter is a set of key value pairs that can provide additional information to github pages about .md and .ipynb files. This can and probably will be used in other file types (ie doc, pdf), if we added them to the system. + +- In the front matter you can also define things like a title and description for the page. Additional front matter is defined to place content on "Computer Science Lab Notebook" page. The `courses:` key will place data on a specific page with the nested `week:` placing data on a specific row on the page. The `type:` key in front matter will place blog under the plans, hacks(ToDo), and tangibles column. + +- In our files the front matter is defined at the top of the page or the first markdown cell. + + - First open one of the .md or .ipynb files already included in either your _posts folder or your _notebooks folder. + + - In the .md file you should notice something similar to this at the top of the page. To see this in your .ipynb files you will need to double click the markdown cell at the top of the file. + + ```yaml + --- + toc: true + comments: false + layout: post + title: Daily Plan Sample + description: Example Blog!!! This shows planning and notes from hacks. + type: plans + courses: { compsci: {week: 0} } + --- + ``` + +- Front matter will always have '---' at the top and bottom to distinguish it and each key value pair will be separated by a ':'. + +- Here we can modify things like the title and description. + +- The type value will tells us which column this is going to appear under, supported values: `plans`, `hacks`, `tangibles`. + +- The courses tells us which menu item it will be under, in this case the `compsci` menu, and the `week` tells it what row (week) it will appear under that menu. + +- In our examples, hacks(ToDo) contains references to our IPYNB files; these are stored in GitHub under the `_notebooks` folder. The plans and tangibles contains references to our MD files; these are stored in GitHub under the `_posts` folder. + +- Key files in Computer Science Lab Notebook + - `compsci.md` - this is the "Computer Science Lab Notebook" page and is the link `https://nighthawkcoders.github.io/student/compsci`. It contains the Title and Number of units on the page. + - `_data/compsci.yml` - this contains the supporting data that helps organize the units on the page. + - `_layouts`\schedule.html - this contains code, in the Liquid language, that generates the HTML for all the rows and columns. + - fyi, the schedule.html could work for another type of page. For instance, you could make a csa.md, _data/csa.yml, and tag files with `csa: {week: 0}` under courses. diff --git a/_config.yml b/_config.yml index 8f941a22e..3ed1dbdf7 100644 --- a/_config.yml +++ b/_config.yml @@ -3,8 +3,8 @@ description: "August 2023 to June 2024" owner_name: Nighthawk Coders github_username: nighthawkcoders baseurl: "/student" -remote_theme: pages-themes/midnight@v0.2.0 -# remote_theme: pages-themes/dinky@v0.2.0 +remote_theme: pages-themes/modernist@v0.2.0 +#remote_theme: pages-themes/dinky@v0.2.0 # remote_theme: pages-themes/minimal@v0.2.0 # remote_theme: pages-themes/hacker@v0.2.0 # remote_theme: pages-themes/cayman@v0.2.0 @@ -12,3 +12,4 @@ remote_theme: pages-themes/midnight@v0.2.0 plugins: - jekyll-remote-theme future: true + diff --git a/_data/compsci.yml b/_data/compsci.yml new file mode 100644 index 000000000..e69de29bb diff --git a/_includes/header.html b/_includes/header.html index 4c482389c..ea6f0644c 100644 --- a/_includes/header.html +++ b/_includes/header.html @@ -4,10 +4,9 @@ diff --git a/_includes/help_list.html b/_includes/help_list.html new file mode 100644 index 000000000..c4373a391 --- /dev/null +++ b/_includes/help_list.html @@ -0,0 +1,9 @@ +
+
+

+ + {{ post.title | escape }} + +

+
+
\ No newline at end of file diff --git a/_layouts/help.html b/_layouts/help.html new file mode 100644 index 000000000..60723f97f --- /dev/null +++ b/_layouts/help.html @@ -0,0 +1,55 @@ +--- +layout: default +--- + +
+ {%- if page.title -%} +

{{ page.title }}

+ {%- endif -%} + + {{ content | markdownify }} + + + {% if site.paginate %} + {% assign rawposts = paginator.posts %} + {% else %} + {% assign rawposts = site.posts %} + {% endif %} + + + {% assign posts = ''|split:'' %} + {% for post in rawposts %} + {% if post.type == "help" %} + {% assign posts = posts|push:post%} + {% endif %} + {% endfor %} + + + {% assign grouped_posts = posts | group_by: "sticky_rank" | sort: "name", "last" %} + {% assign sticky_posts = ''|split:'' %} + {% assign non_sticky_posts = '' | split:'' %} + + + {% for gp in grouped_posts %} + {%- if gp.name == "" -%} + {% assign non_sticky_posts = gp.items | sort: "date" | reverse %} + {%- else %} + {% assign sticky_posts = sticky_posts | concat: gp.items %} + {%- endif -%} + {% endfor %} + + + {% assign sticky_posts = sticky_posts | sort: "sticky_rank", "last" %} + {% assign posts = sticky_posts | concat: non_sticky_posts %} + + {%- if posts.size > 0 -%} + + + {%- endif -%} diff --git a/_notebooks/2023-08-16-linux_shell.ipynb b/_notebooks/2023-08-16-linux_shell.ipynb new file mode 100644 index 000000000..50e4c53ef --- /dev/null +++ b/_notebooks/2023-08-16-linux_shell.ipynb @@ -0,0 +1,492 @@ +{ + "cells": [ + { + "attachments": {}, + "cell_type": "markdown", + "metadata": {}, + "source": [ + "---\n", + "layout: post\n", + "title: Linux Shell and Bash\n", + "description: A Tech Talk on Linux and the Bash shell.\n", + "toc: true\n", + "comments: true\n", + "categories: [5.A, C4.1]\n", + "courses: { csse: {week: 1}, csp: {week: 1, categories: [6.B]}, csa: {week: 1} }\n", + "type: devops\n", + "---" + ] + }, + { + "attachments": {}, + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Bash Tutorial\n", + "> A brief overview of Bash, on your way to becoming a Linux expert. When a computer boots up, a kernel (MacOS, Windows, Linux) is started. This kernel provides a shell, or terminal, that allows user to interact with a most basic set of commands. Typically, the casual user will not interact with the shell/terminal as a Desktop User Interface is started by the computer boot up process. To activate a shell directly, users will run a \"terminal\" through the Desktop. VS Code provides ability to activate \"terminal\" while in the IDE." + ] + }, + { + "attachments": {}, + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Variable Prerequisites\n", + "> Setup bash shell dependency variables for this page. Variables are one of the first aspects of programming. Variables have \"name\" and a \"value\".\n", + "\n", + "- Hack Note: Change variables to match your student project." + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "### Define variable\n", + "The following code cell defines 3 variables and assigns each a value. There are some extra command, called a HERE document, that write these variables to a file. This is so we can use these variables over and over below." + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": { + "vscode": { + "languageId": "shellscript" + } + }, + "outputs": [], + "source": [ + "%%script bash\n", + "\n", + "# Dependency Variables, set to match your project directories\n", + "\n", + "cat < /tmp/variables.sh\n", + "export project_dir=$HOME/vscode # change vscode to different name to test git clone\n", + "export project=\\$project_dir/teacher # change teacher to name of project from git clone\n", + "export project_repo=\"https://github.com/nighthawkcoders/teacher.git\" # change to project of choice\n", + "EOF" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "### Output the value of a variable\n", + "The following code cell outputs the value of the variables, using the echo command. For visual understanding in the output, each echo command provide a title before the $variable " + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": { + "vscode": { + "languageId": "shellscript" + } + }, + "outputs": [], + "source": [ + "%%script bash\n", + "\n", + "# Extract saved variables\n", + "source /tmp/variables.sh\n", + "\n", + "# Output shown title and value variables\n", + "echo \"Project dir: $project_dir\"\n", + "echo \"Project: $project\"\n", + "echo \"Repo: $project_repo\"" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Project Setup and Analysis with Bash Scripts\n", + "The bash scripts that follow automate what was done in the setup procedures. The purpose of this is to show that many of the commands we performed can be added to a script, then performed automatically." + ] + }, + { + "attachments": {}, + "cell_type": "markdown", + "metadata": {}, + "source": [ + "### Pull Code\n", + "> Pull code from GitHub to your machine. This is a bash script, a sequence of commands, that will create a project directory and add the \"project\" from GitHub to the vscode directory. There is conditional logic to make sure that clone only happen if it does not (!) exist. Here are some key elements in this code...\n", + "\n", + "- cd command (change directory), remember this from terminal session\n", + "- if statements (conditional statement, called selection statement by College Board), code inside only happens if condition is met" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": { + "vscode": { + "languageId": "shellscript" + } + }, + "outputs": [], + "source": [ + "%%script bash\n", + "\n", + "# Extract saved variables\n", + "source /tmp/variables.sh\n", + "\n", + "echo \"Using conditional statement to create a project directory and project\"\n", + "\n", + "cd ~ # start in home directory\n", + "\n", + "# Conditional block to make a project directory\n", + "if [ ! -d $project_dir ]\n", + "then \n", + " echo \"Directory $project_dir does not exists... makinng directory $project_dir\"\n", + " mkdir -p $project_dir\n", + "fi\n", + "echo \"Directory $project_dir exists.\" \n", + "\n", + "# Conditional block to git clone a project from project_repo\n", + "if [ ! -d $project ]\n", + "then\n", + " echo \"Directory $project does not exists... cloning $project_repo\"\n", + " cd $project_dir\n", + " git clone $project_repo\n", + " cd ~\n", + "fi\n", + "echo \"Directory $project exists.\" " + ] + }, + { + "attachments": {}, + "cell_type": "markdown", + "metadata": {}, + "source": [ + "### Look at files Github project\n", + "> All computers contain files and directories. The clone brought more files from cloud to your machine. Review the bash shell script, observe the commands that show and interact with files and directories. These were used during setup.\n", + "\n", + "- \"ls\" lists computer files in Unix and Unix-like operating systems\n", + "- \"cd\" offers way to navigate and change working directory\n", + "- \"pwd\" print working directory\n", + "- \"echo\" used to display line of text/string that are passed as an argument" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": { + "vscode": { + "languageId": "shellscript" + } + }, + "outputs": [], + "source": [ + "%%script bash\n", + "\n", + "# Extract saved variables\n", + "source /tmp/variables.sh\n", + "\n", + "echo \"Navigate to project, then navigate to area wwhere files were cloned\"\n", + "cd $project\n", + "pwd\n", + "\n", + "echo \"\"\n", + "echo \"list top level or root of files with project pulled from github\"\n", + "ls\n" + ] + }, + { + "attachments": {}, + "cell_type": "markdown", + "metadata": {}, + "source": [ + "### Look at file list with hidden and long attributes\n", + "> Most linux commands have options to enhance behavior. The enhanced listing below shows permission bits, owner of file, size and date.\n", + "\n", + "[ls reference](https://www.rapidtables.com/code/linux/ls.html)" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": { + "vscode": { + "languageId": "shellscript" + } + }, + "outputs": [], + "source": [ + "%%script bash\n", + "\n", + "# Extract saved variables\n", + "source /tmp/variables.sh\n", + "\n", + "echo \"Navigate to project, then navigate to area wwhere files were cloned\"\n", + "cd $project\n", + "pwd\n", + "\n", + "echo \"\"\n", + "echo \"list all files in long format\"\n", + "ls -al # all files -a (hidden) in -l long listing" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": { + "vscode": { + "languageId": "shellscript" + } + }, + "outputs": [], + "source": [ + "%%script bash\n", + "\n", + "# Extract saved variables\n", + "source /tmp/variables.sh\n", + "\n", + "echo \"Look for posts\"\n", + "export posts=$project/_posts # _posts inside project\n", + "cd $posts # this should exist per fastpages\n", + "pwd # present working directory\n", + "ls -l # list posts" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": { + "vscode": { + "languageId": "shellscript" + } + }, + "outputs": [], + "source": [ + "%%script bash\n", + "\n", + "# Extract saved variables\n", + "source /tmp/variables.sh\n", + "\n", + "echo \"Look for notebooks\"\n", + "export notebooks=$project/_notebooks # _notebooks is inside project\n", + "cd $notebooks # this should exist per fastpages\n", + "pwd # present working directory\n", + "ls -l # list notebooks" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": { + "vscode": { + "languageId": "shellscript" + } + }, + "outputs": [], + "source": [ + "%%script bash\n", + "\n", + "# Extract saved variables\n", + "source /tmp/variables.sh\n", + "\n", + "echo \"Look for images in notebooks, print working directory, list files\"\n", + "cd $notebooks/images # this should exist per fastpages\n", + "pwd\n", + "ls -l" + ] + }, + { + "attachments": {}, + "cell_type": "markdown", + "metadata": {}, + "source": [ + "### Look inside a Markdown File\n", + "> \"cat\" reads data from the file and gives its content as output" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": { + "vscode": { + "languageId": "shellscript" + } + }, + "outputs": [], + "source": [ + "%%script bash\n", + "\n", + "# Extract saved variables\n", + "source /tmp/variables.sh\n", + "\n", + "echo \"Navigate to project, then navigate to area wwhere files were cloned\"\n", + "\n", + "cd $project\n", + "echo \"show the contents of README.md\"\n", + "echo \"\"\n", + "\n", + "cat README.md # show contents of file, in this case markdown\n", + "echo \"\"\n", + "echo \"end of README.md\"\n" + ] + }, + { + "attachments": {}, + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Env, Git and GitHub\n", + "> Env(ironment) is used to capture things like path to Code or Home directory. Git and GitHub is NOT Only used to exchange code between individuals, it is often used to exchange code through servers, in our case deployment for Website. All tools we use have a behind the scenes relationships with the system they run on (MacOS, Windows, Linus) or a relationship with servers which they are connected to (ie GitHub). There is an \"env\" command in bash. There are environment files and setting files (.git/config) for Git. They both use a key/value concept.\n", + "\n", + "- \"env\" show setting for your shell\n", + "- \"git clone\" sets up a director of files\n", + "- \"cd $project\" allows user to move inside that directory of files\n", + "- \".git\" is a hidden directory that is used by git to establish relationship between machine and the git server on GitHub. " + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": { + "vscode": { + "languageId": "shellscript" + } + }, + "outputs": [], + "source": [ + "%%script bash\n", + "\n", + "# This command has no dependencies\n", + "\n", + "echo \"Show the shell environment variables, key on left of equal value on right\"\n", + "echo \"\"\n", + "\n", + "env" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": { + "vscode": { + "languageId": "shellscript" + } + }, + "outputs": [], + "source": [ + "%%script bash\n", + "\n", + "# Extract saved variables\n", + "source /tmp/variables.sh\n", + "\n", + "cd $project\n", + "\n", + "echo \"\"\n", + "echo \"show the secrets of .git\"\n", + "cd .git\n", + "ls -l\n", + "\n", + "echo \"\"\n", + "echo \"look at config file\"\n", + "cat config" + ] + }, + { + "attachments": {}, + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Advanced Student Request - Make a file in Bash\n", + "> This example was requested by a student (Jun Lim, CSA). The request was to make jupyer file using bash, I adapted the request to markdown. This type of thought will have great extrapolation to coding and possibilities of using List, Arrays, or APIs to build user interfaces. JavaScript is a language where building HTML is very common.\n", + "\n", + "> To get more interesting output from terminal, this will require using something like mdless (https://github.com/ttscoff/mdless). This enables see markdown in rendered format.\n", + "- On Desktop [Install PKG from MacPorts](https://www.macports.org/install.php)\n", + "- In Terminal on MacOS\n", + " - [Install ncurses](https://ports.macports.org/port/ncurses/)\n", + " - ```gem install mdless```\n", + " \n", + "> Output of the example is much nicer in \"jupyter\"" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": { + "vscode": { + "languageId": "shellscript" + } + }, + "outputs": [], + "source": [ + "%%script bash\n", + "\n", + "# This example has error in VSCode, it run best on Jupyter\n", + "cd /tmp\n", + "\n", + "file=\"sample.md\"\n", + "if [ -f \"$file\" ]; then\n", + " rm $file\n", + "fi\n", + "\n", + "tee -a $file >/dev/null <>) redirection operator.\" >> $file\n", + "echo \"- The list definition, as is, is using space to seperate lines. Thus the use of commas and hyphens in output.\" >> $file\n", + "actions=(\"ls,list-directory\" \"cd,change-directory\" \"pwd,present-working-directory\" \"if-then-fi,test-condition\" \"env,bash-environment-variables\" \"cat,view-file-contents\" \"tee,write-to-output\" \"echo,display-content-of-string\" \"echo_text_>\\$file,write-content-to-file\" \"echo_text_>>\\$file,append-content-to-file\")\n", + "for action in ${actions[@]}; do # for loop is very similar to other language, though [@], semi-colon, do are new\n", + " action=${action//-/ } # convert dash to space\n", + " action=${action//,/: } # convert comma to colon\n", + " action=${action//_text_/ \\\"sample text\\\" } # convert _text_ to sample text, note escape character \\ to avoid \"\" having meaning\n", + " echo \" - ${action//-/ }\" >> $file # echo is redirected to file with >>\n", + "done\n", + "\n", + "echo \"\"\n", + "echo \"File listing and status\"\n", + "ls -l $file # list file\n", + "wc $file # show words\n", + "mdless $file # this requires installation, but renders markown from terminal\n", + "\n", + "rm $file # clean up termporary file" + ] + }, + { + "attachments": {}, + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Hack Preparation.\n", + "> Review Tool Setup Procedures and think about some thing you could verify through a Shell notebook.\n", + "- Come up with your own student view of this procedure to show your tools are installed. It is best that you keep the few things you understand, add things later as you start to understand them.\n", + "- Name and create blog notes on some Linux commands you will use frequently.\n", + "- Is there anything we use to verify tools we installed? Review versions?\n", + "- How would you update a repository? Use the git command line? \n" + ] + } + ], + "metadata": { + "kernelspec": { + "display_name": "Python 3.10.6 64-bit", + "language": "python", + "name": "python3" + }, + "language_info": { + "codemirror_mode": { + "name": "ipython", + "version": 3 + }, + "file_extension": ".py", + "mimetype": "text/x-python", + "name": "python", + "nbconvert_exporter": "python", + "pygments_lexer": "ipython3", + "version": "3.9.12" + }, + "vscode": { + "interpreter": { + "hash": "aee8b7b246df8f9039afb4144a1f6fd8d2ca17a180786b69acc140d282b71a49" + } + } + }, + "nbformat": 4, + "nbformat_minor": 2 +} diff --git a/_notebooks/2023-08-17-AP-pseudo-vs-python.ipynb b/_notebooks/2023-08-17-AP-pseudo-vs-python.ipynb index 5e36ea783..2bf2ad3e4 100644 --- a/_notebooks/2023-08-17-AP-pseudo-vs-python.ipynb +++ b/_notebooks/2023-08-17-AP-pseudo-vs-python.ipynb @@ -16,6 +16,13 @@ "---" ] }, + { + "cell_type": "code", + "execution_count": null, + "metadata": {}, + "outputs": [], + "source": [] + }, { "attachments": {}, "cell_type": "markdown", diff --git a/_notebooks/2023-08-17-Markdown_Table_Code_Hack.ipynb b/_notebooks/2023-08-17-Markdown_Table_Code_Hack.ipynb new file mode 100644 index 000000000..886c7aaa7 --- /dev/null +++ b/_notebooks/2023-08-17-Markdown_Table_Code_Hack.ipynb @@ -0,0 +1,141 @@ +{ + "cells": [ + { + "attachments": {}, + "cell_type": "markdown", + "metadata": {}, + "source": [ + "---\n", + "toc: true\n", + "comments: true\n", + "layout: post\n", + "title: IPYNB Table, Code\n", + "description: Example!!! This sample shows markdown cell, markdown table, markdown code fencing, and code cells.\n", + "courses: { compsci: {week: 1} }\n", + "type: hacks\n", + "---" + ] + }, + { + "attachments": {}, + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Learning College Board Pseudo Code\n", + "> College Board uses a kind-of programming language in its Multiple Choice exam. There are thousands of different programming languages have been created, and more are being created every year. College Board has designed a pseudo code, a non operational programming language, to highlight concepts that it wants every student to learn.\n", + "\n", + "College Board is trying to remain neutral and build Computer Science Principles off of any language, thus the Teacher is left to pick the language(s) according to application and curriculum. \n", + "\n", + "College Board Pseudo Code [Exam Reference Sheet](https://apcentral.collegeboard.org/media/pdf/ap-computer-science-principles-exam-reference-sheet.pdf)\n" + ] + }, + { + "attachments": {}, + "cell_type": "markdown", + "metadata": {}, + "source": [ + "### Comparison of CB Pseudo Code to Python with descriptions\n", + "\n", + "Command Vocabulary | Pseudo code | Python | Purpose\n", + "Output | DISPLAY(expression) | print(expression, end=\" \") | Displays the value of expression, followed by a space. Python defaults to newline, thus the end=\" \"\n", + "Input | a ← INPUT() | a = input(prompt) | Accepts a value from the user and returns it to the variable a.\n", + "Assignment |\ta ← expression\t | a = expression | Evaluates expression and assigns the result to the variable a.\n", + "Selection | IF (expression) | if expression: | Run commands in the code block associated with the selection\n", + "Iteration n times |\tREPEAT n TIMES | for i in range(n): | Repeat commands in the code block associated withe the iteration n times\n", + "Iteration expression | REPEAT UNTIL (expression) |\twhile expression: | Repeat commands in the code block associated withe the iteration while expression is true\n", + "List Assignment | list ← [expression1, expression2, expression3] | list = [expression1, expression2, expression3] | Assigns 3 values to list, value can be literal or expressions\n", + "First index in List |\tlist[1] | list[0] | Access the 1st element in the list[]. FYI, most programming languages start a zero.\n", + "Last index in List | list[LENGTH(list)] | list[len(list) - 1] | Access the last element in the list[]. If you start at zero, last element is length - 1.\n", + "Define Procedure | PROCEDURE name (parameter) | def name(parameter): | Create a procedure containing a sequence of programming instructions.\n", + "Expression equals |\ta = b\t| a == b | Evaluate if assigned value of a equals assigned value of b\n", + "Expression not equals |\ta ≠ b\t| a != b | Evaluate if assigned value of a is NOT equal to assigned value of b" + ] + }, + { + "attachments": {}, + "cell_type": "markdown", + "metadata": {}, + "source": [ + "### Pseudo code IF Code Block\n", + "```\n", + "a ← 1\n", + "b ← 1\n", + "\n", + "IF (a = b) {\n", + " DISPLAY(\"A equals B\")\n", + "}\n", + "```" + ] + }, + { + "cell_type": "code", + "execution_count": 1, + "metadata": {}, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "A equals B\n" + ] + } + ], + "source": [ + "# Python code if block to match Pseudo Code\n", + "a = 1\n", + "b = 1\n", + "if (a == b):\n", + " # Python uses indent to establish code block, Teacher use tab key\n", + " print(\"A equals B\")" + ] + }, + { + "attachments": {}, + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Hacks\n", + "> Key Learnings. It is very important that you become fluent in \" Vocabulary\" and researching problems.\n", + "\n", + "- Code a JavaScript cell, this must start with %%js%% in first line of cell. Match the IF condition example in this blog.\n", + "\n", + "- Code a REPEAT n TIMES as described in comparison sheet in Pseudo code, Python, and JavaScript. Be sure to comment your code.\n", + " - REPEAT 100 TIMES\n", + " - Sum all the numpers\n", + " - PRINT the result\n", + "\n", + "- Reflect on our PSEUDO code and how it helped with your problem solving in these hacks. \n", + "\n", + "- Maked efinition for: code block, sequence, selections, iteration. Consider a strategy to remember Pseudo Code, Python and JavaScript for these definitions." + ] + }, + { + "attachments": {}, + "cell_type": "markdown", + "metadata": {}, + "source": [] + } + ], + "metadata": { + "kernelspec": { + "display_name": "base", + "language": "python", + "name": "python3" + }, + "language_info": { + "codemirror_mode": { + "name": "ipython", + "version": 3 + }, + "file_extension": ".py", + "mimetype": "text/x-python", + "name": "python", + "nbconvert_exporter": "python", + "pygments_lexer": "ipython3", + "version": "3.9.12" + }, + "orig_nbformat": 4 + }, + "nbformat": 4, + "nbformat_minor": 2 +} diff --git a/_notebooks/2023-08-21-HTML_Image_Hack.ipynb b/_notebooks/2023-08-21-HTML_Image_Hack.ipynb new file mode 100644 index 000000000..974a41445 --- /dev/null +++ b/_notebooks/2023-08-21-HTML_Image_Hack.ipynb @@ -0,0 +1,209 @@ +{ + "cells": [ + { + "attachments": {}, + "cell_type": "markdown", + "metadata": {}, + "source": [ + "---\n", + "comments: true\n", + "layout: post\n", + "title: IPYNB HTML, img\n", + "description: A key to development in this class is the association VSCode to a GitHub pages project. This is where students update assignments and present work.\n", + "type: hacks\n", + "courses: { compsci: {week: 0} }\n", + "categories: [C4.1]\n", + "---" + ] + }, + { + "attachments": {}, + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Create your own GitHub Pages Project\n", + "> Make you own project from GitHub Pages Student Repo." + ] + }, + { + "attachments": {}, + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Make a GitHub Pages Repository\n", + "> Goto GitHub [student](https://github.com/nighthawkcoders/student).\n", + "\n", + "- Reference: [Create from template](https://docs.github.com/en/repositories/creating-and-managing-repositories/creating-a-repository-from-a-template). Most student will pick this option.\n", + "\n", + "\n", + "- Reference: [Fork a repo](https://docs.github.com/en/get-started/quickstart/fork-a-repo). Student in CSA that teacher has asked to contribute to student example repo will pick this.\n" + ] + }, + { + "attachments": {}, + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Start the GitHub Pages Student Project\n", + "> Run the following commands using terminal on you machine. Be sure Repo has been forked.\n", + "\n", + "- Clone and Open project in VSCode\n", + "- Change \"forkme\" text with your \"ghid\" or selected location\n", + "\n", + "\n", + "```bash\n", + "(base) id:~$ mkdir vscode # make a vscode directory, if you don't have one\n", + "(base) id:~$ cd vscode # change to the directory\n", + "(base) id:~$ git clone https://github.com/forkme/student.git # change to your repo\n", + "(base) id:~$ cd student # change to the project directory\n", + "(base) id:~$ code . # open VSCode in project directory\n", + "```" + ] + }, + { + "attachments": {}, + "cell_type": "markdown", + "metadata": {}, + "source": [ + "### VSCode for Python Extensions, adapt for your needs JavaScript, Python, Java\n", + "- VSCode [Language extensions](https://code.visualstudio.com/docs/languages/overview)\n", + " - Install Python, Python Environment Manager, Python Extension Pack, Pylance\n", + " - Install Jupyter, Jupyter Keymap\n", + " - Install IntelliCode, IntelliCode API Usage Examples\n", + " - Windows machines install WSL Remote Development" + ] + }, + { + "cell_type": "code", + "execution_count": 7, + "metadata": { + "vscode": { + "languageId": "html" + } + }, + "outputs": [ + { + "data": { + "text/html": [ + "\n", + "\n", + "\n", + "
\n", + "
\n", + " \n", + " \"Extensions\"\n", + " \n", + "
\n", + "
\n", + "
\n", + "

\n", + " Visual Studio Code claims to provide just the tools a developer needs for a quick code-build-debug and version control cycle. It provides a Market Place for enhancements and more complex workflows. Before adding extensions, clone projects and see what is requested or added. Here are some extension that were added through that process or that I have added...\n", + "

\n", + "
    \n", + "
  • \n", + " In marketplace there are several extensions for Python, Python Intellisense, Python Extension Pack\n", + "
  • \n", + "
  • \n", + " Jupyter: This supports build jupyter ipynb files from within VS Code\n", + "
  • \n", + "
  • \n", + " Code Spell Checker: Got to have it when building documents, particularly if you spell and typo like the Teacher\n", + "
  • \n", + "
  • \n", + " IntelliCode: Got to have it when creating a code file, it will sense type of code by extension. Also, it help with syntax as you are coding.\n", + "
  • \n", + "
\n", + "

\n", + " Review Details in Marketplace for better explanation of purpose of the things explained above. There is a lot more! As you need Git help look at things like Git History and GitLens. Or, perhaps you enjoy Vim and want Vim emulation for editing, their is an extension for that. Later, there may be interest in AWS Toolkit or Deploy extensions. We will learn more about Marketplace Extensions as we do more.\n", + "

\n", + "
\n", + "
\n", + "
\n" + ], + "text/plain": [ + "" + ] + }, + "metadata": {}, + "output_type": "display_data" + } + ], + "source": [ + "%%HTML\n", + "\n", + "\n", + "\n", + "
\n", + "
\n", + " \n", + " \"Extensions\"\n", + " \n", + "
\n", + "
\n", + "
\n", + "

\n", + " Visual Studio Code claims to provide just the tools a developer needs for a quick code-build-debug and version control cycle. It provides a Market Place for enhancements and more complex workflows. Before adding extensions, clone projects and see what is requested or added. Here are some extension that were added through that process or that I have added...\n", + "

\n", + "
    \n", + "
  • \n", + " In marketplace there are several extensions for Python, Python Intellisense, Python Extension Pack\n", + "
  • \n", + "
  • \n", + " Jupyter: This supports build jupyter ipynb files from within VS Code\n", + "
  • \n", + "
  • \n", + " Code Spell Checker: Got to have it when building documents, particularly if you spell and typo like the Teacher\n", + "
  • \n", + "
  • \n", + " IntelliCode: Got to have it when creating a code file, it will sense type of code by extension. Also, it help with syntax as you are coding.\n", + "
  • \n", + "
\n", + "

\n", + " Review Details in Marketplace for better explanation of purpose of the things explained above. There is a lot more! As you need Git help look at things like Git History and GitLens. Or, perhaps you enjoy Vim and want Vim emulation for editing, their is an extension for that. Later, there may be interest in AWS Toolkit or Deploy extensions. We will learn more about Marketplace Extensions as we do more.\n", + "

\n", + "
\n", + "
\n", + "
" + ] + }, + { + "attachments": {}, + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Hacks\n", + "> Setup Tools and test GitHub connection. Tool and Equipment setup is like attendance, without Tools and Equipment you are effectually absent.\n", + "- Change index.md to show it is REALLY YOURS. Refer to [Markdown Cheet Sheet](https://www.markdownguide.org/cheat-sheet/).\n", + " - Push a minor \"index.md\" change and Verify on GitHub [https://code.visualstudio.com/docs/editor/versioncontrol#_git-support](https://code.visualstudio.com/docs/editor/versioncontrol#_git-support)\n", + " - Verify \"index.md\" change on deployed GitHub Pages" + ] + }, + { + "attachments": {}, + "cell_type": "markdown", + "metadata": {}, + "source": [] + } + ], + "metadata": { + "kernelspec": { + "display_name": "Python 3 (ipykernel)", + "language": "python", + "name": "python3" + }, + "language_info": { + "codemirror_mode": { + "name": "ipython", + "version": 3 + }, + "file_extension": ".py", + "mimetype": "text/x-python", + "name": "python", + "nbconvert_exporter": "python", + "pygments_lexer": "ipython3", + "version": "3.9.12" + } + }, + "nbformat": 4, + "nbformat_minor": 2 +} diff --git a/_notebooks/2023-08-29-test.ipynb b/_notebooks/2023-08-29-test.ipynb new file mode 100644 index 000000000..d47ffdf00 --- /dev/null +++ b/_notebooks/2023-08-29-test.ipynb @@ -0,0 +1,35 @@ +{ + "cells": [ + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "---\n", + "layout: post\n", + "title: Linux Shell and Bash\n", + "description: A Tech Talk on Linux and the Bash shell.\n", + "toc: true\n", + "comments: true\n", + "categories: [5.A, C4.1]\n", + "courses: { csse: {week: 3}, csp: {week: 3, categories: [6.B]}, csa: {week: 1} }\n", + "type: devops\n", + "---" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": {}, + "outputs": [], + "source": [] + } + ], + "metadata": { + "language_info": { + "name": "python" + }, + "orig_nbformat": 4 + }, + "nbformat": 4, + "nbformat_minor": 2 +} diff --git a/_posts/2023-08-15-Tools_Plans_Sample.md b/_posts/2023-08-15-Tools_Plans_Sample.md new file mode 100644 index 000000000..fa2a48537 --- /dev/null +++ b/_posts/2023-08-15-Tools_Plans_Sample.md @@ -0,0 +1,26 @@ +--- +toc: true +comments: false +layout: post +title: Weekly Plan +description: Daily Plan for Week 1 +type: plans +courses: { compsci: {week: 1} } +--- + +### PBL Unit 1 / Week 1 + - Download remaining tools, get a local website running + - Experiment on modifying the website with images, videos, minigames + - Edit blogs to create notebook and modify it + - Test around with the blogs and index, add minigames + + +### Pair Planning Meeting +> Update Blog to contain all hacks. Review week with Pair and look ahead and start plan for next week. Try to be done and learn your machine before Monday EOD. +- A laptop, that you bring to class every day with ability to operate Development Tools on it or within the Cloud. +- GitHub Account, VSCode will be used to push/pull changes. GitHub is where we store and share code in the cloud, think of Google Docs but for Code. +- GitHub Pages will be used to host your personal blog: containing notes, answering hacks, and showing tangibles. Building pages will teach Markdown, HTML, CSS, JavaScript and more. +- Jupyter Notebooks will be used in conjunction with GitHub Pages to build running Code in your blog. +- Slack Account, install the App on Laptop and/or phone, get used to reading announcements. Slack is the tool that we will use for messaging, we have been averaging 1000s of essages each year. +- VSCode is the code editor we will be using in this class. VSCode is more than and editor, this type of tool is often called an Interactive Development Environment (IDE). +- Run make commands to build and test blog locally, before pushing changes to GitHub pages. \ No newline at end of file diff --git a/_posts/2023-08-16-Tools_Hacks_Sample.md b/_posts/2023-08-16-Tools_Hacks_Sample.md new file mode 100644 index 000000000..ac3031d57 --- /dev/null +++ b/_posts/2023-08-16-Tools_Hacks_Sample.md @@ -0,0 +1,93 @@ +--- +toc: true +comments: true +layout: post +title: Prunned Tool Procedure ... +description: Example hacks!!! This shows procedures performed by student, not the procedures for the entire class. Modified or prunned for specific machine. +courses: { compsci: {week: 0} } +type: hacks +--- + +## Hacks +> Complete the procedure below accurately. These are absolutely required and must be 100% accurate for your success. + +### GitHub Account +- Follow instruction [https://docs.github.com/en/get-started/signing-up-for-github/signing-up-for-a-new-github-account](https://docs.github.com/en/get-started/signing-up-for-github/signing-up-for-a-new-github-account) Use your own personal/permanent email... NOT SCHOOL!!! GitHub account belongs to you. + +### MacOS 1st Time Developer +> VSCode install +- Install [VSCode](https://code.visualstudio.com/docs/setup/mac) + +> Anaconda install +- Download for MacOS: [Anaconda](https://www.anaconda.com/products/distribution) +- Run Install: Answer yes to questions + +> Homebrew install +- Copy and Paste to Install from Terminal [Homebrew](https://brew.sh) + - Copy ```bash ... curl ...``` command using copy box on website + - Launch ```terminal``` from search bar + - Paste ```bash ... curl ...``` command into Terminal ... + - Make sure command starts, this should provide feedback/output in terminal and could take a long time, like 10-min, there could be a prompt in the middle, at about 5-minutes. Follow any on screen instructions provided in terminal output to finish. +- Homebrew installs a tool called "brew" which helps add and manage developer packages on MacOS. + +> At this point, the next task is to prepare tools. You must start a new Terminal. Now the Terminal prompt should be prefixed with (base). If not, you need to go back to Anaconda install. +- Open new Terminal, your prompt should look like this... +```bash +(base) iMac:~ jmort1021$ +``` + +> Key Packages needed on MacOS +- Close and Start a new terminal, run each command in Terminal +```bash +$ brew list # list packages +$ brew update # update package list +$ brew upgrade # upgrade packages +$ brew install git # install latest git +$ brew install python # install python3 for development +$ python --version # version of python3 installed +``` +### Windows 1st Time Developer +> VSCode install using WSL. Windows users have option to have best of Windows and Linux while developing within VSCode. +- Install [VSCode using WSL]({{site.baseurl}}/techtalk/vscode-wsl). +- Required review, become familiar with [Windows WSL development](https://code.visualstudio.com/docs/remote/wsl-tutorial) + +> Anaconda install on WSL. +- Try the exact commands in WSL Command / Powershell. +- Only if there is a wget error... To find the latest Linux-x86 distribution hover over ```64-Bit (x86) Installer``` of this page: https://www.anaconda.com/download#downloads. Hover over wget and Anaconda3 commands based on new link. +```bash +> PS C:\Users\UserName> wsl # Windows prompt to WSL command +$ cd /tmp +$ wget https://repo.anaconda.com/archive/Anaconda3-2023.03-1-Linux-x86_64.sh +$ chmod +x Anaconda3-2023.03-1-Linux-x86_64.sh +# Answer yes to all the prompts +$ ./Anaconda3-2023.03-1-Linux-x86_64.sh +``` + +> At this point, the next task is to prepare for Packages, Jupyter Notebooks, and Kernels. You must start a new WSL Command / Powershell. Now the WSL prompt should be prefixed with (base) from Anaconda install. If not, you need to go back to Anaconda install. +- Open Command / Powershell. If you are not looking like this you need to back up. +```bash +> PS C:\Users\ShayM> wsl # Windows prompt +(base) shay@MSI:/mnt/c/Users/ShayM$ cd ~ # WSL prompt +(base) shay@MSI:~$ # WSL home, best place to install files +``` + +> Key Packages needing update on WSL Ubuntu +- In a WSL Command / Powershell install Python3 +```bash +$ sudo apt list # list packages +$ sudo apt update # update package list +$ sudo apt upgrade # upgrade packages +$ sudo apt install python3 python3-pip # install python3 and pip3 for development +$ python --version # version of python3 should be shown + + +### Jupyter Install and Kernels (MacOs and WSL) + +> Install Jupyter and check python kernel +```bash +(base) id:~$ conda --version +(base) id:~$ conda install jupyter # install jupyter +(base) id:~$ jupyter kernelspec list # list installed kernels +Available kernels: + python3 /home/shay/.local/share/jupyter/kernels/python3 +``` diff --git a/_posts/2023-08-16-Tools_Help.md b/_posts/2023-08-16-Tools_Help.md new file mode 100644 index 000000000..1de4a4095 --- /dev/null +++ b/_posts/2023-08-16-Tools_Help.md @@ -0,0 +1,18 @@ +--- +toc: false +comments: false +hide: true +layout: post +type: help +title: Tool References +--- + +### `Visual Studio Code` [Overview](https://code.visualstudio.com/docs/introvideos/basics) + +### `Jupyter Notebooks` [Review Jupyter basics 6-min](https://www.youtube.com/watch?v=3jZYC9rGrNg) + +### `WSL` [Basic Commands](https://learn.microsoft.com/en-us/windows/wsl/basic-commands) + +### `Linux Commands` [Cheat Sheet](https://www.geeksforgeeks.org/linux-commands-cheat-sheet/) + +### `Docker` [Docker Overview](https://docs.docker.com/get-started/overview/) diff --git a/_posts/2023-08-21-GitHub_Pages_Plans.md b/_posts/2023-08-21-GitHub_Pages_Plans.md new file mode 100644 index 000000000..aa4dd6032 --- /dev/null +++ b/_posts/2023-08-21-GitHub_Pages_Plans.md @@ -0,0 +1,27 @@ +--- +toc: true +comments: false +layout: post +title: More Detail Plan +description: Example Plan!!! Analyze hacks and plan. +type: plans +courses: { compsci: {week: 1} } +--- + +### PBL Unit 1 / Week 1 +Learning outcome. Building a personal and running GitHub Pages. +- Monday: Schedule Live Review - 4 minutes. Finish Tools setup. Attend Office Hours on HTML, CSS, JS and Student Blog. +- Tuesday: Read [Markdown Student Page](https://nighthawkcoders.github.io/teacher//c4.3/c5.0/2023/08/17/markdown-html_fragments.html), Attend Office Hours on Updating Home Page and Plan Page. +- Wednesday: Work Plan Page and Home Page. Prep with pair on live review. +- Thursday: 10:45 live review per Canvas. Read [Linux Shell and Bash](https://nighthawkcoders.github.io/teacher//5.a/c4.1/2023/08/16/linux_shell_IPYNB_2_.html). Tranfer blog and customize for my lab notebook. + + +### Pair Planning Meeting +> Update Blog to contain all hacks. Review week with Pair and look ahead and start plan for next week. Try to be done and learn your machine before Monday EOD. +- A laptop, that you bring to class every day with ability to operate Development Tools on it or within the Cloud. +- GitHub Account, VSCode will be used to push/pull changes. GitHub is where we store and share code in the cloud, think of Google Docs but for Code. +- GitHub Pages will be used to host your personal blog: containing notes, answering hacks, and showing tangibles. Building pages will teach Markdown, HTML, CSS, JavaScript and more. +- Jupyter Notebooks will be used in conjunction with GitHub Pages to build running Code in your blog. +- Slack Account, install the App on Laptop and/or phone, get used to reading announcements. Slack is the tool that we will use for messaging, we have been averaging 1000s of essages each year. +- VSCode is the code editor we will be using in this class. VSCode is more than and editor, this type of tool is often called an Interactive Development Environment (IDE). +- Run make commands to build and test blog locally, before pushing changes to GitHub pages. diff --git a/_posts/2023-08-26-GitHub_Sync.md b/_posts/2023-08-26-GitHub_Sync.md new file mode 100644 index 000000000..27ac13d7b --- /dev/null +++ b/_posts/2023-08-26-GitHub_Sync.md @@ -0,0 +1,67 @@ +--- +toc: true +comments: false +hide: true +layout: post +type: help +title: GitHub Overview +--- + +## References + +### `GitHub` [Review GitHub concepts 2-min](https://www.youtube.com/watch?v=phGdqJB6ep0) + +### `Git source control` [VSCode](https://code.visualstudio.com/docs/sourcecontrol/overview) +
+ +## Create GitHub Page Repository +You will want to create a personal Github Pages blog for this class. This is a place where you can code, complete the hacks, and record what you have learned. + +### Git Config +Run the following commands to configure user git connection to GitHub. This is required, before pushing code to GitHub. + + ```bash + # Setup GitHub ID + git config --global user.email + git config --global user.name + # Verify Setup + git config --list + ``` + +### [click to Create Repository](https://docs.github.com/en/repositories/creating-and-managing-repositories/creating-a-repository-from-a-template) + +1. Use Template to create [student repository](https://github.com/nighthawkcoders/student) + +2. Once your repository is created, click on the green "Code" button and copy the HTTPS link provided. + +3. In Terminal, to your vscode directory (`cd ~/vscode`). Then clone the repository with `git clone `. + +4. Open your repository in VS Code with `code `. Cloud Terminal requires you to open after lanuching VSCode. +
+ +## VSCode commit/sync to GitHub Pages +The VSCode saved files are only stored on your computer locally until you commit and then sync the changes. + +### Commit Changes, version control locally +This creates a version of your files in you local git database. Often developers commit several times before they sync in VSCode or push from command line. This allows lots of small changes that can be easily reviewed and rolled back. + +1. Click on the button that supports "Source Control" in VS Code's left sidebar + +2. Click on the plus sign to stage your changes + + ![]({{ site.baseurl }}/images/stage.jpg) + +3. Enter a message for your commit in the message box. + +4. Click the "Commit button" + + +### Sync Changes, update change in GitHub +Sync will push files to GitHub and create an Action for GitHub Pages updates, site will update if code is without errors. + +- Click the Menu button and then click "Push". + + ![]({{ site.baseurl }}/images/push.jpg) + +- Watch Actions until done, open action link and review changes on github.io + diff --git a/_posts/2023-08-30-game_of_life.md b/_posts/2023-08-30-game_of_life.md new file mode 100644 index 000000000..a371e546b --- /dev/null +++ b/_posts/2023-08-30-game_of_life.md @@ -0,0 +1,200 @@ +--- +toc: True +comments: False +layout: post +title: Game of life +description: A simulation fof Convay's game of life +courses: {'compsci': {'week': 2}} +type: hacks +--- + + + + +
+
+ Remix of Game of Life +
+ + + + +
+
+
+ + \ No newline at end of file diff --git a/_posts/2023-08-30-get_to.know_me.md b/_posts/2023-08-30-get_to.know_me.md new file mode 100644 index 000000000..45617e78a --- /dev/null +++ b/_posts/2023-08-30-get_to.know_me.md @@ -0,0 +1,70 @@ +--- +toc: True +comments: False +layout: post +title: Get to Know Me Game +description: A simple quiz on me using input and output in html +courses: {'compsci': {'week': 1}} +type: hacks +--- + + + + Get To Know Me Game + + +

Hello. Welcome to the Get To Know Me Game.

+

This is a multiple choice test that will test your knowledge about me.

+ +
+
+ +
+ + + + \ No newline at end of file diff --git a/_posts/2023-08-30-snakegame.md b/_posts/2023-08-30-snakegame.md new file mode 100644 index 000000000..a765e284a --- /dev/null +++ b/_posts/2023-08-30-snakegame.md @@ -0,0 +1,374 @@ +--- +toc: true +comments: false +layout: post +title: Snake Game +description: A classic snake game +type: hacks +courses: { compsci: {week: 2} } +--- + + + + +
+
+

Snake score: 0

+
+
+ + + +
+

Game Over, press space to try again

+ new game + settings +
+ + + +
+

Settings Screen, press space to go back to playing

+ new game +
+

Speed: + + + + + + +

+

Wall: + + + + +

+
+
+
+ + diff --git a/_posts/2023-08-31-calculator_game.md b/_posts/2023-08-31-calculator_game.md new file mode 100644 index 000000000..b8dc6e409 --- /dev/null +++ b/_posts/2023-08-31-calculator_game.md @@ -0,0 +1,74 @@ +--- +toc: true +comments: false +layout: post +title: Calculator +description: A a game where you get randomly generated equations and have to solve them +type: hacks +courses: { compsci: {week: 2} } +--- + + + + Math Quiz + + +

Math Quiz

+
+
+ + + +
+
+ + + + diff --git a/_posts/2023-08-31-week_0_ticket.md b/_posts/2023-08-31-week_0_ticket.md new file mode 100644 index 000000000..8b93d9368 --- /dev/null +++ b/_posts/2023-08-31-week_0_ticket.md @@ -0,0 +1,16 @@ +--- +toc: true +comments: true +layout: post +title: Review Ticket +description: Example Review Ticket!!! This will help us communicate results. +type: tangibles +courses: { compsci: {week: 0} } +--- + +## Week Overview +Learning outcome. Installing Tools and showing usage of VSCode. + - Listened to Mr. Mortenson talk about the class, online notebooks are important + - Installed VSCode, homebrew, and made an account for Github + - Was playing around with the terminal by opening directories + - Installed python and Jupyter on VSCode \ No newline at end of file diff --git a/_posts/2023-08-31-week_1_ticket.md b/_posts/2023-08-31-week_1_ticket.md new file mode 100644 index 000000000..7b66717bb --- /dev/null +++ b/_posts/2023-08-31-week_1_ticket.md @@ -0,0 +1,24 @@ +--- +toc: true +comments: true +layout: post +title: Review Ticket +description: Overview of Week 1 +type: tangibles +courses: { compsci: {week: 1} } +--- + +### Summary of Accomplishments +- Opened a new terminal, created a vscode directory with mkdir vscode and then cd vscode +- Cloned a teacher repository by using git clone +- After learning how do clone a teacher repository I cloned a student repository and forked it onto my Github account +- Opened my student repository in VSCode +- Followed install steps to install gems, pip, ruby, and more +- Once done installing all the necessary tools, I opened terminal in vscode and wrote bundle install and then typed make +- Once the server ran and provided with the link, I opened the website +- I linked the website to my Github Account +- Played around with the website, opened index.md and then changed the heading text to Sri’s Page +- Pressed command save and then went to my website again to see the change +- Repeated the 2 steps above and added more info about me +- Wanted to add free form picture, tried dragging and linking image to my index.md but it didn’t work +- Fixed the problem by copying the relative path of the image and pasting it in and using ![](imageurl) diff --git a/compsci.md b/compsci.md new file mode 100644 index 000000000..a8e2fce8a --- /dev/null +++ b/compsci.md @@ -0,0 +1,6 @@ +--- +layout: schedule +title: Computer Science Lab Notebook +units: "1,2" +course: compsci +--- diff --git a/get_to_know_me_game.py b/get_to_know_me_game.py new file mode 100644 index 000000000..c9920fe33 --- /dev/null +++ b/get_to_know_me_game.py @@ -0,0 +1,23 @@ +# Online Python compiler (interpreter) to run Python online. +# Write Python 3 code in this online editor and run it. +questions = ["When is my birthday", "What is my favorite food","What is my favorite color","What is favorite food"] +responses = [["A. July 8th", "B. January 9th", "C. November 27th", "D. June 9th"], + ["A. Pizza", "B. Salad", "C. Pasta", "D. Mac&Cheese"], + ["A. Blue", "B. Green", "C. Red", "D. Black"], + ["A. 12", "B. 11", "C. 19", "D. 13"]]; +answer = ["A","D","B","D"] +print("Hello. Wellome to the Get To Know Me Game. This is a multiple choice test that will test your knowledge about me") +user_answer = "" +for i in range(len(questions)): + print(questions[i]) + for j in range(4): + print(response[i][j]) + user_answer = input() + + if user_answer == answer[i]: + print("Correct!") + else: + print("Incorrect") + +print() +print("Thank for playing the game") \ No newline at end of file diff --git a/images/about_me_picture_csp.png b/images/about_me_picture_csp.png new file mode 100644 index 000000000..3e58f3189 Binary files /dev/null and b/images/about_me_picture_csp.png differ diff --git a/images/optix_logo.png b/images/optix_logo.png new file mode 100644 index 000000000..95e4cbaab Binary files /dev/null and b/images/optix_logo.png differ diff --git a/images/push.jpg b/images/push.jpg new file mode 100644 index 000000000..86bf42da0 Binary files /dev/null and b/images/push.jpg differ diff --git a/images/vscode_in_WSL.png b/images/vscode_in_WSL.png new file mode 100644 index 000000000..ab43c7890 Binary files /dev/null and b/images/vscode_in_WSL.png differ diff --git a/index.md b/index.md index daaf162b8..e55760d3e 100644 --- a/index.md +++ b/index.md @@ -4,10 +4,83 @@ title: Student Blog --- -## Build you Home Page here -This is about your journey. Start now!!! +## Soham Kulkarni's Page +My name is Soham. A few things I like to do is to reading, play tennis, and code + +![](images/about_me_picture_csp.png) + + +I am also in Del Norte's First Robot Challenge Team + + + + + + + Get To Know Me Game + + +

Hello. Welcome to the Get To Know Me Game.

+

This is a multiple choice test that will test your knowledge about me.

+ +
+
+ +
+ + + + + ## Overview of Hacks, Study and Tangibles + + Blogging in GitHub pages is a way to learn and code at the same time. - Plans, Lists, [Scrum Boards](https://clickup.com/blog/scrum-board/) help you to track key events, show progress and record time. Effort is a big part of your class grade. Show plans and time spent! diff --git a/indexBlogs.md b/indexBlogs.md index 58f501482..960e2aa77 100644 --- a/indexBlogs.md +++ b/indexBlogs.md @@ -1,5 +1,192 @@ --- layout: blogs permalink: /blogs -title: Blogs +title: Soham's Blogs --- +##### This is what I have been doing in CSP class + + + + + Search Terms + + + +

Search Terms

+ + +
+ + + + + +## Super Quick Overview + +| Week | Accomplishments | +| ----------- | ----------- | +| 0 | Installed WSL, VSCode, and created github repo| +| 1 |Set up website, commited changes to github| + + +## August 22th 2023 +Committed the repository to github. And started working on my website. + +### 1) Committing and Push + +a) I clicked source control on the right side of VSCode and committed all the changes. I also synced all the changes + +b) I started working on my website + +## August 21th, 2023 +Today I setup Jupyter notebook, Installed Gemfile dependencies, and started a server + +### 1) Installing Packages + +a) I went to the command prompt and ran theses commands: + + pip install nbconvert + pip install nbformat + pip install pyyaml + jupyter --version + jupyter kernelspec list + +b) Then I went to VSCode and opened the terminal in it + +c) Then I ran the command: + **bundle install** +This installs dependencies in my Gemfile + +d) Then I could finally start my local server by running: + **make** +Initially the command didn't work but after commenting line 7 on Makefile (a file in student repo) +(to find out what bundle install and make are, refer to terms page below) + + +## August 18th, 2023 +Today I cloned the teacher repository (for practice) and a student repository for my website. I also configured a git connection with Git Hub and installed/updated a lot of packages. + +### 1) Cloning the repository + +a) First I opened WSL. Then I used the command **cd vscode** to make sure that the I am in the vscode directory + +b) Then I used the command **git clone https://github.com/nighthawkcoders/teacher.git** to clone the teacher repository on VScode (this is just for my practice. I will be cloning the student repository) + +c) Then, I went to github to create my personal repository. This is so that after I clone the student repository, I can push it to my own repository on github. + +d) After that I used the command **git clone https://github.com/nighthawkcoders/student** to clone the repository. + +e) I opened the repository throught VScode using **code student** +Make sure you are running VSCode from WSL + + + +(Bottom left view of VSCode) + +### 2) Git connection to Github + +a) I ran 2 commands on WSL: + + git config --global user.email + + git config --global user.name + + +### 3) Install and Udpating all the packages + +I ran these commands below. Keep in mind that the lines starting with '#' are comment and not actual commands +I had a lot of these packages installed and up to date but it never hurts to be safe. + + sudo apt update + sudo apt upgrade -y + + # Install Ruby and necessary development tools + sudo apt install -y ruby-full build-essential zlib1g-dev + + # Install Python 3 and pip + sudo apt-get install -y python3 python3-pip python-is-python3 + + # Install Jupyter Notebook + sudo apt-get install -y jupyter-notebook + + # Install Gems + export GEM_HOME="$HOME/gems" + export PATH="$HOME/gems/bin:$PATH" + gem install jekyll bundler + + +## August 17th, 2023 +I installed WSL and VSCode. This will help me make a website on github + +### 1) WSL is a type of virtual machine inbuit in Windows to run linux. + +a. To properly install WSL, I opened the command prompt as adminstrater. This is where we will be doing a lot of the installations + +b. To install WSL, I used the command: + **wsl --install** + +c. After WSL installation, I ran this command to install Ubuntu from WSL: + **wsl --install -d Ubuntu** + +### 2) Now I installed vscode. It is good to have all the files of a repository on github but if I wanted to actually make a website and edit it, I would need to use vscode + +a) I first downloaded VScode here: [Download](https://code.visualstudio.com/) + +b) Then install I it. I clicked on add the Remote Developers extension pack (forgot to do it before) and I clicked Add to PATH + +Now I have VSCode and WSL working! + + +## Terms + make - command that helps run your local server + make convert - checks and ensures Jupyter notebooks are up to date + make clean - stops the local server and cleans the files + make stop - stops the local server + cd ~ allows you to move through directories + cd vscode - allows you to go to VSCode directory + python –version - shows you your current python version + jupyter –version - shows all your jupyter files and their current versions + git clone - clones a repository + rbenv versions - shows your current ruby versions + ruby -v - shows your current ruby version + bundle install - this command installs the dependencies in your Gemfile + ![]( ) - adds an image on markdown + + + diff --git a/indexHelp.md b/indexHelp.md new file mode 100644 index 000000000..163a3d48f --- /dev/null +++ b/indexHelp.md @@ -0,0 +1,5 @@ +--- +layout: help +permalink: /help +title: Help +--- diff --git a/scripts/__pycache__/convert_notebooks.cpython-310.pyc b/scripts/__pycache__/convert_notebooks.cpython-310.pyc new file mode 100644 index 000000000..a4d17c2f2 Binary files /dev/null and b/scripts/__pycache__/convert_notebooks.cpython-310.pyc differ diff --git a/scripts/activate.sh b/scripts/activate.sh index db5d86b09..bf4ccf8fc 100755 --- a/scripts/activate.sh +++ b/scripts/activate.sh @@ -1,26 +1,28 @@ <> ~/.bashrc + fi +} + +#### Github Pages Local Build support echo "=== GitHub pages build tools ===" export GEM_HOME="$HOME/gems" export PATH="$HOME/gems/bin:$PATH" -echo '# Install Ruby Gems to ~/gems' >> ~/.bashrc -echo 'export GEM_HOME="$HOME/gems"' >> ~/.bashrc -echo 'export PATH="$HOME/gems/bin:$PATH"' >> ~/.bashrc +add_to_rc "# Ruby Gem Path" +add_to_rc 'export GEM_HOME="$HOME/gems"' +add_to_rc 'export PATH="$HOME/gems/bin:$PATH"' + echo "=== Gem install starting, thinking... ===" gem install jekyll bundler +echo "=== !!!Start a new Terminal!!! ===" \ No newline at end of file diff --git a/scripts/activate_macos.sh b/scripts/activate_macos.sh new file mode 100755 index 000000000..12a7d7010 --- /dev/null +++ b/scripts/activate_macos.sh @@ -0,0 +1,39 @@ +<> ~/.zshrc + fi +} + +# MacOS required tools +# +# MacOS commands +# +# Upgrade Homebrew and install xz (decompression utility) +echo "=== Upgrade Packages ===" +yes | brew update +yes | brew upgrade +yes | brew install xz # decompression utility + +# Install rbenv, Ruby 3.1.4, and configure it +echo "=== Install Ruby ===" +yes | brew install rbenv + +# Test if Ruby 3.1.4 exists +if ! rbenv versions | grep -q 3.1.4; then + yes | rbenv install 3.1.4 +fi +rbenv global 3.1.4 + +# Configure rbenv to initialize in the shell +add_to_rc "# rbenv initialize" +add_to_rc 'if which rbenv > /dev/null; then eval "$(rbenv init - zsh)"; fi' +# + +# Install Python and Pip using Homebrew +echo "=== Install Python ===" +yes | brew install python + +# Install Jupyter Notebook using Homebrew +echo "=== Install Jupyter Notebook ===" +yes | brew install jupyter + +# Setup Python libraries for Notebook conversion +pip install nbconvert # library for notebook conversion +pip install nbformat # notebook file utility +pip install pyyaml # notebook frontmatter + +#### Github Pages Local Build +echo "=== GitHub pages build tools ===" +export GEM_HOME="$HOME/gems" +export PATH="$HOME/gems/bin:$PATH" +add_to_rc "# Ruby Gem Path" +add_to_rc 'export GEM_HOME="$HOME/gems"' +add_to_rc 'export PATH="$HOME/gems/bin:$PATH"' + +echo "=== Gem install starting, thinking... ===" +gem install jekyll bundler + +echo "=== !!!Start a new Terminal!!! ===" diff --git a/scripts/setup_ubuntu.sh b/scripts/setup_ubuntu.sh new file mode 100755 index 000000000..613b64222 --- /dev/null +++ b/scripts/setup_ubuntu.sh @@ -0,0 +1,43 @@ +#!/bin/bash + +# Function to check if a line exists in run commands +line_exists_in_rc() { + grep -Fxq "$1" ~/.bashrc +} + +# Function to add line to run commands +add_to_rc() { + if ! line_exists_in_rc "$1"; then + echo "$1" >> ~/.bashrc + fi +} + +# Ugrade and install packages for Ubuntu +echo "=== Upgrade Packages ===" +sudo apt update +sudo apt upgrade -y + +# Install Ruby and necessary development tools +echo "=== Install Ruby ===" +sudo apt install -y ruby-full build-essential zlib1g-dev + +# Install Python 3 and pip +echo "=== Install Python ===" +sudo apt-get install -y python3 python3-pip python-is-python3 + +# Install Jupyter Notebook +echo "=== Install Jupyter Notebook ===" +sudo apt-get install -y jupyter-notebook + +#### Github Pages Local Build support +echo "=== GitHub pages build tools ===" +export GEM_HOME="$HOME/gems" +export PATH="$HOME/gems/bin:$PATH" +add_to_rc "# Ruby Gem Path" +add_to_rc 'export GEM_HOME="$HOME/gems"' +add_to_rc 'export PATH="$HOME/gems/bin:$PATH"' + +echo "=== Gem install starting, thinking... ===" +gem install jekyll bundler + +echo "=== !!!Start a new Terminal!!! ===" diff --git a/search_term.py b/search_term.py new file mode 100644 index 000000000..630ad6f99 --- /dev/null +++ b/search_term.py @@ -0,0 +1,24 @@ +raw_terms = open("terms.txt","r") +terms = [] +for i in range(13): + terms.append(raw_terms.readline().strip("\n").split("=")) + +search = "" +is_md = "on Markdown" +found = False +while True: + search = input("Enter your search: ") + for i in range(len(terms)): + if search == terms[i][0]: + found = True + if is_md in search: + print("Format: ", terms[i][1]) + + else: + print("Definition:", "\n", terms[i][1]) + + if found == False: + print("Sorry we can't find that term. Make sure you have spell your query correctly") + + +print(terms) \ No newline at end of file diff --git a/terms.txt b/terms.txt new file mode 100644 index 000000000..3b7366478 --- /dev/null +++ b/terms.txt @@ -0,0 +1,20 @@ +make=command that helps run your local server +make convert=checks and ensures Jupyter notebooks are up to date +make clean=stops the local server and cleans the files +make stop=stops the local server +cd=allows you to move through directories +cd vscode=allows you to go to VSCode directory +python –version=shows you your current python version +jupyter –version=shows all your jupyter files and their current versions +git clone-clones a repository +rbenv versions=shows your current ruby versions +ruby -v=shows your current ruby version +bundle install=this command installs the dependencies in your Gemfile +Image on Markdown=![text](image_file) +ls=lists files in the respository +pwd=Print working directory command +mkdir=Command used to create directories +echo=Print any text that follows the command +clear=Clear the terminal display +mv=Move or rename files +sudo=command to create privileges