---
title: "Github and Math/CS 335"
author: J. Hathaway
params:
  day: 4
  ptitle: true
  pbackground: true
  dtype: "none"
---

```{r setup, include=FALSE}
knitr::opts_chunk$set(echo = TRUE, message = FALSE, warning = FALSE)
library(tidyverse)
library(magrittr)
library(ggrepel)
library(knitr)
library(stringr)

invisible(purl("../backgrounds.Rmd", output = "temp", quiet = TRUE))
read_chunk("temp")


# case study completed
cso <- ceiling(params$day/2) - 1
csn <- ceiling(params$day/2) 

casename_old <-  paste0("cs-", str_pad(cso, 2, "left", "0"))
casename_new <-  paste0("cs-", str_pad(csn, 2, "left", "0"))

link_old <- paste0("> - [Case Study ", cso, "](https://byuistats.github.io/M335/weekly_projects/", str_replace(casename_old,"-",""), "_details.html)")
link_new <- paste0("> - [Case Study ", csn, "](https://byuistats.github.io/M335/weekly_projects/", str_replace(casename_new,"-",""), "_details.html)")

# How did we do?
hdwd <- "> - [How did we do?](https://github.com/BYUI335/hathaway)"

# current task
# 
taskname <- paste0("task-", str_pad(params$day, 2, "left", "0"))
link_task <- paste0("> - [Task ", params$day, "](https://byuistats.github.io/M335/class_tasks/", str_replace(taskname,"-",""), "_details.html)")
```

# Becoming the Critic. {data-background=#e8d725}

```{r nextone}
vday <- params$day - 1
vlink <- paste0("http://www.perceptualedge.com/example", vday, ".php")
titlelink <- paste0('{data-background-iframe="', vlink, '"}')
```

## `r titlelink`

[Visualization of the Day](`r vlink`)

# GitHub and Git

## Really do I have to learn Git and GitHub

[2015 Wired Magazine Article](https://www.wired.com/2015/03/github-conquered-google-microsoft-everyone-else/)

- GitHub now boasts almost 9 million registered users. Each month, about 20 million others visit without registering. ... among the **top 100 most popular sites on earth**.
- everyone hosts their open source projects on GitHub, including Google, Facebook, Twitter, and even Microsoft. 
- the site as a kind of bazaar that offers just about any piece of code you might want-and so much of it free. "If you need something, you just go to GitHub," he says. "You will find it there."

##  Making sure we are all on the same page

Let's take a few minutes to make sure everyone is up to date with the following tasks.

[Class Task 4 Checklist](https://byuistats.github.io/M335/class_tasks/task04_details.html)

> - Install git on your computer
> - Create a GitHub account
> - Work through readings on git and github

## Free private repos

> -  It would benefit you to use the free repos to manage all of your class work.
> - https://education.github.com/discount_requests/new

## The Github Mentality

[The workflow](../images/Git_workflow_diagram.png)

```{R nextone2, eval=FALSE}
# Move to your git managed folder
git pull
git add *
git commit -m "My great work"
git push

```

## Github and R-Studio

### Class Task Items

- Get GitHub working properly
    - Create an account
    - Accept invitations to group and repository

- Open R-Studio and try the git process using the graphical user interface (GUI).
    - Clone repository
    - Edit your README.md and push changes

#  Learning, Slack, & Stack Overflow {data-background=#e8d725}

## {data-background-image="http://mediaassets.ktnv.com/photo/2016/09/08/rupaul_1473370557202_45993103_ver1.0_640_480.jpg"}

<span style="font-size:45px; color:black">
RuPaul on Learning
</span>

<mark>
<span style="font-size:75px; color: black">
Your fear of looking stupid is making you look stupid.
</span>
</mark>

## Hillel the Elder

> - [The pedant does not teach and the shy does not learn](https://torah.org/learning/maharal-p2m6part1/)
> - [Maybe a teacher of Jesus](http://www.newworldencyclopedia.org/entry/Hillel_the_Elder)

## Seriously!
### How do you get people to percieve you are smart?

> - [Time magazine on Looking Stupid Study](http://time.com/3158889/ask-for-advice-competent/)


## Slack 

This space is for us to build a team and support each other.  This is where we learn to ask questions and reach out for support and quick responses. 

## Stack Overflow

Stack Overflow 

- **[Stack Overflow Background and Tips](http://duncanlock.net/blog/2013/06/14/the-smart-guide-to-stack-overflow-zero-to-hero/):**  This is a great page to help you understand how Stack Overflow works. Please read the **Ask Good Questions** section.
- [Create a Stack Overflow Account](https://stackoverflow.com/users/signup?ssrc=head&returnurl=%2fusers%2fstory%2fcurrent&utm_source=stackoverflow.com&utm_medium=dev-story&utm_campaign=signup-redirect)
- [Join our BYUI Channel](https://stackoverflow.com/c/byu/join)


```{r csold, ref.label=casename_old, echo=FALSE, include=FALSE }
# For case study due last Saturday
```

# Review {data-background=#e8d725}

## Class Details

1. Ramping up (week 1)
2. **Replicating (week 2)**
3. Creating (weeks 3 - 12)

## dplyr and ggplot2 coding

https://byuistats.github.io/M335/presentations_class/day_3.html#/wrangling-data
