Re: [Lift] Re: Actor.timer daemon thread terminates after first request?

2010-01-20 Thread Yu-Shan Fung
Thanks for the reply, David!

I finally realized my problem is that I was compiling against the scala
2.7.3 library instead of 2.7.7 as I thought. When I use the newer lib, the
exception apparently goes away.

Regardless, what would be a good replacement for the scala actors library?

Thanks,
Yu-Shan


On Tue, Jan 19, 2010 at 8:44 PM, David Pollak  wrote:

> Howdy,
>
> The short (and not politically popular) answer is that Scala's Actor
> implementation is generally fragile and often broken.  Lift made the painful
> switch away from Scala Actors 4 or so months ago for this reason.
>
> If you can put together a simple example of the failure (basically
> something that we can run with mvn jetty:run) and make it available on
> GitHub, we can take a look at it.
>
> Thanks,
>
> David
>
>  On Tue, Jan 19, 2010 at 5:02 PM, Yu-Shan Fung wrote:
>
>>  Thanks for the reply, Marius. Where can I get the 1.1 or 2.0 snapshot?
>>
>> I'm not doing any scheduling myself. I just created a bunch of Future's,
>> and then call Futures.awaitAll. But my understanding is that Future is
>> implemented with Actor's.
>>
>> val fResults = ids.map { id => future(computeStuff(id)) }
>> val fList = fResults.toList // forces creation of the future
>> variables. otherwise they are created lazily, defeating parallelism
>> val finalResults = Futures.awaitAll(5000, fList: _*)
>>
>> This works the first time (and sometimes for a few times). But pretty
>> soon, the call to awaitAll would fail with the aforementioned exception.
>>
>> I dug a bit into the scala code, and the code that fails within
>> Futures.awaitAll is this:
>>
>>Actor.timer.schedule(new java.util.TimerTask {
>>  def run() { thisActor ! TIMEOUT }
>>}, timeout)
>>
>> And Actor.timer is defined as such:
>>
>> object Actor {
>> ...
>>   private[actors] val timer = new Timer(true)
>> ...
>> }
>>
>>
>> I'm pretty new to both scala and lift, but it looks like the Actor.timer
>> is initialized once (created as a daemon), and expected to always be
>> available. But I don't fully understand what aspects of the lift environment
>> persists across requests, and how, if at all, would Actor.timer end up in a
>> cancelled/terminated state.
>>
>> Any idea? Thanks in advance!
>>
>>
>>
>>
>> On Tue, Jan 19, 2010 at 6:40 AM, Marius  wrote:
>>
>>> I'd recommend using Lisft 1.1-SNAPSHOT or 2.0-SNAPSHOT
>>>
>>> You stacktrace doesn't indicate anything related with Lift, so are you
>>> using Java's scheduler, or are you using actors? Lift's ActorPing and
>>> actors is a good way of doing scheduling. So can you elaborate on how
>>> are you doing the scheduling?
>>>
>>> Br's,
>>> Marius
>>>
>>> On Jan 19, 8:04 am, Yu-Shan Fung  wrote:
>>> > Hi All,
>>> >
>>> > I have a lift app, where one of the functions performs sub-computations
>>> > (including network operations) in parallel via future(s) &
>>> Futures.awaitAll.
>>> > It runs fine on the first request, but subsequent requests throws a
>>> > IllegalStateException:
>>> >
>>> > Exception in thread "Thread-30" java.lang.IllegalStateException: Timer
>>> > already cancelled.
>>> > at java.util.Timer.sched(Timer.java:376)
>>> > at java.util.Timer.schedule(Timer.java:192)
>>> > at scala.actors.Futures$.awaitAll(Future.scala:76)
>>> > at MyWorker.run(MyWorker.scala:20)
>>> > at java.lang.Thread.run(Thread.java:636)
>>> >
>>> > I dug up more documentation and it looks like this exception indicates
>>> an
>>> > attempt to schedule a task on a timer that has already been cancelled
>>> > (associated daemon thread terminated?). Any idea why, or if I'm doing
>>> > something wrong?
>>> >
>>> > In case it matters, I'm running Scala code runner version 2.7.7.final,
>>> > Liftweb 1.0, Jetty 6.1.22.
>>> >
>>> > Any tips/pointers would be appreciated. Thanks!
>>> > Yu-Shan
>>> >
>>> > --
>>> > “When nothing seems to help, I go look at a stonecutter hammering away
>>> at
>>> > his rock perhaps a hundred times without as much as a crack showing in
>>> it.
>>> > Yet at the hundred and first blow it will split in two, and I know it
>>> was
>>> > not that blow that did it, but all that had gone before.” — Jacob Riis
>>>
>>> --
>>>
>>> You received this message because you are subscribed to the Google Groups
>>> "Lift" group.
>>> To post to this group, send email to lift...@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.
>>>
>>>
>>>
>>>
>>
>>
>> --
>> “When nothing seems to help, I go look at a stonecutter hammering away at
>> his rock perhaps a hundred times without as much as a crack showing in it.
>> Yet at the hundred and first blow it will split in two, and I know it was
>> not that blow that did it, but all that had gone before.” — Jacob Riis
>>
>> --
>> You received this message because you are subscribed to the Google Groups
>> "Lift" group.
>>

[Lift] Using frameset

2010-01-20 Thread Chris Thomet
Hi

For one page on my website I need frames. How can I change from
doctype 'transitional' to 'frameset'?

Thank you!
Chris
-- 
You received this message because you are subscribed to the Google Groups 
"Lift" group.
To post to this group, send email to lift...@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: Welcome Mads Hartmann Jensen to the Lift Committers

2010-01-20 Thread Marius
Welcome Mads ! Please do work on that ... I never got to start working
on it :)

Br's,
Marius

On Jan 20, 12:12 am, Mads Hartmann  wrote:
> Thanks guys :)
>
> @Timothy Perrett
> Unless someone beats me to the punch I was thinking about solving
> this:http://github.com/dpp/liftweb/issues#issue/46
>
> I already have a local version which should solve it but unfortunately
> I have an exam the 21. of Jan so can't really work on it without my
> conscience getting the better of me ;)
>
> I'll send you a picture and an description as soon as I've passed my
> exam :)
>
> On Jan 19, 10:54 pm, Naftoli Gugenheim  wrote:
>
> > I assume you meant to post this in your own thread?
>
> > -
>
> > Phillip Stephen wrote:
>
> > I ownwww.pacnboxmoving.comMyinnovation is in the Streaming Music
> > industry.  Looking to get a developer on Scales/ Lift for equity on my
> > project ASAP!
>
> > Thanks,
>
> > Phillip
>
> > 2010/1/19 Timothy Perrett 
>
> > > Welcome Mads, what are you planning on contributing to start with?
>
> > > Send me offline a picture and description of yourself so I can add you to
> > > liftweb.net
>
> > > Cheers, Tim
>
> > > Sent from my iPhone
>
> > > On 19 Jan 2010, at 19:15, David Pollak 
> > > wrote:
>
> > > Folks,
>
> > > Please join me in welcoming Mads to the Lift committers.
>
> > > Thanks,
>
> > > David
>
> > > --
> > > Lift, the simply functional web framework 
> > >http://liftweb.net
> > > Beginning Scala 
> > >http://www.apress.com/book/view/1430219890
> > > Follow me: http://twitter.com/dpp
> > > Surf the harmonics
>
> > > --
> > > You received this message because you are subscribed to the Google Groups
> > > "Lift" group.
> > > To post to this group, send email to lift...@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.
>
> > > --
> > > You received this message because you are subscribed to the Google Groups
> > > "Lift" group.
> > > To post to this group, send email to lift...@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.
>
> > --
> > You received this message because you are subscribed to the Google Groups 
> > "Lift" group.
> > To post to this group, send email to lift...@googlegroups.com.
> > To unsubscribe from this group, send email to 
> > liftweb+unsubscr...@googlegroups.com.
> > For more options, visit this group 
> > athttp://groups.google.com/group/liftweb?hl=en.
-- 
You received this message because you are subscribed to the Google Groups 
"Lift" group.
To post to this group, send email to lift...@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.




Re: [Lift] Re: Actor.timer daemon thread terminates after first request?

2010-01-20 Thread David Pollak
On Tue, Jan 19, 2010 at 11:58 PM, Yu-Shan Fung wrote:

> Thanks for the reply, David!
>
> I finally realized my problem is that I was compiling against the scala
> 2.7.3 library instead of 2.7.7 as I thought. When I use the newer lib, the
> exception apparently goes away.
>

Scala is very version sensitive.  If you're using Lift 1.1-M5+, you must use
Scala 2.7.7.  If you're using Lift 1.0.2, I think the correct version is
2.7.5.


>
> Regardless, what would be a good replacement for the scala actors library?
>


Akka:  akkasource.org


>
> Thanks,
> Yu-Shan
>
>
> On Tue, Jan 19, 2010 at 8:44 PM, David Pollak <
> feeder.of.the.be...@gmail.com> wrote:
>
>> Howdy,
>>
>> The short (and not politically popular) answer is that Scala's Actor
>> implementation is generally fragile and often broken.  Lift made the painful
>> switch away from Scala Actors 4 or so months ago for this reason.
>>
>> If you can put together a simple example of the failure (basically
>> something that we can run with mvn jetty:run) and make it available on
>> GitHub, we can take a look at it.
>>
>> Thanks,
>>
>> David
>>
>>  On Tue, Jan 19, 2010 at 5:02 PM, Yu-Shan Fung wrote:
>>
>>>  Thanks for the reply, Marius. Where can I get the 1.1 or 2.0 snapshot?
>>>
>>> I'm not doing any scheduling myself. I just created a bunch of Future's,
>>> and then call Futures.awaitAll. But my understanding is that Future is
>>> implemented with Actor's.
>>>
>>> val fResults = ids.map { id => future(computeStuff(id)) }
>>> val fList = fResults.toList // forces creation of the future
>>> variables. otherwise they are created lazily, defeating parallelism
>>> val finalResults = Futures.awaitAll(5000, fList: _*)
>>>
>>> This works the first time (and sometimes for a few times). But pretty
>>> soon, the call to awaitAll would fail with the aforementioned exception.
>>>
>>> I dug a bit into the scala code, and the code that fails within
>>> Futures.awaitAll is this:
>>>
>>>Actor.timer.schedule(new java.util.TimerTask {
>>>  def run() { thisActor ! TIMEOUT }
>>>}, timeout)
>>>
>>> And Actor.timer is defined as such:
>>>
>>> object Actor {
>>> ...
>>>   private[actors] val timer = new Timer(true)
>>> ...
>>> }
>>>
>>>
>>> I'm pretty new to both scala and lift, but it looks like the Actor.timer
>>> is initialized once (created as a daemon), and expected to always be
>>> available. But I don't fully understand what aspects of the lift environment
>>> persists across requests, and how, if at all, would Actor.timer end up in a
>>> cancelled/terminated state.
>>>
>>> Any idea? Thanks in advance!
>>>
>>>
>>>
>>>
>>> On Tue, Jan 19, 2010 at 6:40 AM, Marius  wrote:
>>>
 I'd recommend using Lisft 1.1-SNAPSHOT or 2.0-SNAPSHOT

 You stacktrace doesn't indicate anything related with Lift, so are you
 using Java's scheduler, or are you using actors? Lift's ActorPing and
 actors is a good way of doing scheduling. So can you elaborate on how
 are you doing the scheduling?

 Br's,
 Marius

 On Jan 19, 8:04 am, Yu-Shan Fung  wrote:
 > Hi All,
 >
 > I have a lift app, where one of the functions performs
 sub-computations
 > (including network operations) in parallel via future(s) &
 Futures.awaitAll.
 > It runs fine on the first request, but subsequent requests throws a
 > IllegalStateException:
 >
 > Exception in thread "Thread-30" java.lang.IllegalStateException: Timer
 > already cancelled.
 > at java.util.Timer.sched(Timer.java:376)
 > at java.util.Timer.schedule(Timer.java:192)
 > at scala.actors.Futures$.awaitAll(Future.scala:76)
 > at MyWorker.run(MyWorker.scala:20)
 > at java.lang.Thread.run(Thread.java:636)
 >
 > I dug up more documentation and it looks like this exception indicates
 an
 > attempt to schedule a task on a timer that has already been cancelled
 > (associated daemon thread terminated?). Any idea why, or if I'm doing
 > something wrong?
 >
 > In case it matters, I'm running Scala code runner version 2.7.7.final,
 > Liftweb 1.0, Jetty 6.1.22.
 >
 > Any tips/pointers would be appreciated. Thanks!
 > Yu-Shan
 >
 > --
 > “When nothing seems to help, I go look at a stonecutter hammering away
 at
 > his rock perhaps a hundred times without as much as a crack showing in
 it.
 > Yet at the hundred and first blow it will split in two, and I know it
 was
 > not that blow that did it, but all that had gone before.” — Jacob Riis

 --

 You received this message because you are subscribed to the Google
 Groups "Lift" group.
 To post to this group, send email to lift...@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: Using frameset

2010-01-20 Thread Timothy Perrett
http://blog.getintheloop.eu/2008/10/1/explictially-setting-application-doctype-with-lift

Cheers, Tim

On Jan 20, 10:38 am, Chris Thomet  wrote:
> Hi
>
> For one page on my website I need frames. How can I change from
> doctype 'transitional' to 'frameset'?
>
> Thank you!
> Chris
-- 
You received this message because you are subscribed to the Google Groups 
"Lift" group.
To post to this group, send email to lift...@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: Lift and Akka Actors in comparison?

2010-01-20 Thread Franz Bettag
Timothy, did you somehow manage to get them working together? I am at
a point where i would want to mix them in my project. :)

On 15 Jan., 00:56, Timothy Perrett  wrote:
> No no, theLiftversion was only frozen inAkkabecause of the sample
> app (it was causing problems whilst we went through some growing
> pains)... I can upgrade it inAkkato 2.0-M1 if you'd like?
>
> One would imagine its just a case of composing theAkkaActor into the
> comet actor? The composition appears to be fixed to LiftActor and
> there arnt any type parameters?
>
> trait CometActor extends LiftActor with LiftCometActor with
> BindHelpers
>
> Cheers, Tim
>
> On Jan 14, 11:49 pm, David Pollak 
> wrote:
>
> > On Thu, Jan 14, 2010 at 3:48 PM, Timothy Perrett 
> > wrote:
>
> > > David, have you actually mixedAkkaactors withLiftcomet actors (that is,
> > >akkaactors powering our comet)? I keep meaning to try this, but havent yet.
>
> > I have not... plusAkkais onLift1.1 M6 which is so last decade. ;-)
>
> > > Cheers, Tim
>
> > > On 14 Jan 2010, at 22:57, David Pollak wrote:
>
> > > >Akkaactors andLiftActors share the same interface.  Scala Actors do
> > > not share this interface.
>
> > > --
> > > You received this message because you are subscribed to the Google Groups
> > > "Lift" group.
> > > To post to this group, send email to lift...@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, the simply functional web frameworkhttp://liftweb.net
> > Beginning Scalahttp://www.apress.com/book/view/1430219890
> > Follow me:http://twitter.com/dpp
> > Surf the harmonics
-- 
You received this message because you are subscribed to the Google Groups 
"Lift" group.
To post to this group, send email to lift...@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] lift-imaging now in master

2010-01-20 Thread Timothy Perrett
All,

I've merged Ross' image manipulation code into lift master:

http://github.com/dpp/liftweb/tree/master/framework/lift-modules/lift-imaging/

Enjoy.

Cheers, Tim
-- 
You received this message because you are subscribed to the Google Groups 
"Lift" group.
To post to this group, send email to lift...@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: Lift and Akka Actors in comparison?

2010-01-20 Thread Timothy Perrett
DPP really needs to respond on this - or perhaps Marius can add some
more light (as im currently not working on this)

Cheers, Tim

On Jan 20, 3:31 pm, Franz Bettag  wrote:
> Timothy, did you somehow manage to get them working together? I am at
> a point where i would want to mix them in my project. :)
>
> On 15 Jan., 00:56, Timothy Perrett  wrote:
>
>
>
> > No no, theLiftversion was only frozen inAkkabecause of the sample
> > app (it was causing problems whilst we went through some growing
> > pains)... I can upgrade it inAkkato 2.0-M1 if you'd like?
>
> > One would imagine its just a case of composing theAkkaActor into the
> > comet actor? The composition appears to be fixed to LiftActor and
> > there arnt any type parameters?
>
> > trait CometActor extends LiftActor with LiftCometActor with
> > BindHelpers
>
> > Cheers, Tim
>
> > On Jan 14, 11:49 pm, David Pollak 
> > wrote:
>
> > > On Thu, Jan 14, 2010 at 3:48 PM, Timothy Perrett 
> > > wrote:
>
> > > > David, have you actually mixedAkkaactors withLiftcomet actors (that is,
> > > >akkaactors powering our comet)? I keep meaning to try this, but havent 
> > > >yet.
>
> > > I have not... plusAkkais onLift1.1 M6 which is so last decade. ;-)
>
> > > > Cheers, Tim
>
> > > > On 14 Jan 2010, at 22:57, David Pollak wrote:
>
> > > > >Akkaactors andLiftActors share the same interface.  Scala Actors do
> > > > not share this interface.
>
> > > > --
> > > > You received this message because you are subscribed to the Google 
> > > > Groups
> > > > "Lift" group.
> > > > To post to this group, send email to lift...@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, the simply functional web frameworkhttp://liftweb.net
> > > Beginning Scalahttp://www.apress.com/book/view/1430219890
> > > Follow me:http://twitter.com/dpp
> > > Surf the harmonics
-- 
You received this message because you are subscribed to the Google Groups 
"Lift" group.
To post to this group, send email to lift...@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 use prepareStatement to select *** from DB (two db vender)?

2010-01-20 Thread Neil.Lv
Hi all,

  I use two db connections in my app, and I want to use
DB.prepareStatement to select
the records from the second db.

  It failed, Here is the code:
###
  def getHotByTid(id : Long) =
DB.use(bootstrap.liftweb.TwoDB) {
  conn =>
  DB.prepareStatement("SELECT * FROM hots WHERE id=? ", conn) {
  stmt =>
  stmt.setLong(1, id)
Log.info("stmt :" + stmt)   // The information is correctly now, but
after call executeUpdate method
  stmt.executeUpdate()
   }
   }
###

  The update statement can works well:
###
  def updateCountsById(id : Long) =
DB.use(bootstrap.liftweb.TwoDB) {
  conn =>
  DB.prepareStatement("UPDATE hots set count=count+1 WHERE id=?",
conn) {
stmt =>
   stmt.setLong(1, id)
   stmt.executeUpdate()
  }
   }
###

   Thanks for any suggestion that will be appreciated.

Cheers,
  Neil
-- 
You received this message because you are subscribed to the Google Groups 
"Lift" group.
To post to this group, send email to lift...@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.




Re: [Lift] Re: Lift and Akka Actors in comparison?

2010-01-20 Thread David Pollak
On Wed, Jan 20, 2010 at 7:31 AM, Franz Bettag  wrote:

> Timothy, did you somehow manage to get them working together? I am at
> a point where i would want to mix them in my project. :)
>

Are you saying that you want to have an Akka Actor as a CometActor or just
have Akka Actors and Lift Actors in the same project?


>
> On 15 Jan., 00:56, Timothy Perrett  wrote:
> > No no, theLiftversion was only frozen inAkkabecause of the sample
> > app (it was causing problems whilst we went through some growing
> > pains)... I can upgrade it inAkkato 2.0-M1 if you'd like?
> >
> > One would imagine its just a case of composing theAkkaActor into the
> > comet actor? The composition appears to be fixed to LiftActor and
> > there arnt any type parameters?
> >
> > trait CometActor extends LiftActor with LiftCometActor with
> > BindHelpers
> >
> > Cheers, Tim
> >
> > On Jan 14, 11:49 pm, David Pollak 
> > wrote:
> >
> > > On Thu, Jan 14, 2010 at 3:48 PM, Timothy Perrett <
> timo...@getintheloop.eu>wrote:
> >
> > > > David, have you actually mixedAkkaactors withLiftcomet actors (that
> is,
> > > >akkaactors powering our comet)? I keep meaning to try this, but havent
> yet.
> >
> > > I have not... plusAkkais onLift1.1 M6 which is so last decade. ;-)
> >
> > > > Cheers, Tim
> >
> > > > On 14 Jan 2010, at 22:57, David Pollak wrote:
> >
> > > > >Akkaactors andLiftActors share the same interface.  Scala Actors do
> > > > not share this interface.
> >
> > > > --
> > > > You received this message because you are subscribed to the Google
> Groups
> > > > "Lift" group.
> > > > To post to this group, send email to lift...@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, the simply functional web frameworkhttp://liftweb.net
> > > Beginning Scalahttp://www.apress.com/book/view/1430219890
> > > Follow me:http://twitter.com/dpp
> > > Surf the harmonics
>
> --
> You received this message because you are subscribed to the Google Groups
> "Lift" group.
> To post to this group, send email to lift...@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, the simply functional web framework http://liftweb.net
Beginning Scala http://www.apress.com/book/view/1430219890
Follow me: http://twitter.com/dpp
Surf the harmonics
-- 

