<commit_before>package bootstrap.liftweb

import _root_.net.liftweb.common._
import _root_.net.liftweb.http._
import _root_.net.liftweb.http.provider._
import _root_.net.liftweb.sitemap._
import _root_.net.liftweb.sitemap.Loc._
import com.scalableminds.brainflight.handler.RequestHandler
import com.scalableminds.brainflight.binary.{FrustrumModel, ModelStore, CubeModel}
import com.scalableminds.brainflight.model.{MongoConfig, User}


/**
 * A class that's instantiated early and run.  It allows the application
 * to modify lift's environment
 */
class Boot {
  def boot {
    MongoConfig.init
    if(!MongoConfig.isMongoRunning){
      println("No Mongo could be found!exiting....")
      sys.exit()
    }

    // add our custom dispatcher
    LiftRules.dispatch.append{RequestHandler}
    // where to search snippet
    LiftRules.addToPackages("com.scalableminds.brainflight")

    LiftRules.resourceNames = "stringTranslations" :: Nil

    // Build SiteMap
    val entries = Menu(Loc("Home", List("index"), "Home")) ::
    Menu(Loc("Static", Link(List("static"), true, "/static/index"),
      "Static Content")) ::
    User.sitemap

    LiftRules.setSiteMap(SiteMap(entries:_*))

    /*
     * Show the spinny image when an Ajax call starts
     */
    LiftRules.ajaxStart =
      Full(() => LiftRules.jsArtifacts.show("ajax-loader").cmd)

    /*
     * Make the spinny image go away when it ends
     */
    LiftRules.ajaxEnd =
      Full(() => LiftRules.jsArtifacts.hide("ajax-loader").cmd)
    LiftRules.early.append(makeUtf8)

    LiftRules.loggedInTest = Full(() => User.loggedIn_?)

    /*
     * Register all BinaryDataModels
     */
    ModelStore.register(CubeModel,FrustrumModel)
    LiftRules.htmlProperties.default.set((r: Req) =>new Html5Properties(r.userAgent))
  }


  /**
   * Force the request to be UTF-8
   */
  private def makeUtf8(req: HTTPRequest) {
    req.setCharacterEncoding("UTF-8")
  }
}
<commit_msg>fixed Uncaught ReferenceError: jQuery is not defined<commit_after>package bootstrap.liftweb

import _root_.net.liftweb.common._
import _root_.net.liftweb.http._
import _root_.net.liftweb.http.provider._
import _root_.net.liftweb.sitemap._
import _root_.net.liftweb.sitemap.Loc._
import com.scalableminds.brainflight.handler.RequestHandler
import com.scalableminds.brainflight.binary.{FrustrumModel, ModelStore, CubeModel}
import com.scalableminds.brainflight.model.{MongoConfig, User}


/**
 * A class that's instantiated early and run.  It allows the application
 * to modify lift's environment
 */
class Boot {
  def boot {
    MongoConfig.init
    if(!MongoConfig.isMongoRunning){
      println("No Mongo could be found!exiting....")
      sys.exit()
    }

    // add our custom dispatcher
    LiftRules.dispatch.append{RequestHandler}
    // where to search snippet
    LiftRules.addToPackages("com.scalableminds.brainflight")

    LiftRules.resourceNames = "stringTranslations" :: Nil

    // Build SiteMap
    val entries = Menu(Loc("Home", List("index"), "Home")) ::
    Menu(Loc("Static", Link(List("static"), true, "/static/index"),
      "Static Content")) ::
    User.sitemap

    LiftRules.setSiteMap(SiteMap(entries:_*))

    // exclude lift ajax files for flight simulator
    LiftRules.autoIncludeAjax = (session =>
      S.request match {
        case Full(Req("static" :: "index" :: Nil,_,_)) =>
          false
        case _ =>
          true
      })

    /*
     * Show the spinny image when an Ajax call starts
     */
    LiftRules.ajaxStart =
      Full(() => LiftRules.jsArtifacts.show("ajax-loader").cmd)

    /*
     * Make the spinny image go away when it ends
     */
    LiftRules.ajaxEnd =
      Full(() => LiftRules.jsArtifacts.hide("ajax-loader").cmd)
    LiftRules.early.append(makeUtf8)

    LiftRules.loggedInTest = Full(() => User.loggedIn_?)

    /*
     * Register all BinaryDataModels
     */
    ModelStore.register(CubeModel,FrustrumModel)
    LiftRules.htmlProperties.default.set((r: Req) =>new Html5Properties(r.userAgent))
  }


  /**
   * Force the request to be UTF-8
   */
  private def makeUtf8(req: HTTPRequest) {
    req.setCharacterEncoding("UTF-8")
  }
}

{'fraction_non_alphanumeric': 0.12602607436021246, 'fraction_numerical': 0.0024142926122646064, 'mean_word_length': 3.2799586776859506, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 14, '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': '2968981', 'n_tokens_mistral': 1387, 'n_tokens_neox': 1309, 'n_words': 270}