<commit_before># Bottlenose

Bottlenose is a web app for managing assignment submission and grading in
computer science courses. It provides a flexible mechanism for automatic grading
of programming assignments.

## Development Environment

Bottlenose is built expecting the following environment:

 * Ubuntu 16.04 (Note: for settingup Bottlenose on Ubuntu, please go here: [setup_mac](../master/doc/setup-mac.md)
 * A BTRFS (or ZFS) filesystem for /var
 * PostgreSQL
 * Ruby + Bundler

For deployment, Phusion Passenger + Nginx is recommended.

## Bottlenose Setup

The goal of this section is to have a working web-server running Bottlenose and
all of it's dependencies. All scripts in this sections start in the
`$BOTTLENOSE` directory unless explicitly stated otherwise.

### Basics

Some packages are generally good to have, and needed by many future steps in
the setup process.

```sh
sudo apt-get install build-essential git postgresql libpq-dev
```

### Postgres

```sh
# Switch to the postgres user to create the new bottlenose role.
sudo su - postgres

# Create the bottlenose role for postgres.
createuser -d bottlenose

# Exit back to the vagrant user.
exit
```

If you run into authentication trouble later, you may need to modify
the pg_hba.conf in /etc/postgres/.../ to allow local ident auth.

### Ruby

Best practice for Ruby in development is to use a version manager like
[rvm](http://rvm.io) or rbenv. Once you have the correct version installed,

```sh
# Install Ruby's package manager "Bundler".
gem install bundler

# Install Bottlenose's dependencies.
# (from the bottlenose directory checked out from git)
bundle install
```

### Running Bottlenose<commit_msg>added db setup<commit_after># Bottlenose

Bottlenose is a web app for managing assignment submission and grading in
computer science courses. It provides a flexible mechanism for automatic grading
of programming assignments.

## Development Environment

Bottlenose is built expecting the following environment:

 * Ubuntu 16.04 (Note: for settingup Bottlenose on Ubuntu, please go here: [setup_mac](../master/doc/setup-mac.md)
 * A BTRFS (or ZFS) filesystem for /var
 * PostgreSQL
 * Ruby + Bundler

For deployment, Phusion Passenger + Nginx is recommended.

## Bottlenose Setup

The goal of this section is to have a working web-server running Bottlenose and
all of it's dependencies. All scripts in this sections start in the
`$BOTTLENOSE` directory unless explicitly stated otherwise.

### Basics

Some packages are generally good to have, and needed by many future steps in
the setup process.

```sh
sudo apt-get install build-essential git postgresql libpq-dev
```

### Postgres

```sh
# Switch to the postgres user to create the new bottlenose role.
sudo su - postgres

# Create the bottlenose role for postgres.
createuser -d bottlenose

# Exit back to the vagrant user.
exit
```

If you run into authentication trouble later, you may need to modify
the pg_hba.conf in /etc/postgres/.../ to allow local ident auth.

###Database startup for a dev env is:

* As user "postgres":
   ```
   createuser -d bottlenose
  ```
 * As the dev user:
  ```
   rake db:create
   rake db:schema:load
   rake db:seed
  ```

* If you want to start clean on an existing Bottlenose, there's a helper to drop/create/load/seed:
  ```
  rake db:nuke
  ```

### Ruby

Best practice for Ruby in development is to use a version manager like
[rvm](http://rvm.io) or rbenv. Once you have the correct version installed,

```sh
# Install Ruby's package manager "Bundler".
gem install bundler

# Install Bottlenose's dependencies.
# (from the bottlenose directory checked out from git)
bundle install
```

### Running Bottlenose
{'fraction_non_alphanumeric': 0.07560975609756097, 'fraction_numerical': 0.002168021680216802, 'mean_word_length': 4.205923836389281, 'pattern_counts': {'":': 1, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 2, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '1475822', 'n_tokens_mistral': 1105, 'n_tokens_neox': 1028, 'n_words': 495}