[Lift] Re: garbage collection

2009-05-08 Thread Oliver Lambert
On Fri, May 8, 2009 at 6:51 AM, marius d. marius.dan...@gmail.com wrote:


 Personally I'd be very reluctant exposing that to applications as this
 is Lift implementation specific and exposing an API tight to that
 leads to unnecessary coupling.


While I don't like unnecessary coupling, either, I do like simple profiling.



 But why do you really need this? ... just for statistical
 purposes? ... I'm not sure about the relevance of such number.


I want to get an idea about the growth of functions stored in the session.
I
have a idea that might cut the number of functions, under certain
circumstances.


 Br's,
 Marius

 On May 7, 10:22 pm, Oliver Lambert olambo...@gmail.com wrote:
  Any chance of exposing a getter on messageCallback that would return some
  statistics (the number of functions being stored would be a good starting
  point)?
 
  On Thu, May 7, 2009 at 11:21 PM, marius d. marius.dan...@gmail.com
 wrote:
 
   Just FYI ...
 
   Things in this area are may change a bit once JQuery fixes the bug
   related with namespaces.This was the main reason why we had to deviate
   from Dave's original idea of using lift:gc attributes.
 
   Br's,
   Marius
 
   On May 7, 3:47 pm, Oliver Lambert olambo...@gmail.com wrote:
Ah, you mean messageCallback - The joys of private variables.
thanks again
Ol
 
On Thu, May 7, 2009 at 9:55 PM, marius d. marius.dan...@gmail.com
   wrote:
 
 Please see LiftSession.
 
 On May 7, 1:41 pm, Oliver Lambert olambo...@gmail.com wrote:
  Thanks for this. I would like to look at the code that actually
 holds
   the
  storage container and profile it. Any pointers on which class to
 look
   at
 s a
  starting point?
  Ol
 
  On Thu, May 7, 2009 at 7:17 PM, marius d. 
 marius.dan...@gmail.com
 wrote:
 
   In short the current Lift GC is:
 
   1. Each page has an ID
   2. Each mapped function is associated with the page ID
   3. There are periodical Ajax request sent from the page that
 are
   refreshing the timestamps on the mapped functions
   4. Mapped functions that exceeded the expiration time are de-
   referenced hence become eligible for garbage collector.
 
   Br's,
   Marius
 
   On May 7, 10:15 am, Oliver Lambert olambo...@gmail.com
 wrote:
I'm trying to get an understanding how garbage collection is
 implemented
   in
Lift.
Any pointers on what scala classes do the actual work?
 
While I'm at it, S.functionMap appears to only return
 functions
   that
 were
recently bound. Does S._functionMap, contain the functions
   being
   garbage
collected?
 
cheers
Oliver
 


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



[Lift] Re: How about a lift + sling marriage

2009-05-08 Thread Timothy Perrett

Interesting view point... Lift has very good support for managing HTTP
requests, so, by default - REST. Im currently writing a series of
posts about various components in Lift and dispatching / rest was the
next one on my list. Probably get around to writing it next week.

Cheers, Tim

