[Lift] How to prevent OutOfMemory while compiling Lift project?

2009-06-09 Thread sailormoo...@gmail.com

Hi :

   When my project grows, it seems a mvn clean following a mvn test
would generally causes OutOfMemoryException, even with a set
MAVEN_OPTS=-Xms512M -Xmx1024M.
I got this error :

[WARNING] Exception in thread main java.lang.OutOfMemoryError: Java
heap space

[WARNING]   at scala.StringBuilder$.scala$StringBuilder$$copyOf
(StringBuilde
r.scala:867)
[WARNING]   at scala.StringBuilder.expandCapacity
(StringBuilder.scala:112)
[WARNING]   at scala.StringBuilder.append(StringBuilder.scala:246)
[WARNING]   at scala.StringBuilder.append(StringBuilder.scala:234)
[WARNING]   at scala.tools.nsc.symtab.Symbols$Symbol.fullNameString
(Symbols.
scala:1241)
[WARNING]   at scala.tools.nsc.backend.jvm.GenJVM
$BytecodeGenerator.javaName
(GenJVM.scala:1583)
[WARNING]   at scala.tools.nsc.backend.jvm.GenJVM$BytecodeGenerator
$$anonfun
$genBlock$1$1.apply(GenJVM.scala:971)
[WARNING]   at scala.tools.nsc.backend.jvm.GenJVM$BytecodeGenerator
$$anonfun
$genBlock$1$1.apply(GenJVM.scala:868)
[WARNING]   at scala.Iterator$class.foreach(Iterator.scala:414)
[WARNING]   at scala.runtime.BoxedArray$AnyIterator.foreach
(BoxedArray.scala
:45)
[WARNING]   at scala.Iterable$class.foreach(Iterable.scala:256)
[WARNING]   at scala.runtime.BoxedArray.foreach(BoxedArray.scala:
24)
[WARNING]   at scala.tools.nsc.backend.icode.BasicBlocks
$BasicBlock.foreach(
BasicBlocks.scala:130)
[WARNING]   at scala.tools.nsc.backend.jvm.GenJVM
$BytecodeGenerator.genBlock
$1(GenJVM.scala:868)
[WARNING]   at scala.tools.nsc.backend.jvm.GenJVM
$BytecodeGenerator.genBlock
s$1(GenJVM.scala:791)
[WARNING]   at scala.tools.nsc.backend.jvm.GenJVM
$BytecodeGenerator.genCode(
GenJVM.scala:1415)
[WARNING]   at scala.tools.nsc.backend.jvm.GenJVM
$BytecodeGenerator.genMetho
d(GenJVM.scala:594)
[WARNING]   at scala.tools.nsc.backend.jvm.GenJVM$BytecodeGenerator
$$anonfun
$genClass$4.apply(GenJVM.scala:216)
[WARNING]   at scala.tools.nsc.backend.jvm.GenJVM$BytecodeGenerator
$$anonfun
$genClass$4.apply(GenJVM.scala:216)
[WARNING]   at scala.List.foreach(List.scala:841)
[WARNING]   at scala.tools.nsc.backend.jvm.GenJVM
$BytecodeGenerator.genClass
(GenJVM.scala:216)
[WARNING]   at scala.tools.nsc.backend.jvm.GenJVM$JvmPhase$$anonfun
$run$2.ap
ply(GenJVM.scala:55)
[WARNING]   at scala.tools.nsc.backend.jvm.GenJVM$JvmPhase$$anonfun
$run$2.ap
ply(GenJVM.scala:55)
[WARNING]   at scala.Iterator$class.foreach(Iterator.scala:414)
[WARNING]   at scala.collection.Map$$anon$6.foreach(Map.scala:123)
[WARNING]   at scala.tools.nsc.backend.jvm.GenJVM$JvmPhase.run
(GenJVM.scala:
55)
[WARNING]   at scala.tools.nsc.Global$Run.compileSources
(Global.scala:574)
[WARNING]   at scala.tools.nsc.Global$Run.compile(Global.scala:
667)
[WARNING]   at scala.tools.nsc.Main$.process(Main.scala:73)
[WARNING]   at scala.tools.nsc.Main$.main(Main.scala:87)
[WARNING]   at scala.tools.nsc.Main.main(Main.scala)
[INFO]

[ERROR] BUILD FAILURE
[INFO]

[INFO] command line returned non-zero value:1
[INFO]

[INFO] For more information, run Maven with the -e switch
[INFO]

[INFO] Total time: 1 minute 4 seconds
[INFO] Finished at: Tue Jun 09 23:10:56 CST 2009
[INFO] Final Memory: 16M/508M
[INFO]


--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
Lift group.
To post to this group, send email to liftweb@googlegroups.com
To unsubscribe from this group, send email to 
liftweb+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/liftweb?hl=en
-~--~~~~--~~--~--~---



[Lift] Re: How to prevent OutOfMemory while compiling Lift project?

2009-06-09 Thread sailormoo...@gmail.com

Thanks for the help, the jvmArgs works, and I added Kevin's
Suggestions too.

