<commit_before>package main

import (
	"fmt"
	_ "github.com/go-sql-driver/mysql"
	"net/http"
)

var base_url = "http://localhost"
var database = "information_schema"

func faviconHandler(w http.ResponseWriter, r *http.Request) {
	http.StatusText(404)
}

func loginPageHandler(w http.ResponseWriter, request *http.Request) {
	fmt.Fprintf(w, loginPage)
}

func pathHandler(w http.ResponseWriter, r *http.Request) {

	if r.URL.Path == "/" {
		home(w, r)
	} else {
		parray := url2array(r)

		switch len(parray) {
		case 1:
			dumpdb(w, r, parray)
		case 2:
			dumptable(w, r, parray)
		case 3:
			dumprecord(w, r, parray)
		}
	}
}

func indexHandler(w http.ResponseWriter, r *http.Request) {
	user , _ , host , port := getCredentials(r)

	if user != "" {
		fmt.Fprintln(w, "<p>", user + "@" + host + ":" + port, "</p>")
		pathHandler(w, r)
	} else {
		loginPageHandler(w, r)
	}
}

func main() {

	http.HandleFunc("/favicon.ico", faviconHandler)
	http.HandleFunc("/login", loginHandler)
	http.HandleFunc("/logout", logoutHandler)
	http.HandleFunc("/", indexHandler)

	fmt.Println("Listening at localhost:8080")
	http.ListenAndServe(":8080", nil)
}
<commit_msg>ASCII navigation bar including host and port<commit_after>package main

import (
	"fmt"
	_ "github.com/go-sql-driver/mysql"
	"net/http"
)

var base_url = "http://localhost"
var database = "information_schema"

func faviconHandler(w http.ResponseWriter, r *http.Request) {
	http.StatusText(404)
}

func loginPageHandler(w http.ResponseWriter, request *http.Request) {
	fmt.Fprintf(w, loginPage)
}

func pathHandler(w http.ResponseWriter, r *http.Request) {

	if r.URL.Path == "/" {
		fmt.Fprintln(w, "</p>")
		home(w, r)
	} else {
		parray := url2array(r)

		switch len(parray) {
		case 1:
			fmt.Fprintln(w, parray[0], "</p>")
			dumpdb(w, r, parray)
		case 2:
			fmt.Fprintln(w, parray[0], "/", parray[1],"</p>")
			dumptable(w, r, parray)
		case 3:
			fmt.Fprintln(w, parray[0], "/", parray[1], "/", parray[2],"</p>")
			dumprecord(w, r, parray)
		}
	}
}

func indexHandler(w http.ResponseWriter, r *http.Request) {
	user , _ , host , port := getCredentials(r)

	if user != "" {
		fmt.Fprint(w, "<p>", linkDeeper(r.URL.Scheme + r.URL.Host, "exit", "[x]")," &nbsp; ", user + "@" + host + ":" + port, " &nbsp; ")
		// TODO remove this ugly hack
		pathHandler(w, r)
	} else {
		loginPageHandler(w, r)
	}
}

func main() {

	http.HandleFunc("/favicon.ico", faviconHandler)
	http.HandleFunc("/login", loginHandler)
	http.HandleFunc("/exit", logoutHandler)
	http.HandleFunc("/", indexHandler)

	fmt.Println("Listening at localhost:8080")
	http.ListenAndServe(":8080", nil)
}

{'fraction_non_alphanumeric': 0.18126428027418126, 'fraction_numerical': 0.013709063214013708, 'mean_word_length': 4.091085271317829, 'pattern_counts': {'":': 4, '<': 10, '<?xml version=': 0, '>': 10, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '2579510', 'n_tokens_mistral': 1096, 'n_tokens_neox': 1021, 'n_words': 210}