On May 7, 9:29 pm, glenn gl...@exmbly.com wrote:
 You are probably correct about Sling's overall usefullness. I was
 thinking in terms
 of Slings native restful capabilities more so than Jackrabbit, without
 fully realizing that lift can do REST as well.
 Is there documentation, or a sample, that can show me how to use it?
 Here, the lift book is only
 partially helpful. There is an example of JSON form handling, but
 that's about it. Don't I need a REST server
 that can handle the GET, POST, DELETE, etc. commands and work with the
 the mapper objects?

 Glenn Silverman

 On May 7, 12:56 pm, David Pollak feeder.of.the.be...@gmail.com
 wrote:



  On Thu, May 7, 2009 at 12:23 PM, glenn gl...@exmbly.com wrote:

   Are there any thoughts about integrating lift with Apache Sling? There
   is suppose to be a scala bundle that can be used in Sling, but I
   haven't seen it. Does anyone know where to get it, or if it even
   exists.

  I took a look at Sling and see very little value in integration.  Lift has
  the best REST handling out there.  Multiple languages is a lose rather than
  a win.  And anything that advertises itself as fun has an instance yellow
  flag from me.

   There would be a couple of reasons for wanting an integration - using
   the Jackrabbit repository for all your lift-enabled html

  Jackrabbit might be an interesting backing store for Lift and/or Lift
  content.  It's pretty trivial to do this now with Lift.  It's about 100
  lines of code to use an external backing store for Lift content.

   and as an
   alternative to a relational db for model persistence. In addition,
   think of the mashups and gadgetization that would be possible with
   lift OSGi bundles.

  And we have an ongoing OSGi project within Lift, so an external one is not
  necessary.

   Obviously, a full integration would require changes to resource
   management, but nothing that seems insurmountable.

  If there was a compelling use case, I'd consider it more, but reviewing
  Sling, I can't seem to find one.  I'm open to hearing thoughts on actual use
  cases.

  Sorry.

  David

   Glenn Silverman

  --
  Lift, the simply functional web frameworkhttp://liftweb.net
  Beginning Scalahttp://www.apress.com/book/view/1430219890
  Follow me:http://twitter.com/dpp
  Git some:http://github.com/dpp
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
Lift group.
To post to this group, send email to liftweb@googlegroups.com
To unsubscribe from this group, send email to 
liftweb+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/liftweb?hl=en
-~--~~~~--~~--~--~---



[Lift] Re: garbage collection

2009-05-08 Thread marius d.

Can't you use a regular Java profiler to determine this?

Perhaps would be beneficial to start thinking of a generic enough
stats module that would reveal information like that to the lift
applications. I guess we need to see what the general consensus is and
take it from there.

Br's,
Marius

On May 8, 10:49 am, Oliver Lambert olambo...@gmail.com wrote:
 On Fri, May 8, 2009 at 6:51 AM, marius d. marius.dan...@gmail.com wrote:

  Personally I'd be very reluctant exposing that to applications as this
  is Lift implementation specific and exposing an API tight to that
  leads to unnecessary coupling.

 While I don't like unnecessary coupling, either, I do like simple profiling.



  But why do you really need this? ... just for statistical
  purposes? ... I'm not sure about the relevance of such number.

 I want to get an idea about the growth of functions stored in the session.
 I
 have a idea that might cut the number of functions, under certain
 circumstances.

  Br's,
  Marius

  On May 7, 10:22 pm, Oliver Lambert olambo...@gmail.com wrote:
   Any chance of exposing a getter on messageCallback that would return some
   statistics (the number of functions being stored would be a good starting
   point)?

   On Thu, May 7, 2009 at 11:21 PM, marius d. marius.dan...@gmail.com
  wrote:

Just FYI ...

Things in this area are may change a bit once JQuery fixes the bug
related with namespaces.This was the main reason why we had to deviate
from Dave's original idea of using lift:gc attributes.

Br's,
Marius

On May 7, 3:47 pm, Oliver Lambert olambo...@gmail.com wrote:
 Ah, you mean messageCallback - The joys of private variables.
 thanks again
 Ol

 On Thu, May 7, 2009 at 9:55 PM, marius d. marius.dan...@gmail.com
wrote:

  Please see LiftSession.

  On May 7, 1:41 pm, Oliver Lambert olambo...@gmail.com wrote:
   Thanks for this. I would like to look at the code that actually
  holds
the
   storage container and profile it. Any pointers on which class to
  look
at
  s a
   starting point?
   Ol

   On Thu, May 7, 2009 at 7:17 PM, marius d. 
  marius.dan...@gmail.com
  wrote:

In short the current Lift GC is:

1. Each page has an ID
2. Each mapped function is associated with the page ID
3. There are periodical Ajax request sent from the page that
  are
refreshing the timestamps on the mapped functions
4. Mapped functions that exceeded the expiration time are de-
referenced hence become eligible for garbage collector.

Br's,
Marius

On May 7, 10:15 am, Oliver Lambert olambo...@gmail.com
  wrote:
 I'm trying to get an understanding how garbage collection is
  implemented