On 6月9日, 下午11時54分, David Bernard david.bernard...@gmail.com wrote:
 maven fork a new jvm to run scalac (by default) so MAVEN_OPTS is not used to
 launch scalac you need to define the  (like David P said)
         configuration
           jvmArgs
             jvmArg-Xmx1024m/jvmArg
           /jvmArgs

 if you want to customize the jvm args

 /davidB

 On Tue, Jun 9, 2009 at 17:45, Kevin Wright 
 kev.lee.wri...@googlemail.comwrote:



  It might be permgen space, I'm currently using:

  MAVEN_OPTS=-Xms1024m -Xmx1024m -XX:MaxPermSize=256m
  -XX:+UnlockExperimentalVMOptions -XX:+UseG1GC

  *-Xms1024m -Xmx1024m* set the min and max the same, so no dynamic
  reallocation will happen, should be faster :)
  *-XX:MaxPermSize=256m* sets the size of the permenant generation, you
  usually need this if you have a large heap
  *-XX:+UnlockExperimentalVMOptions -XX:+UseG1GC* enables the G1 garbage
  collector (this need the LATEST java update), which seems to be a bit
  faster.

  On Tue, Jun 9, 2009 at 4:14 PM, sailormoo...@gmail.com 
  sailormoo...@gmail.com wrote:

  Hi :

    When my project grows, it seems a mvn clean following a mvn test
  would generally causes OutOfMemoryException, even with a set
  MAVEN_OPTS=-Xms512M -Xmx1024M.
  I got this error :

  [WARNING] Exception in thread main java.lang.OutOfMemoryError: Java
  heap space

  [WARNING]       at scala.StringBuilder$.scala$StringBuilder$$copyOf
  (StringBuilde
  r.scala:867)
  [WARNING]       at scala.StringBuilder.expandCapacity
  (StringBuilder.scala:112)
  [WARNING]       at scala.StringBuilder.append(StringBuilder.scala:246)
  [WARNING]       at scala.StringBuilder.append(StringBuilder.scala:234)
  [WARNING]       at scala.tools.nsc.symtab.Symbols$Symbol.fullNameString
  (Symbols.
  scala:1241)
  [WARNING]       at scala.tools.nsc.backend.jvm.GenJVM
  $BytecodeGenerator.javaName
  (GenJVM.scala:1583)
  [WARNING]       at scala.tools.nsc.backend.jvm.GenJVM$BytecodeGenerator
  $$anonfun
  $genBlock$1$1.apply(GenJVM.scala:971)
  [WARNING]       at scala.tools.nsc.backend.jvm.GenJVM$BytecodeGenerator
  $$anonfun
  $genBlock$1$1.apply(GenJVM.scala:868)
  [WARNING]       at scala.Iterator$class.foreach(Iterator.scala:414)
  [WARNING]       at scala.runtime.BoxedArray$AnyIterator.foreach
  (BoxedArray.scala
  :45)
  [WARNING]       at scala.Iterable$class.foreach(Iterable.scala:256)
  [WARNING]       at scala.runtime.BoxedArray.foreach(BoxedArray.scala:
  24)
  [WARNING]       at scala.tools.nsc.backend.icode.BasicBlocks
  $BasicBlock.foreach(
  BasicBlocks.scala:130)
  [WARNING]       at scala.tools.nsc.backend.jvm.GenJVM
  $BytecodeGenerator.genBlock
  $1(GenJVM.scala:868)
  [WARNING]       at scala.tools.nsc.backend.jvm.GenJVM
  $BytecodeGenerator.genBlock
  s$1(GenJVM.scala:791)
  [WARNING]       at scala.tools.nsc.backend.jvm.GenJVM
  $BytecodeGenerator.genCode(
  GenJVM.scala:1415)
  [WARNING]       at scala.tools.nsc.backend.jvm.GenJVM
  $BytecodeGenerator.genMetho
  d(GenJVM.scala:594)
  [WARNING]       at scala.tools.nsc.backend.jvm.GenJVM$BytecodeGenerator
  $$anonfun
  $genClass$4.apply(GenJVM.scala:216)
  [WARNING]       at scala.tools.nsc.backend.jvm.GenJVM$BytecodeGenerator
  $$anonfun
  $genClass$4.apply(GenJVM.scala:216)
  [WARNING]       at scala.List.foreach(List.scala:841)
  [WARNING]       at scala.tools.nsc.backend.jvm.GenJVM
  $BytecodeGenerator.genClass
  (GenJVM.scala:216)
  [WARNING]       at scala.tools.nsc.backend.jvm.GenJVM$JvmPhase$$anonfun
  $run$2.ap
  ply(GenJVM.scala:55)
  [WARNING]       at scala.tools.nsc.backend.jvm.GenJVM$JvmPhase$$anonfun
  $run$2.ap
  ply(GenJVM.scala:55)
  [WARNING]       at scala.Iterator$class.foreach(Iterator.scala:414)
  [WARNING]       at scala.collection.Map$$anon$6.foreach(Map.scala:123)
  [WARNING]       at scala.tools.nsc.backend.jvm.GenJVM$JvmPhase.run
  (GenJVM.scala:
  55)
  [WARNING]       at scala.tools.nsc.Global$Run.compileSources
  (Global.scala:574)
  [WARNING]       at scala.tools.nsc.Global$Run.compile(Global.scala:
  667)
  [WARNING]       at scala.tools.nsc.Main$.process(Main.scala:73)
  [WARNING]       at scala.tools.nsc.Main$.main(Main.scala:87)
  [WARNING]       at scala.tools.nsc.Main.main(Main.scala)
  [INFO]
  
  [ERROR] BUILD FAILURE
  [INFO]
  
  [INFO] command line returned non-zero value:1
  [INFO]
  
  [INFO] For more information, run Maven with the -e switch
  [INFO]
  
  [INFO] Total time: 1 minute 4 seconds
  [INFO] Finished at: Tue Jun 09 23:10:56 CST 2009
  [INFO] Final Memory: 16M/508M
  [INFO]
  - 
  隱藏被引用文字 -

 - 顯示被引用文字

[Lift] Length too long for generated XML

2009-05-17 Thread sailormoo...@gmail.com

Hi:

  I would like to know if there is a way to insert a \n in the
generated xml,
for some NodeSeq seems too long to make Firefox error. Thanks.

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
Lift group.
To post to this group, send email to liftweb@googlegroups.com
To unsubscribe from this group, send email to 
liftweb+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/liftweb?hl=en
-~--~~~~--~~--~--~---



[Lift] What's the xms and xmx setting in Jetty?

2009-05-15 Thread sailormoo...@gmail.com

Hi :

  I would like to know what's the current setting of xms and xmx in
mvn jetty:run ?
And how to modify them?

  Thanks

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
Lift group.
To post to this group, send email to liftweb@googlegroups.com
To unsubscribe from this group, send email to 
liftweb+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/liftweb?hl=en
-~--~~~~--~~--~--~---



[Lift] Re: What's the xms and xmx setting in Jetty?

2009-05-15 Thread sailormoo...@gmail.com

I checked it and it doesn't seem to mention any Java setting though.

On 5月15日, 下午11時47分, Timothy Perrett timo...@getintheloop.eu wrote:
 Checkout the jetty plugin docs:

 http://docs.codehaus.org/display/JETTY/Maven+Jetty+Plugin

 Cheers, Tim

 On 15/05/2009 16:32, sailormoo...@gmail.com sailormoo...@gmail.com
 wrote:





  Hi :

I would like to know what's the current setting of xms and xmx in
  mvn jetty:run ?
  And how to modify them?

Thanks- 隱藏被引用文字 -

 - 顯示被引用文字 -

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
Lift group.
To post to this group, send email to liftweb@googlegroups.com
To unsubscribe from this group, send email to 
liftweb+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/liftweb?hl=en
-~--~~~~--~~--~--~---



[Lift] Re: What's the xms and xmx setting in Jetty?

2009-05-15 Thread sailormoo...@gmail.com

The jetty.xml sample doesn't seem to include xms and xmx
configuration.
http://confluence.atlassian.com/download/attachments/58294274/jetty.xml

On 5月16日, 上午12時08分, Timothy Perrett timo...@getintheloop.eu wrote:
 There is a parameter called jettyConfig - pass the location of a jetty.xml
 and you can configure it as per normal jetty server.

 Cheers, Tim

 On 15/05/2009 16:54, sailormoo...@gmail.com sailormoo...@gmail.com
 wrote:





  I checked it and it doesn't seem to mention any Java setting though.

  On 5月15日, 下午11時47分, Timothy Perrett timo...@getintheloop.eu wrote:
  Checkout the jetty plugin docs:

 http://docs.codehaus.org/display/JETTY/Maven+Jetty+Plugin

  Cheers, Tim

  On 15/05/2009 16:32, sailormoo...@gmail.com sailormoo...@gmail.com
  wrote:

  Hi :

I would like to know what's the current setting of xms and xmx in
  mvn jetty:run ?
  And how to modify them?

Thanks- 隱藏被引用文字 -

  - 顯示被引用文字 -- 隱藏被引用文字 -

 - 顯示被引用文字 -

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
Lift group.
To post to this group, send email to liftweb@googlegroups.com
To unsubscribe from this group, send email to 
liftweb+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/liftweb?hl=en
-~--~~~~--~~--~--~---



[Lift] Jetty Session problem

2009-05-14 Thread sailormoo...@gmail.com

Hi :

  The Jetty server just happened a weird bug, some ppl seems to get
into another ppl's session,
as a logined user but it's another one's. I don't know why this would
happen, anyone knows if there is a bug,
or maybe some configuration should be made? Thanks.

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
Lift group.
To post to this group, send email to liftweb@googlegroups.com
To unsubscribe from this group, send email to 
liftweb+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/liftweb?hl=en
-~--~~~~--~~--~--~---



[Lift] Re: Jetty Session problem

2009-05-14 Thread sailormoo...@gmail.com

Hi:

  It just happened once so I cannot tell exactly the reason.
  However from the logs it seems there is a wierd GET command with
jsession id,
  while most of the commands aren't.

  Proxy Server? Is it in my configuration ? Or just they use the same