You received this message because you are subscribed to the Google Groups "Lift" group.

To post to this group, send email to lift...@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: Using frameset

2010-01-20 Thread Chris Thomet
Thank you Tim! The doctype is now ok.

Unfortunately, my frameset is still not working.
By using the code below, Chrome and Firefox are only displaying the
title 'Foo'. It works with IE8.
Actually it's only not working if the frameset-page is processed by
the lift framework. If I open that document directly with Chrome or
Firefox, it works fine.

I can't figure out the problem. It's really strange...


fs.html



  Foo
  


  http://www.google.ch"; name="f1" />
  http://www.google.ch"; name="f2" />




fs.html processed by lift




  Foo
  


  http://www.google.ch";>
  http://www.google.ch";>





On Jan 20, 3:57 pm, Timothy Perrett  wrote:
> http://blog.getintheloop.eu/2008/10/1/explictially-setting-applicatio...
>
> Cheers, Tim
>
> On Jan 20, 10:38 am, Chris Thomet  wrote:
>
>
>
> > Hi
>
> > For one page on my website I need frames. How can I change from
> > doctype 'transitional' to 'frameset'?
>
> > Thank you!
> > Chris
-- 
You received this message because you are subscribed to the Google Groups 
"Lift" group.
To post to this group, send email to lift...@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] A better approach to ajax forms?

2010-01-20 Thread Kris Nuttycombe
Hi, all,

I'm working on an AJAX form and feel like I'm missing something:
namely, how to update the page based upon the result of the form
submission.

The three ajaxForm methods in SHtml have the following signatures:

def ajaxForm(body : NodeSeq)
def ajaxForm(body : NodeSeq, onSubmit : JsCmd)
def ajaxForm(body : NodeSeq, onSubmit : JsCmd, postSubmit : JsCmd)

In these signatures, onSubmit is called by the client prior to form
submission, and postSubmit is called by the client after successful
submission. My question is, why is there not a signature like this:

def ajaxForm(body: NodeSeq, result: () => JsCmd)

for which the specified result function will be called, and the JsCmd
returned to the browser for evaluation after processing of the form
contents on the server?

Right now, I'm using the following to achieve this effect, but it
seems really hacky:

