<commit_before>package models

import play.api.db._
import play.api.Play.current
import com.mongodb.casbah.Imports._
import models.context._
import com.novus.salat.annotations._
import com.novus.salat.dao.SalatDAO
import brainflight.security.SCrypt._
import scala.collection.mutable.Stack
import play.api.libs.json.JsValue
import play.api.libs.json.JsBoolean

case class UserConfiguration( 
  settings: Map[String, JsValue]  
)

object UserConfiguration {
  val MaxSettings = 50
  
  val defaultConfiguration = UserConfiguration( 
    Map("mouseActive" -> JsBoolean(true))  
  )
  def isValidSetting( field: Tuple2[String, JsValue]) = {
    val (_,value) = field
    (value.asOpt[String]).isDefined || (value.asOpt[Int]).isDefined || (value.asOpt[Boolean]).isDefined
  }
}<commit_msg>BF-64 added default values<commit_after>package models

import play.api.db._
import play.api.Play.current
import com.mongodb.casbah.Imports._
import models.context._
import com.novus.salat.annotations._
import com.novus.salat.dao.SalatDAO
import brainflight.security.SCrypt._
import scala.collection.mutable.Stack
import play.api.libs.json.JsValue
import play.api.libs.json.JsBoolean
import play.api.libs.json._

case class UserConfiguration(
  settings: Map[String, JsValue] )

object UserConfiguration {
  val MaxSettings = 50

  val defaultConfiguration = UserConfiguration(
    Map(
      "moveValue" -> JsNumber( 1 ),
      "rotateValue" -> JsNumber( 0.01 ),
      "scaleValue" -> JsNumber( 0.05 ),
      "mouseRotateValue" -> JsNumber( 0.004 ),
      "mouseInversionX" -> JsNumber( 1 ),
      "mouseInversionY" -> JsNumber( 1 ),
      "mouseActive" -> JsBoolean( true ),
      "keyboardActive" -> JsBoolean( true ),
      "gamepadActive" -> JsBoolean( false ),
      "motionsensorActive" -> JsBoolean( false ) ) )

  def isValidSetting( field: Tuple2[String, JsValue] ) = {
    val ( _, value ) = field
    ( value.asOpt[String] ).isDefined || ( value.asOpt[Int] ).isDefined || ( value.asOpt[Boolean] ).isDefined
  }
}
{'fraction_non_alphanumeric': 0.12699203187250996, 'fraction_numerical': 0.01045816733067729, 'mean_word_length': 3.9119804400977993, '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': '5430201', 'n_tokens_mistral': 690, 'n_tokens_neox': 664, 'n_words': 135}