proxy server??

  And may I ask if I can disable the jsession id in the GET command to
force them to use cookies?
Thanks

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
Lift group.
To post to this group, send email to liftweb@googlegroups.com
To unsubscribe from this group, send email to 
liftweb+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/liftweb?hl=en
-~--~~~~--~~--~--~---



[Lift] Re: Constantly Ajax Request ?

2009-05-13 Thread sailormoo...@gmail.com

Hi Hi :

  Thanks for the answer but what's the LiftGC used for??
  What's the difference between enabling it and disabling it ?
  Thanks.

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
Lift group.
To post to this group, send email to liftweb@googlegroups.com
To unsubscribe from this group, send email to 
liftweb+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/liftweb?hl=en
-~--~~~~--~~--~--~---



[Lift] Constantly Ajax Request ?

2009-05-12 Thread sailormoo...@gmail.com

Hi :

  I would like to know what's the constantly sending Ajax Request? Is
it for the session keep alive??
Is there a way to disable it? Thanks

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
Lift group.
To post to this group, send email to liftweb@googlegroups.com
To unsubscribe from this group, send email to 
liftweb+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/liftweb?hl=en
-~--~~~~--~~--~--~---



[Lift] Re: How to log exceptions?

2009-05-08 Thread sailormoo...@gmail.com

Thanks, but I cannot find the type of ExceptionHandlerPF in the Lift
doc.

Something like this?

LiftRules.exceptionHandler.prepend((x: NodeSeq) = Log.error(x)).

On 5月8日, 上午12時08分, David Pollak feeder.of.the.be...@gmail.com wrote:
 Exceptions are handled in LiftRules.exceptionHandler

 You can replace the RulesSeq[ExceptionHandlerPF] with your own or prepend a
 handler that will log exceptions.

 On Thu, May 7, 2009 at 7:44 AM, sailormoo...@gmail.com 

 sailormoo...@gmail.com wrote:

  Hi :

   Sometimes exceptions are shown in the pages, but at the same time, I
  wonder why they're not logged. May I ask how to make the exceptions
  auto-logged ??

   Thanks

 --
 Lift, the simply functional web frameworkhttp://liftweb.net
 Beginning Scalahttp://www.apress.com/book/view/1430219890
 Follow me:http://twitter.com/dpp
 Git some:http://github.com/dpp

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
Lift group.
To post to this group, send email to liftweb@googlegroups.com
To unsubscribe from this group, send email to 
liftweb+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/liftweb?hl=en
-~--~~~~--~~--~--~---



[Lift] Re: Mapping null field ?

2009-05-08 Thread sailormoo...@gmail.com

Thanks...

Another question is, when I want to set the foreign key to null
I use talk.actioner_id(null.asInstanceof[UserEntry])

which results an exception, how to set a foreign key to null?

Thanks

On 5月7日, 上午1時18分, David Pollak feeder.of.the.be...@gmail.com wrote:
 On Tue, May 5, 2009 at 6:03 PM, sailormoo...@gmail.com 

 sailormoo...@gmail.com wrote:

  Hello:

   I want to know how to check if a field is null.
  The code results in an error

  if (talk.actioner_id.is != null)
  {}

 I'm figuring talk.actioner_id is a MappedLongForeignKey... correct?  If so,
 use if (talk.acutioner_id.defined_?) { ... }

 Thanks,

 David



  warning: comparing values of types Long and Null using `!=' will
  always yield true

 --
 Lift, the simply functional web frameworkhttp://liftweb.net
 Beginning Scalahttp://www.apress.com/book/view/1430219890
 Follow me:http://twitter.com/dpp
 Git some:http://github.com/dpp

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
Lift group.
To post to this group, send email to liftweb@googlegroups.com
To unsubscribe from this group, send email to 
liftweb+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/liftweb?hl=en
-~--~~~~--~~--~--~---



[Lift] Re: How to log exceptions?

2009-05-08 Thread sailormoo...@gmail.com

Thanks for the help.

What I need might like this

LiftRules.exceptionHandler.prepend {
  case (_, _, exception) = {
Log.error(exception.getStackTrace.toString)
RedirectResponse(/)
  }
}

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
Lift group.
To post to this group, send email to liftweb@googlegroups.com
To unsubscribe from this group, send email to 
liftweb+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/liftweb?hl=en
-~--~~~~--~~--~--~---



[Lift] How to log exceptions?

2009-05-07 Thread sailormoo...@gmail.com

Hi :

  Sometimes exceptions are shown in the pages, but at the same time, I
wonder why they're not logged. May I ask how to make the exceptions
auto-logged ??

  Thanks

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
Lift group.
To post to this group, send email to liftweb@googlegroups.com
To unsubscribe from this group, send email to 
liftweb+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/liftweb?hl=en
-~--~~~~--~~--~--~---



[Lift] Mapping null field ?

2009-05-06 Thread sailormoo...@gmail.com

Hello:

  I want to know how to check if a field is null.
The code results in an error

if (talk.actioner_id.is != null)
{}


warning: comparing values of types Long and Null using `!=' will
always yield true

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
Lift group.
To post to this group, send email to liftweb@googlegroups.com
To unsubscribe from this group, send email to 
liftweb+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/liftweb?hl=en
-~--~~~~--~~--~--~---



[Lift] Logging Exception

2009-05-03 Thread sailormoo...@gmail.com

Hello:

I got an exception

2009-05-03 10:31:23.203::WARN:  failed LiftFilter
java.lang.NoClassDefFoundError: org/slf4j/LoggerFactory
at net.liftweb.util.Slf4jLogBoot$.net$liftweb$util$Slf4jLogBoot
$$_logger
ByName(Slf4jLog.scala:59)

while I added


class Boot {
  def boot {
Slf4jLogBoot.enable()
  }
}

from the Lift Book, did I miss any dependency?
Thanks


--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
Lift group.
To post to this group, send email to liftweb@googlegroups.com
To unsubscribe from this group, send email to 
liftweb+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/liftweb?hl=en
-~--~~~~--~~--~--~---



[Lift] Is there a bulk update function ?

2009-05-03 Thread sailormoo...@gmail.com

Hi :

  From the Lift Book, there is a bulk delete function.

Expense.bulkDelete_!!(By_(Expense.dateOf, date))

  However, I want a bulk update function, is there one or if I must to
update it one by one?
Thanks.

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
Lift group.
To post to this group, send email to liftweb@googlegroups.com
To unsubscribe from this group, send email to 
liftweb+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/liftweb?hl=en
-~--~~~~--~~--~--~---



[Lift] Re: Customizing Javascript

2009-04-26 Thread sailormoo...@gmail.com

Here is the current solution. It's not clean, but I cannot think of
better idea for the code.

 bind(entry, xhtml,
  js_realtimeoutput - script language=JavaScript{Unparsed
(js_realtime_output(room_day, room))}/script)