val (psId, psJs) = ajaxCall(JsRaw("dsl_text.value"), text =>
After(20, SetHtml("results", parse(text

ajaxForm(
bind("plan", xhtml,
 "dsl" -> SHtml.textarea("", s => (), "id" ->
"dsl_text", "rows" -> "40", "cols" -> "120"),
 "submit" -> SHtml.submit("Parse", () => ())
),
psJs.cmd
)

Here, JsCmd is actually doing the heavy lifting prior to form
submission, with noop implementations for handling of the form
elements. Seems really hacky.

I feel like I've got to be missing something here, like there's got to
be a better way to implement this such that the parsing of the
textarea contents can be done by the closure passed to the
SHtml.textarea call. How can I do this?

Here's an idea I've been toying with for a while; it would be a
somewhat significant change to Lift but I feel like there would be
some benefits.

Instead of SHtml.* having signatures like (String, () => Any, (String,
String)*) => NodeSeq, imagine that there was a parameterized class
(call it FormElement) that all of the SHtml methods returned, and then
an implicit conversion from FormElement to NodeSeq. Might look
something like this:

trait FormElement[T] {
  def !: T
  def toNodeSeq: NodeSeq
}

implicit def formElem2NodeSeq[T](e: FormElement[T]) = e.toNodeSeq

Then, the SHtml methods would have signatures like this instead:

def textarea[T](contents: String, onSubmit: (String) => T, attrs :
(String, String)*): FormElement[T]
def submit[T](label: String, onSubmit: () => T, attrs: (String,
String)*): FormElement[T]

With the implicit conversion in scope, these could be used exactly
like their current counterparts, but there's another way they could be
used as well. Here's what the problem I'm facing might look like with
this construction, along with the ability for ajaxForm to take a
closure as above:

val text: FormElement[NodeSeq] = SHtml.textArea("", s => parse(s),
"rows" -> "40", "cols" -> "120")
val submit: FormElement[JsCmd] = SHtml.submit("Parse", () =>
SetHtml("results", text!))

ajaxForm(
  bind("plan", xhtml, "dsl" -> text, "submit" -> submit),
  () => submit!
)

What do you think?

Kris
-- 
You received this message because you are subscribed to the Google Groups 
"Lift" group.
To post to this group, send email to lift...@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.




Re: [Lift] How to use prepareStatement to select *** from DB (two db vender)?

2010-01-20 Thread Jeppe Nejsum Madsen
"Neil.Lv"  writes:

> Hi all,
>
>   I use two db connections in my app, and I want to use
> DB.prepareStatement to select
> the records from the second db.
>
>   It failed, Here is the code:
> ###
>   def getHotByTid(id : Long) =
> DB.use(bootstrap.liftweb.TwoDB) {
>   conn =>
> DB.prepareStatement("SELECT * FROM hots WHERE id=? ", conn) {
> stmt =>
> stmt.setLong(1, id)
> Log.info("stmt :" + stmt)   // The information is correctly now, but
> after call executeUpdate method
> stmt.executeUpdate()
>  }
>}

Not sure what your problem is really, but I think you should use
DB.runQuery to execute a select statement

Ie

  val (_,result) = DB.runQuery("SELECT COUNT(*), contract_length  FROM "+
"vehicles_current v "+
"WHERE v.account_id=? "+
"GROUP BY contract_length "+
"ORDER BY contract_length",
List(42))

/Jeppe

-- 
You received this message because you are subscribed to the Google Groups 
"Lift" group.
To post to this group, send email to lift...@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: A better approach to ajax forms?

2010-01-20 Thread Kris Nuttycombe
On Wed, Jan 20, 2010 at 9:39 AM, Kris Nuttycombe
 wrote:
> Hi, all,
>
> I'm working on an AJAX form and feel like I'm missing something:
> namely, how to update the page based upon the result of the form
> submission.
>
> The three ajaxForm methods in SHtml have the following signatures:
>
> def ajaxForm(body : NodeSeq)
> def ajaxForm(body : NodeSeq, onSubmit : JsCmd)
> def ajaxForm(body : NodeSeq, onSubmit : JsCmd, postSubmit : JsCmd)
>
> In these signatures, onSubmit is called by the client prior to form
> submission, and postSubmit is called by the client after successful
> submission. My question is, why is there not a signature like this:
>
> def ajaxForm(body: NodeSeq, result: () => JsCmd)
>
> for which the specified result function will be called, and the JsCmd
> returned to the browser for evaluation after processing of the form
> contents on the server?
>
> Right now, I'm using the following to achieve this effect, but it
> seems really hacky:
>
>        val (psId, psJs) = ajaxCall(JsRaw("dsl_text.value"), text =>
> After(20, SetHtml("results", parse(text
>
>        ajaxForm(
>            bind("plan", xhtml,
>                 "dsl" -> SHtml.textarea("", s => (), "id" ->
> "dsl_text", "rows" -> "40", "cols" -> "120"),
>                 "submit" -> SHtml.submit("Parse", () => ())
>            ),
>            psJs.cmd
>        )
>
> Here, JsCmd is actually doing the heavy lifting prior to form
> submission, with noop implementations for handling of the form
> elements. Seems really hacky.
>
> I feel like I've got to be missing something here, like there's got to
> be a better way to implement this such that the parsing of the
> textarea contents can be done by the closure passed to the
> SHtml.textarea call. How can I do this?
>
> Here's an idea I've been toying with for a while; it would be a
> somewhat significant change to Lift but I feel like there would be
> some benefits.
>
> Instead of SHtml.* having signatures like (String, () => Any, (String,
> String)*) => NodeSeq, imagine that there was a parameterized class
> (call it FormElement) that all of the SHtml methods returned, and then
> an implicit conversion from FormElement to NodeSeq. Might look
> something like this:
>
> trait FormElement[T] {
>  def !: T
>  def toNodeSeq: NodeSeq
> }

An addendum: there's an obvious extension available here:

trait FormElement[T] { self =>
  def !: T

  def toNodeSeq: NodeSeq

  def map[U](f: T => U): FormElement[U] = new FormElement[U] {
lazy val !: U = f(self!)
lazy val toNodeSeq: NodeSeq = self.toNodeSeq
  }

  def flatMap[U](f: T => FormElement[U]): FormElement[U] = new
FormElement[U] {
private lazy val cache = f(self!)
lazy val !: U = cache!
lazy val toNodeSeq = self.toNodeSeq ++ cache.toNodeSeq
  }
}

Kris
-- 
You received this message because you are subscribed to the Google Groups 
"Lift" group.
To post to this group, send email to lift...@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 happens between 7000 and 8000 requests?

2010-01-20 Thread Stefan Koenig
Hey everyone,

I'm very new to lift, so maybe this is just some "production"-flip I
don't know about, but I made a few performance tests Lift vs. Rails
and I was a bit surprised that with my configuration Rails won (for a
high number of requests).

As I said I'm new to Lift, but am using Rails since late 2005 and have
various projects in production, also managing a few of my own servers.
So what I want to say is: Compared to Rails I know nothing about
deploying applications effective in Lift. So that's obviously unfair.

For testing I used two very basic "hello world"-like applications,
trying to serve the same HTML, with a little layout handling on both
sides.
For Rails I chose Thin server which is more or less on par with
Passenger+NginX stack I use in production (and I know Thin is being
used in production environment). For Lift I took the Jetty server
which came out of the box and I read Jetty is often being chosen over
Tomcat for production. (I couldn't find any obvious deploy guide.)

After Testing:

Lift is indeed faster (+ ~93%) in a low number of requests <7000, but
something happens between 7000 and 8000 requests which puts lift into
trouble (Threadpool full?).

Another finding is that the CPU usage of Lift was much higher, than
the one of Rails, even in a low number of requests. (I added
screenshots of the CPU usage in the repository)

So basically my questions: Did I do something wrong? What happens
between 7000 and 8000 requests?

You can find all of the data here: http://github.com/koenig/testlift/

Thank you,
Stefan Koenig
-- 
You received this message because you are subscribed to the Google Groups 
"Lift" group.
To post to this group, send email to lift...@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: Lift and Akka Actors in comparison?

2010-01-20 Thread Franz Bettag
What i am trying is, to get a CometActor to receive messages from an
Akka Actor.

On 20 Jan., 17:13, David Pollak  wrote:
> On Wed, Jan 20, 2010 at 7:31 AM, Franz Bettag  wrote:
> > Timothy, did you somehow manage to get them working together? I am at
> > a point where i would want to mix them in my project. :)
>
> Are you saying that you want to have an Akka Actor as a CometActor or just
> have Akka Actors and Lift Actors in the same project?
>
>
>
>
>
> > On 15 Jan., 00:56, Timothy Perrett  wrote:
> > > No no, theLiftversion was only frozen inAkkabecause of the sample
> > > app (it was causing problems whilst we went through some growing
> > > pains)... I can upgrade it inAkkato 2.0-M1 if you'd like?
>
> > > One would imagine its just a case of composing theAkkaActor into the
> > > comet actor? The composition appears to be fixed to LiftActor and
> > > there arnt any type parameters?
>
> > > trait CometActor extends LiftActor with LiftCometActor with
> > > BindHelpers
>
> > > Cheers, Tim
>
> > > On Jan 14, 11:49 pm, David Pollak 
> > > wrote:
>
> > > > On Thu, Jan 14, 2010 at 3:48 PM, Timothy Perrett <
> > timo...@getintheloop.eu>wrote:
>
> > > > > David, have you actually mixedAkkaactors withLiftcomet actors (that
> > is,
> > > > >akkaactors powering our comet)? I keep meaning to try this, but havent
> > yet.
>
> > > > I have not... plusAkkais onLift1.1 M6 which is so last decade. ;-)
>
> > > > > Cheers, Tim
>
> > > > > On 14 Jan 2010, at 22:57, David Pollak wrote:
>
> > > > > >Akkaactors andLiftActors share the same interface.  Scala Actors do
> > > > > not share this interface.
>
> > > > > --
> > > > > You received this message because you are subscribed to the Google
> > Groups
> > > > > "Lift" group.
> > > > > To post to this group, send email to lift...@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, the simply functional web frameworkhttp://liftweb.net
> > > > Beginning Scalahttp://www.apress.com/book/view/1430219890
> > > > Follow me:http://twitter.com/dpp
> > > > Surf the harmonics
>
> > --
> > You received this message because you are subscribed to the Google Groups
> > "Lift" group.
> > To post to this group, send email to lift...@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, the simply functional web frameworkhttp://liftweb.net
> Beginning Scalahttp://www.apress.com/book/view/1430219890
> Follow me:http://twitter.com/dpp
> Surf the harmonics
-- 
You received this message because you are subscribed to the Google Groups 
"Lift" group.
To post to this group, send email to lift...@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.




Re: [Lift] What happens between 7000 and 8000 requests?

2010-01-20 Thread Ross Mellgren
I'm not going to try and explain, but I do recommend you run ab two or more 
times in succession and take the average. HotSpot VMs (the java VM) does 
selective optimization, so the first run of a benchmark will not be near it's 
maximum speed. I'm not saying this will resolve the issue for you, but it'll 
make for a better benchmark.

-Ross

On Jan 20, 2010, at 12:03 PM, Stefan Koenig wrote:

> Hey everyone,
> 
> I'm very new to lift, so maybe this is just some "production"-flip I
> don't know about, but I made a few performance tests Lift vs. Rails
> and I was a bit surprised that with my configuration Rails won (for a
> high number of requests).
> 
> As I said I'm new to Lift, but am using Rails since late 2005 and have
> various projects in production, also managing a few of my own servers.
> So what I want to say is: Compared to Rails I know nothing about
> deploying applications effective in Lift. So that's obviously unfair.
> 
> For testing I used two very basic "hello world"-like applications,
> trying to serve the same HTML, with a little layout handling on both
> sides.
> For Rails I chose Thin server which is more or less on par with
> Passenger+NginX stack I use in production (and I know Thin is being
> used in production environment). For Lift I took the Jetty server
> which came out of the box and I read Jetty is often being chosen over
> Tomcat for production. (I couldn't find any obvious deploy guide.)
> 
> After Testing:
> 
> Lift is indeed faster (+ ~93%) in a low number of requests <7000, but
> something happens between 7000 and 8000 requests which puts lift into
> trouble (Threadpool full?).
> 
> Another finding is that the CPU usage of Lift was much higher, than
> the one of Rails, even in a low number of requests. (I added
> screenshots of the CPU usage in the repository)
> 
> So basically my questions: Did I do something wrong? What happens
> between 7000 and 8000 requests?
> 
> You can find all of the data here: http://github.com/koenig/testlift/
> 
> Thank you,
> Stefan Koenig
> -- 
> You received this message because you are subscribed to the Google Groups 
> "Lift" group.
> To post to this group, send email to lift...@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.
> 
> 

-- 
You received this message because you are subscribed to the Google Groups 
"Lift" group.
To post to this group, send email to lift...@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 use prepareStatement to select *** from DB (two db vender)?

2010-01-20 Thread Neil.Lv

   Thank you very much,

   But it doesn't work yet, maybe because of using two db connections.

   I'll test it later again.


On Jan 21, 12:44 am, Jeppe Nejsum Madsen  wrote:
> "Neil.Lv"  writes:
> > Hi all,
>
> >   I use two db connections in my app, and I want to use
> > DB.prepareStatement to select
> > the records from the second db.
>
> >   It failed, Here is the code:
> > ###
> >   def getHotByTid(id : Long) =
> >     DB.use(bootstrap.liftweb.TwoDB) {
> >       conn =>
> >      DB.prepareStatement("SELECT * FROM hots WHERE id=? ", conn) {
> >              stmt =>
> >                      stmt.setLong(1, id)
> > Log.info("stmt :" + stmt)   // The information is correctly now, but
> > after call executeUpdate method
> >                      stmt.executeUpdate()
> >       }
> >    }
>
> Not sure what your problem is really, but I think you should use
> DB.runQuery to execute a select statement
>
> Ie
>
>   val (_,result) = DB.runQuery("SELECT COUNT(*), contract_length  FROM "+
>                     "vehicles_current v "+
>                     "WHERE v.account_id=? "+
>                     "GROUP BY contract_length "+
>                     "ORDER BY contract_length",
>                     List(42))
>
> /Jeppe
-- 
You received this message because you are subscribed to the Google Groups 
"Lift" group.
To post to this group, send email to lift...@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] Help understanding lift:comet

2010-01-20 Thread Donald McLean
I am a total newbie trying to learn Scala and Lift. It is a near
certainty that my problem is a misunderstanding of something simple so
please don't assume that I have a clue.

My organization is performing a technology evaluation and the winning
technology will be used for an upcoming project. Scala/Lift is the
first technology to be evaluated.

As part of the evaluation, we are going to implement a handful of
small items in each technology so that we can evaluate them on factors
such as ease of learning and ease of modifying.

The first feature that we are going to start with is a simple comet
bit that reports the summary of the system server status - number of
servers that are up vs number that are down. Determining these two
numbers is hard but displaying them looks like it should be reasonably
easy - if I could understand it enough to make it work.

I'm starting with the comet example from section 9.5.2 of "Exploring Lift".

I have a block in my HTML file and I also have a class "ServerStatus".
The result is the error message at the end of this message (with the
arrow showing that srvstat is the unbound prefix).

What am I missing?

Thank you,

Donald

- HTML snippet-

Servers up: don't know
Servers down: don't know


- file ServerStatus.scala -

package demo.helloworld.comet

import net.liftweb.http.CometActor
import net.liftweb.http.js.JsCmds.SetHtml
import java.util.Date

import xml.Text
import net.liftweb.util.{ActorPing, Full, Helpers}

class ServerStatus extends CometActor {
  override def defaultPrefix = Full("srvstat")

  def upCount: Int = 5
  def downCount: Int = 6

  def render = bind("up" -> upText)
  def upText = (
{upCount}
  )

  def downText = (
{downCount}
  )

  // schedule a ping every 10 seconds so we redraw
  val tickSpan: Helpers.TimeSpan = Helpers.intToTimeSpan(1)
  ActorPing.schedule(this, Tick, tickSpan)

  override def lowPriority: PartialFunction[Any, Unit] = {
case Tick => {
  println("Got tick " + new Date());
  partialUpdate(SetHtml("up", Text(upCount.toString)))
  partialUpdate(SetHtml("down", Text(downCount.toString)))
  // schedule an update in 10 seconds
  ActorPing.schedule(this, Tick, tickSpan)
}
  }
}
case object Tick

- Error Message -
XML Parsing Error: prefix not bound to a namespace
Location: http://mcproto.translab.stsci.edu:8080/liftdemo/
Line Number 22, Column 23:Servers down: don't
know
--^
-- 
Family photographs are a critical legacy for
ourselves and our descendants. Protect that
legacy with a digital backup and recovery plan.

Join the photo preservation advocacy Facebook group:
http://www.facebook.com/home.php?ref=logo#/group.php?gid=148274709288
-- 
You received this message because you are subscribed to the Google Groups 
"Lift" group.
To post to this group, send email to lift...@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: A better approach to ajax forms?

2010-01-20 Thread Kris Nuttycombe
On Wed, Jan 20, 2010 at 9:51 AM, Kris Nuttycombe
 wrote:
> On Wed, Jan 20, 2010 at 9:39 AM, Kris Nuttycombe
>  wrote:
>> Hi, all,
>>
>> I'm working on an AJAX form and feel like I'm missing something:
>> namely, how to update the page based upon the result of the form
>> submission.
>>
>> The three ajaxForm methods in SHtml have the following signatures:
>>
>> def ajaxForm(body : NodeSeq)
>> def ajaxForm(body : NodeSeq, onSubmit : JsCmd)
>> def ajaxForm(body : NodeSeq, onSubmit : JsCmd, postSubmit : JsCmd)
>>
>> In these signatures, onSubmit is called by the client prior to form
>> submission, and postSubmit is called by the client after successful
>> submission. My question is, why is there not a signature like this:
>>
>> def ajaxForm(body: NodeSeq, result: () => JsCmd)
>>
>> for which the specified result function will be called, and the JsCmd
>> returned to the browser for evaluation after processing of the form
>> contents on the server?
>>
>> Right now, I'm using the following to achieve this effect, but it
>> seems really hacky:
>>
>>        val (psId, psJs) = ajaxCall(JsRaw("dsl_text.value"), text =>
>> After(20, SetHtml("results", parse(text
>>
>>        ajaxForm(
>>            bind("plan", xhtml,
>>                 "dsl" -> SHtml.textarea("", s => (), "id" ->
>> "dsl_text", "rows" -> "40", "cols" -> "120"),
>>                 "submit" -> SHtml.submit("Parse", () => ())
>>            ),
>>            psJs.cmd
>>        )
>>
>> Here, JsCmd is actually doing the heavy lifting prior to form
>> submission, with noop implementations for handling of the form
>> elements. Seems really hacky.
>>
>> I feel like I've got to be missing something here, like there's got to
>> be a better way to implement this such that the parsing of the
>> textarea contents can be done by the closure passed to the
>> SHtml.textarea call. How can I do this?
>>
>> Here's an idea I've been toying with for a while; it would be a
>> somewhat significant change to Lift but I feel like there would be
>> some benefits.
>>
>> Instead of SHtml.* having signatures like (String, () => Any, (String,
>> String)*) => NodeSeq, imagine that there was a parameterized class
>> (call it FormElement) that all of the SHtml methods returned, and then
>> an implicit conversion from FormElement to NodeSeq. Might look
>> something like this:
>>
>> trait FormElement[T] {
>>  def !: T
>>  def toNodeSeq: NodeSeq
>> }
>
> An addendum: there's an obvious extension available here:
>
> trait FormElement[T] { self =>
>  def !: T
>
>  def toNodeSeq: NodeSeq
>
>  def map[U](f: T => U): FormElement[U] = new FormElement[U] {
>    lazy val !: U = f(self!)
>    lazy val toNodeSeq: NodeSeq = self.toNodeSeq
>  }
>
>  def flatMap[U](f: T => FormElement[U]): FormElement[U] = new
> FormElement[U] {
>    private lazy val cache = f(self!)
>    lazy val !: U = cache!
>    lazy val toNodeSeq = self.toNodeSeq ++ cache.toNodeSeq
>  }
> }

On second thought, that FormElement implementation as a monad is wrong
because toNodeSeq would cause strict evaluation of the closure when
used in the SHtml.* case. Maybe FormElement just has to be a functor
and not a monad.

Kris
-- 
You received this message because you are subscribed to the Google Groups 
"Lift" group.
To post to this group, send email to lift...@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.




Re: [Lift] What happens between 7000 and 8000 requests?

2010-01-20 Thread David Pollak
On Wed, Jan 20, 2010 at 9:03 AM, Stefan Koenig  wrote:

> Hey everyone,
>
> I'm very new to lift, so maybe this is just some "production"-flip I
> don't know about, but I made a few performance tests Lift vs. Rails
> and I was a bit surprised that with my configuration Rails won (for a
> high number of requests).
>
> As I said I'm new to Lift, but am using Rails since late 2005 and have
> various projects in production, also managing a few of my own servers.
> So what I want to say is: Compared to Rails I know nothing about
> deploying applications effective in Lift. So that's obviously unfair.
>
> For testing I used two very basic "hello world"-like applications,
> trying to serve the same HTML, with a little layout handling on both
> sides.
> For Rails I chose Thin server which is more or less on par with
> Passenger+NginX stack I use in production (and I know Thin is being
> used in production environment). For Lift I took the Jetty server
> which came out of the box and I read Jetty is often being chosen over
> Tomcat for production. (I couldn't find any obvious deploy guide.)
>
> After Testing:
>
> Lift is indeed faster (+ ~93%) in a low number of requests <7000, but
> something happens between 7000 and 8000 requests which puts lift into
> trouble (Threadpool full?).
>

Without all the parameters of your test (what JVM, what OS, what JVM flags
(memory size, garbage collection flags, etc.), how you were making the
requests), it's hard to diagnose the difference.  Plus, as Ross points out,
you have to run 100,000 requests through the pipeline before the JVM
optimizes the JITed code.

But, my best guess as to what's happening is that you're making requests
without passing the session ID, so Lift is creating 7,000-8,000 separate
sessions.  Lift keeps sessions in memory and a typical server (unless you're
FourSquare) is unlikely to have 7,000 people logged in at the same time.
The sessions take up memory and the CPU is consumed with doing garbage
collection once you get to 80%+ of RAM taken up by session information.


>
> Another finding is that the CPU usage of Lift was much higher, than
> the one of Rails, even in a low number of requests. (I added
> screenshots of the CPU usage in the repository)
>
> So basically my questions: Did I do something wrong? What happens
> between 7000 and 8000 requests?
>
> You can find all of the data here: http://github.com/koenig/testlift/
>
> Thank you,
> Stefan Koenig
>
> --
> You received this message because you are subscribed to the Google Groups
> "Lift" group.
> To post to this group, send email to lift...@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, the simply functional web framework http://liftweb.net
Beginning Scala http://www.apress.com/book/view/1430219890
Follow me: http://twitter.com/dpp
Surf the harmonics
-- 

You received this message because you are subscribed to the Google Groups "Lift" group.

To post to this group, send email to lift...@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.



Re: [Lift] Re: Lift and Akka Actors in comparison?

2010-01-20 Thread David Pollak
On Wed, Jan 20, 2010 at 9:09 AM, Franz Bettag  wrote:

> What i am trying is, to get a CometActor to receive messages from an
> Akka Actor.
>

That should "just work".  Send the message from the Akka Actor to the
CometActor.


>
> On 20 Jan., 17:13, David Pollak  wrote:
> > On Wed, Jan 20, 2010 at 7:31 AM, Franz Bettag  wrote:
> > > Timothy, did you somehow manage to get them working together? I am at
> > > a point where i would want to mix them in my project. :)
> >
> > Are you saying that you want to have an Akka Actor as a CometActor or
> just
> > have Akka Actors and Lift Actors in the same project?
> >
> >
> >
> >
> >
> > > On 15 Jan., 00:56, Timothy Perrett  wrote:
> > > > No no, theLiftversion was only frozen inAkkabecause of the sample
> > > > app (it was causing problems whilst we went through some growing
> > > > pains)... I can upgrade it inAkkato 2.0-M1 if you'd like?
> >
> > > > One would imagine its just a case of composing theAkkaActor into the
> > > > comet actor? The composition appears to be fixed to LiftActor and
> > > > there arnt any type parameters?
> >
> > > > trait CometActor extends LiftActor with LiftCometActor with
> > > > BindHelpers
> >
> > > > Cheers, Tim
> >
> > > > On Jan 14, 11:49 pm, David Pollak 
> > > > wrote:
> >
> > > > > On Thu, Jan 14, 2010 at 3:48 PM, Timothy Perrett <
> > > timo...@getintheloop.eu>wrote:
> >
> > > > > > David, have you actually mixedAkkaactors withLiftcomet actors
> (that
> > > is,
> > > > > >akkaactors powering our comet)? I keep meaning to try this, but
> havent
> > > yet.
> >
> > > > > I have not... plusAkkais onLift1.1 M6 which is so last decade. ;-)
> >
> > > > > > Cheers, Tim
> >
> > > > > > On 14 Jan 2010, at 22:57, David Pollak wrote:
> >
> > > > > > >Akkaactors andLiftActors share the same interface.  Scala Actors
> do
> > > > > > not share this interface.
> >
> > > > > > --
> > > > > > You received this message because you are subscribed to the
> Google
> > > Groups
> > > > > > "Lift" group.
> > > > > > To post to this group, send email to lift...@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, the simply functional web frameworkhttp://liftweb.net
> > > > > Beginning Scalahttp://www.apress.com/book/view/1430219890
> > > > > Follow me:http://twitter.com/dpp
> > > > > Surf the harmonics
> >
> > > --
> > > You received this message because you are subscribed to the Google
> Groups
> > > "Lift" group.
> > > To post to this group, send email to lift...@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, the simply functional web frameworkhttp://liftweb.net
> > Beginning Scalahttp://www.apress.com/book/view/1430219890
> > Follow me:http://twitter.com/dpp
> > Surf the harmonics
>
> --
> You received this message because you are subscribed to the Google Groups
> "Lift" group.
> To post to this group, send email to lift...@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, the simply functional web framework http://liftweb.net
Beginning Scala http://www.apress.com/book/view/1430219890
Follow me: http://twitter.com/dpp
Surf the harmonics
-- 

You received this message because you are subscribed to the Google Groups "Lift" group.

To post to this group, send email to lift...@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.



Re: [Lift] Help understanding lift:comet

2010-01-20 Thread David Pollak
The problem is very simple.  You're only binding to the  tag.
Please update:

bind("up" -> upText, "down" -> downText)

With that being said, polling for changes doesn't make much sense.  I'd
suggest only redrawing when you get a message that a server has gone
up/down.

On Wed, Jan 20, 2010 at 9:19 AM, Donald McLean  wrote:

> I am a total newbie trying to learn Scala and Lift. It is a near
> certainty that my problem is a misunderstanding of something simple so
> please don't assume that I have a clue.
>
> My organization is performing a technology evaluation and the winning
> technology will be used for an upcoming project. Scala/Lift is the
> first technology to be evaluated.
>
> As part of the evaluation, we are going to implement a handful of
> small items in each technology so that we can evaluate them on factors
> such as ease of learning and ease of modifying.
>
> The first feature that we are going to start with is a simple comet
> bit that reports the summary of the system server status - number of
> servers that are up vs number that are down. Determining these two
> numbers is hard but displaying them looks like it should be reasonably
> easy - if I could understand it enough to make it work.
>
> I'm starting with the comet example from section 9.5.2 of "Exploring Lift".
>
> I have a block in my HTML file and I also have a class "ServerStatus".
> The result is the error message at the end of this message (with the
> arrow showing that srvstat is the unbound prefix).
>
> What am I missing?
>
> Thank you,
>
> Donald
>
> - HTML snippet-
>
>Servers up: don't know
>Servers down: don't know
>
>
> - file ServerStatus.scala -
>
> package demo.helloworld.comet
>
> import net.liftweb.http.CometActor
> import net.liftweb.http.js.JsCmds.SetHtml
> import java.util.Date
>
> import xml.Text
> import net.liftweb.util.{ActorPing, Full, Helpers}
>
> class ServerStatus extends CometActor {
>  override def defaultPrefix = Full("srvstat")
>
>  def upCount: Int = 5
>  def downCount: Int = 6
>
>  def render = bind("up" -> upText)
>  def upText = (
>{upCount}
>  )
>
>  def downText = (
>{downCount}
>  )
>
>  // schedule a ping every 10 seconds so we redraw
>  val tickSpan: Helpers.TimeSpan = Helpers.intToTimeSpan(1)
>  ActorPing.schedule(this, Tick, tickSpan)
>
>  override def lowPriority: PartialFunction[Any, Unit] = {
>case Tick => {
>  println("Got tick " + new Date());
>  partialUpdate(SetHtml("up", Text(upCount.toString)))
>  partialUpdate(SetHtml("down", Text(downCount.toString)))
>  // schedule an update in 10 seconds
>  ActorPing.schedule(this, Tick, tickSpan)
>}
>  }
> }
> case object Tick
>
> - Error Message -
> XML Parsing Error: prefix not bound to a namespace
> Location: http://mcproto.translab.stsci.edu:8080/liftdemo/
> Line Number 22, Column 23:Servers down: don't
> know
> --^
> --
> Family photographs are a critical legacy for
> ourselves and our descendants. Protect that
> legacy with a digital backup and recovery plan.
>
> Join the photo preservation advocacy Facebook group:
> http://www.facebook.com/home.php?ref=logo#/group.php?gid=148274709288
>
> --
> You received this message because you are subscribed to the Google Groups
> "Lift" group.
> To post to this group, send email to lift...@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, the simply functional web framework http://liftweb.net
Beginning Scala http://www.apress.com/book/view/1430219890
Follow me: http://twitter.com/dpp
Surf the harmonics
-- 

You received this message because you are subscribed to the Google Groups "Lift" group.

To post to this group, send email to lift...@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.



Re: [Lift] Help understanding lift:comet

2010-01-20 Thread Naftoli Gugenheim
Also note that the error is not from lift but the browser, if I'm not mistaken.

-
David Pollak wrote:

The problem is very simple.  You're only binding to the  tag.
Please update:

bind("up" -> upText, "down" -> downText)

With that being said, polling for changes doesn't make much sense.  I'd
suggest only redrawing when you get a message that a server has gone
up/down.

On Wed, Jan 20, 2010 at 9:19 AM, Donald McLean  wrote:

> I am a total newbie trying to learn Scala and Lift. It is a near
> certainty that my problem is a misunderstanding of something simple so
> please don't assume that I have a clue.
>
> My organization is performing a technology evaluation and the winning
> technology will be used for an upcoming project. Scala/Lift is the
> first technology to be evaluated.
>
> As part of the evaluation, we are going to implement a handful of
> small items in each technology so that we can evaluate them on factors
> such as ease of learning and ease of modifying.
>
> The first feature that we are going to start with is a simple comet
> bit that reports the summary of the system server status - number of
> servers that are up vs number that are down. Determining these two
> numbers is hard but displaying them looks like it should be reasonably
> easy - if I could understand it enough to make it work.
>
> I'm starting with the comet example from section 9.5.2 of "Exploring Lift".
>
> I have a block in my HTML file and I also have a class "ServerStatus".
> The result is the error message at the end of this message (with the
> arrow showing that srvstat is the unbound prefix).
>
> What am I missing?
>
> Thank you,
>
> Donald
>
> - HTML snippet-
>
>Servers up: don't know
>Servers down: don't know
>
>
> - file ServerStatus.scala -
>
> package demo.helloworld.comet
>
> import net.liftweb.http.CometActor
> import net.liftweb.http.js.JsCmds.SetHtml
> import java.util.Date
>
> import xml.Text
> import net.liftweb.util.{ActorPing, Full, Helpers}
>
> class ServerStatus extends CometActor {
>  override def defaultPrefix = Full("srvstat")
>
>  def upCount: Int = 5
>  def downCount: Int = 6
>
>  def render = bind("up" -> upText)
>  def upText = (
>{upCount}
>  )
>
>  def downText = (
>{downCount}
>  )
>
>  // schedule a ping every 10 seconds so we redraw
>  val tickSpan: Helpers.TimeSpan = Helpers.intToTimeSpan(1)
>  ActorPing.schedule(this, Tick, tickSpan)
>
>  override def lowPriority: PartialFunction[Any, Unit] = {
>case Tick => {
>  println("Got tick " + new Date());
>  partialUpdate(SetHtml("up", Text(upCount.toString)))
>  partialUpdate(SetHtml("down", Text(downCount.toString)))
>  // schedule an update in 10 seconds
>  ActorPing.schedule(this, Tick, tickSpan)
>}
>  }
> }
> case object Tick
>
> - Error Message -
> XML Parsing Error: prefix not bound to a namespace
> Location: http://mcproto.translab.stsci.edu:8080/liftdemo/
> Line Number 22, Column 23:Servers down: don't
> know
> --^
> --
> Family photographs are a critical legacy for
> ourselves and our descendants. Protect that
> legacy with a digital backup and recovery plan.
>
> Join the photo preservation advocacy Facebook group:
> http://www.facebook.com/home.php?ref=logo#/group.php?gid=148274709288
>
> --
> You received this message because you are subscribed to the Google Groups
> "Lift" group.
> To post to this group, send email to lift...@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, the simply functional web framework http://liftweb.net
Beginning Scala http://www.apress.com/book/view/1430219890
Follow me: http://twitter.com/dpp
Surf the harmonics
--
You received this message because you are subscribed to the Google Groups 
"Lift" group.
To post to this group, send email to lift...@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.

-- 
You received this message because you are subscribed to the Google Groups 
"Lift" group.
To post to this group, send email to lift...@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.




Re: [Lift] Help understanding lift:comet

2010-01-20 Thread Donald McLean
Yes, that was simple. Thank you, David.

I actually planned on redrawing only on change - I just hadn't gotten
that far yet.

On Wed, Jan 20, 2010 at 12:30 PM, David Pollak
 wrote:
> The problem is very simple.  You're only binding to the  tag.
> Please update:
>
> bind("up" -> upText, "down" -> downText)
>
> With that being said, polling for changes doesn't make much sense.  I'd
> suggest only redrawing when you get a message that a server has gone
> up/down.

-- 
Family photographs are a critical legacy for
ourselves and our descendants. Protect that
legacy with a digital backup and recovery plan.

Join the photo preservation advocacy Facebook group:
http://www.facebook.com/home.php?ref=logo#/group.php?gid=148274709288
-- 
You received this message because you are subscribed to the Google Groups 
"Lift" group.
To post to this group, send email to lift...@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 use prepareStatement to select *** from DB (two db vender)?

2010-01-20 Thread Neil.Lv

  The DB.runQuery can works now, but the DB.prepareStatement also
cant' work.

  Here is the test app address:
  http://github.com/anim510/two_db_demo

Cheers,
  Neil

On Jan 21, 1:16 am, "Neil.Lv"  wrote:
>    Thank you very much,
>
>    But it doesn't work yet, maybe because of using two db connections.
>
>    I'll test it later again.
>
> On Jan 21, 12:44 am, Jeppe Nejsum Madsen  wrote:
>
> > "Neil.Lv"  writes:
> > > Hi all,
>
> > >   I use two db connections in my app, and I want to use
> > > DB.prepareStatement to select
> > > the records from the second db.
>
> > >   It failed, Here is the code:
> > > ###
> > >   def getHotByTid(id : Long) =
> > >     DB.use(bootstrap.liftweb.TwoDB) {
> > >       conn =>
> > >      DB.prepareStatement("SELECT * FROM hots WHERE id=? ", conn) {
> > >              stmt =>
> > >                      stmt.setLong(1, id)
> > > Log.info("stmt :" + stmt)   // The information is correctly now, but
> > > after call executeUpdate method
> > >                      stmt.executeUpdate()
> > >       }
> > >    }
>
> > Not sure what your problem is really, but I think you should use
> > DB.runQuery to execute a select statement
>
> > Ie
>
> >   val (_,result) = DB.runQuery("SELECT COUNT(*), contract_length  FROM "+
> >                     "vehicles_current v "+
> >                     "WHERE v.account_id=? "+
> >                     "GROUP BY contract_length "+
> >                     "ORDER BY contract_length",
> >                     List(42))
>
> > /Jeppe
-- 
You received this message because you are subscribed to the Google Groups 
"Lift" group.
To post to this group, send email to lift...@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.




Re: [Lift] Help understanding lift:comet

2010-01-20 Thread David Pollak
On Wed, Jan 20, 2010 at 9:55 AM, Donald McLean  wrote:

> Yes, that was simple. Thank you, David.
>
> I actually planned on redrawing only on change - I just hadn't gotten
> that far yet.
>

Okay.  Also, for such a small component, you might just want to do a
"reRender(false)" rather than partial update.  Anything that fits into 1 MTU
(about 1,500 bytes) is not worth optimizing.


>
> On Wed, Jan 20, 2010 at 12:30 PM, David Pollak
>  wrote:
> > The problem is very simple.  You're only binding to the 
> tag.
> > Please update:
> >
> > bind("up" -> upText, "down" -> downText)
> >
> > With that being said, polling for changes doesn't make much sense.  I'd
> > suggest only redrawing when you get a message that a server has gone
> > up/down.
>
> --
> Family photographs are a critical legacy for
> ourselves and our descendants. Protect that
> legacy with a digital backup and recovery plan.
>
> Join the photo preservation advocacy Facebook group:
> http://www.facebook.com/home.php?ref=logo#/group.php?gid=148274709288
>
> --
> You received this message because you are subscribed to the Google Groups
> "Lift" group.
> To post to this group, send email to lift...@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, the simply functional web framework http://liftweb.net
Beginning Scala http://www.apress.com/book/view/1430219890
Follow me: http://twitter.com/dpp
Surf the harmonics
-- 

You received this message because you are subscribed to the Google Groups "Lift" group.

To post to this group, send email to lift...@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: Lift and Akka Actors in comparison?

2010-01-20 Thread Franz Bettag
I am having a little bug that i'll investigate. It's prolly something
in my cometactor. But in debugging it looks fine so far.

On 20 Jan., 18:25, David Pollak  wrote:
> On Wed, Jan 20, 2010 at 9:09 AM, Franz Bettag  wrote:
> > What i am trying is, to get a CometActor to receive messages from an
> > Akka Actor.
>
> That should "just work".  Send the message from the Akka Actor to the
> CometActor.
>
>
>
>
>
> > On 20 Jan., 17:13, David Pollak  wrote:
> > > On Wed, Jan 20, 2010 at 7:31 AM, Franz Bettag  wrote:
> > > > Timothy, did you somehow manage to get them working together? I am at
> > > > a point where i would want to mix them in my project. :)
>
> > > Are you saying that you want to have an Akka Actor as a CometActor or
> > just
> > > have Akka Actors and Lift Actors in the same project?
>
> > > > On 15 Jan., 00:56, Timothy Perrett  wrote:
> > > > > No no, theLiftversion was only frozen inAkkabecause of the sample
> > > > > app (it was causing problems whilst we went through some growing
> > > > > pains)... I can upgrade it inAkkato 2.0-M1 if you'd like?
>
> > > > > One would imagine its just a case of composing theAkkaActor into the
> > > > > comet actor? The composition appears to be fixed to LiftActor and
> > > > > there arnt any type parameters?
>
> > > > > trait CometActor extends LiftActor with LiftCometActor with
> > > > > BindHelpers
>
> > > > > Cheers, Tim
>
> > > > > On Jan 14, 11:49 pm, David Pollak 
> > > > > wrote:
>
> > > > > > On Thu, Jan 14, 2010 at 3:48 PM, Timothy Perrett <
> > > > timo...@getintheloop.eu>wrote:
>
> > > > > > > David, have you actually mixedAkkaactors withLiftcomet actors
> > (that
> > > > is,
> > > > > > >akkaactors powering our comet)? I keep meaning to try this, but
> > havent
> > > > yet.
>
> > > > > > I have not... plusAkkais onLift1.1 M6 which is so last decade. ;-)
>
> > > > > > > Cheers, Tim
>
> > > > > > > On 14 Jan 2010, at 22:57, David Pollak wrote:
>
> > > > > > > >Akkaactors andLiftActors share the same interface.  Scala Actors
> > do
> > > > > > > not share this interface.
>
> > > > > > > --
> > > > > > > You received this message because you are subscribed to the
> > Google
> > > > Groups
> > > > > > > "Lift" group.
> > > > > > > To post to this group, send email to lift...@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, the simply functional web frameworkhttp://liftweb.net
> > > > > > Beginning Scalahttp://www.apress.com/book/view/1430219890
> > > > > > Follow me:http://twitter.com/dpp
> > > > > > Surf the harmonics
>
> > > > --
> > > > You received this message because you are subscribed to the Google
> > Groups
> > > > "Lift" group.
> > > > To post to this group, send email to lift...@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, the simply functional web frameworkhttp://liftweb.net
> > > Beginning Scalahttp://www.apress.com/book/view/1430219890
> > > Follow me:http://twitter.com/dpp
> > > Surf the harmonics
>
> > --
> > You received this message because you are subscribed to the Google Groups
> > "Lift" group.
> > To post to this group, send email to lift...@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, the simply functional web frameworkhttp://liftweb.net
> Beginning Scalahttp://www.apress.com/book/view/1430219890
> Follow me:http://twitter.com/dpp
> Surf the harmonics
-- 
You received this message because you are subscribed to the Google Groups 
"Lift" group.
To post to this group, send email to lift...@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: Using frameset

2010-01-20 Thread Chris Thomet
it's working now. i have forgotten to add xmlns="http://www.w3.org/
1999/xhtml" in the html element


On Jan 20, 5:38 pm, Chris Thomet  wrote:
> Thank you Tim! The doctype is now ok.
>
> Unfortunately, my frameset is still not working.
> By using the code below, Chrome and Firefox are only displaying the
> title 'Foo'. It works with IE8.
> Actually it's only not working if the frameset-page is processed by
> the lift framework. If I open that document directly with Chrome or
> Firefox, it works fine.
>
> I can't figure out the problem. It's really strange...
>
> 
> fs.html
> 
> 
> 
>   Foo
>   
> 
> 
>   http://www.google.ch"; name="f1" />
>   http://www.google.ch"; name="f2" />
> 
> 
>
> 
> fs.html processed by lift
> 
>  "http://www.w3.org/TR/xhtml1/DTD/xhtml1-frameset.dtd";>
> 
> 
>   Foo
>   
> 
> 
>   http://www.google.ch";>
>   http://www.google.ch";>
> 
> 
>
> On Jan 20, 3:57 pm, Timothy Perrett  wrote:
>
>
>
> >http://blog.getintheloop.eu/2008/10/1/explictially-setting-applicatio...
>
> > Cheers, Tim
>
> > On Jan 20, 10:38 am, Chris Thomet  wrote:
>
> > > Hi
>
> > > For one page on my website I need frames. How can I change from
> > > doctype 'transitional' to 'frameset'?
>
> > > Thank you!
> > > Chris
-- 
You received this message because you are subscribed to the Google Groups 
"Lift" group.
To post to this group, send email to lift...@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] Snippet question

2010-01-20 Thread Franz Bettag
Sorry if i am asking a lot of questions lately, but i am trying to get
this project of mine working so i can write about the specific
problems i ran into and how they got done.

def subnets(xhtml: NodeSeq): NodeSeq = {
val content = IPnet.findAll(OrderBy(IPnet.name, 
Ascending)).map(ip
=> {

/* Bind the xml */
bind("ip", xhtml,
"subnet" -> Text(ip.name.toString),
"action" -> SHtml.a(expand(ip.subnet) _, "See 
all IPs")
)
}).mkString

XML.loadString("%s".format(content))
}

def expand(subnet: String): JsCmd = {
Log.info("Requested subnet %s".format(subnet))
Alert("subnet %s was requested".format(subnet))
}

The Problem is the "action" that gets binded. I don't get how i have
to use SHtml.a to pass a value to the called function. Any hints?

Thank you very much in advance
-- 
You received this message because you are subscribed to the Google Groups 
"Lift" group.
To post to this group, send email to lift...@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.




Re: [Lift] Re: Using frameset

2010-01-20 Thread David Pollak
On Wed, Jan 20, 2010 at 10:03 AM, Chris Thomet  wrote:

> it's working now. i have forgotten to add xmlns="http://www.w3.org/
> 1999/xhtml " in the html element
>

I'd also strongly recommend setting the character set to UTF-8 for anything
that's Lift-related.


>
>
> On Jan 20, 5:38 pm, Chris Thomet  wrote:
> > Thank you Tim! The doctype is now ok.
> >
> > Unfortunately, my frameset is still not working.
> > By using the code below, Chrome and Firefox are only displaying the
> > title 'Foo'. It works with IE8.
> > Actually it's only not working if the frameset-page is processed by
> > the lift framework. If I open that document directly with Chrome or
> > Firefox, it works fine.
> >
> > I can't figure out the problem. It's really strange...
> >
> > 
> > fs.html
> > 
> > 
> > 
> >   Foo
> >   
> > 
> > 
> >   http://www.google.ch"; name="f1" />
> >   http://www.google.ch"; name="f2" />
> > 
> > 
> >
> > 
> > fs.html processed by lift
> > 
> >  http://www.w3.org/TR/xhtml1/DTD/xhtml1-frameset.dtd";>
> > 
> > 
> >   Foo
> >   
> > 
> > 
> >   http://www.google.ch";>
> >   http://www.google.ch";>
> > 
> > 
> >
> > On Jan 20, 3:57 pm, Timothy Perrett  wrote:
> >
> >
> >
> > >http://blog.getintheloop.eu/2008/10/1/explictially-setting-applicatio.
> ..
> >
> > > Cheers, Tim
> >
> > > On Jan 20, 10:38 am, Chris Thomet  wrote:
> >
> > > > Hi
> >
> > > > For one page on my website I need frames. How can I change from
> > > > doctype 'transitional' to 'frameset'?
> >
> > > > Thank you!
> > > > Chris
>
> --
> You received this message because you are subscribed to the Google Groups
> "Lift" group.
> To post to this group, send email to lift...@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, the simply functional web framework http://liftweb.net
Beginning Scala http://www.apress.com/book/view/1430219890
Follow me: http://twitter.com/dpp
Surf the harmonics
-- 

You received this message because you are subscribed to the Google Groups "Lift" group.

To post to this group, send email to lift...@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] Mapper FKs

2010-01-20 Thread Naftoli Gugenheim
David and everone,
Some time ago we discussed on this list what it would take to have Schemifier 
generate foreign key constraints. The obvious reason why it doesn't currently 
is because the relevant flag on all the DriverTypes is set to false.
Derek was going to work on it but he got busy and didn't get far. Now, I 
personally, on my local repository, enabled foreign key generation for H2 and 
it seems to have worked fine (although it gave me plenty of work manually 
fixing the integrity of my client's database so the keys could be generated 
successfully).
In order for the tests to be successful, I had to change my ManyToManySpecs (if 
that's what it's called) to use a dummy DriverType with FK generation off, so 
it could test ManyToMany with broken joins.
In any case, my quesion is, what criteria have to be fulfilled to push this 
(besides ReviewBoard approval obviously :) )?
What level of testing?
I assume it should be controllable with a flag that should, at least 
temporarily, be false. What form should this setting take?
What other features should be supported? Different ON UPDATE/DELETE actions?
Note that this is not the most immediate thing on my plate but I did already 
start as mentioned.
Thanks.

-- 
You received this message because you are subscribed to the Google Groups 
"Lift" group.
To post to this group, send email to lift...@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: Snippet question

2010-01-20 Thread Franz Bettag
Ah figured it out. Played long enough around to get the right way:

() => {expand(trafficReply.subnet)}

Another question though, would it be possible to use
 and pass the
given NodeSeq over the bind into a function?

On 20 Jan., 19:08, Franz Bettag  wrote:
> Sorry if i am asking a lot of questions lately, but i am trying to get
> this project of mine working so i can write about the specific
> problems i ran into and how they got done.
>
>         def subnets(xhtml: NodeSeq): NodeSeq = {
>                 val content = IPnet.findAll(OrderBy(IPnet.name, 
> Ascending)).map(ip
> => {
>
>                         /* Bind the xml */
>                         bind("ip", xhtml,
>                                 "subnet" -> Text(ip.name.toString),
>                                 "action" -> SHtml.a(expand(ip.subnet) _, "See 
> all IPs")
>                                 )
>                 }).mkString
>
>                 XML.loadString("%s".format(content))
>         }
>
>         def expand(subnet: String): JsCmd = {
>                 Log.info("Requested subnet %s".format(subnet))
>                 Alert("subnet %s was requested".format(subnet))
>         }
>
> The Problem is the "action" that gets binded. I don't get how i have
> to use SHtml.a to pass a value to the called function. Any hints?
>
> Thank you very much in advance
-- 
You received this message because you are subscribed to the Google Groups 
"Lift" group.
To post to this group, send email to lift...@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.




Re: [Lift] Re: Snippet question

2010-01-20 Thread Naftoli Gugenheim
You can pass a NodeSeq=>NodeSeq function to bind instead of a plain NodeSeq.

-
Franz Bettag wrote:

Ah figured it out. Played long enough around to get the right way:

() => {expand(trafficReply.subnet)}

Another question though, would it be possible to use
 and pass the
given NodeSeq over the bind into a function?

On 20 Jan., 19:08, Franz Bettag  wrote:
> Sorry if i am asking a lot of questions lately, but i am trying to get
> this project of mine working so i can write about the specific
> problems i ran into and how they got done.
>
>         def subnets(xhtml: NodeSeq): NodeSeq = {
>                 val content = IPnet.findAll(OrderBy(IPnet.name, 
> Ascending)).map(ip
> => {
>
>                         /* Bind the xml */
>                         bind("ip", xhtml,
>                                 "subnet" -> Text(ip.name.toString),
>                                 "action" -> SHtml.a(expand(ip.subnet) _, "See 
> all IPs")
>                                 )
>                 }).mkString
>
>                 XML.loadString("%s".format(content))
>         }
>
>         def expand(subnet: String): JsCmd = {
>                 Log.info("Requested subnet %s".format(subnet))
>                 Alert("subnet %s was requested".format(subnet))
>         }
>
> The Problem is the "action" that gets binded. I don't get how i have
> to use SHtml.a to pass a value to the called function. Any hints?
>
> Thank you very much in advance
-- 
You received this message because you are subscribed to the Google Groups 
"Lift" group.
To post to this group, send email to lift...@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.


-- 
You received this message because you are subscribed to the Google Groups 
"Lift" group.
To post to this group, send email to lift...@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.




Re: [Lift] Re: Snippet question

2010-01-20 Thread Naftoli Gugenheim
Meaning to the right of the -> arrow.

-
Franz Bettag wrote:

Ah figured it out. Played long enough around to get the right way:

() => {expand(trafficReply.subnet)}

Another question though, would it be possible to use
 and pass the
given NodeSeq over the bind into a function?

On 20 Jan., 19:08, Franz Bettag  wrote:
> Sorry if i am asking a lot of questions lately, but i am trying to get
> this project of mine working so i can write about the specific
> problems i ran into and how they got done.
>
>         def subnets(xhtml: NodeSeq): NodeSeq = {
>                 val content = IPnet.findAll(OrderBy(IPnet.name, 
> Ascending)).map(ip
> => {
>
>                         /* Bind the xml */
>                         bind("ip", xhtml,
>                                 "subnet" -> Text(ip.name.toString),
>                                 "action" -> SHtml.a(expand(ip.subnet) _, "See 
> all IPs")
>                                 )
>                 }).mkString
>
>                 XML.loadString("%s".format(content))
>         }
>
>         def expand(subnet: String): JsCmd = {
>                 Log.info("Requested subnet %s".format(subnet))
>                 Alert("subnet %s was requested".format(subnet))
>         }
>
> The Problem is the "action" that gets binded. I don't get how i have
> to use SHtml.a to pass a value to the called function. Any hints?
>
> Thank you very much in advance
-- 
You received this message because you are subscribed to the Google Groups 
"Lift" group.
To post to this group, send email to lift...@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.


-- 
You received this message because you are subscribed to the Google Groups 
"Lift" group.
To post to this group, send email to lift...@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: Snippet question

2010-01-20 Thread Franz Bettag
How would that look like?
"foo" => nodeSeqMethod _ ?

On 20 Jan., 21:21, Naftoli Gugenheim  wrote:
> Meaning to the right of the -> arrow.
>
> -
>
> Franz Bettag wrote:
>
> Ah figured it out. Played long enough around to get the right way:
>
> () => {expand(trafficReply.subnet)}
>
> Another question though, would it be possible to use
>  and pass the
> given NodeSeq over the bind into a function?
>
> On 20 Jan., 19:08, Franz Bettag  wrote:
>
> > Sorry if i am asking a lot of questions lately, but i am trying to get
> > this project of mine working so i can write about the specific
> > problems i ran into and how they got done.
>
> >         def subnets(xhtml: NodeSeq): NodeSeq = {
> >                 val content = IPnet.findAll(OrderBy(IPnet.name, 
> > Ascending)).map(ip
> > => {
>
> >                         /* Bind the xml */
> >                         bind("ip", xhtml,
> >                                 "subnet" -> Text(ip.name.toString),
> >                                 "action" -> SHtml.a(expand(ip.subnet) _, 
> > "See all IPs")
> >                                 )
> >                 }).mkString
>
> >                 XML.loadString("%s".format(content))
> >         }
>
> >         def expand(subnet: String): JsCmd = {
> >                 Log.info("Requested subnet %s".format(subnet))
> >                 Alert("subnet %s was requested".format(subnet))
> >         }
>
> > The Problem is the "action" that gets binded. I don't get how i have
> > to use SHtml.a to pass a value to the called function. Any hints?
>
> > Thank you very much in advance
>
> --
> You received this message because you are subscribed to the Google Groups 
> "Lift" group.
> To post to this group, send email to lift...@googlegroups.com.
> To unsubscribe from this group, send email to 
> liftweb+unsubscr...@googlegroups.com.
> For more options, visit this group 
> athttp://groups.google.com/group/liftweb?hl=en.
-- 
You received this message because you are subscribed to the Google Groups 
"Lift" group.
To post to this group, send email to lift...@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: Snippet question

2010-01-20 Thread greekscala
Hello,

yes a function that takes NodeSeq parameter and returns
a NodeSeq :)

"foo" -> (ns) => {function body} or
"foo" -> theCalledFunction

best regards

On 20 Jan., 21:26, Franz Bettag  wrote:
> How would that look like?
> "foo" => nodeSeqMethod _ ?
>
> On 20 Jan., 21:21, Naftoli Gugenheim  wrote:
>
> > Meaning to the right of the -> arrow.
>
> > -
>
> > Franz Bettag wrote:
>
> > Ah figured it out. Played long enough around to get the right way:
>
> > () => {expand(trafficReply.subnet)}
>
> > Another question though, would it be possible to use
> >  and pass the
> > given NodeSeq over the bind into a function?
>
> > On 20 Jan., 19:08, Franz Bettag  wrote:
>
> > > Sorry if i am asking a lot of questions lately, but i am trying to get
> > > this project of mine working so i can write about the specific
> > > problems i ran into and how they got done.
>
> > >         def subnets(xhtml: NodeSeq): NodeSeq = {
> > >                 val content = IPnet.findAll(OrderBy(IPnet.name, 
> > > Ascending)).map(ip
> > > => {
>
> > >                         /* Bind the xml */
> > >                         bind("ip", xhtml,
> > >                                 "subnet" -> Text(ip.name.toString),
> > >                                 "action" -> SHtml.a(expand(ip.subnet) _, 
> > > "See all IPs")
> > >                                 )
> > >                 }).mkString
>
> > >                 XML.loadString("%s".format(content))
> > >         }
>
> > >         def expand(subnet: String): JsCmd = {
> > >                 Log.info("Requested subnet %s".format(subnet))
> > >                 Alert("subnet %s was requested".format(subnet))
> > >         }
>
> > > The Problem is the "action" that gets binded. I don't get how i have
> > > to use SHtml.a to pass a value to the called function. Any hints?
>
> > > Thank you very much in advance
>
> > --
> > You received this message because you are subscribed to the Google Groups 
> > "Lift" group.
> > To post to this group, send email to lift...@googlegroups.com.
> > To unsubscribe from this group, send email to 
> > liftweb+unsubscr...@googlegroups.com.
> > For more options, visit this group 
> > athttp://groups.google.com/group/liftweb?hl=en.
-- 
You received this message because you are subscribed to the Google Groups 
"Lift" group.
To post to this group, send email to lift...@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: Snippet question

2010-01-20 Thread Franz Bettag
"expand" -> (fooXhtml) => { Log.error(fooXhtml.toString);  },

error: not a legal formal parameter (pointing at the => )

On 20 Jan., 21:32, greekscala  wrote:
> Hello,
>
> yes a function that takes NodeSeq parameter and returns
> a NodeSeq :)
>
> "foo" -> (ns) => {function body} or
> "foo" -> theCalledFunction
>
> best regards
>
> On 20 Jan., 21:26, Franz Bettag  wrote:
>
> > How would that look like?
> > "foo" => nodeSeqMethod _ ?
>
> > On 20 Jan., 21:21, Naftoli Gugenheim  wrote:
>
> > > Meaning to the right of the -> arrow.
>
> > > -
>
> > > Franz Bettag wrote:
>
> > > Ah figured it out. Played long enough around to get the right way:
>
> > > () => {expand(trafficReply.subnet)}
>
> > > Another question though, would it be possible to use
> > >  and pass the
> > > given NodeSeq over the bind into a function?
>
> > > On 20 Jan., 19:08, Franz Bettag  wrote:
>
> > > > Sorry if i am asking a lot of questions lately, but i am trying to get
> > > > this project of mine working so i can write about the specific
> > > > problems i ran into and how they got done.
>
> > > >         def subnets(xhtml: NodeSeq): NodeSeq = {
> > > >                 val content = IPnet.findAll(OrderBy(IPnet.name, 
> > > > Ascending)).map(ip
> > > > => {
>
> > > >                         /* Bind the xml */
> > > >                         bind("ip", xhtml,
> > > >                                 "subnet" -> Text(ip.name.toString),
> > > >                                 "action" -> SHtml.a(expand(ip.subnet) 
> > > > _, "See all IPs")
> > > >                                 )
> > > >                 }).mkString
>
> > > >                 XML.loadString("%s".format(content))
> > > >         }
>
> > > >         def expand(subnet: String): JsCmd = {
> > > >                 Log.info("Requested subnet %s".format(subnet))
> > > >                 Alert("subnet %s was requested".format(subnet))
> > > >         }
>
> > > > The Problem is the "action" that gets binded. I don't get how i have
> > > > to use SHtml.a to pass a value to the called function. Any hints?
>
> > > > Thank you very much in advance
>
> > > --
> > > You received this message because you are subscribed to the Google Groups 
> > > "Lift" group.
> > > To post to this group, send email to lift...@googlegroups.com.
> > > To unsubscribe from this group, send email to 
> > > liftweb+unsubscr...@googlegroups.com.
> > > For more options, visit this group 
> > > athttp://groups.google.com/group/liftweb?hl=en.
-- 
You received this message because you are subscribed to the Google Groups 
"Lift" group.
To post to this group, send email to lift...@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.




Re: [Lift] Re: Snippet question

2010-01-20 Thread Ross Mellgren
Scala can't figure out what type of parameter you mean, so you need to annotate 
it  -- "expand" -> (fooXhtml: NodeSeq) => {... }

Or use a separately named function with a type signature, e.g.

def doTheStuff(ns: NodeSeq): NodeSeq) = { Log.error(ns.toStrnig);  }

bind(..., "expand" -> doTheStuff _)


-Ross

On Jan 20, 2010, at 3:41 PM, Franz Bettag wrote:

> "expand" -> (fooXhtml) => { Log.error(fooXhtml.toString);  },
> 
> error: not a legal formal parameter (pointing at the => )
> 
> On 20 Jan., 21:32, greekscala  wrote:
>> Hello,
>> 
>> yes a function that takes NodeSeq parameter and returns
>> a NodeSeq :)
>> 
>> "foo" -> (ns) => {function body} or
>> "foo" -> theCalledFunction
>> 
>> best regards
>> 
>> On 20 Jan., 21:26, Franz Bettag  wrote:
>> 
>>> How would that look like?
>>> "foo" => nodeSeqMethod _ ?
>> 
>>> On 20 Jan., 21:21, Naftoli Gugenheim  wrote:
>> 
 Meaning to the right of the -> arrow.
>> 
 -
>> 
 Franz Bettag wrote:
>> 
 Ah figured it out. Played long enough around to get the right way:
>> 
 () => {expand(trafficReply.subnet)}
>> 
 Another question though, would it be possible to use
  and pass the
 given NodeSeq over the bind into a function?
>> 
 On 20 Jan., 19:08, Franz Bettag  wrote:
>> 
> Sorry if i am asking a lot of questions lately, but i am trying to get
> this project of mine working so i can write about the specific
> problems i ran into and how they got done.
>> 
> def subnets(xhtml: NodeSeq): NodeSeq = {
> val content = IPnet.findAll(OrderBy(IPnet.name, 
> Ascending)).map(ip
> => {
>> 
> /* Bind the xml */
> bind("ip", xhtml,
> "subnet" -> Text(ip.name.toString),
> "action" -> SHtml.a(expand(ip.subnet) _, 
> "See all IPs")
> )
> }).mkString
>> 
> XML.loadString("%s".format(content))
> }
>> 
> def expand(subnet: String): JsCmd = {
> Log.info("Requested subnet %s".format(subnet))
> Alert("subnet %s was requested".format(subnet))
> }
>> 
> The Problem is the "action" that gets binded. I don't get how i have
> to use SHtml.a to pass a value to the called function. Any hints?
>> 
> Thank you very much in advance
>> 
 --
 You received this message because you are subscribed to the Google Groups 
 "Lift" group.
 To post to this group, send email to lift...@googlegroups.com.
 To unsubscribe from this group, send email to 
 liftweb+unsubscr...@googlegroups.com.
 For more options, visit this group 
 athttp://groups.google.com/group/liftweb?hl=en.
> -- 
> You received this message because you are subscribed to the Google Groups 
> "Lift" group.
> To post to this group, send email to lift...@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.
> 
> 

-- 
You received this message because you are subscribed to the Google Groups 
"Lift" group.
To post to this group, send email to lift...@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: Snippet question

2010-01-20 Thread Franz Bettag
That doesn't seem to fix the compiler error. :)

On 20 Jan., 21:44, Ross Mellgren  wrote:
> Scala can't figure out what type of parameter you mean, so you need to 
> annotate it  -- "expand" -> (fooXhtml: NodeSeq) => {... }
>
> Or use a separately named function with a type signature, e.g.
>
> def doTheStuff(ns: NodeSeq): NodeSeq) = { Log.error(ns.toStrnig);  }
>
> bind(..., "expand" -> doTheStuff _)
>
> -Ross
>
> On Jan 20, 2010, at 3:41 PM, Franz Bettag wrote:
>
> > "expand" -> (fooXhtml) => { Log.error(fooXhtml.toString);  },
>
> > error: not a legal formal parameter (pointing at the => )
>
> > On 20 Jan., 21:32, greekscala  wrote:
> >> Hello,
>
> >> yes a function that takes NodeSeq parameter and returns
> >> a NodeSeq :)
>
> >> "foo" -> (ns) => {function body} or
> >> "foo" -> theCalledFunction
>
> >> best regards
>
> >> On 20 Jan., 21:26, Franz Bettag  wrote:
>
> >>> How would that look like?
> >>> "foo" => nodeSeqMethod _ ?
>
> >>> On 20 Jan., 21:21, Naftoli Gugenheim  wrote:
>
>  Meaning to the right of the -> arrow.
>
>  -
>
>  Franz Bettag wrote:
>
>  Ah figured it out. Played long enough around to get the right way:
>
>  () => {expand(trafficReply.subnet)}
>
>  Another question though, would it be possible to use
>   and pass the
>  given NodeSeq over the bind into a function?
>
>  On 20 Jan., 19:08, Franz Bettag  wrote:
>
> > Sorry if i am asking a lot of questions lately, but i am trying to get
> > this project of mine working so i can write about the specific
> > problems i ran into and how they got done.
>
> >         def subnets(xhtml: NodeSeq): NodeSeq = {
> >                 val content = IPnet.findAll(OrderBy(IPnet.name, 
> > Ascending)).map(ip
> > => {
>
> >                         /* Bind the xml */
> >                         bind("ip", xhtml,
> >                                 "subnet" -> Text(ip.name.toString),
> >                                 "action" -> SHtml.a(expand(ip.subnet) 
> > _, "See all IPs")
> >                                 )
> >                 }).mkString
>
> >                 XML.loadString("%s".format(content))
> >         }
>
> >         def expand(subnet: String): JsCmd = {
> >                 Log.info("Requested subnet %s".format(subnet))
> >                 Alert("subnet %s was requested".format(subnet))
> >         }
>
> > The Problem is the "action" that gets binded. I don't get how i have
> > to use SHtml.a to pass a value to the called function. Any hints?
>
> > Thank you very much in advance
>
>  --
>  You received this message because you are subscribed to the Google 
>  Groups "Lift" group.
>  To post to this group, send email to lift...@googlegroups.com.
>  To unsubscribe from this group, send email to 
>  liftweb+unsubscr...@googlegroups.com.
>  For more options, visit this group 
>  athttp://groups.google.com/group/liftweb?hl=en.
> > --
> > You received this message because you are subscribed to the Google Groups 
> > "Lift" group.
> > To post to this group, send email to lift...@googlegroups.com.
> > To unsubscribe from this group, send email to 
> > liftweb+unsubscr...@googlegroups.com.
> > For more options, visit this group 
> > athttp://groups.google.com/group/liftweb?hl=en.
-- 
You received this message because you are subscribed to the Google Groups 
"Lift" group.
To post to this group, send email to lift...@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.




Re: [Lift] Re: Snippet question

2010-01-20 Thread Ross Mellgren
Well, it would help to have the compiler error, but I may have gotten 
precedence wrong. Try:

"expand" -> { (fooXhtml: NodeSeq) => ... }

instead

-Ross

On Jan 20, 2010, at 3:51 PM, Franz Bettag wrote:

> That doesn't seem to fix the compiler error. :)
> 
> On 20 Jan., 21:44, Ross Mellgren  wrote:
>> Scala can't figure out what type of parameter you mean, so you need to 
>> annotate it  -- "expand" -> (fooXhtml: NodeSeq) => {... }
>> 
>> Or use a separately named function with a type signature, e.g.
>> 
>> def doTheStuff(ns: NodeSeq): NodeSeq) = { Log.error(ns.toStrnig);  }
>> 
>> bind(..., "expand" -> doTheStuff _)
>> 
>> -Ross
>> 
>> On Jan 20, 2010, at 3:41 PM, Franz Bettag wrote:
>> 
>>> "expand" -> (fooXhtml) => { Log.error(fooXhtml.toString);  },
>> 
>>> error: not a legal formal parameter (pointing at the => )
>> 
>>> On 20 Jan., 21:32, greekscala  wrote:
 Hello,
>> 
 yes a function that takes NodeSeq parameter and returns
 a NodeSeq :)
>> 
 "foo" -> (ns) => {function body} or
 "foo" -> theCalledFunction
>> 
 best regards
>> 
 On 20 Jan., 21:26, Franz Bettag  wrote:
>> 
> How would that look like?
> "foo" => nodeSeqMethod _ ?
>> 
> On 20 Jan., 21:21, Naftoli Gugenheim  wrote:
>> 
>> Meaning to the right of the -> arrow.
>> 
>> -
>> 
>> Franz Bettag wrote:
>> 
>> Ah figured it out. Played long enough around to get the right way:
>> 
>> () => {expand(trafficReply.subnet)}
>> 
>> Another question though, would it be possible to use
>>  and pass the
>> given NodeSeq over the bind into a function?
>> 
>> On 20 Jan., 19:08, Franz Bettag  wrote:
>> 
>>> Sorry if i am asking a lot of questions lately, but i am trying to get
>>> this project of mine working so i can write about the specific
>>> problems i ran into and how they got done.
>> 
>>> def subnets(xhtml: NodeSeq): NodeSeq = {
>>> val content = IPnet.findAll(OrderBy(IPnet.name, 
>>> Ascending)).map(ip
>>> => {
>> 
>>> /* Bind the xml */
>>> bind("ip", xhtml,
>>> "subnet" -> Text(ip.name.toString),
>>> "action" -> SHtml.a(expand(ip.subnet) 
>>> _, "See all IPs")
>>> )
>>> }).mkString
>> 
>>> XML.loadString("%s".format(content))
>>> }
>> 
>>> def expand(subnet: String): JsCmd = {
>>> Log.info("Requested subnet %s".format(subnet))
>>> Alert("subnet %s was requested".format(subnet))
>>> }
>> 
>>> The Problem is the "action" that gets binded. I don't get how i have
>>> to use SHtml.a to pass a value to the called function. Any hints?
>> 
>>> Thank you very much in advance
>> 
>> --
>> You received this message because you are subscribed to the Google 
>> Groups "Lift" group.
>> To post to this group, send email to lift...@googlegroups.com.
>> To unsubscribe from this group, send email to 
>> liftweb+unsubscr...@googlegroups.com.
>> For more options, visit this group 
>> athttp://groups.google.com/group/liftweb?hl=en.
>>> --
>>> You received this message because you are subscribed to the Google Groups 
>>> "Lift" group.
>>> To post to this group, send email to lift...@googlegroups.com.
>>> To unsubscribe from this group, send email to 
>>> liftweb+unsubscr...@googlegroups.com.
>>> For more options, visit this group 
>>> athttp://groups.google.com/group/liftweb?hl=en.
> -- 
> You received this message because you are subscribed to the Google Groups 
> "Lift" group.
> To post to this group, send email to lift...@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.
> 
> 

-- 
You received this message because you are subscribed to the Google Groups 
"Lift" group.
To post to this group, send email to lift...@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] Embedding comet actor in ModalDialog