in
 Lift.
 Any pointers on what scala classes do the actual work?

 While I'm at it, S.functionMap appears to only return
  functions
that
  were
 recently bound. Does S._functionMap, contain the functions
being
garbage
 collected?

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



[Lift] Re: How to log exceptions?

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

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

Something like this?

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

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

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

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

 sailormoo...@gmail.com wrote:

  Hi :

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

   Thanks

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

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



[Lift] Re: Mapping null field ?

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

Thanks...

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

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

Thanks

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

 sailormoo...@gmail.com wrote:

  Hello:

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

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

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

 Thanks,

 David



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

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

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



[Lift] Re: Duplicate Querying??

2009-05-08 Thread David Pollak
2009/5/8 sailormoo...@gmail.com sailormoo...@gmail.com


 Thanks. Any idea to remove the redundant logs?


They are not redundant.  They each represent a JDBC operation.




 On 5月7日, 上午1時26分, David Pollak feeder.of.the.be...@gmail.com wrote:
  That's because there are two round-trips to the RDBMS.  The first one is
 the
  preparation of the PreparedStatement and the second one is the execution
 of
  the bound prepared statement.  There's only one query that's executed,
 but
  there are two calls into the JDBC infrastructure.
 
  On Wed, May 6, 2009 at 8:41 AM, sailormoo...@gmail.com 
 
 
 
 
 
  sailormoo...@gmail.com wrote:
 
   HI :
 
I turned on the SQL in Boot.scala by
   DB.addLogFunc((query, len) = Log.info(The query: +query+ took +len
   + milliseconds))
 
However I found for each query, it generates two actual querys, at
   least in log it shows two.
   The first one seems to be real, but the second one is always with some
   ** NOT SPECIFIED **
 
   for example
 
   [INFO] Starting scanner at interval of 5 seconds.
   23:24:11.501 [31720...@qtp-4321831-0] INFO  lift - The query:
   com.mysql.jdbc.JDB
   c4preparedstatem...@3d12a6: SELECT  DISTINCT room.id, room.room_name,
   room.room_
   comment, room.day_minutes, room.night_minutes, room.max_user,
   room.room_flags, r
   oom.status, room.victory, room.created, room.updated FROM room   WHERE
   id = 1  t
   ook 16 milliseconds
   23:24:11.501 [31720...@qtp-4321831-0] INFO  lift - The query:
   com.mysql.jdbc.JDB
   c4preparedstatem...@3d12a6: SELECT  DISTINCT room.id, room.room_name,
   room.room_
   comment, room.day_minutes, room.night_minutes, room.max_user,
   room.room_flags, r
   oom.status, room.victory, room.created, room.updated FROM room   WHERE
   id = ** N
   OT SPECIFIED **  took 31 milliseconds
 
   The second query is exactly the same just the id becomes ** NOT
   SPECIFIED ** ?
   I wonder why this would happen.
 
   Thanks for the help.
 
   Note: All other DB queries seem to be duplicated in the same way too.
 
  --
  Lift, the simply functional web frameworkhttp://liftweb.net
  Beginning Scalahttp://www.apress.com/book/view/1430219890
  Follow me:http://twitter.com/dpp
  Git some:http://github.com/dpp- 隱藏被引用文字 -
 
  - 顯示被引用文字 -

 



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

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



[Lift] Re: Form values after submit

2009-05-08 Thread David Pollak
On Fri, May 8, 2009 at 12:33 AM, wapgui torsten.schm...@wapgui.com wrote:


 With your hint I made it, except fileUpload fields. You can't set
 default values there, or am I wrong?


No... file uploads take no default values in HTML... if I'm wrong about
that, we can update Lift... just point me to the W3C spec.




 Thanks
 Torsten

 On May 7, 7:12 pm, David Pollak feeder.of.the.be...@gmail.com wrote:
  On Thu, May 7, 2009 at 5:40 AM, wapgui torsten.schm...@wapgui.com
 wrote:
 
   Hi all,
 
   I have a normal form defined via bind.
 
   object smlink extends RequestVar(Full())
