<commit_before>package net.liftmodules.ng
package test.snippet

import Angular._
import net.liftweb.common.Empty
import net.liftweb.http.{S, SessionVar}
import net.liftweb.util.Schedule
import net.liftweb.util.TimeHelpers.TimeSpan

object Server2ClientBindTests {
  case class ListWrap(l:List[String] = List.empty[String]) {
    def :+ (a:String) = ListWrap(l :+ a)
  }
  case class Counter(current:Int)

  object array extends SessionVar[ListWrap](ListWrap())

  def optimized = render("ArrayOptimizedBindActor")
  def standard = render("ArrayStandardBindActor")

  def render(cometName:String) = {
    var counting = false
    var count = 0

    val session = S.session.openOrThrowException("Piss off, Lou!")

    def schedule:Unit = Schedule(() => {
      if(counting) {
        session.findComet("CounterSessionBindActor", Empty).foreach( _ ! Counter(count) )
        count += 1
      }
      schedule
    }, TimeSpan(1000).millis)

    schedule

    renderIfNotAlreadyDefined(angular.module("S2cBindServices").factory("counterService", jsObjFactory()
      .jsonCall("toggle", {
        counting = !counting
        Empty
      })
    ).factory("arrSvc", jsObjFactory()
      .jsonCall("next", {
        array.update(_ :+ (new java.util.Date().toString))
        session.findComet(cometName, Empty).foreach( _ ! array.is )
        Empty
      })
    ))
  }
}<commit_msg>Removing two more deprecated lift-ng calls<commit_after>package net.liftmodules.ng
package test.snippet

import Angular._
import net.liftweb.common.Empty
import net.liftweb.http.{S, SessionVar}
import net.liftweb.json.DefaultFormats
import net.liftweb.util.Schedule
import net.liftweb.util.TimeHelpers.TimeSpan

object Server2ClientBindTests {
  case class ListWrap(l:List[String] = List.empty[String]) {
    def :+ (a:String) = ListWrap(l :+ a)
  }
  case class Counter(current:Int)

  object array extends SessionVar[ListWrap](ListWrap())

  def optimized = render("ArrayOptimizedBindActor")
  def standard = render("ArrayStandardBindActor")

  def render(cometName:String) = {
    implicit val formats = DefaultFormats
    var counting = false
    var count = 0

    val session = S.session.openOrThrowException("Piss off, Lou!")

    def schedule:Unit = Schedule(() => {
      if(counting) {
        session.findComet("CounterSessionBindActor", Empty).foreach( _ ! Counter(count) )
        count += 1
      }
      schedule
    }, TimeSpan(1000).millis)

    schedule

    renderIfNotAlreadyDefined(angular.module("S2cBindServices").factory("counterService", jsObjFactory()
      .defAny("toggle", {
        counting = !counting
        Empty
      })
    ).factory("arrSvc", jsObjFactory()
      .defAny("next", {
        array.update(_ :+ (new java.util.Date().toString))
        session.findComet(cometName, Empty).foreach( _ ! array.is )
        Empty
      })
    ))
  }
}
{'fraction_non_alphanumeric': 0.125, 'fraction_numerical': 0.0056022408963585435, 'mean_word_length': 3.429457364341085, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 5, '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': '1797888', 'n_tokens_mistral': 918, 'n_tokens_neox': 867, 'n_words': 169}