2010-01-20 Thread ced
Hi all,

I'm trying to create some sort of progress notification for a long
lasting request. The idea is to answer an ajax request with a
JqJsCmds.ModalDialog which embeds a comet actor like so:

ajaxButton("Start process", () => ModalDialog(Progress))

Unfortunately this doesn't work, the dialog doesn't get displayed.
Embedding a "normal" snippet works just fine though.

The code returned in the response to the button click seems ok also.

As a workaround I place the comet actor in the page enclosed in a
hidden .
Then I return the ModalDialog(Progress) along with some JS-code that takes the "progress-
actor" div, moves it into the "actor-goes-here" div and makes it
visible.

Does anyone tried something similar? Any help is appreciated...

Chris
-- 
You received this message because you are subscribed to the Google Groups 
"Lift" group.
To post to this group, send email to lift...@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: Snippet question

2010-01-20 Thread Franz Bettag
What i am trying to do, maybe i am doing it all wrong.

The html/xml can be found here: http://pastie.org/787126

The question is, what is the best way to render the bound XML which i
pass in ip:expand, so that upon the "actions" click, it will be
rendered in the correct table on the page. I haven't figured out how a
snippet might just return a string which gets passed as id/class of an
html-tag.

i hope you see my problem, because i am diddling around with this for
like 4 hours straight and i don't find a way to simply tell it "the
lift way" to do the ajax request and replace div XY.
The replacing is not the problem. but how do i get an ID or something
into the template where it gets rendered.

