<commit_before>package info.spielproject.spiel

import android.content._
import android.hardware._
import android.os.Handler
import android.util.Log

import events._

object Sensors extends SensorEventListener {

  private lazy val sensorManager = service.getSystemService(Context.SENSOR_SERVICE).asInstanceOf[SensorManager]

  private lazy val Accelerometer = Option(sensorManager.getDefaultSensor(Sensor.TYPE_ACCELEROMETER))

  private lazy val Proximity = Option(sensorManager.getDefaultSensor(Sensor.TYPE_PROXIMITY))

  private var service:SpielService = null

  def apply(_service:SpielService) {
    service = _service
  }

  private var _shakerEnabled = false

  def shakerEnabled = _shakerEnabled

  // This may need tweaking, but this seems like a good value for an intentional shake.
  private val shakerThreshold = 1.2

  def onSensorChanged(e:SensorEvent) = Option(e.sensor) match {
    case Accelerometer =>
      val netForce = math.sqrt(math.pow(e.values(0)/SensorManager.GRAVITY_EARTH, 2)
      +math.pow(e.values(1)/SensorManager.GRAVITY_EARTH, 2)
      +math.pow(e.values(2)/SensorManager.GRAVITY_EARTH, 2))
      if(netForce > shakerThreshold)<commit_msg>Eliminate warnings introduced in upgrade to Scala 2.10.1.<commit_after>package info.spielproject.spiel

import android.content._
import android.hardware._
import android.os.Handler
import android.util.Log

import events._

object Sensors extends SensorEventListener {

  private lazy val sensorManager = service.getSystemService(Context.SENSOR_SERVICE).asInstanceOf[SensorManager]

  private lazy val Accelerometer = Option(sensorManager.getDefaultSensor(Sensor.TYPE_ACCELEROMETER))

  private lazy val Proximity = Option(sensorManager.getDefaultSensor(Sensor.TYPE_PROXIMITY))

  private var service:SpielService = null

  def apply(_service:SpielService) {
    service = _service
  }

  private var _shakerEnabled = false

  def shakerEnabled = _shakerEnabled

  // This may need tweaking, but this seems like a good value for an intentional shake.
  private val shakerThreshold = 1.2

  def onSensorChanged(e:SensorEvent) = e.sensor match {
    case Accelerometer =>
      val netForce = math.sqrt(math.pow(e.values(0)/SensorManager.GRAVITY_EARTH, 2)
      +math.pow(e.values(1)/SensorManager.GRAVITY_EARTH, 2)
      +math.pow(e.values(2)/SensorManager.GRAVITY_EARTH, 2))
      if(netForce > shakerThreshold)
{'fraction_non_alphanumeric': 0.0834731543624161, 'fraction_numerical': 0.008389261744966443, 'mean_word_length': 4.831295843520782, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 7, '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': '5873285', 'n_tokens_mistral': 746, 'n_tokens_neox': 746, 'n_words': 168}