val widget = new Widget()
 
def show(xhtml: NodeSeq): NodeSeq = {
  var smallLink = 
  var dlText = 
 
  if (smlink.isEmpty || smlink.open_!.length == 0) {
Log.debug(Starting new widget generation)
  } else if (!smlink.open_!.startsWith(Error)) {
Log.debug(Widget generation successfull)
smallLink = smlink.open_!
dlText = Download here
  } else {
Log.debug(Widget generation unsuccessfull)
dlText = smlink.open_!
  }
 
  bind(widget, xhtml,
title - text(widget.title, widget.title = _) % (size -
   10) % (id - title),
url - text(widget.url, widget.url = _) % (size - 56) %
   (id - url),
submit - submit(Generate, () = {
  smlink(Full(buildWidgetPackage(burl,widget)))
}),
link - a href={smallLink}{dlText}/a
  )
}
 
   After submit the inputs are tested and errors return a string with the
   specific error message. The message is shown as link, but all the
   inputs are gone after reloading the page to show the error.
   Is there a way to get the widget object after submit to set the values
   in the form to the submitted values? Maybe it is in smlink or should I
   use a tuple to return the widget object from the buildWidgetPackage
   function.
 
  Try using a StatefulSnippet (make your snippet a subclass of
  StatefulSnippet).  That will use the same snippet across form
 submissions.
 
  If you need a more detailed explanation, please let me know and I'll work
  one up for you.
 
 
 
   Thanks,
   Torsten
 
  --
  Lift, the simply functional web frameworkhttp://liftweb.net
  Beginning Scalahttp://www.apress.com/book/view/1430219890
  Follow me:http://twitter.com/dpp
  Git some:http://github.com/dpp

 



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

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



[Lift] Re: How to log exceptions?

2009-05-08 Thread Timothy Perrett

It would be something more like this:

LiftRules.exceptionHandler.prepend {
  case (production, Req(path, , GetRequest), SomeException) = {
Log.error(MELT DOWN!!)
RedirectResponse(/)
  }
}

The signature of the exception handler type is:

type ExceptionHandlerPF = PartialFunction[(Props.RunModes.Value, Req,
Throwable), LiftResponse]

You can see it here:

http://scala-tools.org/mvnsites-snapshots/liftweb/lift-webkit/scaladocs/net/liftweb/http/LiftRules.scala.html

Does that help?

Cheers, Tim


On May 8, 7:10 am, sailormoo...@gmail.com sailormoo...@gmail.com
wrote:
 Thanks, but I cannot find the type of ExceptionHandlerPF in the Lift
 doc.

 Something like this?

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

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



  Exceptions are handled in LiftRules.exceptionHandler

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

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

  sailormoo...@gmail.com wrote:

   Hi :

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

Thanks

  --
  Lift, the simply functional web frameworkhttp://liftweb.net
  Beginning Scalahttp://www.apress.com/book/view/1430219890
  Follow me:http://twitter.com/dpp
  Git some:http://github.com/dpp
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
Lift group.
To post to this group, send email to liftweb@googlegroups.com
To unsubscribe from this group, send email to 
liftweb+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/liftweb?hl=en
-~--~~~~--~~--~--~---



[Lift] Re: How to log exceptions?

2009-05-08 Thread Timothy Perrett

Sorry, scratch that - made a slight error writing that code from
memory! It should read:

LiftRules.exceptionHandler.prepend {
  case (Props.RunModes.Production, Req(path, , GetRequest),
exception) = {
Log.error(MELT DOWN!!)
RedirectResponse(/)
  }
}

Cheers, Tim

On May 8, 1:39 pm, Timothy Perrett timo...@getintheloop.eu wrote:
 It would be something more like this:

 LiftRules.exceptionHandler.prepend {
   case (production, Req(path, , GetRequest), SomeException) = {
 Log.error(MELT DOWN!!)
 RedirectResponse(/)
   }

 }

 The signature of the exception handler type is:

 type ExceptionHandlerPF = PartialFunction[(Props.RunModes.Value, Req,
 Throwable), LiftResponse]

 You can see it here:

 http://scala-tools.org/mvnsites-snapshots/liftweb/lift-webkit/scalado...

 Does that help?

 Cheers, Tim

 On May 8, 7:10 am, sailormoo...@gmail.com sailormoo...@gmail.com
 wrote:



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

  Something like this?

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

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

   Exceptions are handled in LiftRules.exceptionHandler

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

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

   sailormoo...@gmail.com wrote:

Hi :

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

 Thanks

   --
   Lift, the simply functional web frameworkhttp://liftweb.net
   Beginning Scalahttp://www.apress.com/book/view/1430219890
   Follow me:http://twitter.com/dpp
   Git some:http://github.com/dpp
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
Lift group.
To post to this group, send email to liftweb@googlegroups.com
To unsubscribe from this group, send email to 
liftweb+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/liftweb?hl=en
-~--~~~~--~~--~--~---



[Lift] Re: garbage collection

2009-05-08 Thread David Pollak
On Fri, May 8, 2009 at 12:49 AM, Oliver Lambert olambo...@gmail.com wrote:



 On Fri, May 8, 2009 at 6:51 AM, marius d. marius.dan...@gmail.com wrote:


 Personally I'd be very reluctant exposing that to applications as this
 is Lift implementation specific and exposing an API tight to that
 leads to unnecessary coupling.


 While I don't like unnecessary coupling, either, I do like simple
 profiling.


We have a Map of names and functions and the functions can be associated
with particular pages and they have a last seen time.  What kind of
information do you want?  The issue is that the page association part of
the data structure will likely change.  The storage mechanism will likely
change.  Do you want a call (which will be somewhat expensive) to get a list
of functions, their opaque ID, and their expected expiration date?






 But why do you really need this? ... just for statistical
 purposes? ... I'm not sure about the relevance of such number.


 I want to get an idea about the growth of functions stored in the session.
 I
 have a idea that might cut the number of functions, under certain
 circumstances.


 Br's,
 Marius

 On May 7, 10:22 pm, Oliver Lambert olambo...@gmail.com wrote:
  Any chance of exposing a getter on messageCallback that would return
 some
  statistics (the number of functions being stored would be a good
 starting
  point)?
 
  On Thu, May 7, 2009 at 11:21 PM, marius d. marius.dan...@gmail.com
 wrote:
 
   Just FYI ...
 
   Things in this area are may change a bit once JQuery fixes the bug
   related with namespaces.This was the main reason why we had to deviate
   from Dave's original idea of using lift:gc attributes.
 
   Br's,
   Marius
 
   On May 7, 3:47 pm, Oliver Lambert olambo...@gmail.com wrote:
Ah, you mean messageCallback - The joys of private variables.
thanks again
Ol
 
On Thu, May 7, 2009 at 9:55 PM, marius d. marius.dan...@gmail.com
   wrote:
 
 Please see LiftSession.
 
 On May 7, 1:41 pm, Oliver Lambert olambo...@gmail.com wrote:
  Thanks for this. I would like to look at the code that actually
 holds
   the
  storage container and profile it. Any pointers on which class to
 look
   at
 s a
  starting point?
  Ol
 
  On Thu, May 7, 2009 at 7:17 PM, marius d. 
 marius.dan...@gmail.com
 wrote:
 
   In short the current Lift GC is:
 
   1. Each page has an ID
   2. Each mapped function is associated with the page ID
   3. There are periodical Ajax request sent from the page that
 are
   refreshing the timestamps on the mapped functions
   4. Mapped functions that exceeded the expiration time are de-
   referenced hence become eligible for garbage collector.
 
   Br's,
   Marius
 
   On May 7, 10:15 am, Oliver Lambert olambo...@gmail.com
 wrote:
I'm trying to get an understanding how garbage collection is
 implemented
   in
Lift.
Any pointers on what scala classes do the actual work?
 
While I'm at it, S.functionMap appears to only return
 functions
   that
 were
recently bound. Does S._functionMap, contain the functions
   being
   garbage
collected?
 
cheers
Oliver



 



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

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



[Lift] Tail merge?