private def js_realtime_output(room_day: RoomDay, room: Room) : String
= {
def date_string(datetime : GregorianCalendar) : String  = {
  String.format(new Date(%s,%s,%s,%s,%s,%s),
datetime.get(Calendar.YEAR).toString, datetime.get
(Calendar.MONTH).toString,
datetime.get(Calendar.DAY_OF_MONTH).toString, datetime.get
(Calendar.HOUR_OF_DAY).toString,
datetime.get(Calendar.MINUTE).toString, datetime.get
(Calendar.SECOND).toString)
}

val s_datetime = new GregorianCalendar()
val e_datetime = new GregorianCalendar()
if (room_day.day_no.is == 0) {
   function realtime_output() {
 php_now =  + date_string(s_datetime) + ;
 local_now = new Date();
 diff_sec = Math.floor( (local_now - php_now) / 1000);
 document.realtime_form.realtime_output.value = 伺服器與本地時間差: +
diff_sec + 秒;
   }
} else {
  s_datetime.setTime(room_day.created.is)
  e_datetime.setTime(room_day.created.is)

  var until_string = 
  if (room_day.day_no.is % 2 == 0) {
e_datetime.add(Calendar.MINUTE, room.day_minutes.is)
until_string = 日落
  } else {
e_datetime.add(Calendar.MINUTE, room.night_minutes.is)
until_string = 早上
  }

  starttime =  + date_string(s_datetime) + ;
  endtime   =  + date_string(e_datetime) + ;
  diffseconds = Math.floor((endtime - starttime)/1000);
  function realtime_output() {
nowtime = new Date();
leftseconds = diffseconds - Math.floor((nowtime - starttime)/
1000);
lefttime = new Date(0,0,0,0,0,leftseconds);
virtual_left_seconds = Math.floor(12*60*60*(leftseconds /
diffseconds));
virtual_lefttime = new Date(0,0,0,0,0,virtual_left_seconds);
if(leftseconds  0){
  document.realtime_form.realtime_output.value =   +
until_string + 剩餘  + virtual_lefttime.getHours()+時
間+virtual_lefttime.getMinutes()+分 (實際時間 +lefttime.getMinutes()
+分+lefttime.getSeconds()+秒);
} else {
  overseconds = Math.abs(leftseconds);
  overtime = new Date(0,0,0,0,0,overseconds);
  document.realtime_form.realtime_output.value = 超過時間
+overtime.getMinutes()+分+overtime.getSeconds()+秒;
}
tid = setTimeout('realtime_output()', 1000);
  }
}
  }

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
Lift group.
To post to this group, send email to liftweb@googlegroups.com
To unsubscribe from this group, send email to 
liftweb+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/liftweb?hl=en
-~--~~~~--~~--~--~---



[Lift] About Scala XML Manipulation

2009-04-26 Thread sailormoo...@gmail.com

Hi :

  I want to ask why the d/ won't appear in the following XML code.
  And if I want to make such effect ? the if is inside an outer tag
following by a previous tag, how could I do ?
  Thanks

scala brcs/{if(1==1) d/}/br
res26: scala.xml.Elem = brcs/cs/br


--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
Lift group.
To post to this group, send email to liftweb@googlegroups.com
To unsubscribe from this group, send email to 
liftweb+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/liftweb?hl=en
-~--~~~~--~~--~--~---



[Lift] Re: Customizing Javascript

2009-04-26 Thread sailormoo...@gmail.com

Hi David :

  I think I need some really simple example, for example
body onload=alert('%= alert_message %') 

Can you give me the detail how to make this ?
It doesn't seem to work as body onload=alert('Lift:Alert.message /
') 


From the Liftbook, there are some advanced examples with Comet and
Ajax,
but my problem is even some simple things I don't know how to make it.

The previous javascript code needs 3 parameters, start_time,
end_time and an until_string( just for the message to display),
but in the original PHP there are two functions with the same name,
it's the code that decides which to use.

The javascript is to display a message to show much time left, it
calls itself to replenish the display,
that's why there is an setTimeout('realtime_output()', 1000); in the
end of the function.

And other than javascript, I would like to know how to make dynamic
CSS.

style type=text/css
!--
  body{background-color:%=background_color;color:
%=text_color;}
  A:link { color: blue; }
  A:visited { color: blue; }
  A:active { color: red; }
  A:hover { color: red; }
  .left_real_time{ color:%=text_color; background-color:
%=background_color;font-size:11pt;border-width:0px;border-
style:solid;}
--
 /style

My solution to this CSS is still a snippet, because I don't know how
to make a dynamic CSS other than snippet.

Thanks to the help.

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
Lift group.
To post to this group, send email to liftweb@googlegroups.com
To unsubscribe from this group, send email to 
liftweb+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/liftweb?hl=en
-~--~~~~--~~--~--~---



[Lift] Re: Binding Radio Button

2009-04-25 Thread sailormoo...@gmail.com

Oh...I think I found the reason...Thanks for the help
The reason is in my code

The binding to submit button is previous to binding to checkbox.
if the order is changed...it would work correctly


--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
Lift group.
To post to this group, send email to liftweb@googlegroups.com
To unsubscribe from this group, send email to 
liftweb+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/liftweb?hl=en
-~--~~~~--~~--~--~---



[Lift] Re: **IMPORTANT** Lift 1.1-SNAPSHOT now compiled against Scala 2.7.4

2009-04-25 Thread sailormoo...@gmail.com

Hi :

   Can you detail what exactly needs to change ?

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
Lift group.
To post to this group, send email to liftweb@googlegroups.com
To unsubscribe from this group, send email to 
liftweb+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/liftweb?hl=en
-~--~~~~--~~--~--~---



[Lift] Customizing Javascript

2009-04-25 Thread sailormoo...@gmail.com

Hello:

   I have a javascript that needs to get a parameter from a snippet,
for example.
  starttime = new Date(entry:starttime /);

  This seems not to work, any idea how to make it? or if I should
generate the entire javascript from the snippet to bind it into a
single tag?

Thanks

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
Lift group.
To post to this group, send email to liftweb@googlegroups.com
To unsubscribe from this group, send email to 
liftweb+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/liftweb?hl=en
-~--~~~~--~~--~--~---



[Lift] Re: Binding Radio Button

2009-04-24 Thread sailormoo...@gmail.com

Thanks Timothy, but can you give an example of checkbox, because no
matter what I try, the binding function of checkbox doesn't seem to be
called when checkbox is set. I tried some trivious binding function,
but it's no effect still.

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
Lift group.
To post to this group, send email to liftweb@googlegroups.com
To unsubscribe from this group, send email to 
liftweb+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/liftweb?hl=en
-~--~~~~--~~--~--~---



[Lift] Re: Binding Radio Button

2009-04-24 Thread sailormoo...@gmail.com


The example from the lift book doesn't work.

Listing 4.4: A checkbox example
SHtml.checkbox(false, if (_) frobnicate(), Full(snazzy), class -
woohoo)

and mine is

bind(entry, xhtml,
  test_mode - SHtml.checkbox(false, if (_) option_list
= option_list ::: List(FlagEnum.TEST_MODE), id-test_mode))

doesn't work.

even with a simpler one (no if checking, and no list appending)
doesn't work.

bind(entry, xhtml,
  test_mode - SHtml.checkbox(false, {x:Boolean =
option_list
=  List(FlagEnum.TEST_MODE)}, id-test_mode))

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
Lift group.
To post to this group, send email to liftweb@googlegroups.com
To unsubscribe from this group, send email to 
liftweb+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/liftweb?hl=en
-~--~~~~--~~--~--~---



[Lift] Re: Binding Radio Button

2009-04-24 Thread sailormoo...@gmail.com

I didn't get a compilation error, but the function in the checkbox
(Boolean) = Any doesn't seem to be called

bind(c,xhtml,
  checkbox - SHtml.checkbox(booleanThing, booleanThing = _) %
(class - myCSSclass)
)

As the example, booleanThing is always false no matter if I clicked
the checkbox or not.
I don't know why though.

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
Lift group.
To post to this group, send email to liftweb@googlegroups.com
To unsubscribe from this group, send email to 
liftweb+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/liftweb?hl=en
-~--~~~~--~~--~--~---



[Lift] Re: Binding Radio Button

2009-04-22 Thread sailormoo...@gmail.com

Thanks for the help ^.^