It is also a mystery to me, why a snippet can't return something like
. I haven't found any clue on how to simply return a
group of xml objects. i always need to pack around some span or god
knows what to make that happen. This is especially bad if you want all
the nifty "split design and code" but are not able to somehow let the
user design his table because if you nest it (like i try to), you may
end up with a tbody in a tbody..

these simple things are really badly documented for beginners. Mostly
because i wouldn't know what that method/class i need would be
called. :)

best regards

On 20 Jan., 21:44, Ross Mellgren  wrote:
> Scala can't figure out what type of parameter you mean, so you need to 
> annotate it  -- "expand" -> (fooXhtml: NodeSeq) => {... }
>
> Or use a separately named function with a type signature, e.g.
>
> def doTheStuff(ns: NodeSeq): NodeSeq) = { Log.error(ns.toStrnig);  }
>
> bind(..., "expand" -> doTheStuff _)
>
> -Ross
>
> On Jan 20, 2010, at 3:41 PM, Franz Bettag wrote:
>
> > "expand" -> (fooXhtml) => { Log.error(fooXhtml.toString);  },
>
> > error: not a legal formal parameter (pointing at the => )
>
> > On 20 Jan., 21:32, greekscala  wrote:
> >> Hello,
>
> >> yes a function that takes NodeSeq parameter and returns
> >> a NodeSeq :)
>
> >> "foo" -> (ns) => {function body} or
> >> "foo" -> theCalledFunction
>
> >> best regards
>
> >> On 20 Jan., 21:26, Franz Bettag  wrote:
>
> >>> How would that look like?
> >>> "foo" => nodeSeqMethod _ ?
>
> >>> On 20 Jan., 21:21, Naftoli Gugenheim  wrote:
>
>  Meaning to the right of the -> arrow.
>
>  -
>
>  Franz Bettag wrote:
>
>  Ah figured it out. Played long enough around to get the right way:
>
>  () => {expand(trafficReply.subnet)}
>
>  Another question though, would it be possible to use
>   and pass the
>  given NodeSeq over the bind into a function?
>
>  On 20 Jan., 19:08, Franz Bettag  wrote:
>
> > Sorry if i am asking a lot of questions lately, but i am trying to get
> > this project of mine working so i can write about the specific
> > problems i ran into and how they got done.
>
> >         def subnets(xhtml: NodeSeq): NodeSeq = {
> >                 val content = IPnet.findAll(OrderBy(IPnet.name, 
> > Ascending)).map(ip
> > => {
>
> >                         /* Bind the xml */
> >                         bind("ip", xhtml,
> >                                 "subnet" -> Text(ip.name.toString),
> >                                 "action" -> SHtml.a(expand(ip.subnet) 
> > _, "See all IPs")
> >                                 )
> >                 }).mkString
>
> >                 XML.loadString("%s".format(content))
> >         }
>
> >         def expand(subnet: String): JsCmd = {
> >                 Log.info("Requested subnet %s".format(subnet))
> >                 Alert("subnet %s was requested".format(subnet))
> >         }
>
> > The Problem is the "action" that gets binded. I don't get how i have
> > to use SHtml.a to pass a value to the called function. Any hints?
>
> > Thank you very much in advance
>
>  --
>  You received this message because you are subscribed to the Google 
>  Groups "Lift" group.
>  To post to this group, send email to lift...@googlegroups.com.
>  To unsubscribe from this group, send email to 
>  liftweb+unsubscr...@googlegroups.com.
>  For more options, visit this group 
>  athttp://groups.google.com/group/liftweb?hl=en.
> > --
> > You received this message because you are subscribed to the Google Groups 
> > "Lift" group.
> > To post to this group, send email to lift...@googlegroups.com.
> > To unsubscribe from this group, send email to 
> > liftweb+unsubscr...@googlegroups.com.
> > For more options, visit this group 
> > athttp://groups.google.com/group/liftweb?hl=en.
-- 
You received this message because you are subscribed to the Google Groups 
"Lift" group.
To post to this group, send email to lift...@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.




Re: [Lift] Re: Snippet question

2010-01-20 Thread Naftoli Gugenheim
Yes, the problem is the operator precedence.
If the function consists of one expression you can use parenthesis instead of 
curly braces.
If you're using curly braces, you don't need the parenthesis around the 
argument: { ns: NodeSeq => ...


-
Ross Mellgren wrote:

Well, it would help to have the compiler error, but I may have gotten 
precedence wrong. Try:

"expand" -> { (fooXhtml: NodeSeq) => ... }

instead

-Ross

On Jan 20, 2010, at 3:51 PM, Franz Bettag wrote:

> That doesn't seem to fix the compiler error. :)
> 
> On 20 Jan., 21:44, Ross Mellgren  wrote:
>> Scala can't figure out what type of parameter you mean, so you need to 
>> annotate it  -- "expand" -> (fooXhtml: NodeSeq) => {... }
>> 
>> Or use a separately named function with a type signature, e.g.
>> 
>> def doTheStuff(ns: NodeSeq): NodeSeq) = { Log.error(ns.toStrnig);  }
>> 
>> bind(..., "expand" -> doTheStuff _)
>> 
>> -Ross
>> 
>> On Jan 20, 2010, at 3:41 PM, Franz Bettag wrote:
>> 
>>> "expand" -> (fooXhtml) => { Log.error(fooXhtml.toString);  },
>> 
>>> error: not a legal formal parameter (pointing at the => )
>> 
>>> On 20 Jan., 21:32, greekscala  wrote:
 Hello,
>> 
 yes a function that takes NodeSeq parameter and returns
 a NodeSeq :)
>> 
 "foo" -> (ns) => {function body} or
 "foo" -> theCalledFunction
>> 
 best regards
>> 
 On 20 Jan., 21:26, Franz Bettag  wrote:
>> 
> How would that look like?
> "foo" => nodeSeqMethod _ ?
>> 
> On 20 Jan., 21:21, Naftoli Gugenheim  wrote:
>> 
>> Meaning to the right of the -> arrow.
>> 
>> -
>> 
>> Franz Bettag wrote:
>> 
>> Ah figured it out. Played long enough around to get the right way:
>> 
>> () => {expand(trafficReply.subnet)}
>> 
>> Another question though, would it be possible to use
>>  and pass the
>> given NodeSeq over the bind into a function?
>> 
>> On 20 Jan., 19:08, Franz Bettag  wrote:
>> 
>>> Sorry if i am asking a lot of questions lately, but i am trying to get
>>> this project of mine working so i can write about the specific
>>> problems i ran into and how they got done.
>> 
>>> def subnets(xhtml: NodeSeq): NodeSeq = {
>>> val content = IPnet.findAll(OrderBy(IPnet.name, 
>>> Ascending)).map(ip
>>> => {
>> 
>>> /* Bind the xml */
>>> bind("ip", xhtml,
>>> "subnet" -> Text(ip.name.toString),
>>> "action" -> SHtml.a(expand(ip.subnet) 
>>> _, "See all IPs")
>>> )
>>> }).mkString
>> 
>>> XML.loadString("%s".format(content))
>>> }
>> 
>>> def expand(subnet: String): JsCmd = {
>>> Log.info("Requested subnet %s".format(subnet))
>>> Alert("subnet %s was requested".format(subnet))
>>> }
>> 
>>> The Problem is the "action" that gets binded. I don't get how i have
>>> to use SHtml.a to pass a value to the called function. Any hints?
>> 
>>> Thank you very much in advance
>> 
>> --
>> You received this message because you are subscribed to the Google 
>> Groups "Lift" group.
>> To post to this group, send email to lift...@googlegroups.com.
>> To unsubscribe from this group, send email to 
>> liftweb+unsubscr...@googlegroups.com.
>> For more options, visit this group 
>> athttp://groups.google.com/group/liftweb?hl=en.
>>> --
>>> You received this message because you are subscribed to the Google Groups 
>>> "Lift" group.
>>> To post to this group, send email to lift...@googlegroups.com.
>>> To unsubscribe from this group, send email to 
>>> liftweb+unsubscr...@googlegroups.com.
>>> For more options, visit this group 
>>> athttp://groups.google.com/group/liftweb?hl=en.
> -- 
> You received this message because you are subscribed to the Google Groups 
> "Lift" group.
> To post to this group, send email to lift...@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.
> 
> 

-- 
You received this message because you are subscribed to the Google Groups 
"Lift" group.
To post to this group, send email to lift...@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.


-- 
You received this message because you are subscribed to the Google Groups 
"Lift" group.
To post to this group, send email to lift...@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.




Re: [Lift] Re: Snippet question

2010-01-20 Thread Naftoli Gugenheim
The problem with writing two spans in Scala is that one is a whole expression. 
So either concatenate them with ++, or surround them with ..., which 
is a fake xml element to wrap a few elements as one expression.

-
Franz Bettag wrote:

What i am trying to do, maybe i am doing it all wrong.

The html/xml can be found here: http://pastie.org/787126

The question is, what is the best way to render the bound XML which i
pass in ip:expand, so that upon the "actions" click, it will be
rendered in the correct table on the page. I haven't figured out how a
snippet might just return a string which gets passed as id/class of an
html-tag.

