Instantly share code, notes, and snippets.

View setup_scala.sh
#!/bin/bash
echo "deb https://dl.bintray.com/sbt/debian /" | sudo tee -a /etc/apt/sources.list.d/sbt.list
sudo apt-key adv --keyserver hkp://keyserver.ubuntu.com:80 --recv 2EE0EA64E40A89B84B2DF73499E82A75642AC823
sudo apt-get update
sudo apt-get install sbt
View latex_slides.Rnw
\documentclass{beamer}
\begin{document}
\title{Positive and Negative Words in Dracula}
\author{Ron Richardson}
\begin{frame}
\titlepage
View wordcloud2.R
library(gutenbergr)
library(tidytext)
library(dplyr)
library(wordcloud2)
dracula<-gutenberg_download(345)
dracula$gutenberg_id<-NULL
dracula<-dracula%>%
unnest_tokens(word, text)
View comparision_cloud.R
library(gutenbergr)
library(tidytext)
library(dplyr)
library(wordcloud)
dracula<-gutenberg_download(345)
dracula$gutenberg_id<-NULL
dracula<-dracula%>%
unnest_tokens(word, text)
View ggplot_facet_wrap.R
# Import the libraries used
library(gutenbergr)
library(tidytext)
library(dplyr)
library(ggplot2)
# Download text from Project Gutenberg
dracula<-gutenberg_download(345)
# Split the lines of text into words
View basic_unittest.py
# Our function to test
def above_freezing(celcius):
""" (int) -> boolean
Return True if celcius is above zero, and False if not
"""
return celcius > 0
View positive_dracula.R
library(gutenbergr)
library(tidytext)
library(dplyr)
library(ggplot2)
# Using Dracula as our example text, download it from Project Gutenberg
dracula<-gutenberg_download(345)
# Split each line of text into individual words
dracula<-dracula%>%
View python_sorting.py
def bubble_sort(L):
for i in range(len(L)-1, 0, -1):
for j in range(i):
if L[j] > L[j+1]:
temp = L[j]
L[j] = L[j+1]
L[j+1] = temp
def selection_sort(L):
View file_prompts.py
import os.path
def input_file_prompt():
""" () -> string
Precondition: none
This function returns back a filename that the user wants to read data from. It also checks to see
if the file already exists and if not, informs the users and prompts them to try again.
View sentiments.R
library(dplyr)
library(tidytext)
library(gutenbergr)
library(ggplot2)
# Get our data, the text of Frankenstein
dracula<-gutenberg_download(345)
# Remove the gutenberg_id field since we don't need it
dracula$gutenberg_id<-NULL