And if I want the choices are dynamic, what should I do ?
For example, there could be 3 radios, or maybe 5 radios.

I still cannot understand the mechanism of lift, but may I make such
binding?

def example(xhtml: NodeSeq): NodeSeq = bind(entry, xhtml,
  radio - table{ for (radio_item - radio_group) trtd
{radio_item}/td/tr}/table
)

while radio_group is

val radios = SHtml.radio(radio_map.keys.toList, Full(radio_selected),
radio_selected = _)

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
Lift group.
To post to this group, send email to liftweb@googlegroups.com
To unsubscribe from this group, send email to 
liftweb+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/liftweb?hl=en
-~--~~~~--~~--~--~---



[Lift] Re: Binding Radio Button

2009-04-22 Thread sailormoo...@gmail.com

Hello:

  And about the checkbox..

 bind(entry, xhtml,
  test_mode - SHtml.checkbox(false, if (_) option_list
= option_list ::: List(FlagEnum.TEST_MODE), id-test_mode))

I have a option_list of List[FlagEnum.Value] for saving the options
(note : I have over 40 checkboxs), I am not sure if I should bind them
to one per tag,
or if there is any better solution??

Oh...I forgot to mention the code doesn't work, because the
option_list isn't modified no matter if I clicked the checkbox or not.

Thanks

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
Lift group.
To post to this group, send email to liftweb@googlegroups.com
To unsubscribe from this group, send email to 
liftweb+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/liftweb?hl=en
-~--~~~~--~~--~--~---



[Lift] Binding Radio Button

2009-04-21 Thread sailormoo...@gmail.com

Hello:

var sex = M
val sex_map = Map(Male-M, Female-F)

bind(entry, xhtml,
  sex   - SHtml.radio(sex_map.keys.toList, Empty,
sex = _),
)

I don't know why I would get an exception like this:
Thanks for the help