i hope you see my problem, because i am diddling around with this for
like 4 hours straight and i don't find a way to simply tell it "the
lift way" to do the ajax request and replace div XY.
The replacing is not the problem. but how do i get an ID or something
into the template where it gets rendered.

It is also a mystery to me, why a snippet can't return something like
. I haven't found any clue on how to simply return a
group of xml objects. i always need to pack around some span or god
knows what to make that happen. This is especially bad if you want all
the nifty "split design and code" but are not able to somehow let the
user design his table because if you nest it (like i try to), you may
end up with a tbody in a tbody..

these simple things are really badly documented for beginners. Mostly
because i wouldn't know what that method/class i need would be
called. :)

best regards

On 20 Jan., 21:44, Ross Mellgren  wrote:
> Scala can't figure out what type of parameter you mean, so you need to 
> annotate it  -- "expand" -> (fooXhtml: NodeSeq) => {... }
>
> Or use a separately named function with a type signature, e.g.
>
> def doTheStuff(ns: NodeSeq): NodeSeq) = { Log.error(ns.toStrnig);  }
>
> bind(..., "expand" -> doTheStuff _)
>
> -Ross
>
> On Jan 20, 2010, at 3:41 PM, Franz Bettag wrote:
>
> > "expand" -> (fooXhtml) => { Log.error(fooXhtml.toString);  },
>
> > error: not a legal formal parameter (pointing at the => )
>
> > On 20 Jan., 21:32, greekscala  wrote:
> >> Hello,
>
> >> yes a function that takes NodeSeq parameter and returns
> >> a NodeSeq :)
>
> >> "foo" -> (ns) => {function body} or
> >> "foo" -> theCalledFunction
>
> >> best regards
>
> >> On 20 Jan., 21:26, Franz Bettag  wrote:
>
> >>> How would that look like?
> >>> "foo" => nodeSeqMethod _ ?
>
> >>> On 20 Jan., 21:21, Naftoli Gugenheim  wrote:
>
>  Meaning to the right of the -> arrow.
>
>  -
>
>  Franz Bettag wrote:
>
>  Ah figured it out. Played long enough around to get the right way:
>
>  () => {expand(trafficReply.subnet)}
>
>  Another question though, would it be possible to use
>   and pass the
>  given NodeSeq over the bind into a function?
>
>  On 20 Jan., 19:08, Franz Bettag  wrote:
>
> > Sorry if i am asking a lot of questions lately, but i am trying to get
> > this project of mine working so i can write about the specific
> > problems i ran into and how they got done.
>
> >         def subnets(xhtml: NodeSeq): NodeSeq = {
> >                 val content = IPnet.findAll(OrderBy(IPnet.name, 
> > Ascending)).map(ip
> > => {
>
> >                         /* Bind the xml */
> >                         bind("ip", xhtml,
> >                                 "subnet" -> Text(ip.name.toString),
> >                                 "action" -> SHtml.a(expand(ip.subnet) 
> > _, "See all IPs")
> >                                 )
> >                 }).mkString
>
> >                 XML.loadString("%s".format(content))
> >         }
>
> >         def expand(subnet: String): JsCmd = {
> >                 Log.info("Requested subnet %s".format(subnet))
> >                 Alert("subnet %s was requested".format(subnet))
> >         }
>
> > The Problem is the "action" that gets binded. I don't get how i have
> > to use SHtml.a to pass a value to the called function. Any hints?
>
> > Thank you very much in advance
>
>  --
>  You received this message because you are subscribed to the Google 
>  Groups "Lift" group.
>  To post to this group, send email to lift...@googlegroups.com.
>  To unsubscribe from this group, send email to 
>  liftweb+unsubscr...@googlegroups.com.
>  For more options, visit this group 
>  athttp://groups.google.com/group/liftweb?hl=en.
> > --
> > You received this message because you are subscribed to the Google Groups 
> > "Lift" group.
> > To post to this group, send email to lift...@googlegroups.com.
> > To unsubscribe from this group, send email to 
> > liftweb+unsubscr...@googlegroups.com.
> > For more options, visit this group 
> > athttp://groups.google.com/group/liftweb?hl=en.
-- 
You received this message because you are subscribed to the Google Groups 
"L

[Lift] Re: Snippet question

2010-01-20 Thread Franz Bettag
Of course i forgot to paste the snippet..
http://pastie.org/787160

On 20 Jan., 21:44, Ross Mellgren  wrote:
> Scala can't figure out what type of parameter you mean, so you need to 
> annotate it  -- "expand" -> (fooXhtml: NodeSeq) => {... }
>
> Or use a separately named function with a type signature, e.g.
>
> def doTheStuff(ns: NodeSeq): NodeSeq) = { Log.error(ns.toStrnig);  }
>
> bind(..., "expand" -> doTheStuff _)
>
> -Ross
>
> On Jan 20, 2010, at 3:41 PM, Franz Bettag wrote:
>
> > "expand" -> (fooXhtml) => { Log.error(fooXhtml.toString);  },
>
> > error: not a legal formal parameter (pointing at the => )
>
> > On 20 Jan., 21:32, greekscala  wrote:
> >> Hello,
>
> >> yes a function that takes NodeSeq parameter and returns
> >> a NodeSeq :)
>
> >> "foo" -> (ns) => {function body} or
> >> "foo" -> theCalledFunction
>
> >> best regards
>
> >> On 20 Jan., 21:26, Franz Bettag  wrote:
>
> >>> How would that look like?
> >>> "foo" => nodeSeqMethod _ ?
>
> >>> On 20 Jan., 21:21, Naftoli Gugenheim  wrote:
>
>  Meaning to the right of the -> arrow.
>
>  -
>
>  Franz Bettag wrote:
>
>  Ah figured it out. Played long enough around to get the right way:
>
>  () => {expand(trafficReply.subnet)}
>
>  Another question though, would it be possible to use
>   and pass the
>  given NodeSeq over the bind into a function?
>
>  On 20 Jan., 19:08, Franz Bettag  wrote:
>
> > Sorry if i am asking a lot of questions lately, but i am trying to get
> > this project of mine working so i can write about the specific
> > problems i ran into and how they got done.
>
> >         def subnets(xhtml: NodeSeq): NodeSeq = {
> >                 val content = IPnet.findAll(OrderBy(IPnet.name, 
> > Ascending)).map(ip
> > => {
>
> >                         /* Bind the xml */
> >                         bind("ip", xhtml,
> >                                 "subnet" -> Text(ip.name.toString),
> >                                 "action" -> SHtml.a(expand(ip.subnet) 
> > _, "See all IPs")
> >                                 )
> >                 }).mkString
>
> >                 XML.loadString("%s".format(content))
> >         }
>
> >         def expand(subnet: String): JsCmd = {
> >                 Log.info("Requested subnet %s".format(subnet))
> >                 Alert("subnet %s was requested".format(subnet))
> >         }
>
> > The Problem is the "action" that gets binded. I don't get how i have
> > to use SHtml.a to pass a value to the called function. Any hints?
>
> > Thank you very much in advance
>
>  --
>  You received this message because you are subscribed to the Google 
>  Groups "Lift" group.
>  To post to this group, send email to lift...@googlegroups.com.
>  To unsubscribe from this group, send email to 
>  liftweb+unsubscr...@googlegroups.com.
>  For more options, visit this group 
>  athttp://groups.google.com/group/liftweb?hl=en.
> > --
> > You received this message because you are subscribed to the Google Groups 
> > "Lift" group.
> > To post to this group, send email to lift...@googlegroups.com.
> > To unsubscribe from this group, send email to 
> > liftweb+unsubscr...@googlegroups.com.
> > For more options, visit this group 
> > athttp://groups.google.com/group/liftweb?hl=en.
-- 
You received this message because you are subscribed to the Google Groups 
"Lift" group.
To post to this group, send email to lift...@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.




Re: [Lift] Embedding comet actor in ModalDialog

2010-01-20 Thread David Pollak
Due to the way CometActors work, they must be on the originally requested
page and cannot currently be delivered via an Ajax response.

On Wed, Jan 20, 2010 at 1:00 PM, ced  wrote:

> Hi all,
>
> I'm trying to create some sort of progress notification for a long
> lasting request. The idea is to answer an ajax request with a
> JqJsCmds.ModalDialog which embeds a comet actor like so:
>
> ajaxButton("Start process", () => ModalDialog(Progress div>))
>
> Unfortunately this doesn't work, the dialog doesn't get displayed.
> Embedding a "normal" snippet works just fine though.
>
> The code returned in the response to the button click seems ok also.
>
> As a workaround I place the comet actor in the page enclosed in a
> hidden .
> Then I return the ModalDialog(Progress) along with some JS-code that takes the "progress-
> actor" div, moves it into the "actor-goes-here" div and makes it
> visible.
>
> Does anyone tried something similar? Any help is appreciated...
>
> Chris
>
> --
> You received this message because you are subscribed to the Google Groups
> "Lift" group.
> To post to this group, send email to lift...@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, the simply functional web framework http://liftweb.net
Beginning Scala http://www.apress.com/book/view/1430219890
Follow me: http://twitter.com/dpp
Surf the harmonics
-- 

You received this message because you are subscribed to the Google Groups "Lift" group.

To post to this group, send email to lift...@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: Embedding comet actor in ModalDialog

2010-01-20 Thread Marius
I really don't see the need for such use-case. I mean if one wants to
see async stuff in a dialog only when the dialog is opened this could
be easily done via Ajax requests that will "activate"/"deactivate"
async messages to client by sending from the ajax functions messages
to the comet actor.

Is that your use-case ?  so see async intems coming from server
only when the dialog is opened?

Br's,
Marius

On Jan 20, 11:00 pm, ced  wrote:
> Hi all,
>
> I'm trying to create some sort of progress notification for a long
> lasting request. The idea is to answer an ajax request with a
> JqJsCmds.ModalDialog which embeds a comet actor like so:
>
> ajaxButton("Start process", () => ModalDialog(Progress div>))
>
> Unfortunately this doesn't work, the dialog doesn't get displayed.
> Embedding a "normal" snippet works just fine though.
>
> The code returned in the response to the button click seems ok also.
>
> As a workaround I place the comet actor in the page enclosed in a
> hidden .
> Then I return the ModalDialog(Progress) along with some JS-code that takes the "progress-
> actor" div, moves it into the "actor-goes-here" div and makes it
> visible.
>
> Does anyone tried something similar? Any help is appreciated...
>
> Chris
-- 
You received this message because you are subscribed to the Google Groups 
"Lift" group.
To post to this group, send email to lift...@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 happens between 7000 and 8000 requests?

2010-01-20 Thread cody koeninger


On Jan 20, 11:03 am, Stefan Koenig  wrote:
> So basically my questions: Did I do something wrong?

Complete requests:  1
Failed requests:9866
   (Connect: 0, Receive: 0, Length: 9866, Exceptions: 0)


Unless you're intentionally returning a page with dynamic length,
which from a cursory examination of your template it doesn't look like
you are, there is something wrong with your test.

It looks like you're using lift 1.0, so 
http://github.com/dpp/liftweb/issues/issue/275
may be an issue.
-- 
You received this message because you are subscribed to the Google Groups 
"Lift" group.
To post to this group, send email to lift...@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.




Re: [Lift] Re: What happens between 7000 and 8000 requests?

2010-01-20 Thread David Pollak
I've updated the project to Lift 2.0-SNAPSHOT

It's been my experience that Jetty doesn't always close streams and has
problems with benchmarks where it's just "open stream, dump stuff out,
forget to close stream."  I'd suggest trying with Tomcat.  I have not seen
similar problems in production.

But I expect that the problem is a number of sessions created issue.

On Wed, Jan 20, 2010 at 2:56 PM, cody koeninger  wrote:

>
>
> On Jan 20, 11:03 am, Stefan Koenig  wrote:
> > So basically my questions: Did I do something wrong?
>
> Complete requests:  1
> Failed requests:9866
>   (Connect: 0, Receive: 0, Length: 9866, Exceptions: 0)
>
>
> Unless you're intentionally returning a page with dynamic length,
> which from a cursory examination of your template it doesn't look like
> you are, there is something wrong with your test.
>
> It looks like you're using lift 1.0, so
> http://github.com/dpp/liftweb/issues/issue/275
> may be an issue.
>
> --
> You received this message because you are subscribed to the Google Groups
> "Lift" group.
> To post to this group, send email to lift...@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, the simply functional web framework http://liftweb.net
Beginning Scala http://www.apress.com/book/view/1430219890
Follow me: http://twitter.com/dpp
Surf the harmonics
-- 

You received this message because you are subscribed to the Google Groups "Lift" group.

To post to this group, send email to lift...@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: Snippet question

2010-01-20 Thread Franz Bettag
Works like a charm now! Thanks!

One last question tho, is it possible to get a client-Side-callback
for net.liftweb.http.SHtml.a?
I want to start showing a specific ajax spinner (have more than one on
the page) upon pressing a special link.

I don't get how i might "chain" them together. :)

On 20 Jan., 22:15, Franz Bettag  wrote:
> Of course i forgot to paste the snippet..http://pastie.org/787160
>
> On 20 Jan., 21:44, Ross Mellgren  wrote:
>
> > Scala can't figure out what type of parameter you mean, so you need to 
> > annotate it  -- "expand" -> (fooXhtml: NodeSeq) => {... }
>
> > Or use a separately named function with a type signature, e.g.
>
> > def doTheStuff(ns: NodeSeq): NodeSeq) = { Log.error(ns.toStrnig);  }
>
> > bind(..., "expand" -> doTheStuff _)
>
> > -Ross
>
> > On Jan 20, 2010, at 3:41 PM, Franz Bettag wrote:
>
> > > "expand" -> (fooXhtml) => { Log.error(fooXhtml.toString);  },
>
> > > error: not a legal formal parameter (pointing at the => )
>
> > > On 20 Jan., 21:32, greekscala  wrote:
> > >> Hello,
>
> > >> yes a function that takes NodeSeq parameter and returns
> > >> a NodeSeq :)
>
> > >> "foo" -> (ns) => {function body} or
> > >> "foo" -> theCalledFunction
>
> > >> best regards
>
> > >> On 20 Jan., 21:26, Franz Bettag  wrote:
>
> > >>> How would that look like?
> > >>> "foo" => nodeSeqMethod _ ?
>
> > >>> On 20 Jan., 21:21, Naftoli Gugenheim  wrote:
>
> >  Meaning to the right of the -> arrow.
>
> >  -
>
> >  Franz Bettag wrote:
>
> >  Ah figured it out. Played long enough around to get the right way:
>
> >  () => {expand(trafficReply.subnet)}
>
> >  Another question though, would it be possible to use
> >   and pass the
> >  given NodeSeq over the bind into a function?
>
> >  On 20 Jan., 19:08, Franz Bettag  wrote:
>
> > > Sorry if i am asking a lot of questions lately, but i am trying to get
> > > this project of mine working so i can write about the specific
> > > problems i ran into and how they got done.
>
> > >         def subnets(xhtml: NodeSeq): NodeSeq = {
> > >                 val content = IPnet.findAll(OrderBy(IPnet.name, 
> > > Ascending)).map(ip
> > > => {
>
> > >                         /* Bind the xml */
> > >                         bind("ip", xhtml,
> > >                                 "subnet" -> Text(ip.name.toString),
> > >                                 "action" -> SHtml.a(expand(ip.subnet) 
> > > _, "See all IPs")
> > >                                 )
> > >                 }).mkString
>
> > >                 XML.loadString("%s".format(content))
> > >         }
>
> > >         def expand(subnet: String): JsCmd = {
> > >                 Log.info("Requested subnet %s".format(subnet))
> > >                 Alert("subnet %s was requested".format(subnet))
> > >         }
>
> > > The Problem is the "action" that gets binded. I don't get how i have
> > > to use SHtml.a to pass a value to the called function. Any hints?
>
> > > Thank you very much in advance
>
> >  --
> >  You received this message because you are subscribed to the Google 
> >  Groups "Lift" group.
> >  To post to this group, send email to lift...@googlegroups.com.
> >  To unsubscribe from this group, send email to 
> >  liftweb+unsubscr...@googlegroups.com.
> >  For more options, visit this group 
> >  athttp://groups.google.com/group/liftweb?hl=en.
> > > --
> > > You received this message because you are subscribed to the Google Groups 
> > > "Lift" group.
> > > To post to this group, send email to lift...@googlegroups.com.
> > > To unsubscribe from this group, send email to 
> > > liftweb+unsubscr...@googlegroups.com.
> > > For more options, visit this group 
> > > athttp://groups.google.com/group/liftweb?hl=en.
-- 
You received this message because you are subscribed to the Google Groups 
"Lift" group.
To post to this group, send email to lift...@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.




Re: [Lift] Re: Snippet question

2010-01-20 Thread Ross Mellgren
Use & to combine JsCmd. e.g.

JsShowId("ajax-spinner") & SetHtml("subnet-1234", my awesome subnet 
contents)

-Ross

On Jan 20, 2010, at 7:16 PM, Franz Bettag wrote:

> Works like a charm now! Thanks!
> 
> One last question tho, is it possible to get a client-Side-callback
> for net.liftweb.http.SHtml.a?
> I want to start showing a specific ajax spinner (have more than one on
> the page) upon pressing a special link.
> 
> I don't get how i might "chain" them together. :)
> 
> On 20 Jan., 22:15, Franz Bettag  wrote:
>> Of course i forgot to paste the snippet..http://pastie.org/787160
>> 
>> On 20 Jan., 21:44, Ross Mellgren  wrote:
>> 
>>> Scala can't figure out what type of parameter you mean, so you need to 
>>> annotate it  -- "expand" -> (fooXhtml: NodeSeq) => {... }
>> 
>>> Or use a separately named function with a type signature, e.g.
>> 
>>> def doTheStuff(ns: NodeSeq): NodeSeq) = { Log.error(ns.toStrnig);  }
>> 
>>> bind(..., "expand" -> doTheStuff _)
>> 
>>> -Ross
>> 
>>> On Jan 20, 2010, at 3:41 PM, Franz Bettag wrote:
>> 
 "expand" -> (fooXhtml) => { Log.error(fooXhtml.toString);  },
>> 
 error: not a legal formal parameter (pointing at the => )
>> 
 On 20 Jan., 21:32, greekscala  wrote:
> Hello,
>> 
> yes a function that takes NodeSeq parameter and returns
> a NodeSeq :)
>> 
> "foo" -> (ns) => {function body} or
> "foo" -> theCalledFunction
>> 
> best regards
>> 
> On 20 Jan., 21:26, Franz Bettag  wrote:
>> 
>> How would that look like?
>> "foo" => nodeSeqMethod _ ?
>> 
>> On 20 Jan., 21:21, Naftoli Gugenheim  wrote:
>> 
>>> Meaning to the right of the -> arrow.
>> 
>>> -
>> 
>>> Franz Bettag wrote:
>> 
>>> Ah figured it out. Played long enough around to get the right way:
>> 
>>> () => {expand(trafficReply.subnet)}
>> 
>>> Another question though, would it be possible to use
>>>  and pass the
>>> given NodeSeq over the bind into a function?
>> 
>>> On 20 Jan., 19:08, Franz Bettag  wrote:
>> 
 Sorry if i am asking a lot of questions lately, but i am trying to get
 this project of mine working so i can write about the specific
 problems i ran into and how they got done.
>> 
 def subnets(xhtml: NodeSeq): NodeSeq = {
 val content = IPnet.findAll(OrderBy(IPnet.name, 
 Ascending)).map(ip
 => {
>> 
 /* Bind the xml */
 bind("ip", xhtml,
 "subnet" -> Text(ip.name.toString),
 "action" -> SHtml.a(expand(ip.subnet) 
 _, "See all IPs")
 )
 }).mkString
>> 
 XML.loadString("%s".format(content))
 }
>> 
 def expand(subnet: String): JsCmd = {
 Log.info("Requested subnet %s".format(subnet))
 Alert("subnet %s was requested".format(subnet))
 }
>> 
 The Problem is the "action" that gets binded. I don't get how i have
 to use SHtml.a to pass a value to the called function. Any hints?
>> 
 Thank you very much in advance
>> 
>>> --
>>> You received this message because you are subscribed to the Google 
>>> Groups "Lift" group.
>>> To post to this group, send email to lift...@googlegroups.com.
>>> To unsubscribe from this group, send email to 
>>> liftweb+unsubscr...@googlegroups.com.
>>> For more options, visit this group 
>>> athttp://groups.google.com/group/liftweb?hl=en.
 --
 You received this message because you are subscribed to the Google Groups 
 "Lift" group.
 To post to this group, send email to lift...@googlegroups.com.
 To unsubscribe from this group, send email to 
 liftweb+unsubscr...@googlegroups.com.
 For more options, visit this group 
 athttp://groups.google.com/group/liftweb?hl=en.
> -- 
> You received this message because you are subscribed to the Google Groups 
> "Lift" group.
> To post to this group, send email to lift...@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.
> 
> 

-- 
You received this message because you are subscribed to the Google Groups 
"Lift" group.
To post to this group, send email to lift...@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.