2009-05-08 Thread KWright

It's becoming an established best practice that scripts should be put
at the END of a page, where possible, in order to speed up download
times

Good article here: http://developer.yahoo.com/performance/rules.html


It would be nice if Lift could help encourage and support this by
allowing a tail (or Lift:tail?) element that could be merged in
the same fashion as the head element, perhaps also removing
duplicates, etc.

This element would then disappear and expose only its content when the
page is ultimately sent to the browser.

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



[Lift] Re: Tail merge?

2009-05-08 Thread marius d.

A lift:tail built in snippet might me a good addition. I could
probably allocate some time to noodle on it.

Br's,
Marius

On May 8, 5:05 pm, KWright kev.lee.wri...@googlemail.com wrote:
 It's becoming an established best practice that scripts should be put
 at the END of a page, where possible, in order to speed up download
 times

 Good article here:http://developer.yahoo.com/performance/rules.html

 It would be nice if Lift could help encourage and support this by
 allowing a tail (or Lift:tail?) element that could be merged in
 the same fashion as the head element, perhaps also removing
 duplicates, etc.

 This element would then disappear and expose only its content when the
 page is ultimately sent to the browser.
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
Lift group.
To post to this group, send email to liftweb@googlegroups.com
To unsubscribe from this group, send email to 
liftweb+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/liftweb?hl=en
-~--~~~~--~~--~--~---



[Lift] Re: Tail merge?

2009-05-08 Thread Charles F. Munat

I like it.

Chas.

marius d. wrote:
 A lift:tail built in snippet might me a good addition. I could
 probably allocate some time to noodle on it.
 
 Br's,
 Marius
 
 On May 8, 5:05 pm, KWright kev.lee.wri...@googlemail.com wrote:
 It's becoming an established best practice that scripts should be put
 at the END of a page, where possible, in order to speed up download
 times

 Good article here:http://developer.yahoo.com/performance/rules.html

 It would be nice if Lift could help encourage and support this by
 allowing a tail (or Lift:tail?) element that could be merged in
 the same fashion as the head element, perhaps also removing
 duplicates, etc.

 This element would then disappear and expose only its content when the
 page is ultimately sent to the browser.
  

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



[Lift] Re: Tail merge?

2009-05-08 Thread Timothy Perrett


Sounds like this could be a neat addition. Looking forward to see what you
come up with :-)

Cheers, Tim

On 08/05/2009 20:19, marius d. marius.dan...@gmail.com wrote:

 
 A lift:tail built in snippet might me a good addition. I could
 probably allocate some time to noodle on it.
 
 Br's,
 Marius
 
 On May 8, 5:05 pm, KWright kev.lee.wri...@googlemail.com wrote:
 It's becoming an established best practice that scripts should be put
 at the END of a page, where possible, in order to speed up download
 times
 
 Good article here:http://developer.yahoo.com/performance/rules.html
 
 It would be nice if Lift could help encourage and support this by
 allowing a tail (or Lift:tail?) element that could be merged in
 the same fashion as the head element, perhaps also removing
 duplicates, etc.
 
 This element would then disappear and expose only its content when the
 page is ultimately sent to the browser.
  
 



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



[Lift] Re: How to log exceptions?

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

Thanks for the help.

What I need might like this

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

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



[Lift] Re: How to log exceptions?

2009-05-08 Thread Timothy Perrett


 Thanks for the help.

Your most welcome.

 What I need might like this
 
 LiftRules.exceptionHandler.prepend {
   case (_, _, exception) = {
 Log.error(exception.getStackTrace.toString)
 RedirectResponse(/)
   }
 }

If that works for your needs, go for it. The only suggestion I might have is
that you might perhaps want to display something static to say about the
error (if for instance, your error occurred on the home page you'd have an
infinite loop)



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



[Lift] Locale/Language in URL?

2009-05-08 Thread Franz Bettag

Heyho,

anyone has an idea how one might accomplish having the locale/language
of the content in the url? since most search engines can't work with
cookies and therefore change the language correctly, i wanted to go
for URLs like /de/mystuff or /en/mystuff. I guess everyone gets the
point.