[WARNING] D:\\snippet\UserEntryController.scala:52: error:
overloaded method value bind with alternatives
(String,net.liftweb.util.Box[(scala.xml.NodeSeq) =
scala.xml.NodeSeq],net.liftweb.util.Box[(scala.xml.PrefixedAttribute)
=
scala.xml.MetaData],scala.xml.NodeSeq,net.liftweb.util.Helpers.BindParam*)
scala.xml.NodeSeq and
(String,scala.xml.NodeSeq,net.liftweb.util.Helpers.BindParam*)
scala.xml.NodeSeq cannot be applied to
java.lang.String,scala.xml.Group,net.liftweb.util.Helpers.TheBindParam,net.liftweb.util.Helpers.TheBindParam,net.liftweb.util.Helpers.TheBindParam,net.liftweb.util.Helpers.TheBindParam,net.liftweb.util.Helpers.TheBindParam,net.liftweb.util.Helpers.TheBindParam,
(String, net.liftweb.http.SHtml.ChoiceHolder
[String]),net.liftweb.util.Helpers.TheBindParam)
[WARNING] bind(entry, xhtml,
[WARNING] ^
[WARNING] one error found

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
Lift group.
To post to this group, send email to liftweb@googlegroups.com
To unsubscribe from this group, send email to 
liftweb+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/liftweb?hl=en
-~--~~~~--~~--~--~---



[Lift] Scala Exception

2009-04-20 Thread sailormoo...@gmail.com

Hi :

   need help for the following again. Thanks ^.^

[WARNING] Exception in thread main java.lang.RuntimeException:
malformed Scala
 signature of Room at 12608; reference type _1 of none refers to
nonexisting s
ymbol.
[WARNING]   at scala.tools.nsc.symtab.classfile.UnPickler
$UnPickle.errorBadS
ignature(UnPickler.scala:762)
[WARNING]   at scala.tools.nsc.symtab.classfile.UnPickler
$UnPickle.scala$too
ls$nsc$symtab$classfile$UnPickler$UnPickle$$readSymbol(UnPickler.scala:
172)
[WARNING]   at scala.tools.nsc.symtab.classfile.UnPickler$UnPickle$
$anonfun$
scala$tools$nsc$symtab$classfile$UnPickler$UnPickle$$readSymbolRef
$1.apply(UnPic
kler.scala:714)
[WARNING]   at scala.tools.nsc.symtab.classfile.UnPickler$UnPickle$
$anonfun$
scala$tools$nsc$symtab$classfile$UnPickler$UnPickle$$readSymbolRef
$1.apply(UnPic
kler.scala:714)
[WARNING]   at scala.tools.nsc.symtab.classfile.UnPickler
$UnPickle.scala$too
ls$nsc$symtab$classfile$UnPickler$UnPickle$$at(UnPickler.scala:139)
[WARNING]   at scala.tools.nsc.symtab.classfile.UnPickler
$UnPickle.scala$too
ls$nsc$symtab$classfile$UnPickler$UnPickle$$readSymbolRef
(UnPickler.scala:714)
[WARNING]   at scala.tools.nsc.symtab.classfile.UnPickler
$UnPickle.scala$too
ls$nsc$symtab$classfile$UnPickler$UnPickle$$readType(UnPickler.scala:
254)
[WARNING]   at scala.tools.nsc.symtab.classfile.UnPickler$UnPickle$
$anonfun$
scala$tools$nsc$symtab$classfile$UnPickler$UnPickle$$readTypeRef
$1.apply(UnPickl
er.scala:715)
[WARNING]   at scala.tools.nsc.symtab.classfile.UnPickler$UnPickle$
$anonfun$
scala$tools$nsc$symtab$classfile$UnPickler$UnPickle$$readTypeRef
$1.apply(UnPickl
er.scala:715)
[WARNING]   at scala.tools.nsc.symtab.classfile.UnPickler
$UnPickle.scala$too
ls$nsc$symtab$classfile$UnPickler$UnPickle$$at(UnPickler.scala:139)
[WARNING]   at scala.tools.nsc.symtab.classfile.UnPickler
$UnPickle.scala$too
ls$nsc$symtab$classfile$UnPickler$UnPickle$$readTypeRef
(UnPickler.scala:715)
[WARNING]   at scala.tools.nsc.symtab.classfile.UnPickler$UnPickle$
$anonfun$
3.apply(UnPickler.scala:255)
[WARNING]   at scala.tools.nsc.symtab.classfile.UnPickler$UnPickle$
$anonfun$
3.apply(UnPickler.scala:255)
[WARNING]   at scala.tools.nsc.symtab.classfile.PickleBuffer.until
(PickleBuf
fer.scala:127)
[WARNING]   at scala.tools.nsc.symtab.classfile.UnPickler
$UnPickle.scala$too
ls$nsc$symtab$classfile$UnPickler$UnPickle$$readType(UnPickler.scala:
255)
[WARNING]   at scala.tools.nsc.symtab.classfile.UnPickler$UnPickle$
$anonfun$
scala$tools$nsc$symtab$classfile$UnPickler$UnPickle$$readTypeRef
$1.apply(UnPickl
er.scala:715)
[WARNING]   at scala.tools.nsc.symtab.classfile.UnPickler$UnPickle$
$anonfun$
scala$tools$nsc$symtab$classfile$UnPickler$UnPickle$$readTypeRef
$1.apply(UnPickl
er.scala:715)
[WARNING]   at scala.tools.nsc.symtab.classfile.UnPickler
$UnPickle.scala$too
ls$nsc$symtab$classfile$UnPickler$UnPickle$$at(UnPickler.scala:139)
[WARNING]   at scala.tools.nsc.symtab.classfile.UnPickler
$UnPickle.scala$too
ls$nsc$symtab$classfile$UnPickler$UnPickle$$readTypeRef
(UnPickler.scala:715)
[WARNING]   at scala.tools.nsc.symtab.classfile.UnPickler
$UnPickle.scala$too
ls$nsc$symtab$classfile$UnPickler$UnPickle$$readType(UnPickler.scala:
286)
[WARNING]   at scala.tools.nsc.symtab.classfile.UnPickler$UnPickle$
$anonfun$
scala$tools$nsc$symtab$classfile$UnPickler$UnPickle$$readTypeRef
$1.apply(UnPickl
er.scala:715)
[WARNING]   at scala.tools.nsc.symtab.classfile.UnPickler$UnPickle$
$anonfun$
scala$tools$nsc$symtab$classfile$UnPickler$UnPickle$$readTypeRef
$1.apply(UnPickl
er.scala:715)
[WARNING]   at scala.tools.nsc.symtab.classfile.UnPickler
$UnPickle.scala$too
ls$nsc$symtab$classfile$UnPickler$UnPickle$$at(UnPickler.scala:139)
[WARNING]   at scala.tools.nsc.symtab.classfile.UnPickler
$UnPickle.scala$too
ls$nsc$symtab$classfile$UnPickler$UnPickle$$readTypeRef
(UnPickler.scala:715)
[WARNING]   at scala.tools.nsc.symtab.classfile.UnPickler$UnPickle$
$anonfun$
3.apply(UnPickler.scala:255)
[WARNING]   at scala.tools.nsc.symtab.classfile.UnPickler$UnPickle$
$anonfun$
3.apply(UnPickler.scala:255)
[WARNING]   at scala.tools.nsc.symtab.classfile.PickleBuffer.until
(PickleBuf
fer.scala:127)
[WARNING]   at scala.tools.nsc.symtab.classfile.UnPickler
$UnPickle.scala$too
ls$nsc$symtab$classfile$UnPickler$UnPickle$$readType(UnPickler.scala:
255)
[WARNING]   at scala.tools.nsc.symtab.classfile.UnPickler$UnPickle$
$anonfun$
scala$tools$nsc$symtab$classfile$UnPickler$UnPickle$$readTypeRef
$1.apply(UnPickl
er.scala:715)
[WARNING]   at scala.tools.nsc.symtab.classfile.UnPickler$UnPickle$
$anonfun$
scala$tools$nsc$symtab$classfile$UnPickler$UnPickle$$readTypeRef
$1.apply(UnPickl
er.scala:715)
[WARNING]   at scala.tools.nsc.symtab.classfile.UnPickler
$UnPickle.scala$too
ls$nsc$symtab$classfile$UnPickler$UnPickle$$at(UnPickler.scala:139)
[WARNING]   at scala.tools.nsc.symtab.classfile.UnPickler

[Lift] Re: Need Help with the RuntimeException

2009-04-14 Thread sailormoo...@gmail.com

And need help with this too...
BufferUnderFlowException??

java.nio.BufferUnderflowException
at java.nio.Buffer.nextGetIndex(Buffer.java:398)
at java.nio.HeapCharBuffer.get(HeapCharBuffer.java:117)
at scala.io.BufferedSource$$anon$2.init(BufferedSource.scala:77)
at scala.io.BufferedSource.init(BufferedSource.scala:74)
at scala.io.BufferedSource$$anon$1.init(BufferedSource.scala:34)
at scala.io.BufferedSource$.fromInputStream(BufferedSource.scala:32)
at scala.io.BufferedSource$.fromInputStream(BufferedSource.scala:27)
at scala.io.BufferedSource$.fromInputStream(BufferedSource.scala:23)
at scala.io.Source$.fromInputStream(Source.scala:215)
at scala.io.Source$$anonfun$fromInputStream$2.apply(Source.scala:215)
at scala.io.Source$$anonfun$fromInputStream$2.apply(Source.scala:215)
at scala.io.BufferedSource$$anon$1.reset(BufferedSource.scala:35)
at scala.io.Source.getLine(Source.scala:272)
at scala.io.Source.report(Source.scala:368)
at scala.io.Source.reportError(Source.scala:355)
at scala.io.Source.reportError(Source.scala:344)
at scala.xml.parsing.MarkupParser$class.reportSyntaxError
(MarkupParser.scala:1113)
at net.liftweb.util.PCDataXmlParser.reportSyntaxError
(PCDataMarkupParser.scala:91)
at scala.xml.parsing.MarkupParser$class.reportSyntaxError
(MarkupParser.scala:1117)
at net.liftweb.util.PCDataXmlParser.reportSyntaxError
(PCDataMarkupParser.scala:91)
at scala.xml.parsing.MarkupParser$class.xEndTag(MarkupParser.scala:
378)
at net.liftweb.util.PCDataXmlParser.xEndTag(PCDataMarkupParser.scala:
91)
at scala.xml.parsing.MarkupParser$class.element1(MarkupParser.scala:
683)
at net.liftweb.util.PCDataXmlParser.element1(PCDataMarkupParser.scala:
91)
at scala.xml.parsing.MarkupParser$class.content1(MarkupParser.scala:
481)
at net.liftweb.util.PCDataXmlParser.content1(PCDataMarkupParser.scala:
91)
at scala.xml.parsing.MarkupParser$class.content(MarkupParser.scala:
505)
at net.liftweb.util.PCDataXmlParser.content(PCDataMarkupParser.scala:
91)
at scala.xml.parsing.MarkupParser$class.element1(MarkupParser.scala:
682)
at net.liftweb.util.PCDataXmlParser.element1(PCDataMarkupParser.scala:
91)
at scala.xml.parsing.MarkupParser$class.content1(MarkupParser.scala:
481)
at net.liftweb.util.PCDataXmlParser.content1(PCDataMarkupParser.scala:
91)
at scala.xml.parsing.MarkupParser$class.content(MarkupParser.scala:
505)
at net.liftweb.util.PCDataXmlParser.content(PCDataMarkupParser.scala:
91)
at scala.xml.parsing.MarkupParser$class.element1(MarkupParser.scala:
682)
at net.liftweb.util.PCDataXmlParser.element1(PCDataMarkupParser.scala:
91)
at scala.xml.parsing.MarkupParser$class.content1(MarkupParser.scala:
481)
at net.liftweb.util.PCDataXmlParser.content1(PCDataMarkupParser.scala:
91)
at scala.xml.parsing.MarkupParser$class.content(MarkupParser.scala:
505)
at net.liftweb.util.PCDataXmlParser.content(PCDataMarkupParser.scala:
91)
at scala.xml.parsing.MarkupParser$class.element1(MarkupParser.scala:
682)
at net.liftweb.util.PCDataXmlParser.element1(PCDataMarkupParser.scala:
91)
at scala.xml.parsing.MarkupParser$class.content1(MarkupParser.scala:
481)
at net.liftweb.util.PCDataXmlParser.content1(PCDataMarkupParser.scala:
91)
at scala.xml.parsing.MarkupParser$class.content(MarkupParser.scala:
505)
at net.liftweb.util.PCDataXmlParser.content(PCDataMarkupParser.scala:
91)
at scala.xml.parsing.MarkupParser$class.element1(MarkupParser.scala:
682)
at net.liftweb.util.PCDataXmlParser.element1(PCDataMarkupParser.scala:
91)
at scala.xml.parsing.MarkupParser$class.content1(MarkupParser.scala:
481)
at net.liftweb.util.PCDataXmlParser.content1(PCDataMarkupParser.scala:
91)
at scala.xml.parsing.MarkupParser$class.content(MarkupParser.scala:
505)
at net.liftweb.util.PCDataXmlParser.content(PCDataMarkupParser.scala:
91)
at scala.xml.parsing.MarkupParser$class.element1(MarkupParser.scala:
682)
at net.liftweb.util.PCDataXmlParser.element1(PCDataMarkupParser.scala:
91)
at scala.xml.parsing.MarkupParser$class.content1(MarkupParser.scala:
481)
at net.liftweb.util.PCDataXmlParser.content1(PCDataMarkupParser.scala:
91)
at scala.xml.parsing.MarkupParser$class.content(MarkupParser.scala:
505)
at net.liftweb.util.PCDataXmlParser.content(PCDataMarkupParser.scala:
91)
at scala.xml.parsing.MarkupParser$class.element1(MarkupParser.scala:
682)
at net.liftweb.util.PCDataXmlParser.element1(PCDataMarkupParser.scala:
91)
at scala.xml.parsing.MarkupParser$class.content1(MarkupParser.scala:
481)
at net.liftweb.util.PCDataXmlParser.content1(PCDataMarkupParser.scala:
91)
at 

[Lift] Re: XML Creation

2009-04-13 Thread sailormoo...@gmail.com

I See...Thanks...
and if I want 5 items a line

does it work as follows?

lift:MyTable.foo
table
  tb:entries
  tr
tdentry:name //td
tdentry:name //td
tdentry:name //td
tdentry:name //td
tdentry:name //td
  /tr
  /tb:entries
/table
/lift:MyTable.foo

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
Lift group.
To post to this group, send email to liftweb@googlegroups.com
To unsubscribe from this group, send email to 
liftweb+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/liftweb?hl=en
-~--~~~~--~~--~--~---



[Lift] Re: XML Creation

2009-04-13 Thread sailormoo...@gmail.com

I wrote a zip function to group the list as follows:

scala def zipListBySize[T](size: Int)(list: List[T]) : List[List[T]]
= {
 |   var (first, second)  = list.splitAt(size)
 |   if (second == Nil)
 | List(first)
 |   else
 | List(first) ++ zipListBySize(size)(second)
 | }
zipListBySize: [T](Int)(List[T])List[List[T]]

scala zipListBySize(5)(List
(1,2,3,4,5,6,7,8,9,10,11))
res17: List[List[java.lang.String]] = List(List(1, 2, 3, 4, 5), List
(6, 7, 8, 9,
 10), List(11))

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
Lift group.
To post to this group, send email to liftweb@googlegroups.com
To unsubscribe from this group, send email to 
liftweb+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/liftweb?hl=en
-~--~~~~--~~--~--~---



[Lift] Re: Need Help with the RuntimeException

2009-04-13 Thread sailormoo...@gmail.com

Thanks

but the mvn test still gives ambigulous exceptions. A filename and a
line number would help more.

java.util.NoSuchElementException
at scala.RandomAccessSeq$$anon$13.next(RandomAccessSeq.scala:165)
at scala.xml.parsing.MarkupParser$class.normalizeAttributeValue
(MarkupParser.scala:1191)
at net.liftweb.util.PCDataXmlParser.normalizeAttributeValue
(PCDataMarkupParser.scala:91)
at scala.xml.parsing.MarkupParser$class.xAttributeValue
(MarkupParser.scala:334)
at net.liftweb.util.PCDataXmlParser.xAttributeValue
(PCDataMarkupParser.scala:91)
at scala.xml.parsing.MarkupParser$class.xAttributes
(MarkupParser.scala:288)
at net.liftweb.util.PCDataXmlParser.xAttributes
(PCDataMarkupParser.scala:91)
at scala.xml.parsing.MarkupParser$class.xTag(MarkupParser.scala:365)
at net.liftweb.util.PCDataXmlParser.xTag(PCDataMarkupParser.scala:91)
at scala.xml.parsing.MarkupParser$class.element1(MarkupParser.scala:
667)
at net.liftweb.util.PCDataXmlParser.element1(PCDataMarkupParser.scala:
91)
at scala.xml.parsing.MarkupParser$class.content1(MarkupParser.scala:
481)
at net.liftweb.util.PCDataXmlParser.content1(PCDataMarkupParser.scala:
91)
at scala.xml.parsing.MarkupParser$class.content(MarkupParser.scala:
505)
at net.liftweb.util.PCDataXmlParser.content(PCDataMarkupParser.scala:
91)
at scala.xml.parsing.MarkupParser$class.element1(MarkupParser.scala:
682)
at net.liftweb.util.PCDataXmlParser.element1(PCDataMarkupParser.scala:
91)
at scala.xml.parsing.MarkupParser$class.content1(MarkupParser.scala:
481)
at net.liftweb.util.PCDataXmlParser.content1(PCDataMarkupParser.scala:
91)
at scala.xml.parsing.MarkupParser$class.content(MarkupParser.scala:
505)
at net.liftweb.util.PCDataXmlParser.content(PCDataMarkupParser.scala:
91)
at scala.xml.parsing.MarkupParser$class.element1(MarkupParser.scala:
682)
at net.liftweb.util.PCDataXmlParser.element1(PCDataMarkupParser.scala:
91)
at scala.xml.parsing.MarkupParser$class.content1(MarkupParser.scala:
481)
at net.liftweb.util.PCDataXmlParser.content1(PCDataMarkupParser.scala:
91)
at scala.xml.parsing.MarkupParser$class.content(MarkupParser.scala:
505)
at net.liftweb.util.PCDataXmlParser.content(PCDataMarkupParser.scala:
91)
at scala.xml.parsing.MarkupParser$class.element1(MarkupParser.scala:
682)
at net.liftweb.util.PCDataXmlParser.element1(PCDataMarkupParser.scala:
91)
at scala.xml.parsing.MarkupParser$class.content1(MarkupParser.scala:
481)
at net.liftweb.util.PCDataXmlParser.content1(PCDataMarkupParser.scala:
91)
at scala.xml.parsing.MarkupParser$class.content(MarkupParser.scala:
505)
at net.liftweb.util.PCDataXmlParser.content(PCDataMarkupParser.scala:
91)
at scala.xml.parsing.MarkupParser$class.element1(MarkupParser.scala:
682)
at net.liftweb.util.PCDataXmlParser.element1(PCDataMarkupParser.scala:
91)
at scala.xml.parsing.MarkupParser$class.content1(MarkupParser.scala:
481)
at net.liftweb.util.PCDataXmlParser.content1(PCDataMarkupParser.scala:
91)
at scala.xml.parsing.MarkupParser$class.content(MarkupParser.scala:
505)
at net.liftweb.util.PCDataXmlParser.content(PCDataMarkupParser.scala:
91)
at scala.xml.parsing.MarkupParser$class.element1(MarkupParser.scala:
682)
at net.liftweb.util.PCDataXmlParser.element1(PCDataMarkupParser.scala:
91)
at scala.xml.parsing.MarkupParser$class.content1(MarkupParser.scala:
481)
at net.liftweb.util.PCDataXmlParser.content1(PCDataMarkupParser.scala:
91)
at scala.xml.parsing.MarkupParser$class.document(MarkupParser.scala:
206)
at net.liftweb.util.PCDataXmlParser.document(PCDataMarkupParser.scala:
91)
at net.liftweb.util.PCDataXmlParser$.apply(PCDataMarkupParser.scala:
102)
at org.plummtw.jinrou.AppTest.wellFormed$1(AppTest.scala:60)
at org.plummtw.jinrou.AppTest$$anonfun$wellFormed$1$1.apply
(AppTest.scala:48)
at org.plummtw.jinrou.AppTest$$anonfun$wellFormed$1$1.apply
(AppTest.scala:48)
at scala.Iterator$class.foreach(Iterator.scala:414)
at scala.runtime.BoxedArray$AnyIterator.foreach(BoxedArray.scala:45)
at scala.Iterable$class.foreach(Iterable.scala:256)
at scala.runtime.BoxedArray.foreach(BoxedArray.scala:24)
at org.plummtw.jinrou.AppTest.wellFormed$1(AppTest.scala:48)
at org.plummtw.jinrou.AppTest.testXml(AppTest.scala:67)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke
(NativeMethodAccessorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke
(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:585)
at junit.framework.TestCase.runTest(TestCase.java:168)
at 

[Lift] Need Help with the RuntimeException

2009-04-12 Thread sailormoo...@gmail.com

Hello:

   I've got this exception accessing one of the page, but I cannot
find the reason ( and the runtime exception gives very ambigulous
information). Can someone help to get the reason? Thanks.

Message: java.lang.RuntimeException: FATAL
scala.Predef$.error(Predef.scala:76)
scala.xml.parsing.MarkupParser$class.xToken(MarkupParser.scala:267)
net.liftweb.util.PCDataXmlParser.xToken(PCDataMarkupParser.scala:91)
scala.xml.parsing.MarkupParser$class.xEQ(MarkupParser.scala:714)
net.liftweb.util.PCDataXmlParser.xEQ(PCDataMarkupParser.scala:91)
scala.xml.parsing.MarkupParser$class.xAttributes(MarkupParser.scala:
287)
net.liftweb.util.PCDataXmlParser.xAttributes(PCDataMarkupParser.scala:
91)
scala.xml.parsing.MarkupParser$class.xTag(MarkupParser.scala:365)
net.liftweb.util.PCDataXmlParser.xTag(PCDataMarkupParser.scala:91)
scala.xml.parsing.MarkupParser$class.element1(MarkupParser.scala:667)
net.liftweb.util.PCDataXmlParser.element1(PCDataMarkupParser.scala:
91)
scala.xml.parsing.MarkupParser$class.content1(MarkupParser.scala:481)
net.liftweb.util.PCDataXmlParser.content1(PCDataMarkupParser.scala:
91)
scala.xml.parsing.MarkupParser$class.content(MarkupParser.scala:505)
net.liftweb.util.PCDataXmlParser.content(PCDataMarkupParser.scala:91)
scala.xml.parsing.MarkupParser$class.element1(MarkupParser.scala:682)
net.liftweb.util.PCDataXmlParser.element1(PCDataMarkupParser.scala:
91)
scala.xml.parsing.MarkupParser$class.content1(MarkupParser.scala:481)
net.liftweb.util.PCDataXmlParser.content1(PCDataMarkupParser.scala:
91)
scala.xml.parsing.MarkupParser$class.content(MarkupParser.scala:505)
net.liftweb.util.PCDataXmlParser.content(PCDataMarkupParser.scala:91)
scala.xml.parsing.MarkupParser$class.element1(MarkupParser.scala:682)
net.liftweb.util.PCDataXmlParser.element1(PCDataMarkupParser.scala:
91)
scala.xml.parsing.MarkupParser$class.content1(MarkupParser.scala:481)
net.liftweb.util.PCDataXmlParser.content1(PCDataMarkupParser.scala:
91)
scala.xml.parsing.MarkupParser$class.content(MarkupParser.scala:505)
net.liftweb.util.PCDataXmlParser.content(PCDataMarkupParser.scala:91)
scala.xml.parsing.MarkupParser$class.element1(MarkupParser.scala:682)
net.liftweb.util.PCDataXmlParser.element1(PCDataMarkupParser.scala:
91)
scala.xml.parsing.MarkupParser$class.content1(MarkupParser.scala:481)
net.liftweb.util.PCDataXmlParser.content1(PCDataMarkupParser.scala:
91)
scala.xml.parsing.MarkupParser$class.content(MarkupParser.scala:505)
net.liftweb.util.PCDataXmlParser.content(PCDataMarkupParser.scala:91)
scala.xml.parsing.MarkupParser$class.element1(MarkupParser.scala:682)
net.liftweb.util.PCDataXmlParser.element1(PCDataMarkupParser.scala:
91)
scala.xml.parsing.MarkupParser$class.content1(MarkupParser.scala:481)
net.liftweb.util.PCDataXmlParser.content1(PCDataMarkupParser.scala:
91)
scala.xml.parsing.MarkupParser$class.content(MarkupParser.scala:505)
net.liftweb.util.PCDataXmlParser.content(PCDataMarkupParser.scala:91)
scala.xml.parsing.MarkupParser$class.element1(MarkupParser.scala:682)
net.liftweb.util.PCDataXmlParser.element1(PCDataMarkupParser.scala:
91)
scala.xml.parsing.MarkupParser$class.content1(MarkupParser.scala:481)
net.liftweb.util.PCDataXmlParser.content1(PCDataMarkupParser.scala:
91)
scala.xml.parsing.MarkupParser$class.content(MarkupParser.scala:505)
net.liftweb.util.PCDataXmlParser.content(PCDataMarkupParser.scala:91)
scala.xml.parsing.MarkupParser$class.element1(MarkupParser.scala:682)
net.liftweb.util.PCDataXmlParser.element1(PCDataMarkupParser.scala:
91)
scala.xml.parsing.MarkupParser$class.content1(MarkupParser.scala:481)
net.liftweb.util.PCDataXmlParser.content1(PCDataMarkupParser.scala:
91)
scala.xml.parsing.MarkupParser$class.content(MarkupParser.scala:505)
net.liftweb.util.PCDataXmlParser.content(PCDataMarkupParser.scala:91)
scala.xml.parsing.MarkupParser$class.element1(MarkupParser.scala:682)
net.liftweb.util.PCDataXmlParser.element1(PCDataMarkupParser.scala:
91)
scala.xml.parsing.MarkupParser$class.content1(MarkupParser.scala:481)
net.liftweb.util.PCDataXmlParser.content1(PCDataMarkupParser.scala:
91)
scala.xml.parsing.MarkupParser$class.content(MarkupParser.scala:505)
net.liftweb.util.PCDataXmlParser.content(PCDataMarkupParser.scala:91)
scala.xml.parsing.MarkupParser$class.element1(MarkupParser.scala:682)
net.liftweb.util.PCDataXmlParser.element1(PCDataMarkupParser.scala:
91)
scala.xml.parsing.MarkupParser$class.content1(MarkupParser.scala:481)
net.liftweb.util.PCDataXmlParser.content1(PCDataMarkupParser.scala:
91)

[Lift] XML Creation

2009-04-12 Thread sailormoo...@gmail.com

Hello:

  Thanks for the previous answers of my questions.
  I would like to know how to make the following example work by Lift:
  ( I use the old style Java scriptlet for example ).

table
 % for (int i = 0; i  data.size(); i++) { %
trtd%= data.name %/td/tr
  % } %
/table

  I cannot find an example like this, and I don't know if it should be
done by a single snippet with all the rows, or some list/array to
iterate in the view.

  Thanks.

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
Lift group.
To post to this group, send email to liftweb@googlegroups.com
To unsubscribe from this group, send email to 
liftweb+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/liftweb?hl=en
-~--~~~~--~~--~--~---



[Lift] How to generate war file??

2009-04-06 Thread sailormoo...@gmail.com

Hi Hi :

   I am new to Lift and new to maven, I would just like to ask how to
generate a war file to put it into the real server. Thanks

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
Lift group.
To post to this group, send email to liftweb@googlegroups.com
To unsubscribe from this group, send email to 
liftweb+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/liftweb?hl=en
-~--~~~~--~~--~--~---