Re: [Lift] Re: What happens between 7000 and 8000 requests?

2010-01-20 Thread Derek Williams
I could be wrong here, but I think the failed requests might be due to the
jsessionid that jetty adds onto the links, they may be different sizes. I am
away from my computer right now and can't test it though.

On Jan 20, 2010 5:11 PM, "David Pollak" 
wrote:

I've updated the project to Lift 2.0-SNAPSHOT

It's been my experience that Jetty doesn't always close streams and has
problems with benchmarks where it's just "open stream, dump stuff out,
forget to close stream."  I'd suggest trying with Tomcat.  I have not seen
similar problems in production.

But I expect that the problem is a number of sessions created issue.

On Wed, Jan 20, 2010 at 2:56 PM, cody koeninger  wrote:

> > > > > On Jan 20, 11:03 am, Stefan Koenig  wrote: > >
> So basically my questions...
>
> > -- > You received this message because you are subscribed to the Google
> Groups "Lift" group. > To ...
>
-- Lift, the simply functional web framework http://liftweb.net Beginning
Scala http://www.apres...

-- 
You received this message because you are subscribed to the Google Groups
"Lift" group.
To post to this group, send email to lift...@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.
-- 

You received this message because you are subscribed to the Google Groups "Lift" group.

To post to this group, send email to lift...@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: Snippet question

2010-01-20 Thread Franz Bettag
Ah, i was already wondering if that was a typo or what it does =)
thank you very much.

The project is coming along nicely. You really notice the performance
difference between our old one (ruby based) and scala. Lift delivery
the list of all subnets in 2.6 seconds. Merb needed almost 8 seconds
for the same request.

I must admit that the merb project used amqp to collect remote data
and i use akka now, but the performance boost is kinda incredible.
Also on the merb-implementation, i had most of the rendering done by
JS since rendering everything with ruby slowed down everything for
another few seconds, on lift it works even faster on the client side
since it already does the output-generation in a nip of a second.

Kudos!

On 21 Jan., 01:24, Ross Mellgren  wrote:
> Use & to combine JsCmd. e.g.
>
> JsShowId("ajax-spinner") & SetHtml("subnet-1234", my awesome subnet 
> contents)
>
> -Ross
>
> On Jan 20, 2010, at 7:16 PM, Franz Bettag wrote:
>
> > Works like a charm now! Thanks!
>
> > One last question tho, is it possible to get a client-Side-callback
> > for net.liftweb.http.SHtml.a?
> > I want to start showing a specific ajax spinner (have more than one on
> > the page) upon pressing a special link.
>
> > I don't get how i might "chain" them together. :)
>
> > On 20 Jan., 22:15, Franz Bettag  wrote:
> >> Of course i forgot to paste the snippet..http://pastie.org/787160
>
> >> On 20 Jan., 21:44, Ross Mellgren  wrote:
>
> >>> Scala can't figure out what type of parameter you mean, so you need to 
> >>> annotate it  -- "expand" -> (fooXhtml: NodeSeq) => {... }
>
> >>> Or use a separately named function with a type signature, e.g.
>
> >>> def doTheStuff(ns: NodeSeq): NodeSeq) = { Log.error(ns.toStrnig);  >>> /> }
>
> >>> bind(..., "expand" -> doTheStuff _)
>
> >>> -Ross
>
> >>> On Jan 20, 2010, at 3:41 PM, Franz Bettag wrote:
>
>  "expand" -> (fooXhtml) => { Log.error(fooXhtml.toString);  },
>
>  error: not a legal formal parameter (pointing at the => )
>
>  On 20 Jan., 21:32, greekscala  wrote:
> > Hello,
>
> > yes a function that takes NodeSeq parameter and returns
> > a NodeSeq :)
>
> > "foo" -> (ns) => {function body} or
> > "foo" -> theCalledFunction
>
> > best regards
>
> > On 20 Jan., 21:26, Franz Bettag  wrote:
>
> >> How would that look like?
> >> "foo" => nodeSeqMethod _ ?
>
> >> On 20 Jan., 21:21, Naftoli Gugenheim  wrote:
>
> >>> Meaning to the right of the -> arrow.
>
> >>> -
>
> >>> Franz Bettag wrote:
>
> >>> Ah figured it out. Played long enough around to get the right way:
>
> >>> () => {expand(trafficReply.subnet)}
>
> >>> Another question though, would it be possible to use
> >>>  and pass the
> >>> given NodeSeq over the bind into a function?
>
> >>> On 20 Jan., 19:08, Franz Bettag  wrote:
>
>  Sorry if i am asking a lot of questions lately, but i am trying to 
>  get
>  this project of mine working so i can write about the specific
>  problems i ran into and how they got done.
>
>          def subnets(xhtml: NodeSeq): NodeSeq = {
>                  val content = IPnet.findAll(OrderBy(IPnet.name, 
>  Ascending)).map(ip
>  => {
>
>                          /* Bind the xml */
>                          bind("ip", xhtml,
>                                  "subnet" -> Text(ip.name.toString),
>                                  "action" -> 
>  SHtml.a(expand(ip.subnet) _, "See all IPs")
>                                  )
>                  }).mkString
>
>                  XML.loadString("%s".format(content))
>          }
>
>          def expand(subnet: String): JsCmd = {
>                  Log.info("Requested subnet %s".format(subnet))
>                  Alert("subnet %s was requested".format(subnet))
>          }
>
>  The Problem is the "action" that gets binded. I don't get how i have
>  to use SHtml.a to pass a value to the called function. Any hints?
>
>  Thank you very much in advance
>
> >>> --
> >>> You received this message because you are subscribed to the Google 
> >>> Groups "Lift" group.
> >>> To post to this group, send email to lift...@googlegroups.com.
> >>> To unsubscribe from this group, send email to 
> >>> liftweb+unsubscr...@googlegroups.com.
> >>> For more options, visit this group 
> >>> athttp://groups.google.com/group/liftweb?hl=en.
>  --
>  You received this message because you are subscribed to the Google 
>  Groups "Lift" group.
>  To post to this group, send email to lift...@googlegroups.com.
>  To unsubscribe from this group, send email to 
>  liftweb+unsubscr...@googlegroups.com.
>  For more options, visit this group 
>  athttp://groups.google.com/group/liftweb?hl=en.
> > --
> > You received 

[Lift] Ideas for how to inject QueryParams into find() and findAll()

2010-01-20 Thread Franz Bettag
Metaprogramming is still a bit new for me, so here is the question:

What would be the cleanest way to implement a parameter-injection into
find() and findAll()?
The idea is to wrap catch every find() and findAll() and inject for
example the User.currentUser's customerId.

So it would be quite safe to .find() whatever the user requests, since
it would only return records belonging to that customer. Since i
already have a trait called Customerize which adds a customer
MappedLongForeignKey to every extended class, i guess this would be
the entry point to start dispatching.

I tried to override findAll() but i basically wound up copying all
code from MetaMapper.scala which wasn't really what i want.

So if anyone has an idea of how to solve this, i'd love to hear it. :)

best regards
-- 
You received this message because you are subscribed to the Google Groups 
"Lift" group.
To post to this group, send email to lift...@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.




Re: [Lift] Ideas for how to inject QueryParams into find() and findAll()

2010-01-20 Thread Naftoli Gugenheim
Why not define a new method?
def findByCurUser(params: QueryParam*) = User.currentUser.flatMap(user=> 
find((Seq(By(User.username, user.username.is)) ++ params): _*))
find returns a Box and currentUser does too, so flatMap flattens them into one. 
Basically find takes a varargs and you're passing a Seq instead using : _*, and 
that Seq contains the user and other params.
You could probably write params + By(User.username, user.username.is) instead 
of the reverse order, as it's shorter than the previous version.


-
Franz Bettag wrote:

Metaprogramming is still a bit new for me, so here is the question:

What would be the cleanest way to implement a parameter-injection into
find() and findAll()?
The idea is to wrap catch every find() and findAll() and inject for
example the User.currentUser's customerId.

So it would be quite safe to .find() whatever the user requests, since
it would only return records belonging to that customer. Since i
already have a trait called Customerize which adds a customer
MappedLongForeignKey to every extended class, i guess this would be
the entry point to start dispatching.

I tried to override findAll() but i basically wound up copying all
code from MetaMapper.scala which wasn't really what i want.

So if anyone has an idea of how to solve this, i'd love to hear it. :)

best regards
-- 
You received this message because you are subscribed to the Google Groups 
"Lift" group.
To post to this group, send email to lift...@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.


-- 
You received this message because you are subscribed to the Google Groups 
"Lift" group.
To post to this group, send email to lift...@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 S.addAround(DB.buildLoanWrapper) used for?

2010-01-20 Thread XiaomingZheng
a silly question, S.addAround(BS.buildLoadWrapper) seems to be new in
lift web application. What's this clouse used for? thanks
-- 
You received this message because you are subscribed to the Google Groups 
"Lift" group.
To post to this group, send email to lift...@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 use prepareStatement to select *** from DB (two db vender)?

2010-01-20 Thread Neil.Lv


Mabye it's a bug with DB.runQuery and DB.use in the two db vender 

Two question: (problem)

1: I don't know why the HelloWorld snippet code will be execute 2
times in this code. (See the HelloWorld.scala file.)
2: The dbDefaultConnectionIdentifier method in the Model that it works
fine when using Mapper's method such as ModelName.findAll(),
it doesn't work when using DB.runQuery and DB.use(...) --- (Maybe it
can't find the default db identifier)

The question 2 I test it many times that found this problem.

In the test app , the Hot.getHots2 and Hot.getHots3 method can't work.

I comment the code now in the HelloWorld.scala file, you can try it.



  I can push the code on the github, and get this errors "fatal:
unable to fork"

  So If anyone know what's wrong with it and I can send the demo.tar
file through the email.

  Thanks very much!



Cheers,
  Neil

On Jan 21, 1:56 am, "Neil.Lv"  wrote:
>   The DB.runQuery can works now, but the DB.prepareStatement also
> cant' work.
>
>   Here is the test app address:
>  http://github.com/anim510/two_db_demo
>
> Cheers,
>   Neil
>
> On Jan 21, 1:16 am, "Neil.Lv"  wrote:
>
> >Thank you very much,
>
> >But it doesn't work yet, maybe because of using two db connections.
>
> >I'll test it later again.
>
> > On Jan 21, 12:44 am, Jeppe Nejsum Madsen  wrote:
>
> > > "Neil.Lv"  writes:
> > > > Hi all,
>
> > > >   I use two db connections in my app, and I want to use
> > > > DB.prepareStatement to select
> > > > the records from the second db.
>
> > > >   It failed, Here is the code:
> > > > ###
> > > >   def getHotByTid(id : Long) =
> > > > DB.use(bootstrap.liftweb.TwoDB) {
> > > >   conn =>
> > > >  DB.prepareStatement("SELECT * FROM hots WHERE id=? ", conn) {
> > > >  stmt =>
> > > >  stmt.setLong(1, id)
> > > > Log.info("stmt :" + stmt)   // The information is correctly now, but
> > > > after call executeUpdate method
> > > >  stmt.executeUpdate()
> > > >   }
> > > >}
>
> > > Not sure what your problem is really, but I think you should use
> > > DB.runQuery to execute a select statement
>
> > > Ie
>
> > >   val (_,result) = DB.runQuery("SELECT COUNT(*), contract_length  FROM "+
> > > "vehicles_current v "+
> > > "WHERE v.account_id=? "+
> > > "GROUP BY contract_length "+
> > > "ORDER BY contract_length",
> > > List(42))
>
> > > /Jeppe
-- 
You received this message because you are subscribed to the Google Groups 
"Lift" group.
To post to this group, send email to lift...@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 use prepareStatement to select *** from DB (two db vender)?

2010-01-20 Thread Neil.Lv

  My email is :   anim...@gmail.com

On Jan 21, 11:17 am, "Neil.Lv"  wrote:
> Mabye it's a bug with DB.runQuery and DB.use in the two db vender 
>
> Two question: (problem)
>
> 1: I don't know why the HelloWorld snippet code will be execute 2
> times in this code. (See the HelloWorld.scala file.)
> 2: The dbDefaultConnectionIdentifier method in the Model that it works
> fine when using Mapper's method such as ModelName.findAll(),
> it doesn't work when using DB.runQuery and DB.use(...) --- (Maybe it
> can't find the default db identifier)
>
> The question 2 I test it many times that found this problem.
>
> In the test app , the Hot.getHots2 and Hot.getHots3 method can't work.
>
> I comment the code now in the HelloWorld.scala file, you can try it.
>
> 
>
>   I can push the code on the github, and get this errors "fatal:
> unable to fork"
>
>   So If anyone know what's wrong with it and I can send the demo.tar
> file through the email.
>
>   Thanks very much!
>
> 
>
> Cheers,
>   Neil
>
> On Jan 21, 1:56 am, "Neil.Lv"  wrote:
>
> >   The DB.runQuery can works now, but the DB.prepareStatement also
> > cant' work.
>
> >   Here is the test app address:
> >  http://github.com/anim510/two_db_demo
>
> > Cheers,
> >   Neil
>
> > On Jan 21, 1:16 am, "Neil.Lv"  wrote:
>
> > >Thank you very much,
>
> > >But it doesn't work yet, maybe because of using two db connections.
>
> > >I'll test it later again.
>
> > > On Jan 21, 12:44 am, Jeppe Nejsum Madsen  wrote:
>
> > > > "Neil.Lv"  writes:
> > > > > Hi all,
>
> > > > >   I use two db connections in my app, and I want to use
> > > > > DB.prepareStatement to select
> > > > > the records from the second db.
>
> > > > >   It failed, Here is the code:
> > > > > ###
> > > > >   def getHotByTid(id : Long) =
> > > > > DB.use(bootstrap.liftweb.TwoDB) {
> > > > >   conn =>
> > > > >  DB.prepareStatement("SELECT * FROM hots WHERE id=? ", conn) {
> > > > >  stmt =>
> > > > >  stmt.setLong(1, id)
> > > > > Log.info("stmt :" + stmt)   // The information is correctly now, but
> > > > > after call executeUpdate method
> > > > >  stmt.executeUpdate()
> > > > >   }
> > > > >}
>
> > > > Not sure what your problem is really, but I think you should use
> > > > DB.runQuery to execute a select statement
>
> > > > Ie
>
> > > >   val (_,result) = DB.runQuery("SELECT COUNT(*), contract_length  FROM 
> > > > "+
> > > > "vehicles_current v "+
> > > > "WHERE v.account_id=? "+
> > > > "GROUP BY contract_length "+
> > > > "ORDER BY contract_length",
> > > > List(42))
>
> > > > /Jeppe
-- 
You received this message because you are subscribed to the Google Groups 
"Lift" group.
To post to this group, send email to lift...@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.




Re: [Lift] Re: What happens between 7000 and 8000 requests?

2010-01-20 Thread Derek Williams
Okay, I tried it out. jsessionid is sometimes 12 or 13 characters long
which is why the document length is changing. Those failures due to
length are probably safe to ignore.

On Wed, Jan 20, 2010 at 6:00 PM, Derek Williams  wrote:
> I could be wrong here, but I think the failed requests might be due to the
> jsessionid that jetty adds onto the links, they may be different sizes. I am
> away from my computer right now and can't test it though.

-- 
Derek Williams
-- 
You received this message because you are subscribed to the Google Groups 
"Lift" group.
To post to this group, send email to lift...@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.




Re: [Lift] what's S.addAround(DB.buildLoanWrapper) used for?

2010-01-20 Thread David Pollak
On Wed, Jan 20, 2010 at 5:52 PM, XiaomingZheng wrote:

> a silly question, S.addAround(BS.buildLoadWrapper) seems to be new in
> lift web application. What's this clouse used for? thanks
>

S.addAround takes a LoanWrapper and applies the LoanWrapper with the body of
the request servicing.

DB.buildLoanWrapper puts a JDBC transaction around the request so that all
database queries will be part of the same transaction and the transaction
will be committed unless the request results in an exception being thrown.


>
> --
> You received this message because you are subscribed to the Google Groups
> "Lift" group.
> To post to this group, send email to lift...@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, the simply functional web framework http://liftweb.net
Beginning Scala http://www.apress.com/book/view/1430219890
Follow me: http://twitter.com/dpp
Surf the harmonics
-- 

You received this message because you are subscribed to the Google Groups "Lift" group.

To post to this group, send email to lift...@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.



Re: [Lift] Ideas for how to inject QueryParams into find() and findAll()

2010-01-20 Thread David Pollak
If you've got a MetaMapper object:

object MyTable extends MyTable with MetaMapper[MyTable]

In your snippet:

MyTable.addlQueryParams.set(By(MyTable.user, User.currentUser))

Or, if you want to do it just as part of a call:

MyTable.addQueryParams.doWith(By(MyTable.user, User.currentUser)) {
 ... call in here
}

So, none of this is metaprogramming, it's just an API call.

On Wed, Jan 20, 2010 at 5:18 PM, Franz Bettag  wrote:

> Metaprogramming is still a bit new for me, so here is the question:
>
> What would be the cleanest way to implement a parameter-injection into
> find() and findAll()?
> The idea is to wrap catch every find() and findAll() and inject for
> example the User.currentUser's customerId.
>
> So it would be quite safe to .find() whatever the user requests, since
> it would only return records belonging to that customer. Since i
> already have a trait called Customerize which adds a customer
> MappedLongForeignKey to every extended class, i guess this would be
> the entry point to start dispatching.
>
> I tried to override findAll() but i basically wound up copying all
> code from MetaMapper.scala which wasn't really what i want.
>
> So if anyone has an idea of how to solve this, i'd love to hear it. :)
>
> best regards
>
> --
> You received this message because you are subscribed to the Google Groups
> "Lift" group.
> To post to this group, send email to lift...@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, the simply functional web framework http://liftweb.net
Beginning Scala http://www.apress.com/book/view/1430219890
Follow me: http://twitter.com/dpp
Surf the harmonics
-- 

You received this message because you are subscribed to the Google Groups "Lift" group.

To post to this group, send email to lift...@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: Memory behavior in Jetty with CometActor - 25MB of scala.xml.Text!

2010-01-20 Thread Java1Guy
Ok - i've left my Jetty server up and running with one page open...
The good news is Jetty hasn't crapped out.  It had 500MB of heap space
used before a forced GC brought it down to 250MB.  The heap dump is
interesting: http://twitpic.com/z0xnx almost 25MB of Text objects used
by the almost 80K displayList partial function objects in my
CometActor.
To me that sounds like a lot of functions!

Thanks in advance if you can have a look.
Mark

On Jan 18, 6:36 pm, Java1Guy  wrote:
> Thanks for the response.  I have created a small project 
> here:http://drop.io/memtest(btw - the zip file is so big because there are
> 3 heap dumps - before that it was only 21k!) which i believe does
> exhibit the problem.  One comet actor page which gets updated every 20
> sec. via tick.
> So to run this, I've built the war file and installed it into a Jetty
> 6.1.22 installation.  The file etc/memtest.xml goes in the jetty/
> contexts dir.
> I open my Firefox browser to the only page it shows and just leave it
> open for about four hours now - so the session should still be active,
> FWIW.
> An additional thing I'm noticing now is that despite not much else
> happening in the app, the comet responses are taking just under 20
> sec.  That seems huge.
> There are two things I notice in the heap dumps: one is the large
> number of xml.Text objects and their Strings, but second the 5800
> anonFuncs from the DatastreamActor which are being held by the S
> $ProxtFuncHolder.  I guess I could look up the API on that to see if
> there's a way to controls itsbehavior...  but there it is.
> Thanks to anyone who takes a look at this, Mark
>
> The stdout:
> ConsoleActor.lowPriority.Tick...>>>DataStreamActor.lowPriority: HostAddMsg 
> local
>
> ds count 4
> DataStreamActor.refreshStreams: now we know about stream count: 8
> INFO - Service request (GET) /memtest/comet_request/2021921075/
> p6s263zexmzz took 19513 Milliseconds
> ConsoleActor.lowPriority.Tick...>>>DataStreamActor.lowPriority: HostAddMsg 
> local
>
> ds count 4
> DataStreamActor.refreshStreams: now we know about stream count: 8
> INFO - Service request (GET) /memtest/comet_request/11287578067/
> p6s263zexmzz took 19879 Milliseconds
> ConsoleActor.lowPriority.Tick...>>>DataStreamActor.lowPriority: HostAddMsg 
> local
>
> ds count 4
> DataStreamActor.refreshStreams: now we know about stream count: 8
> INFO - Service request (GET) /memtest/comet_request/26532853932/
> p6s263zexmzz took 19868 Milliseconds
> ConsoleActor.lowPriority.Tick...>>>DataStreamActor.lowPriority: HostAddMsg 
> local
>
> ds count 4
> DataStreamActor.refreshStreams: now we know about stream count: 8
> INFO - Service request (GET) /memtest/comet_request/11619469749/
> p6s263zexmzz took 19918 Milliseconds
>
> On Jan 16, 2:32 am, Marius  wrote:
>
> > Lift GC is likely keeping your functions to not expire but this is
> > meant to be that way ... but this doesn't explain the large amount of
> > functions. Can you post a minimalistic example of your app where you
> > can reproduce thisbehavior?
>
> > Br's,
> > Marius
-- 
You received this message because you are subscribed to the Google Groups 
"Lift" group.
To post to this group, send email to lift...@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.