Any ideas how to do that without compromising the whole Sitemap
feature?

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



[Lift] starship 'paratroper's

2009-05-08 Thread Meredith Gregory
Lifted,

Since there's another SOS conference coming
up%20http://homepages.inf.ed.ac.uk/bklin/SOS2009/,
i've decided to formally write up this really neat idea for reduction
http://biosimilarity.blogspot.com/2009/04/law-of-attraction.htmlthat i
discovered. To support the paper (i.e. provide an executable version of the
mathematical model), i'm building out a lift project, cut from the same
cloth as the rlambda project i did. Instead of a two-level type version of
lambda, it's a two-level type version of Milner's π-calculus. This enables
one to do the very same trick that Martin challenged us to with lambda, but
this time with π-calculus.

My plan is to flesh this one out with all the features i've been mumbling
about:

   - concrete syntax and multi-target parser
   - two-level type-based abstract syntax
   - polymorphic reduction strategy support multiple different variable and
   environment representations
  - The final form of the reduction strategy will also include a version
  of Oleg's LogicT
  - persistent code model (XSD schema + BDBXML XQuery db)
   - query langage for the code model

This seems like a reasonably rich example on which to base a lift archetype,
that i would like to dub lift-DSL. As i mentioned before, the primary input
to the archetype is a brief specification of a DSL. The output is a
web-based REPL++. i believe such an archetype encapsulates the salient
features of Microsoft's Oslo and extends them, but built out of parts you
can just find lying around on the web. (Oops! Commoditized again! ;-)

You can find the current project here http://code.google.com/p/paratrope/.
The name comes from banging the two memes

para - Greek origin meaning beside, near, past, beyond, or
 contrary

 A literary *trope* is a common pattern, 
 themehttp://en.wikipedia.org/wiki/Theme_%28literature%29,
 motif http://en.wikipedia.org/wiki/Motif_%28narrative%29 in literature,
 or a figure of speech http://en.wikipedia.org/wiki/Figure_of_speech in
 which words are used in a sense different from their literal 
 meaning.[*citation
 needed http://en.wikipedia.org/wiki/Wikipedia:Citation_needed*] The term
 *trope* derives from Greek http://en.wikipedia.org/wiki/Greek_language *
 τροπή http://en.wiktionary.org/wiki/%CF%84%CF%81%CE%BF%CF%80%CE%AE*turn, 
 turning
 [1] http://en.wikipedia.org/wiki/Trope_%28literature%29#cite_note-0,
 from 
 *τρόποςhttp://en.wiktionary.org/wiki/%CF%84%CF%81%CF%8C%CF%80%CE%BF%CF%82
 * - *tropos* turn, direction, 
 way[2]http://en.wikipedia.org/wiki/Trope_%28literature%29#cite_note-1related
  to the root of
 *τρέπω http://en.wiktionary.org/wiki/%CF%84%CF%81%CE%AD%CF%80%CF%89* - *
 trepō*, to turn, to direct, to alter, to 
 change[3]http://en.wikipedia.org/wiki/Trope_%28literature%29#cite_note-2
 .


around in a mind whose formative years were spent dangerously overexposed to
Robert Heinlein.

To do this i need the following bits and bobs

   - Help writing a mvn plugin for BNFC
  - i started writing one, but got depressed about the complexity and
  never returned to the task
  - if anyone has a working mvn plugin written entirely in Scala, i
  could probably write mine from that -- i've just gotten to the
point where
  if i want to get things done on the scale i'm trying to work i
really need
  to limit the amount of Java i have to write
  - A dtd - xsd converter (and an xsd - SQL schema converter would be
   really, really nice)
   - A nice-to-have would be a LINQ-like interface on top of the BDBXML/Java
   interface, but i can make do without it

i could also really use a code reviewer or two.

Best wishes,

--greg

-- 
L.G. Meredith
Managing Partner
Biosimilarity LLC
1219 NW 83rd St
Seattle, WA 98117

+1 206.650.3740

http://biosimilarity.blogspot.com

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