Re: [Lift] Re: Memory behavior in Jetty with CometActor - 25MB of scala.xml.Text!

2010-01-20 Thread David Pollak
On Wed, Jan 20, 2010 at 9:03 PM, Java1Guy  wrote:

> Ok - i've left my Jetty server up and running with one page open...
> The good news is Jetty hasn't crapped out.  It had 500MB of heap space
> used before a forced GC brought it down to 250MB.  The heap dump is
> interesting: http://twitpic.com/z0xnx almost 25MB of Text objects used
> by the almost 80K displayList partial function objects in my
> CometActor.
> To me that sounds like a lot of functions!
>

Without your actual code, there's little we can do.


>
> Thanks in advance if you can have a look.
> Mark
>
> On Jan 18, 6:36 pm, Java1Guy  wrote:
> > Thanks for the response.  I have created a small project here:
> http://drop.io/memtest(btw  - the zip file
> is so big because there are
> > 3 heap dumps - before that it was only 21k!) which i believe does
> > exhibit the problem.  One comet actor page which gets updated every 20
> > sec. via tick.
> > So to run this, I've built the war file and installed it into a Jetty
> > 6.1.22 installation.  The file etc/memtest.xml goes in the jetty/
> > contexts dir.
> > I open my Firefox browser to the only page it shows and just leave it
> > open for about four hours now - so the session should still be active,
> > FWIW.
> > An additional thing I'm noticing now is that despite not much else
> > happening in the app, the comet responses are taking just under 20
> > sec.  That seems huge.
> > There are two things I notice in the heap dumps: one is the large
> > number of xml.Text objects and their Strings, but second the 5800
> > anonFuncs from the DatastreamActor which are being held by the S
> > $ProxtFuncHolder.  I guess I could look up the API on that to see if
> > there's a way to controls itsbehavior...  but there it is.
> > Thanks to anyone who takes a look at this, Mark
> >
> > The stdout:
> > ConsoleActor.lowPriority.Tick...>>>DataStreamActor.lowPriority:
> HostAddMsg local
> >
> > ds count 4
> > DataStreamActor.refreshStreams: now we know about stream count: 8
> > INFO - Service request (GET) /memtest/comet_request/2021921075/
> > p6s263zexmzz took 19513 Milliseconds
> > ConsoleActor.lowPriority.Tick...>>>DataStreamActor.lowPriority:
> HostAddMsg local
> >
> > ds count 4
> > DataStreamActor.refreshStreams: now we know about stream count: 8
> > INFO - Service request (GET) /memtest/comet_request/11287578067/
> > p6s263zexmzz took 19879 Milliseconds
> > ConsoleActor.lowPriority.Tick...>>>DataStreamActor.lowPriority:
> HostAddMsg local
> >
> > ds count 4
> > DataStreamActor.refreshStreams: now we know about stream count: 8
> > INFO - Service request (GET) /memtest/comet_request/26532853932/
> > p6s263zexmzz took 19868 Milliseconds
> > ConsoleActor.lowPriority.Tick...>>>DataStreamActor.lowPriority:
> HostAddMsg local
> >
> > ds count 4
> > DataStreamActor.refreshStreams: now we know about stream count: 8
> > INFO - Service request (GET) /memtest/comet_request/11619469749/
> > p6s263zexmzz took 19918 Milliseconds
> >
> > On Jan 16, 2:32 am, Marius  wrote:
> >
> > > Lift GC is likely keeping your functions to not expire but this is
> > > meant to be that way ... but this doesn't explain the large amount of
> > > functions. Can you post a minimalistic example of your app where you
> > > can reproduce thisbehavior?
> >
> > > Br's,
> > > Marius
>
> --
> You received this message because you are subscribed to the Google Groups
> "Lift" group.
> To post to this group, send email to lift...@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, the simply functional web framework http://liftweb.net
Beginning Scala http://www.apress.com/book/view/1430219890
Follow me: http://twitter.com/dpp
Surf the harmonics
-- 

You received this message because you are subscribed to the Google Groups "Lift" group.

To post to this group, send email to lift...@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.



Re: [Lift] Re: Memory behavior in Jetty with CometActor - 25MB of scala.xml.Text!

2010-01-20 Thread mark chance
I did post the project to drop.io - http://drop.io/memtest.


On Wed, Jan 20, 2010 at 10:06 PM, David Pollak <
feeder.of.the.be...@gmail.com> wrote:

>
>
> On Wed, Jan 20, 2010 at 9:03 PM, Java1Guy  wrote:
>
>> Ok - i've left my Jetty server up and running with one page open...
>> The good news is Jetty hasn't crapped out.  It had 500MB of heap space
>> used before a forced GC brought it down to 250MB.  The heap dump is
>> interesting: http://twitpic.com/z0xnx almost 25MB of Text objects used
>> by the almost 80K displayList partial function objects in my
>> CometActor.
>> To me that sounds like a lot of functions!
>>
>
> Without your actual code, there's little we can do.
>
>
>>
>> Thanks in advance if you can have a look.
>> Mark
>>
>> On Jan 18, 6:36 pm, Java1Guy  wrote:
>> > Thanks for the response.  I have created a small project here:
>> http://drop.io/memtest(btw  - the zip file
>> is so big because there are
>> > 3 heap dumps - before that it was only 21k!) which i believe does
>> > exhibit the problem.  One comet actor page which gets updated every 20
>> > sec. via tick.
>> > So to run this, I've built the war file and installed it into a Jetty
>> > 6.1.22 installation.  The file etc/memtest.xml goes in the jetty/
>> > contexts dir.
>> > I open my Firefox browser to the only page it shows and just leave it
>> > open for about four hours now - so the session should still be active,
>> > FWIW.
>> > An additional thing I'm noticing now is that despite not much else
>> > happening in the app, the comet responses are taking just under 20
>> > sec.  That seems huge.
>> > There are two things I notice in the heap dumps: one is the large
>> > number of xml.Text objects and their Strings, but second the 5800
>> > anonFuncs from the DatastreamActor which are being held by the S
>> > $ProxtFuncHolder.  I guess I could look up the API on that to see if
>> > there's a way to controls itsbehavior...  but there it is.
>> > Thanks to anyone who takes a look at this, Mark
>> >
>> > The stdout:
>> > ConsoleActor.lowPriority.Tick...>>>DataStreamActor.lowPriority:
>> HostAddMsg local
>> >
>> > ds count 4
>> > DataStreamActor.refreshStreams: now we know about stream count: 8
>> > INFO - Service request (GET) /memtest/comet_request/2021921075/
>> > p6s263zexmzz took 19513 Milliseconds
>> > ConsoleActor.lowPriority.Tick...>>>DataStreamActor.lowPriority:
>> HostAddMsg local
>> >
>> > ds count 4
>> > DataStreamActor.refreshStreams: now we know about stream count: 8
>> > INFO - Service request (GET) /memtest/comet_request/11287578067/
>> > p6s263zexmzz took 19879 Milliseconds
>> > ConsoleActor.lowPriority.Tick...>>>DataStreamActor.lowPriority:
>> HostAddMsg local
>> >
>> > ds count 4
>> > DataStreamActor.refreshStreams: now we know about stream count: 8
>> > INFO - Service request (GET) /memtest/comet_request/26532853932/
>> > p6s263zexmzz took 19868 Milliseconds
>> > ConsoleActor.lowPriority.Tick...>>>DataStreamActor.lowPriority:
>> HostAddMsg local
>> >
>> > ds count 4
>> > DataStreamActor.refreshStreams: now we know about stream count: 8
>> > INFO - Service request (GET) /memtest/comet_request/11619469749/
>> > p6s263zexmzz took 19918 Milliseconds
>> >
>> > On Jan 16, 2:32 am, Marius  wrote:
>> >
>> > > Lift GC is likely keeping your functions to not expire but this is
>> > > meant to be that way ... but this doesn't explain the large amount of
>> > > functions. Can you post a minimalistic example of your app where you
>> > > can reproduce thisbehavior?
>> >
>> > > Br's,
>> > > Marius
>>
>> --
>> You received this message because you are subscribed to the Google Groups
>> "Lift" group.
>> To post to this group, send email to lift...@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, the simply functional web framework http://liftweb.net
> Beginning Scala http://www.apress.com/book/view/1430219890
> Follow me: http://twitter.com/dpp
> Surf the harmonics
>
> --
> You received this message because you are subscribed to the Google Groups
> "Lift" group.
> To post to this group, send email to lift...@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.
>
>
-- 

You received this message because you are subscribed to the Google Groups "Lift" group.

To post to this group, send email to lift...@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.



Re: [Lift] Re: Memory behavior in Jetty with CometActor - 25MB of scala.xml.Text!

2010-01-20 Thread David Pollak
On Wed, Jan 20, 2010 at 9:28 PM, mark chance  wrote:

> I did post the project to drop.io - http://drop.io/memtest.
>
>
This drop is empty


>
> On Wed, Jan 20, 2010 at 10:06 PM, David Pollak <
> feeder.of.the.be...@gmail.com> wrote:
>
>>
>>
>> On Wed, Jan 20, 2010 at 9:03 PM, Java1Guy  wrote:
>>
>>> Ok - i've left my Jetty server up and running with one page open...
>>> The good news is Jetty hasn't crapped out.  It had 500MB of heap space
>>> used before a forced GC brought it down to 250MB.  The heap dump is
>>> interesting: http://twitpic.com/z0xnx almost 25MB of Text objects used
>>> by the almost 80K displayList partial function objects in my
>>> CometActor.
>>> To me that sounds like a lot of functions!
>>>
>>
>> Without your actual code, there's little we can do.
>>
>>
>>>
>>> Thanks in advance if you can have a look.
>>> Mark
>>>
>>> On Jan 18, 6:36 pm, Java1Guy  wrote:
>>> > Thanks for the response.  I have created a small project here:
>>> http://drop.io/memtest(btw  - the zip file
>>> is so big because there are
>>> > 3 heap dumps - before that it was only 21k!) which i believe does
>>> > exhibit the problem.  One comet actor page which gets updated every 20
>>> > sec. via tick.
>>> > So to run this, I've built the war file and installed it into a Jetty
>>> > 6.1.22 installation.  The file etc/memtest.xml goes in the jetty/
>>> > contexts dir.
>>> > I open my Firefox browser to the only page it shows and just leave it
>>> > open for about four hours now - so the session should still be active,
>>> > FWIW.
>>> > An additional thing I'm noticing now is that despite not much else
>>> > happening in the app, the comet responses are taking just under 20
>>> > sec.  That seems huge.
>>> > There are two things I notice in the heap dumps: one is the large
>>> > number of xml.Text objects and their Strings, but second the 5800
>>> > anonFuncs from the DatastreamActor which are being held by the S
>>> > $ProxtFuncHolder.  I guess I could look up the API on that to see if
>>> > there's a way to controls itsbehavior...  but there it is.
>>> > Thanks to anyone who takes a look at this, Mark
>>> >
>>> > The stdout:
>>> > ConsoleActor.lowPriority.Tick...>>>DataStreamActor.lowPriority:
>>> HostAddMsg local
>>> >
>>> > ds count 4
>>> > DataStreamActor.refreshStreams: now we know about stream count: 8
>>> > INFO - Service request (GET) /memtest/comet_request/2021921075/
>>> > p6s263zexmzz took 19513 Milliseconds
>>> > ConsoleActor.lowPriority.Tick...>>>DataStreamActor.lowPriority:
>>> HostAddMsg local
>>> >
>>> > ds count 4
>>> > DataStreamActor.refreshStreams: now we know about stream count: 8
>>> > INFO - Service request (GET) /memtest/comet_request/11287578067/
>>> > p6s263zexmzz took 19879 Milliseconds
>>> > ConsoleActor.lowPriority.Tick...>>>DataStreamActor.lowPriority:
>>> HostAddMsg local
>>> >
>>> > ds count 4
>>> > DataStreamActor.refreshStreams: now we know about stream count: 8
>>> > INFO - Service request (GET) /memtest/comet_request/26532853932/
>>> > p6s263zexmzz took 19868 Milliseconds
>>> > ConsoleActor.lowPriority.Tick...>>>DataStreamActor.lowPriority:
>>> HostAddMsg local
>>> >
>>> > ds count 4
>>> > DataStreamActor.refreshStreams: now we know about stream count: 8
>>> > INFO - Service request (GET) /memtest/comet_request/11619469749/
>>> > p6s263zexmzz took 19918 Milliseconds
>>> >
>>> > On Jan 16, 2:32 am, Marius  wrote:
>>> >
>>> > > Lift GC is likely keeping your functions to not expire but this is
>>> > > meant to be that way ... but this doesn't explain the large amount of
>>> > > functions. Can you post a minimalistic example of your app where you
>>> > > can reproduce thisbehavior?
>>> >
>>> > > Br's,
>>> > > Marius
>>>
>>> --
>>> You received this message because you are subscribed to the Google Groups
>>> "Lift" group.
>>> To post to this group, send email to lift...@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, the simply functional web framework http://liftweb.net
>> Beginning Scala http://www.apress.com/book/view/1430219890
>> Follow me: http://twitter.com/dpp
>> Surf the harmonics
>>
>> --
>> You received this message because you are subscribed to the Google Groups
>> "Lift" group.
>> To post to this group, send email to lift...@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.
>>
>>
>
> --
> You received this message because you are subscribed to the Google Groups
> "Lift" group.
> To post to this group, send email to lift...@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/li

[Lift] Re: Memory behavior in Jetty with CometActor - 25MB of scala.xml.Text!

2010-01-20 Thread Java1Guy
Well, no idea where it went :(
I'm uploading it again, but this time, I'll keep the heapdump files
separate since they're so big.
Waiting on drop.io now...
Thanks David!

On Jan 20, 10:40 pm, David Pollak 
wrote:
> On Wed, Jan 20, 2010 at 9:28 PM, mark chance  wrote:
> > I did post the project to drop.io -http://drop.io/memtest.
>
> This drop is empty
>
>
>
>
>
> > On Wed, Jan 20, 2010 at 10:06 PM, David Pollak <
> > feeder.of.the.be...@gmail.com> wrote:
>
> >> On Wed, Jan 20, 2010 at 9:03 PM, Java1Guy  wrote:
>
> >>> Ok - i've left my Jetty server up and running with one page open...
> >>> The good news is Jetty hasn't crapped out.  It had 500MB of heap space
> >>> used before a forced GC brought it down to 250MB.  The heap dump is
> >>> interesting:http://twitpic.com/z0xnxalmost 25MB of Text objects used
> >>> by the almost 80K displayList partial function objects in my
> >>> CometActor.
> >>> To me that sounds like a lot of functions!
>
> >> Without your actual code, there's little we can do.
>
> >>> Thanks in advance if you can have a look.
> >>> Mark
>
> >>> On Jan 18, 6:36 pm, Java1Guy  wrote:
> >>> > Thanks for the response.  I have created a small project here:
> >>>http://drop.io/memtest(btw - the zip file
> >>> is so big because there are
> >>> > 3 heap dumps - before that it was only 21k!) which i believe does
> >>> > exhibit the problem.  One comet actor page which gets updated every 20
> >>> > sec. via tick.
> >>> > So to run this, I've built the war file and installed it into a Jetty
> >>> > 6.1.22 installation.  The file etc/memtest.xml goes in the jetty/
> >>> > contexts dir.
> >>> > I open my Firefox browser to the only page it shows and just leave it
> >>> > open for about four hours now - so the session should still be active,
> >>> > FWIW.
> >>> > An additional thing I'm noticing now is that despite not much else
> >>> > happening in the app, the comet responses are taking just under 20
> >>> > sec.  That seems huge.
> >>> > There are two things I notice in the heap dumps: one is the large
> >>> > number of xml.Text objects and their Strings, but second the 5800
> >>> > anonFuncs from the DatastreamActor which are being held by the S
> >>> > $ProxtFuncHolder.  I guess I could look up the API on that to see if
> >>> > there's a way to controls itsbehavior...  but there it is.
> >>> > Thanks to anyone who takes a look at this, Mark
>
> >>> > The stdout:
> >>> > ConsoleActor.lowPriority.Tick...>>>DataStreamActor.lowPriority:
> >>> HostAddMsg local
>
> >>> > ds count 4
> >>> > DataStreamActor.refreshStreams: now we know about stream count: 8
> >>> > INFO - Service request (GET) /memtest/comet_request/2021921075/
> >>> > p6s263zexmzz took 19513 Milliseconds
> >>> > ConsoleActor.lowPriority.Tick...>>>DataStreamActor.lowPriority:
> >>> HostAddMsg local
>
> >>> > ds count 4
> >>> > DataStreamActor.refreshStreams: now we know about stream count: 8
> >>> > INFO - Service request (GET) /memtest/comet_request/11287578067/
> >>> > p6s263zexmzz took 19879 Milliseconds
> >>> > ConsoleActor.lowPriority.Tick...>>>DataStreamActor.lowPriority:
> >>> HostAddMsg local
>
> >>> > ds count 4
> >>> > DataStreamActor.refreshStreams: now we know about stream count: 8
> >>> > INFO - Service request (GET) /memtest/comet_request/26532853932/
> >>> > p6s263zexmzz took 19868 Milliseconds
> >>> > ConsoleActor.lowPriority.Tick...>>>DataStreamActor.lowPriority:
> >>> HostAddMsg local
>
> >>> > ds count 4
> >>> > DataStreamActor.refreshStreams: now we know about stream count: 8
> >>> > INFO - Service request (GET) /memtest/comet_request/11619469749/
> >>> > p6s263zexmzz took 19918 Milliseconds
>
> >>> > On Jan 16, 2:32 am, Marius  wrote:
>
> >>> > > Lift GC is likely keeping your functions to not expire but this is
> >>> > > meant to be that way ... but this doesn't explain the large amount of
> >>> > > functions. Can you post a minimalistic example of your app where you
> >>> > > can reproduce thisbehavior?
>
> >>> > > Br's,
> >>> > > Marius
>
> >>> --
> >>> You received this message because you are subscribed to the Google Groups
> >>> "Lift" group.
> >>> To post to this group, send email to lift...@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, the simply functional web frameworkhttp://liftweb.net
> >> Beginning Scalahttp://www.apress.com/book/view/1430219890
> >> Follow me:http://twitter.com/dpp
> >> Surf the harmonics
>
> >> --
> >> You received this message because you are subscribed to the Google Groups
> >> "Lift" group.
> >> To post to this group, send email to lift...@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.
>
> > --
> > You rece

[Lift] Re: Embedding comet actor in ModalDialog

2010-01-20 Thread ced
@David: Thanks. Now the approach is clear.

> Is that your use-case ?  so see async intems coming from server
> only when the dialog is opened?

@Marius: Yes, it is. I'd like to display a progressbar in the dialog.
It seemed to me quite natural to deliver it (the comet component)
along with the dialog, but as I now know that this is not possible,
it's really no problem to have it prepared in the page and bring it to
life when needed, i.e. make it visible. Another solution would be to
redirect to a whole new page with the progressbar on it, but I wanted
to look it more like a desktop application.

Thanks,
Chris



On 20 Jan., 23:22, Marius  wrote:
> I really don't see the need for such use-case. I mean if one wants to
> see async stuff in a dialog only when the dialog is opened this could
> be easily done via Ajax requests that will "activate"/"deactivate"
> async messages to client by sending from the ajax functions messages
> to the comet actor.
>
> Is that your use-case ?  so see async intems coming from server
> only when the dialog is opened?
>
> Br's,
> Marius
>
> On Jan 20, 11:00 pm, ced  wrote:
>
>
>
> > Hi all,
>
> > I'm trying to create some sort of progress notification for a long
> > lasting request. The idea is to answer an ajax request with a
> > JqJsCmds.ModalDialog which embeds a comet actor like so:
>
> > ajaxButton("Start process", () => ModalDialog(Progress > div>))
>
> > Unfortunately this doesn't work, the dialog doesn't get displayed.
> > Embedding a "normal" snippet works just fine though.
>
> > The code returned in the response to the button click seems ok also.
>
> > As a workaround I place the comet actor in the page enclosed in a
> > hidden .
> > Then I return the ModalDialog(Progress) along with some JS-code that takes the "progress-
> > actor" div, moves it into the "actor-goes-here" div and makes it
> > visible.
>
> > Does anyone tried something similar? Any help is appreciated...
>
> > Chris
-- 
You received this message because you are subscribed to the Google Groups 
"Lift" group.
To post to this group, send email to lift...@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.