Re: [Lift] Re: serving images from a directory

2010-02-27 Thread Jack Widman
Thanks Marius.

On Sat, Feb 27, 2010 at 4:07 AM, Marius marius.dan...@gmail.com wrote:

 If you want Lift to serve images you should put them in /resources/
 toserve folder and reference them as /classpath/{image file}

 If you want to put images say in /img folder at the same level with /
 WEB-INF for example, you just reference tham /img/{image file} ...
 these will not be served by Lift but by web container.

 There is no need for SiteMap when serving other resources.



 On Feb 27, 10:53 am, jack jack.wid...@gmail.com wrote:
  I would like to access an image on the client via a URL. How do I
  generate that URL. Currently, I'm getting the error
 
  The requested page was not defined in your SiteMap, so access was
  blocked.
 
  I understand what this error means for html pages. How does it work
  for images?
 
  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.comliftweb%2bunsubscr...@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] heapsize

2009-12-17 Thread jack
How do I increase the heapsize in Lift?

--

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] error locating template/main

2009-12-15 Thread jack
Without changing any code, I just got this error. The template main is
where it always was. Any ideas?

Error locating template/main.
Message::1:6:  expected

scala.xml.dtd.ValidationException: :1:6: 
expectednet.liftweb.util.PCDataXmlParser.reportSyntaxError
(PCDataMarkupParser.scala:169)
scala.xml.parsing.MarkupParser$class.reportSyntaxError
(MarkupParser.scala:1117)
net.liftweb.util.PCDataXmlParser.reportSyntaxError
(PCDataMarkupParser.scala:92)
scala.xml.parsing.MarkupParser$class.document(MarkupParser.scala:186)
net.liftweb.util.PCDataXmlParser.document(PCDataMarkupParser.scala:92)
etc

--

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: error locating template/main

2009-12-15 Thread jack
never mind :)

On Dec 16, 1:09 am, jack jack.wid...@gmail.com wrote:
 Without changing any code, I just got this error. The template main is
 where it always was. Any ideas?

 Error locating template/main.
 Message::1:6:  expected

 scala.xml.dtd.ValidationException: :1:6: 
 expectednet.liftweb.util.PCDataXmlParser.reportSyntaxError
 (PCDataMarkupParser.scala:169)
 scala.xml.parsing.MarkupParser$class.reportSyntaxError
 (MarkupParser.scala:1117)
 net.liftweb.util.PCDataXmlParser.reportSyntaxError
 (PCDataMarkupParser.scala:92)
 scala.xml.parsing.MarkupParser$class.document(MarkupParser.scala:186)
 net.liftweb.util.PCDataXmlParser.document(PCDataMarkupParser.scala:92)
 etc

--

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] load testing a lift application

2009-12-15 Thread jack
I need to load test my site. It uses Comet. I am trying JMeter but I'm
not sure if it will work with Comet. The application I am testing is
basically a search engine that returns results via Comet.
What is a good tool to load and stress test this?

--

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] fsc and Lift

2009-11-27 Thread jack
Does anybody use fsc instead of scalac? I find scalac slow. Are there
any known issues with using fsc with Lift?

--

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] simple database question

2009-11-26 Thread jack
I have my database configured properly in Boot.scala and in my
pom.xml. Suppose I have a table name person with a field called name.
What is the simple code to return all rows of this table using Mapper.
I want to understand the essence of how lift ties tables to objects
with a simple example.

--

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: simple database question

2009-11-26 Thread Jack Widman
excellent. Thanks. Just what I needed.

On Thu, Nov 26, 2009 at 2:34 PM, harryh har...@gmail.com wrote:

 Here is what you need for a minimal Person table that contains two
 columns: an id for the primary key, and name which is a string:

 package com.jacksdomain.model

 import net.liftweb.mapper._

 class Person extends LongKeyedMapper[Person] with IdPK {
  def getSingleton = Person

  object name extends MappedString(this, 100)
 }

 object Person extends Person with LongKeyedMetaMapper[Person] {
  override def dbTableName = person
 }

 You can then do things like this:

 val person = Person.find(1)   // retrieve the person with id = 1 from
 the database
 val person = Person.find(By(Person.name, Jack)) // retrieve the
 person with name = Jack from the database
 val people = Person.findAll() // retrieve all people form the database
 val people = Person.findAll(By_(Person.id, 10)) // retrieve all the
 people with id  10

 etc.

 -harryh

 On Nov 26, 1:39 pm, jack jack.wid...@gmail.com wrote:
  wow. thats impressive. But for this, what does the Person class have
  to look like? Suppose I have the table but I don't have the Person
  class written. What does it need to look like?
 
  On Nov 26, 1:32 pm, harryh har...@gmail.com wrote:
 
   val people = Person.findAll()
 
   On Nov 26, 1:22 pm, jack jack.wid...@gmail.com wrote:
 
I have my database configured properly in Boot.scala and in my
pom.xml. Suppose I have a table name person with a field called name.
What is the simple code to return all rows of this table using
 Mapper.
I want to understand the essence of how lift ties tables to objects
with a simple example.

 --

 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.comliftweb%2bunsubscr...@googlegroups.com
 .
 For more options, visit this group at
 http://groups.google.com/group/liftweb?hl=en.





-- 
Jack Widman

co-founder / cto,  Authoritude, Inc.

203-641-9355

--

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] partialUpdate

2009-11-25 Thread jack
I have the following method in a CometActor

override def highPriority = {
case Tick(page) = {
  pages = processPages(pages,page)
  reRender(false)
}
  }

where pages is a list of Page objects.

How do I make this into a partialUpdate. I looked at the chat example
but do not see how to do it in this case.

--

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: partialUpdate

2009-11-25 Thread jack
Just to clarify: the render function takes the list 'pages' and
transforms it into HTML.

On Nov 25, 11:25 am, jack jack.wid...@gmail.com wrote:
 I have the following method in a CometActor

 override def highPriority = {
     case Tick(page) = {
       pages = processPages(pages,page)
       reRender(false)
     }
   }

 where pages is a list of Page objects.

 How do I make this into a partialUpdate. I looked at the chat example
 but do not see how to do it in this case.

--

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] derby

2009-11-25 Thread jack
Could somebody point me to a quickstart or tutorial about how to use
Derby with Lift?

--

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] input box in comet actor page resetting.

2009-11-22 Thread jack
I have a comet actor page with an html input box. When ever the comet
page gets rerendered, the contents of the input box disappear. What
should I do?

--

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=.




[Lift] opening new window from snippet.

2009-11-22 Thread jack
I want to put a link in a snippet that opens up a web page in a new
browser window. What is the best way to do this?

--

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=.




[Lift] session variable question

2009-11-22 Thread jack
I defined a session variable like this

object isAdminVar extends SessionVar[Box[Boolean]](Empty)

in a class. I set it to true in that same class upon successful login
and then access it in another class but it is coming out false.

I am accessing it with

isAdminVar.is.openOr(false)

Am I missing something obvious?

--

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=.




[Lift] InputStream to String

2009-11-21 Thread jack
I have seen this problem around and it seems basic but I haven't found
a solution. I need to turn an InputStream into a String. There seems
to be a bug in the Source class that fails for large files so I don't
want to use that (though it is an elegant approach).

The following doesn't work because reader.readLine returns Unit and
not null, as in Java.

 val reader = new BufferedReader(new InputStreamReader(is))
 var responseBody = 

 var line = reader.readLine()

 while(line != null){
responseBody  += line
line = reader.readLine()
 }

return responseBody

What to do?

--

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=.




Re: [Lift] InputStream to String

2009-11-21 Thread Jack Widman
I kind of like it. Says exactly what it does :)

On Sat, Nov 21, 2009 at 9:56 AM, David Pollak feeder.of.the.be...@gmail.com
 wrote:

 Helpers.readWholeThing(reader): String

 Yes... this method name is ripe for bettering.


 On Sat, Nov 21, 2009 at 6:47 AM, jack jack.wid...@gmail.com wrote:

 I have seen this problem around and it seems basic but I haven't found
 a solution. I need to turn an InputStream into a String. There seems
 to be a bug in the Source class that fails for large files so I don't
 want to use that (though it is an elegant approach).

 The following doesn't work because reader.readLine returns Unit and
 not null, as in Java.

  val reader = new BufferedReader(new InputStreamReader(is))
  var responseBody = 

  var line = reader.readLine()

  while(line != null){
responseBody  += line
line = reader.readLine()
  }

 return responseBody

 What to do?

 --

 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.comliftweb%2bunsubscr...@googlegroups.com
 .
 For more options, visit this group at
 http://groups.google.com/group/liftweb?hl=.





 --
 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.comliftweb%2bunsubscr...@googlegroups.com
 .
 For more options, visit this group at
 http://groups.google.com/group/liftweb?hl=.




-- 
Jack Widman

co-founder / cto,  Authoritude, Inc.

203-641-9355

--

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=.




Re: [Lift] Re: InputStream to String

2009-11-21 Thread Jack Widman
How about

pleaseGoOutAndConvertThisInputStreamToAStringAndReturnIt

And then after returns the String you can call a function called

thankYou

On Sat, Nov 21, 2009 at 10:40 AM, Timothy Perrett
timo...@getintheloop.euwrote:

 HAHAHA. That is an awesome method name if ever i did see one. Little
 confused why readWholeInputStream was somehow not the obvious
 choice ;-)

 Cheers, Tim

 On Nov 21, 4:37 pm, Jack Widman jack.wid...@gmail.com wrote:
  I kind of like it. Says exactly what it does :)
 
  On Sat, Nov 21, 2009 at 9:56 AM, David Pollak 
 feeder.of.the.be...@gmail.com
 
 
 
 
 
   wrote:
   Helpers.readWholeThing(reader): String
 
   Yes... this method name is ripe for bettering.
 
   On Sat, Nov 21, 2009 at 6:47 AM, jack jack.wid...@gmail.com wrote:
 
   I have seen this problem around and it seems basic but I haven't found
   a solution. I need to turn an InputStream into a String. There seems
   to be a bug in the Source class that fails for large files so I don't
   want to use that (though it is an elegant approach).
 
   The following doesn't work because reader.readLine returns Unit and
   not null, as in Java.
 
val reader = new BufferedReader(new InputStreamReader(is))
var responseBody = 
 
var line = reader.readLine()
 
while(line != null){
  responseBody  += line
  line = reader.readLine()
}
 
   return responseBody
 
   What to do?
 
   --
 
   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.comliftweb%2bunsubscr...@googlegroups.com
 liftweb%2bunsubscr...@googlegroups.comliftweb%252bunsubscr...@googlegroups.com
   .
   For more options, visit this group at
  http://groups.google.com/group/liftweb?hl=.
 
   --
   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.comliftweb%2bunsubscr...@googlegroups.com
 liftweb%2bunsubscr...@googlegroups.comliftweb%252bunsubscr...@googlegroups.com
   .
   For more options, visit this group at
  http://groups.google.com/group/liftweb?hl=.
 
  --
  Jack Widman
 
  co-founder / cto,  Authoritude, Inc.
 
  203-641-9355

 --

 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.comliftweb%2bunsubscr...@googlegroups.com
 .
 For more options, visit this group at
 http://groups.google.com/group/liftweb?hl=.





-- 
Jack Widman

co-founder / cto,  Authoritude, Inc.

203-641-9355

--

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=.




Re: [Lift] Re: Menu generated from database?

2009-11-19 Thread Jack Widman
This is one of thing that is so amazing about the lift community David. You
apologize for not getting to something today. [?]

On Thu, Nov 19, 2009 at 12:56 PM, David Pollak 
feeder.of.the.be...@gmail.com wrote:

 Philip  list,

 I've had it on my to-do list to write up an example... and haven't...
 but...

 In your Loc, you can override def supplimentalKidMenuItems and dynamically
 generate kid menu items.

 I'll try to get to an example but not today... sorry :-(

 Thanks,

 David


 On Thu, Nov 19, 2009 at 12:35 AM, philip philip14...@gmail.com wrote:


 Hi David,

 Since I am programming a CMS for my client, I need my lift menu to
 come from the database.

 LiftRules.setSiteMap(SiteMap(MenuInfo.menu :_*))

  def menu: List[Menu] =
  {
Log.info(Menu called)
 ...

 It seems my menu function only gets called once, on subsquent calls I
 do not get any log message.

 Maybe I have to subclass SiteMap?

 Can you point me in the right direction?

 Thanks, Philip



 On 10月21日, 下午11時20分, David Pollak feeder.of.the.be...@gmail.com
 wrote:
  I owe the list example code to do this... maybe tomorrow.
 
  On Wed, Oct 21, 2009 at 6:26 AM, philip philip14...@gmail.com wrote:
 
   Hi,
 
   How can I get a Liftweb menu to be generated from database content?
 
   Alternatively, can the menu come from a XML datasource? could I load/
   serialize from that?
   Could it change dynamically at any time?
 
   Thanks, Philip
 
  --
  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.comliftweb%2bunsubscr...@googlegroups.com
 .
 For more options, visit this group at
 http://groups.google.com/group/liftweb?hl=.





 --
 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.comliftweb%2bunsubscr...@googlegroups.com
 .
 For more options, visit this group at
 http://groups.google.com/group/liftweb?hl=.




-- 
Jack Widman

co-founder / cto,  Authoritude, Inc.

203-641-9355

--

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=.


330.gif

Re: [Lift] Re: Call it Lift 2.0

2009-11-17 Thread Jack Widman
 good feedback
 from you), the Scala 2.8 port, and the flood of newbies on the list.  So,
 yeah, I don't spend 2+ hours a day debating... I make shorter fuse
 decisions.

 But, the it's DPP's ball and he'll do with it what he wants kind of
 feedback bugs me at a very, very core level.


  -
  Jonathan Fergusonj...@spiralarm.com wrote:
 
  I was thinking about this earlier, if there is to be a 2.0 I would hope
  there was a chance to remove deprecated code.
 

 Which particular deprecated code are you thinking.


  Also consider making breaking
  changes @dpp hasn't been in favour of making to date.
 

 Which changes are you thinking about?


  Not to annoy him. As
  1.X to 2.X is a big enough change that people who don't want to move can
  stay with a stable 1.X and those of us who are running HEAD/TRUNK
 whatever
  these new fangled git kids call it nowadays can keep racing along.
 

 I'm not sure we have the resources to support a 1.X and a 2.X and a 2.7.x
 and a 2.8.x branch.  If there are any folks who want to step up and
 maintain
 a branch (or if there's money to hire someone), it's something worth a
 discussion, but I don't think there's anyone I know of who could maintain a
 1.X branch if we're going to get radical with a 2.X.  I think it's one
 branch.


 
  Jono.
 
  2009/11/17 Heiko Seeberger heiko.seeber...@googlemail.com
 
   2009/11/17 David Pollak feeder.of.the.be...@gmail.com
  
   The current Lift is not a major change to Lift 1.0, it's a minor
   progression and a lot of tuning of the developer experience.
  
  
   There are breaking changes to the API which in the version policy
  suggested
   by me (the OSGi way) means increasing the major version number. OK, of
   course we need not stick to this particular version policy, but it
 would
  be
   beneficial to have one. What about: Increasing the minor version number
   (e.g. 1.0 - 1.1) means breaking changes to the API. Increasing the
 micro
   version number (e.g. 1.1.0 - 1.1.1) means *no* breaking changes to the
  API.
  
   Heiko
  
  
   My job: weiglewilczek.com
   My blog: heikoseeberger.name
   Follow me: twitter.com/hseeberger
   OSGi on Scala: scalamodules.org
   Lift, the simply functional web framework: liftweb.net
  
   --
   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.comliftweb%2bunsubscr...@googlegroups.com
 liftweb%2bunsubscr...@googlegroups.comliftweb%252bunsubscr...@googlegroups.com
 
  liftweb%2bunsubscr...@googlegroups.comliftweb%252bunsubscr...@googlegroups.com
 liftweb%252bunsubscr...@googlegroups.comliftweb%25252bunsubscr...@googlegroups.com
 
  
   .
   For more options, visit this group at
   http://groups.google.com/group/liftweb?hl=.
  
 
  --
 
  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.comliftweb%2bunsubscr...@googlegroups.com
 liftweb%2bunsubscr...@googlegroups.comliftweb%252bunsubscr...@googlegroups.com
 
  .
  For more options, visit this group at
  http://groups.google.com/group/liftweb?hl=.
 
 
  --
 
  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.comliftweb%2bunsubscr...@googlegroups.com
 liftweb%2bunsubscr...@googlegroups.comliftweb%252bunsubscr...@googlegroups.com
 
  .
  For more options, visit this group at
  http://groups.google.com/group/liftweb?hl=.
 
 
 


 --
 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.comliftweb%2bunsubscr...@googlegroups.com
 .
 For more options, visit this group at
 http://groups.google.com/group/liftweb?hl=.


 --

 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.comliftweb%2bunsubscr...@googlegroups.com
 .
 For more options, visit this group at
 http://groups.google.com/group/liftweb?hl=.





-- 
Jack Widman

co-founder / cto,  Authoritude, Inc.

203-641-9355

--

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

Re: [Lift] Re: How do I properly read a value from a cookie?

2009-11-16 Thread Jack Widman
A refuting piece of evidence from the guy who created nulls. How cool is
that?!  :)

On Tue, Nov 17, 2009 at 1:20 AM, David Pollak feeder.of.the.be...@gmail.com
 wrote:



 On Mon, Nov 16, 2009 at 9:01 PM, DMB combust...@gmail.com wrote:

  that it's not null--which is a source of many bugs

 After a bold statement like this, one can't help but wonder how
 programmers manage to ship software in all the other languages. :-)
 Come to think of it, after working on a couple of pretty large ASP.NET
 projects (~50 devs), I haven't once seen a bug which was caused by the
 semantics of retrieving the cookie or URL parameter values. I'm not
 saying the Box thing doesn't have its uses, I'm just saying that in
 this particular case it's a pain in the ass and overkill.


 Before judging, spend a month or two writing idomatic Scala code rather
 than fighting with it.

 In your example, I reduced the lines of code, made your code more logical
 and reduced the McCabe complexity (see
 http://en.wikipedia.org/wiki/Cyclomatic_complexity).  The higher the
 McCabe complexity, the more defects there are in software.

 So, even in a trivial 20 line program, using the Scala idioms shortens code
 and generally makes code easier to read and easier to maintain.

 And we're not the only ones who think null is a problem... the guy that
 invented null thinks it's a huge problem:
 http://qconlondon.com/london-2009/presentation/Null+References:+The+Billion+Dollar+Mistake




 On Nov 16, 2:40 pm, Naftoli Gugenheim naftoli...@gmail.com wrote:
  As others may have said, the difference between a Box and a value that
 may be null is that both may or may not contain what you want it to have;
 but in one case the compiler lets you assume that it does--that it's not
 null--which is a source of many bugs.
  Programming presents a tension between type safety and conciseness, and
 Scala does an amazing job of being extremely type safe and extremely
 concise. But type safety comes first.
 
  -
 
  DMBcombust...@gmail.com wrote:
 
  I guess that could work, but why go to such lengths where there are
  much more straightforward solutions available? What do for
  comprehensions buy you in this case? I mean, 99% of the time, when I
  want to check for a cookie, I don't need the cookie itself or any of
  its properties. I need its value, or null if there's no cookie. Why
  not do something a-la RoR:
 
  S.cookieValue(cookieName)
 
  or a-la ASP.NET:
 
  val c = S.cookie(cookieName)
  if(c != null) {
 val v = c.value
 
  }
 
  Or, indeed, both?
 
  On Nov 16, 1:22 am, Sergey Andreev andser...@gmail.com wrote:
 
   Hi,
 
   For-comprehensions could help you out:
 
   for{
 cookie - S.findCookie(cookieName)
 value - cookie} doSomethingWithValue
 
   Regards
 
   On Mon, Nov 16, 2009 at 12:07 PM, DMB combust...@gmail.com wrote:
 
When I call findCookie it returns a Box. Then, the value on the
 cookie
itself is also a box. Hence a ruby one-liner turns into something
like:
 
val cookie = S.findCookie(cookieName)
if(cookie.isDefined) {
val cookieVal = cookie.open_!.value.openOr(null)
// Do something with the cookie value
}
 
This is very ugly, so I'm guessing I'm doing something wrong, but
 try
as I might, I could not find any examples that would look even
 vaguely
right to me.
 
Why can't findCookie return a simple, unboxed HTTPCookie object or
null if cookie is not found?
Why does the value inside a cookie need to also be Box'ed?
 
For the sake of comparison, here's how you do the same thing in RoR:
v = cookies[cookieName]
// Do something with the cookie
 
or ASP.NET:
var c = Request.Cookies[CookieName]
if(c != null) {
  var v = c.Value
  // Do something with the cookie
}
 
I fail to see why Lift should be more complicated.
 
This is with Lift 1.1 M7

 --

 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.comliftweb%2bunsubscr...@googlegroups.com
 .
 For more options, visit this group at
 http://groups.google.com/group/liftweb?hl=.





 --
 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.comliftweb%2bunsubscr...@googlegroups.com
 .
 For more options, visit this group at
 http://groups.google.com/group/liftweb?hl=.




-- 
Jack Widman

co-founder / cto,  Authoritude, Inc.

203-641-9355

--

You received this message because you are subscribed to the Google Groups

[Lift] Re: CometListener

2009-11-13 Thread Jack Widman
sure. Thanks Ross. I will send it tonight. Also what is the difference
between the CometListener and the CometListenee?

On Fri, Nov 13, 2009 at 11:14 AM, Ross Mellgren dri...@gmail.com wrote:

 Could you send over your pom.xml if you're using Maven? It sounds like
 maybe your build path is not correct.

 -Ross


 On Nov 13, 2009, at 12:09 AM, Jack Widman wrote:

 David,

 I'm using lift 1.1 and scala 2.5 now and the compiler says it cant find
 CometListener when I import net.liftweb.http._

 Jack

 On Fri, Nov 13, 2009 at 12:01 AM, David Pollak 
 feeder.of.the.be...@gmail.com wrote:



 On Thu, Nov 12, 2009 at 8:54 PM, Jack Widman jack.wid...@gmail.comwrote:

 C:\work\widman\src\main\scala\com\widman\comet\PackComet.scala:20: error:
 type CometListener is not a member of package net.liftweb.http

 I got this compile error.

 I must be missing something obvious.


 It's part of Lift 1.1, not Lift 1.0




  On Thu, Nov 12, 2009 at 11:42 PM, Ross Mellgren dri...@gmail.comwrote:


 It is in net.liftweb.http.


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


 By the way, the link you gave only indicates it's in either
 net.liftweb.http, net.liftweb.util, net.liftweb or model (or a couple
 other packages, since scala implicitly imports superpackages).

 -Ross

 On Nov 12, 2009, at 11:38 PM, jack wrote:

 
  I also tried net.liftweb.http
 
  On Nov 12, 11:35 pm, jack jack.wid...@gmail.com wrote:
  I am trying to use CometListener. According tohttp://bit.ly/1Wnxt4,
  it is in the package net.liftweb._ but compiler says it can't be
  found. Is this the wrong package?
  






 --
 Jack Widman

 co-founder / cto,  Authoritude, Inc.

 203-641-9355






 --
 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





 --
 Jack Widman

 co-founder / cto,  Authoritude, Inc.

 203-641-9355




 



-- 
Jack Widman

co-founder / cto,  Authoritude, Inc.

203-641-9355

--~--~-~--~~~---~--~~
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] priority of events

2009-11-13 Thread jack

What is the order that the following three things happen in?

1)localSetup
2)the first time render is called
3)a piece of code in the CometActor that is not inside any method.
--~--~-~--~~~---~--~~
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: CometListener

2009-11-13 Thread Jack Widman
Here is my pom.xml

On Fri, Nov 13, 2009 at 12:09 PM, Jack Widman jack.wid...@gmail.com wrote:

 sure. Thanks Ross. I will send it tonight. Also what is the difference
 between the CometListener and the CometListenee?


 On Fri, Nov 13, 2009 at 11:14 AM, Ross Mellgren dri...@gmail.com wrote:

 Could you send over your pom.xml if you're using Maven? It sounds like
 maybe your build path is not correct.

 -Ross


 On Nov 13, 2009, at 12:09 AM, Jack Widman wrote:

 David,

 I'm using lift 1.1 and scala 2.5 now and the compiler says it cant find
 CometListener when I import net.liftweb.http._

 Jack

 On Fri, Nov 13, 2009 at 12:01 AM, David Pollak 
 feeder.of.the.be...@gmail.com wrote:



 On Thu, Nov 12, 2009 at 8:54 PM, Jack Widman jack.wid...@gmail.comwrote:

 C:\work\widman\src\main\scala\com\widman\comet\PackComet.scala:20:
 error: type CometListener is not a member of package net.liftweb.http

 I got this compile error.

 I must be missing something obvious.


 It's part of Lift 1.1, not Lift 1.0




  On Thu, Nov 12, 2009 at 11:42 PM, Ross Mellgren dri...@gmail.comwrote:


 It is in net.liftweb.http.


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


 By the way, the link you gave only indicates it's in either
 net.liftweb.http, net.liftweb.util, net.liftweb or model (or a couple
 other packages, since scala implicitly imports superpackages).

 -Ross

 On Nov 12, 2009, at 11:38 PM, jack wrote:

 
  I also tried net.liftweb.http
 
  On Nov 12, 11:35 pm, jack jack.wid...@gmail.com wrote:
  I am trying to use CometListener. According tohttp://bit.ly/1Wnxt4,
  it is in the package net.liftweb._ but compiler says it can't be
  found. Is this the wrong package?
  






 --
 Jack Widman

 co-founder / cto,  Authoritude, Inc.

 203-641-9355






 --
 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





 --
 Jack Widman

 co-founder / cto,  Authoritude, Inc.

 203-641-9355




 



 --
 Jack Widman

 co-founder / cto,  Authoritude, Inc.

 203-641-9355




-- 
Jack Widman

co-founder / cto,  Authoritude, Inc.

203-641-9355

--~--~-~--~~~---~--~~
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
-~--~~~~--~~--~--~---


project xmlns=http://maven.apache.org/POM/4.0.0; xmlns:xsi=http://www.w3.org/2001/XMLSchema-instance; xsi:schemaLocation=http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd;
  modelVersion4.0.0/modelVersion
  groupIdcom.widman/groupId
  artifactIdwidman/artifactId
  version1.1-M6/version
  packagingwar/packaging
  namewidman/name
  inceptionYear2007/inceptionYear
  properties
scala.version2.7.5/scala.version
  /properties

  repositories
repository
  idscala-tools.org/id
  nameScala-Tools Maven2 Repository/name
  urlhttp://scala-tools.org/repo-releases/url
/repository
  /repositories

  pluginRepositories
pluginRepository
  idscala-tools.org/id
  nameScala-Tools Maven2 Repository/name
  urlhttp://scala-tools.org/repo-releases/url
/pluginRepository
  /pluginRepositories

  dependencies
dependency
   groupIdnet.liftweb/groupId
   artifactIdlift-textile/artifactId
   version1.1-M6/version
/dependency
dependency
  groupIdorg.scala-lang/groupId
  artifactIdscala-library/artifactId
  version${scala.version}/version
/dependency
dependency
  groupIdnet.liftweb/groupId
  artifactIdlift-util/artifactId
  version1.0/version
/dependency
dependency
  groupIdnet.liftweb/groupId
  artifactIdlift-webkit/artifactId
  version1.0/version
/dependency
dependency
  groupIdnet.liftweb/groupId
  artifactIdlift-mapper/artifactId
  version1.0/version
/dependency
dependency
  groupIdjavax.servlet/groupId
  artifactIdservlet-api/artifactId
  version2.5/version
  scopeprovided/scope
/dependency
dependency
  groupIdjunit/groupId
  artifactIdjunit/artifactId
  version4.5/version
  scopetest/scope
/dependency
dependency
  groupIdorg.mortbay.jetty/groupId
  artifactIdjetty/artifactId
  version[6.1.6,)/version
  scopetest/scope
/dependency
!-- for LiftConsole --
dependency
  groupIdorg.scala-lang/groupId
  artifactIdscala-compiler/artifactId
  version${scala.version}/version
  scopetest/scope
/dependency
   !-- dependency
  groupIdorg.apache.httpcomponents/groupId
  artifactIdhttpcore/artifactId
  version4.0.1/version
  scopecompile

[Lift] Comet Actor

2009-11-13 Thread jack

I have a some code in a CometActor that I want to run right after
render is called for the first time. What is the best way to do this?
I could set a boolean variable in the render method and then send a
message back to the CometActor to tell it to run the code. I suspect
there is a better way?
--~--~-~--~~~---~--~~
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: CometListener

2009-11-13 Thread Jack Widman
Thanks Ross.

On Fri, Nov 13, 2009 at 11:55 PM, Ross Mellgren dri...@gmail.com wrote:

 Your pom specifies lift 1.0, not 1.1 for the majority of lift modules. You
 are using 1.1-M6 for lift-textile. In addition, you don't have the snapshots
 repository configured.

 To fix this, first add the snapshot repository to repositories:

 repository
   idscala-tools.org.snapshots/id
   nameScala-Tools Maven2 Repository for Snapshots/name
   urlhttp://scala-tools.org/repo-snapshots/url
   snapshots/
 /repository

 Then switch *all* your lift-* dependencies to 1.1-SNAPSHOT and your scala
 version to 2.7.7. I use a property for the lift version to use, myself, like
 this:

 properties
 scala.version2.7.7/scala.version
 lift.version1.1-SNAPSHOT/lift.version
 /properties

 ...

 dependency
 groupIdnet.liftweb/gropuId
 artifactIdlift-util/artifactId
 version${lift.version}/version}
 /dependency

 (and so on, for each lift-* dependency)

 I'm not sure what would happen exactly if you have mixed versions of the
 lift modules, but It Can't Be Good.

 Hope that helps,
 -Ross

 On Nov 13, 2009, at 10:17 PM, Jack Widman wrote:

 Here is my pom.xml

 On Fri, Nov 13, 2009 at 12:09 PM, Jack Widman jack.wid...@gmail.comwrote:

 sure. Thanks Ross. I will send it tonight. Also what is the difference
 between the CometListener and the CometListenee?


 On Fri, Nov 13, 2009 at 11:14 AM, Ross Mellgren dri...@gmail.com wrote:

 Could you send over your pom.xml if you're using Maven? It sounds like
 maybe your build path is not correct.

 -Ross


 On Nov 13, 2009, at 12:09 AM, Jack Widman wrote:

 David,

 I'm using lift 1.1 and scala 2.5 now and the compiler says it cant find
 CometListener when I import net.liftweb.http._

 Jack

 On Fri, Nov 13, 2009 at 12:01 AM, David Pollak 
 feeder.of.the.be...@gmail.com wrote:



 On Thu, Nov 12, 2009 at 8:54 PM, Jack Widman jack.wid...@gmail.comwrote:

 C:\work\widman\src\main\scala\com\widman\comet\PackComet.scala:20:
 error: type CometListener is not a member of package net.liftweb.http

 I got this compile error.

 I must be missing something obvious.


 It's part of Lift 1.1, not Lift 1.0




  On Thu, Nov 12, 2009 at 11:42 PM, Ross Mellgren dri...@gmail.comwrote:


 It is in net.liftweb.http.


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


 By the way, the link you gave only indicates it's in either
 net.liftweb.http, net.liftweb.util, net.liftweb or model (or a couple
 other packages, since scala implicitly imports superpackages).

 -Ross

 On Nov 12, 2009, at 11:38 PM, jack wrote:

 
  I also tried net.liftweb.http
 
  On Nov 12, 11:35 pm, jack jack.wid...@gmail.com wrote:
  I am trying to use CometListener. According tohttp://bit.ly/1Wnxt4
 ,
  it is in the package net.liftweb._ but compiler says it can't be
  found. Is this the wrong package?
  






 --
 Jack Widman

 co-founder / cto,  Authoritude, Inc.

 203-641-9355






 --
 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





 --
 Jack Widman

 co-founder / cto,  Authoritude, Inc.

 203-641-9355








 --
 Jack Widman

 co-founder / cto,  Authoritude, Inc.

 203-641-9355




 --
 Jack Widman

 co-founder / cto,  Authoritude, Inc.

 203-641-9355


 pom.xml



 



-- 
Jack Widman

co-founder / cto,  Authoritude, Inc.

203-641-9355

--~--~-~--~~~---~--~~
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: CometActor and render

2009-11-12 Thread Jack Widman
I did and its actually in the code I attached. In one place I use Dispatch
and in another place I use httpclient directly. I intend to use Dispatch for
everything.

On Thu, Nov 12, 2009 at 4:05 PM, Randinn rand...@gmail.com wrote:


 I'm not trying to change the subject but I was wondering if you looked
 at Databinder Dispatch http://databinder.net/dispatch/About for your
 url calls?

 On Nov 12, 3:26 pm, Jack Widman jack.wid...@gmail.com wrote:
  David,
 
  I have attached my code. It runs but does not behave as I intended it to.
  The code does a web search on the term scala and displays a list of
 URLs
  of the results. Next to each URL it says Page Length : -1. A process is
  running in the background which takes each URL, goes out and gets the
 page
  and takes the length of the page. The length of that page is then
 supposed
  to immediately appear on the page next to that URL. I put the lengths on
 a
  queue, as they come in, and I have the Comet page poll the queue and
 display
  the results. It would probably be better to have the results send a
 message
  to the Comet class so the page is only re-rendered when there is a change
  but for now I am polling.
 
  I can see the lengths coming in and being put on the queue, but the Comet
  page is not getting them till they are all retrieved. (This takes way too
  long and nothing changes on the screen till its too late). I need them to
  appear as they come in. Occasionally I can see a length being retrieved
 and
  the Comet page finds it but even then it is not displayed until all the
  lengths are in.   I know this is not very clear but I think it will be
 clear
  from the code.
 
  I also know there are a lot of places in the code which can be improved
 and
  I welcome all of your input but what I would love is to have these
 numbers
  appear on the page as they they are retrieved. I have been stumped by
 this
  for a while and I suspect that somebody who knows Lift well might see the
  problem right away.
 
  The class that retrieves the page lengths is called Calculator and the
 queue
  is called SourceQueue. The classes are pretty small so hopefully it will
 be
  clear what is going on. I want you to know I think it is incredible how
  responsive you and the group are and I look forward to using Lift in the
  future.
 
  Thanks so much.
 
  Jack
 
  On Tue, Nov 10, 2009 at 1:27 AM, David Pollak 
 feeder.of.the.be...@gmail.com
 
   wrote:
 
   On Mon, Nov 9, 2009 at 10:10 PM, Jack Widman jack.wid...@gmail.com
 wrote:
 
   The only difference between your working code and mine is that mine
 has a
   process in the background that is always running and puts Foo objects
 on a
   queue whenever they are ready. Where can I start this long running
 process
   so that it doesn't interfere with the lowPriority method that takes
 things
   off the queue and rerenders the page. I tried starting the process in
 its
   own Actor that I start in localSetup but it seems somehow to be
 blocking the
   lowPriority method from doing its thing.
 
   I have no idea what this means... sorry.
 
   Please post actual runnable code and we can help you debug.
 
   On Sun, Nov 8, 2009 at 11:35 PM, David Pollak 
   feeder.of.the.be...@gmail.com wrote:
 
   Jack,
 
   I reproduced your code and it seems to work fine.  I've enclosed a
   working copy.
 
   Some comments about your code:
 
  - The foos variable and the foo variable may be getting confused
 in
  the code... the render method may be rendering the same thing
 based on the
  unchanging foos variable.
  - Doing null testing is a sign that you have logic errors in your
  code.  I strongly recommend using either Box or Option for
 everything that
  can logically not contain a value/reference.  If you're bridging
 out to Java
  code and are expecting null from the Java code, write a small
 bridge that
  will wrapper the Java return values in Box/Option.
  - You have a case class (Tick) that contains no parameters.
  Please
  use a case object instead.
  - Your Tick look is a spin loop.  You fire a Tick message as part
 of
  processing the Tick message.  I would suggest that if you're
 polling, that
  you have a reasonable poll interval, otherwise you'll starve your
 CPU.
  Further, having reRender on each loop through means that you're
 forcing a
  lot of bytes over the wire rather than only doing a reRender on
 changed
  values.
 
   Thanks,
 
   David
 
   On Sun, Nov 8, 2009 at 3:47 PM, Jack Widman jack.wid...@gmail.com
 wrote:
 
   Sorry. Here it is:   As I said, I know that when render is called,
   foo.getValue has the right value. But it does not show on the
 screen, unless
   I refresh the browser.
 
   package com.foo.comet
 
   import net.liftweb._
   import http._
   import js._
   import JsCmds._
   import net.liftweb.util._
   import net.liftweb.http._
   import _root_.scala.xml._
   import scala.actors._
   import com.authoritude.snippet

[Lift] Re: CometActor and render

2009-11-12 Thread Jack Widman
Will do. One more small question How do I send a message to the Comet Actor
from another class? Can the CometActor be an object instead of a class? In
the code

X ! messageToCometActor,   what is X? I don't have a variable that holds the
instance of the CometActor.

On Thu, Nov 12, 2009 at 5:12 PM, David Pollak feeder.of.the.be...@gmail.com
 wrote:

 Jack,

 The issues you're seeing are not Lift related.  You are not using Actors
 correctly.  Please see Philipp Haller's preso on Actors:
 http://lamp.epfl.ch/~phaller/doc/ScalaActors.pdfhttp://lamp.epfl.ch/%7Ephaller/doc/ScalaActors.pdf

 Please also look at the Actor chapters in Beginning Scala or Programming in
 Scala.

 Thanks,

 David


 On Wed, Nov 11, 2009 at 8:26 PM, Jack Widman jack.wid...@gmail.comwrote:

 David,

 I have attached my code. It runs but does not behave as I intended it to.
 The code does a web search on the term scala and displays a list of URLs
 of the results. Next to each URL it says Page Length : -1. A process is
 running in the background which takes each URL, goes out and gets the page
 and takes the length of the page. The length of that page is then supposed
 to immediately appear on the page next to that URL. I put the lengths on a
 queue, as they come in, and I have the Comet page poll the queue and display
 the results. It would probably be better to have the results send a message
 to the Comet class so the page is only re-rendered when there is a change
 but for now I am polling.

 I can see the lengths coming in and being put on the queue, but the Comet
 page is not getting them till they are all retrieved. (This takes way too
 long and nothing changes on the screen till its too late). I need them to
 appear as they come in. Occasionally I can see a length being retrieved and
 the Comet page finds it but even then it is not displayed until all the
 lengths are in.   I know this is not very clear but I think it will be clear
 from the code.

 I also know there are a lot of places in the code which can be improved
 and I welcome all of your input but what I would love is to have these
 numbers appear on the page as they they are retrieved. I have been stumped
 by this for a while and I suspect that somebody who knows Lift well might
 see the problem right away.

 The class that retrieves the page lengths is called Calculator and the
 queue is called SourceQueue. The classes are pretty small so hopefully it
 will be clear what is going on. I want you to know I think it is incredible
 how responsive you and the group are and I look forward to using Lift in the
 future.

 Thanks so much.

 Jack


 On Tue, Nov 10, 2009 at 1:27 AM, David Pollak 
 feeder.of.the.be...@gmail.com wrote:



 On Mon, Nov 9, 2009 at 10:10 PM, Jack Widman jack.wid...@gmail.comwrote:

 The only difference between your working code and mine is that mine has
 a process in the background that is always running and puts Foo objects on 
 a
 queue whenever they are ready. Where can I start this long running process
 so that it doesn't interfere with the lowPriority method that takes things
 off the queue and rerenders the page. I tried starting the process in its
 own Actor that I start in localSetup but it seems somehow to be blocking 
 the
 lowPriority method from doing its thing.


 I have no idea what this means... sorry.

 Please post actual runnable code and we can help you debug.



 On Sun, Nov 8, 2009 at 11:35 PM, David Pollak 
 feeder.of.the.be...@gmail.com wrote:

 Jack,

 I reproduced your code and it seems to work fine.  I've enclosed a
 working copy.

 Some comments about your code:

- The foos variable and the foo variable may be getting confused in
the code... the render method may be rendering the same thing based on 
 the
unchanging foos variable.
- Doing null testing is a sign that you have logic errors in your
code.  I strongly recommend using either Box or Option for everything 
 that
can logically not contain a value/reference.  If you're bridging out 
 to Java
code and are expecting null from the Java code, write a small bridge 
 that
will wrapper the Java return values in Box/Option.
- You have a case class (Tick) that contains no parameters.  Please
use a case object instead.
- Your Tick look is a spin loop.  You fire a Tick message as part
of processing the Tick message.  I would suggest that if you're 
 polling,
that you have a reasonable poll interval, otherwise you'll starve your 
 CPU.
Further, having reRender on each loop through means that you're 
 forcing a
lot of bytes over the wire rather than only doing a reRender on changed
values.

 Thanks,

 David

 On Sun, Nov 8, 2009 at 3:47 PM, Jack Widman jack.wid...@gmail.comwrote:

 Sorry. Here it is:   As I said, I know that when render is called,
 foo.getValue has the right value. But it does not show on the screen, 
 unless
 I refresh the browser.

 package com.foo.comet

 import net.liftweb._
 import http

[Lift] Re: CometActor and render

2009-11-12 Thread Jack Widman
Thanks.

On Thu, Nov 12, 2009 at 5:32 PM, David Pollak feeder.of.the.be...@gmail.com
 wrote:



 On Thu, Nov 12, 2009 at 2:16 PM, Jack Widman jack.wid...@gmail.comwrote:

 Will do. One more small question How do I send a message to the Comet
 Actor from another class? Can the CometActor be an object instead of a
 class? In the code


 Lift instantiates a new CometActor each time it needs one.  If you have a
 singleton CometActor, you'd be sharing state across all sessions and that
 would be impossible to manage.



 X ! messageToCometActor,   what is X? I don't have a variable that holds
 the instance of the CometActor.


 If the CometActor is a listener to another service, you can register the
 instance of the CometActor as a listener during localSetup and unregister
 during localShutdown.

 See that Chat example in lift-examples/example




 On Thu, Nov 12, 2009 at 5:12 PM, David Pollak 
 feeder.of.the.be...@gmail.com wrote:

 Jack,

 The issues you're seeing are not Lift related.  You are not using Actors
 correctly.  Please see Philipp Haller's preso on Actors:
 http://lamp.epfl.ch/~phaller/doc/ScalaActors.pdfhttp://lamp.epfl.ch/%7Ephaller/doc/ScalaActors.pdf

 Please also look at the Actor chapters in Beginning Scala or Programming
 in Scala.

 Thanks,

 David


 On Wed, Nov 11, 2009 at 8:26 PM, Jack Widman jack.wid...@gmail.comwrote:

 David,

 I have attached my code. It runs but does not behave as I intended it
 to. The code does a web search on the term scala and displays a list of
 URLs of the results. Next to each URL it says Page Length : -1. A process
 is running in the background which takes each URL, goes out and gets the
 page and takes the length of the page. The length of that page is then
 supposed to immediately appear on the page next to that URL. I put the
 lengths on a queue, as they come in, and I have the Comet page poll the
 queue and display the results. It would probably be better to have the
 results send a message to the Comet class so the page is only re-rendered
 when there is a change but for now I am polling.

 I can see the lengths coming in and being put on the queue, but the
 Comet page is not getting them till they are all retrieved. (This takes way
 too long and nothing changes on the screen till its too late). I need them
 to appear as they come in. Occasionally I can see a length being retrieved
 and the Comet page finds it but even then it is not displayed until all the
 lengths are in.   I know this is not very clear but I think it will be 
 clear
 from the code.

 I also know there are a lot of places in the code which can be improved
 and I welcome all of your input but what I would love is to have these
 numbers appear on the page as they they are retrieved. I have been stumped
 by this for a while and I suspect that somebody who knows Lift well might
 see the problem right away.

 The class that retrieves the page lengths is called Calculator and the
 queue is called SourceQueue. The classes are pretty small so hopefully it
 will be clear what is going on. I want you to know I think it is incredible
 how responsive you and the group are and I look forward to using Lift in 
 the
 future.

 Thanks so much.

 Jack


 On Tue, Nov 10, 2009 at 1:27 AM, David Pollak 
 feeder.of.the.be...@gmail.com wrote:



 On Mon, Nov 9, 2009 at 10:10 PM, Jack Widman jack.wid...@gmail.comwrote:

 The only difference between your working code and mine is that mine
 has a process in the background that is always running and puts Foo 
 objects
 on a queue whenever they are ready. Where can I start this long running
 process so that it doesn't interfere with the lowPriority method that 
 takes
 things off the queue and rerenders the page. I tried starting the 
 process in
 its own Actor that I start in localSetup but it seems somehow to be 
 blocking
 the lowPriority method from doing its thing.


 I have no idea what this means... sorry.

 Please post actual runnable code and we can help you debug.



 On Sun, Nov 8, 2009 at 11:35 PM, David Pollak 
 feeder.of.the.be...@gmail.com wrote:

 Jack,

 I reproduced your code and it seems to work fine.  I've enclosed a
 working copy.

 Some comments about your code:

- The foos variable and the foo variable may be getting confused
in the code... the render method may be rendering the same thing 
 based on
the unchanging foos variable.
- Doing null testing is a sign that you have logic errors in your
code.  I strongly recommend using either Box or Option for 
 everything that
can logically not contain a value/reference.  If you're bridging out 
 to Java
code and are expecting null from the Java code, write a small bridge 
 that
will wrapper the Java return values in Box/Option.
- You have a case class (Tick) that contains no parameters.
Please use a case object instead.
- Your Tick look is a spin loop.  You fire a Tick message as part
of processing the Tick message.  I would suggest

[Lift] Re: CometActor and render

2009-11-12 Thread Jack Widman
got it. I was mixing metaphors.

On Thu, Nov 12, 2009 at 5:41 PM, David Pollak feeder.of.the.be...@gmail.com
 wrote:



 On Thu, Nov 12, 2009 at 2:25 PM, Jack Widman jack.wid...@gmail.comwrote:

 Is it that I am putting things on a Queue from within an the Calculator
 Actor and having the CometActor retrieve them from the Queue? Is that the
 problem?  I will read up on actors but it would help if you could tell me
 (if only briefly) what you saw about my actor code that is wrong.


 The act method in an actor sets up the receive/react loop.  It is not a
 background thread in and of itself.  Actors are not background threads
 they are things that process messages sent to them with the ! method.  You
 set up the message handling in the receive/react loop.

 Further, mixing method calls and Actor message handling is wicked dangerous
 (especially without synchronized blocks).  Choose either a traditional
 threading model or an Actor-based model, but not both.


  Thanks.



 On Thu, Nov 12, 2009 at 5:12 PM, David Pollak 
 feeder.of.the.be...@gmail.com wrote:

 Jack,

 The issues you're seeing are not Lift related.  You are not using Actors
 correctly.  Please see Philipp Haller's preso on Actors:
 http://lamp.epfl.ch/~phaller/doc/ScalaActors.pdfhttp://lamp.epfl.ch/%7Ephaller/doc/ScalaActors.pdf

 Please also look at the Actor chapters in Beginning Scala or Programming
 in Scala.

 Thanks,

 David


 On Wed, Nov 11, 2009 at 8:26 PM, Jack Widman jack.wid...@gmail.comwrote:

 David,

 I have attached my code. It runs but does not behave as I intended it
 to. The code does a web search on the term scala and displays a list of
 URLs of the results. Next to each URL it says Page Length : -1. A process
 is running in the background which takes each URL, goes out and gets the
 page and takes the length of the page. The length of that page is then
 supposed to immediately appear on the page next to that URL. I put the
 lengths on a queue, as they come in, and I have the Comet page poll the
 queue and display the results. It would probably be better to have the
 results send a message to the Comet class so the page is only re-rendered
 when there is a change but for now I am polling.

 I can see the lengths coming in and being put on the queue, but the
 Comet page is not getting them till they are all retrieved. (This takes way
 too long and nothing changes on the screen till its too late). I need them
 to appear as they come in. Occasionally I can see a length being retrieved
 and the Comet page finds it but even then it is not displayed until all the
 lengths are in.   I know this is not very clear but I think it will be 
 clear
 from the code.

 I also know there are a lot of places in the code which can be improved
 and I welcome all of your input but what I would love is to have these
 numbers appear on the page as they they are retrieved. I have been stumped
 by this for a while and I suspect that somebody who knows Lift well might
 see the problem right away.

 The class that retrieves the page lengths is called Calculator and the
 queue is called SourceQueue. The classes are pretty small so hopefully it
 will be clear what is going on. I want you to know I think it is incredible
 how responsive you and the group are and I look forward to using Lift in 
 the
 future.

 Thanks so much.

 Jack


 On Tue, Nov 10, 2009 at 1:27 AM, David Pollak 
 feeder.of.the.be...@gmail.com wrote:



 On Mon, Nov 9, 2009 at 10:10 PM, Jack Widman jack.wid...@gmail.comwrote:

 The only difference between your working code and mine is that mine
 has a process in the background that is always running and puts Foo 
 objects
 on a queue whenever they are ready. Where can I start this long running
 process so that it doesn't interfere with the lowPriority method that 
 takes
 things off the queue and rerenders the page. I tried starting the 
 process in
 its own Actor that I start in localSetup but it seems somehow to be 
 blocking
 the lowPriority method from doing its thing.


 I have no idea what this means... sorry.

 Please post actual runnable code and we can help you debug.



 On Sun, Nov 8, 2009 at 11:35 PM, David Pollak 
 feeder.of.the.be...@gmail.com wrote:

 Jack,

 I reproduced your code and it seems to work fine.  I've enclosed a
 working copy.

 Some comments about your code:

- The foos variable and the foo variable may be getting confused
in the code... the render method may be rendering the same thing 
 based on
the unchanging foos variable.
- Doing null testing is a sign that you have logic errors in your
code.  I strongly recommend using either Box or Option for 
 everything that
can logically not contain a value/reference.  If you're bridging out 
 to Java
code and are expecting null from the Java code, write a small bridge 
 that
will wrapper the Java return values in Box/Option.
- You have a case class (Tick) that contains no parameters.
Please use a case object instead

[Lift] CometListener

2009-11-12 Thread jack

I am trying to use CometListener. According to http://bit.ly/1Wnxt4 ,
it is in the package net.liftweb._ but compiler says it can't be
found. Is this the wrong package?
--~--~-~--~~~---~--~~
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: CometListener

2009-11-12 Thread jack

I also tried net.liftweb.http

On Nov 12, 11:35 pm, jack jack.wid...@gmail.com wrote:
 I am trying to use CometListener. According tohttp://bit.ly/1Wnxt4,
 it is in the package net.liftweb._ but compiler says it can't be
 found. Is this the wrong package?
--~--~-~--~~~---~--~~
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: CometListener

2009-11-12 Thread Jack Widman
C:\work\widman\src\main\scala\com\widman\comet\PackComet.scala:20: error:
type CometListener is not a member of package net.liftweb.http

I got this compile error.

I must be missing something obvious.

On Thu, Nov 12, 2009 at 11:42 PM, Ross Mellgren dri...@gmail.com wrote:


 It is in net.liftweb.http.


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


 By the way, the link you gave only indicates it's in either
 net.liftweb.http, net.liftweb.util, net.liftweb or model (or a couple
 other packages, since scala implicitly imports superpackages).

 -Ross

 On Nov 12, 2009, at 11:38 PM, jack wrote:

 
  I also tried net.liftweb.http
 
  On Nov 12, 11:35 pm, jack jack.wid...@gmail.com wrote:
  I am trying to use CometListener. According tohttp://bit.ly/1Wnxt4,
  it is in the package net.liftweb._ but compiler says it can't be
  found. Is this the wrong package?
  


 



-- 
Jack Widman

co-founder / cto,  Authoritude, Inc.

203-641-9355

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



[Lift] scala version

2009-11-12 Thread jack

I'm using lift version 1.1-M6. Which version of scala do I need? In
general, how do I know which version of Scala to use?
--~--~-~--~~~---~--~~
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: CometListener

2009-11-12 Thread Jack Widman
David,

I'm using lift 1.1 and scala 2.5 now and the compiler says it cant find
CometListener when I import net.liftweb.http._

Jack

On Fri, Nov 13, 2009 at 12:01 AM, David Pollak 
feeder.of.the.be...@gmail.com wrote:



 On Thu, Nov 12, 2009 at 8:54 PM, Jack Widman jack.wid...@gmail.comwrote:

 C:\work\widman\src\main\scala\com\widman\comet\PackComet.scala:20: error:
 type CometListener is not a member of package net.liftweb.http

 I got this compile error.

 I must be missing something obvious.


 It's part of Lift 1.1, not Lift 1.0




  On Thu, Nov 12, 2009 at 11:42 PM, Ross Mellgren dri...@gmail.comwrote:


 It is in net.liftweb.http.


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


 By the way, the link you gave only indicates it's in either
 net.liftweb.http, net.liftweb.util, net.liftweb or model (or a couple
 other packages, since scala implicitly imports superpackages).

 -Ross

 On Nov 12, 2009, at 11:38 PM, jack wrote:

 
  I also tried net.liftweb.http
 
  On Nov 12, 11:35 pm, jack jack.wid...@gmail.com wrote:
  I am trying to use CometListener. According tohttp://bit.ly/1Wnxt4,
  it is in the package net.liftweb._ but compiler says it can't be
  found. Is this the wrong package?
  






 --
 Jack Widman

 co-founder / cto,  Authoritude, Inc.

 203-641-9355






 --
 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

 



-- 
Jack Widman

co-founder / cto,  Authoritude, Inc.

203-641-9355

--~--~-~--~~~---~--~~
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: CometActor and render

2009-11-11 Thread jack

one more thing: I also ran the code without the piece that retrieves
web pages and gets their length. Instead I just had the Calculator
class sleep for 10 seconds (which is longer than the http request
takes) and then return a random number. This worked fine. I can't see
what the difference is.

On Nov 11, 11:26 pm, Jack Widman jack.wid...@gmail.com wrote:
 David,

 I have attached my code. It runs but does not behave as I intended it to.
 The code does a web search on the term scala and displays a list of URLs
 of the results. Next to each URL it says Page Length : -1. A process is
 running in the background which takes each URL, goes out and gets the page
 and takes the length of the page. The length of that page is then supposed
 to immediately appear on the page next to that URL. I put the lengths on a
 queue, as they come in, and I have the Comet page poll the queue and display
 the results. It would probably be better to have the results send a message
 to the Comet class so the page is only re-rendered when there is a change
 but for now I am polling.

 I can see the lengths coming in and being put on the queue, but the Comet
 page is not getting them till they are all retrieved. (This takes way too
 long and nothing changes on the screen till its too late). I need them to
 appear as they come in. Occasionally I can see a length being retrieved and
 the Comet page finds it but even then it is not displayed until all the
 lengths are in.   I know this is not very clear but I think it will be clear
 from the code.

 I also know there are a lot of places in the code which can be improved and
 I welcome all of your input but what I would love is to have these numbers
 appear on the page as they they are retrieved. I have been stumped by this
 for a while and I suspect that somebody who knows Lift well might see the
 problem right away.

 The class that retrieves the page lengths is called Calculator and the queue
 is called SourceQueue. The classes are pretty small so hopefully it will be
 clear what is going on. I want you to know I think it is incredible how
 responsive you and the group are and I look forward to using Lift in the
 future.

 Thanks so much.

 Jack

 On Tue, Nov 10, 2009 at 1:27 AM, David Pollak feeder.of.the.be...@gmail.com

  wrote:

  On Mon, Nov 9, 2009 at 10:10 PM, Jack Widman jack.wid...@gmail.comwrote:

  The only difference between your working code and mine is that mine has a
  process in the background that is always running and puts Foo objects on a
  queue whenever they are ready. Where can I start this long running process
  so that it doesn't interfere with the lowPriority method that takes things
  off the queue and rerenders the page. I tried starting the process in its
  own Actor that I start in localSetup but it seems somehow to be blocking 
  the
  lowPriority method from doing its thing.

  I have no idea what this means... sorry.

  Please post actual runnable code and we can help you debug.

  On Sun, Nov 8, 2009 at 11:35 PM, David Pollak 
  feeder.of.the.be...@gmail.com wrote:

  Jack,

  I reproduced your code and it seems to work fine.  I've enclosed a
  working copy.

  Some comments about your code:

     - The foos variable and the foo variable may be getting confused in
     the code... the render method may be rendering the same thing based on 
  the
     unchanging foos variable.
     - Doing null testing is a sign that you have logic errors in your
     code.  I strongly recommend using either Box or Option for everything 
  that
     can logically not contain a value/reference.  If you're bridging out 
  to Java
     code and are expecting null from the Java code, write a small bridge 
  that
     will wrapper the Java return values in Box/Option.
     - You have a case class (Tick) that contains no parameters.  Please
     use a case object instead.
     - Your Tick look is a spin loop.  You fire a Tick message as part of
     processing the Tick message.  I would suggest that if you're polling, 
  that
     you have a reasonable poll interval, otherwise you'll starve your CPU.
     Further, having reRender on each loop through means that you're 
  forcing a
     lot of bytes over the wire rather than only doing a reRender on changed
     values.

  Thanks,

  David

  On Sun, Nov 8, 2009 at 3:47 PM, Jack Widman jack.wid...@gmail.comwrote:

  Sorry. Here it is:   As I said, I know that when render is called,
  foo.getValue has the right value. But it does not show on the screen, 
  unless
  I refresh the browser.

  package com.foo.comet

  import net.liftweb._
  import http._
  import js._
  import JsCmds._
  import net.liftweb.util._
  import net.liftweb.http._
  import _root_.scala.xml._
  import scala.actors._
  import com.authoritude.snippet._
  import scala.collection.mutable.Queue
  import net.liftweb.http.SessionVar

  class MyComet extends CometActor {

    override def defaultPrefix = Full(auth)

    private var foos = FooManager.getFoos

[Lift] Re: CometActor and render

2009-11-10 Thread Jack Widman
Sorry. Just reread my past post and it is indeed unclear. I will post
running code tonight. I very much appreciate your help.

On Tue, Nov 10, 2009 at 1:27 AM, David Pollak feeder.of.the.be...@gmail.com
 wrote:



 On Mon, Nov 9, 2009 at 10:10 PM, Jack Widman jack.wid...@gmail.comwrote:

 The only difference between your working code and mine is that mine has a
 process in the background that is always running and puts Foo objects on a
 queue whenever they are ready. Where can I start this long running process
 so that it doesn't interfere with the lowPriority method that takes things
 off the queue and rerenders the page. I tried starting the process in its
 own Actor that I start in localSetup but it seems somehow to be blocking the
 lowPriority method from doing its thing.


 I have no idea what this means... sorry.

 Please post actual runnable code and we can help you debug.



 On Sun, Nov 8, 2009 at 11:35 PM, David Pollak 
 feeder.of.the.be...@gmail.com wrote:

 Jack,

 I reproduced your code and it seems to work fine.  I've enclosed a
 working copy.

 Some comments about your code:

- The foos variable and the foo variable may be getting confused in
the code... the render method may be rendering the same thing based on 
 the
unchanging foos variable.
- Doing null testing is a sign that you have logic errors in your
code.  I strongly recommend using either Box or Option for everything 
 that
can logically not contain a value/reference.  If you're bridging out to 
 Java
code and are expecting null from the Java code, write a small bridge that
will wrapper the Java return values in Box/Option.
- You have a case class (Tick) that contains no parameters.  Please
use a case object instead.
- Your Tick look is a spin loop.  You fire a Tick message as part of
processing the Tick message.  I would suggest that if you're polling, 
 that
you have a reasonable poll interval, otherwise you'll starve your CPU.
Further, having reRender on each loop through means that you're forcing a
lot of bytes over the wire rather than only doing a reRender on changed
values.

 Thanks,

 David

 On Sun, Nov 8, 2009 at 3:47 PM, Jack Widman jack.wid...@gmail.comwrote:

 Sorry. Here it is:   As I said, I know that when render is called,
 foo.getValue has the right value. But it does not show on the screen, 
 unless
 I refresh the browser.

 package com.foo.comet

 import net.liftweb._
 import http._
 import js._
 import JsCmds._
 import net.liftweb.util._
 import net.liftweb.http._
 import _root_.scala.xml._
 import scala.actors._
 import com.authoritude.snippet._
 import scala.collection.mutable.Queue
 import net.liftweb.http.SessionVar


 class MyComet extends CometActor {

   override def defaultPrefix = Full(auth)

   private var foos = FooManager.getFoos

   def createDisplay(foos:List[Foo]):NodeSeq = {
 span id=gotable
 {
   for {foo - foos} yield trtd{foo.getValue}/td/tr
 }

 /table/span
   }

   def render = { bind(foo - createDisplay(foos)) }

   override def localSetup = {
 super.localSetup
 this ! Tick
   }

   var foo:Foo = null
   override def lowPriority = {
 case Tick = {
   foo=FooQueue.getLatest
   if (foo!=null  foo.getValue  -1) {
 blogs = FooManager.process(foo, foos)
   } else if (foo!=null){
 foos = foos.remove((f:Foo)=(f.id==foo.id))
   }
   reRender(false)
   this ! Tick
 }
   }
 }

 case class Tick



 On Sun, Nov 8, 2009 at 5:31 AM, Timothy Perrett 
 timo...@getintheloop.eu wrote:


 Without posting your code it's going to be tough to help you.

 Cheers, Tim

 Sent from my iPhone

 On 8 Nov 2009, at 08:14, jack jack.wid...@gmail.com wrote:

 
  By the way, I know that when render is called, all the variables have
  the right values. I just don't see it on the screen unless I refresh
  it.
 
  On Nov 8, 3:12 am, jack jack.wid...@gmail.com wrote:
  I have a CometActor. render is called when it is supposed to be but
 I
  don't see the changes. If I refresh the page at anytime, I do see
 the
  changes. Any idea what might cause this?
  
 





 --
 Jack Widman

 co-founder / cto,  Authoritude, Inc.

 203-641-9355






 --
 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






 --
 Jack Widman

 co-founder / cto,  Authoritude, Inc.

 203-641-9355





 --
 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

 



-- 
Jack Widman

co-founder / cto,  Authoritude, Inc.

203-641-9355

--~--~-~--~~~---~--~~
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

[Lift] Re: CometActor and render

2009-11-09 Thread Jack Widman
The only difference between your working code and mine is that mine has a
process in the background that is always running and puts Foo objects on a
queue whenever they are ready. Where can I start this long running process
so that it doesn't interfere with the lowPriority method that takes things
off the queue and rerenders the page. I tried starting the process in its
own Actor that I start in localSetup but it seems somehow to be blocking the
lowPriority method from doing its thing.

On Sun, Nov 8, 2009 at 11:35 PM, David Pollak feeder.of.the.be...@gmail.com
 wrote:

 Jack,

 I reproduced your code and it seems to work fine.  I've enclosed a working
 copy.

 Some comments about your code:

- The foos variable and the foo variable may be getting confused in the
code... the render method may be rendering the same thing based on the
unchanging foos variable.
- Doing null testing is a sign that you have logic errors in your
code.  I strongly recommend using either Box or Option for everything that
can logically not contain a value/reference.  If you're bridging out to 
 Java
code and are expecting null from the Java code, write a small bridge that
will wrapper the Java return values in Box/Option.
- You have a case class (Tick) that contains no parameters.  Please use
a case object instead.
- Your Tick look is a spin loop.  You fire a Tick message as part of
processing the Tick message.  I would suggest that if you're polling, that
you have a reasonable poll interval, otherwise you'll starve your CPU.
Further, having reRender on each loop through means that you're forcing a
lot of bytes over the wire rather than only doing a reRender on changed
values.

 Thanks,

 David

 On Sun, Nov 8, 2009 at 3:47 PM, Jack Widman jack.wid...@gmail.com wrote:

 Sorry. Here it is:   As I said, I know that when render is called,
 foo.getValue has the right value. But it does not show on the screen, unless
 I refresh the browser.

 package com.foo.comet

 import net.liftweb._
 import http._
 import js._
 import JsCmds._
 import net.liftweb.util._
 import net.liftweb.http._
 import _root_.scala.xml._
 import scala.actors._
 import com.authoritude.snippet._
 import scala.collection.mutable.Queue
 import net.liftweb.http.SessionVar


 class MyComet extends CometActor {

   override def defaultPrefix = Full(auth)

   private var foos = FooManager.getFoos

   def createDisplay(foos:List[Foo]):NodeSeq = {
 span id=gotable
 {
   for {foo - foos} yield trtd{foo.getValue}/td/tr
 }

 /table/span
   }

   def render = { bind(foo - createDisplay(foos)) }

   override def localSetup = {
 super.localSetup
 this ! Tick
   }

   var foo:Foo = null
   override def lowPriority = {
 case Tick = {
   foo=FooQueue.getLatest
   if (foo!=null  foo.getValue  -1) {
 blogs = FooManager.process(foo, foos)
   } else if (foo!=null){
 foos = foos.remove((f:Foo)=(f.id==foo.id))
   }
   reRender(false)
   this ! Tick
 }
   }
 }

 case class Tick



 On Sun, Nov 8, 2009 at 5:31 AM, Timothy Perrett 
 timo...@getintheloop.euwrote:


 Without posting your code it's going to be tough to help you.

 Cheers, Tim

 Sent from my iPhone

 On 8 Nov 2009, at 08:14, jack jack.wid...@gmail.com wrote:

 
  By the way, I know that when render is called, all the variables have
  the right values. I just don't see it on the screen unless I refresh
  it.
 
  On Nov 8, 3:12 am, jack jack.wid...@gmail.com wrote:
  I have a CometActor. render is called when it is supposed to be but I
  don't see the changes. If I refresh the page at anytime, I do see the
  changes. Any idea what might cause this?
  
 





 --
 Jack Widman

 co-founder / cto,  Authoritude, Inc.

 203-641-9355






 --
 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


 



-- 
Jack Widman

co-founder / cto,  Authoritude, Inc.

203-641-9355

--~--~-~--~~~---~--~~
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] CometActor and render

2009-11-08 Thread jack

I have a CometActor. render is called when it is supposed to be but I
don't see the changes. If I refresh the page at anytime, I do see the
changes. Any idea what might cause this?
--~--~-~--~~~---~--~~
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: CometActor and render

2009-11-08 Thread jack

By the way, I know that when render is called, all the variables have
the right values. I just don't see it on the screen unless I refresh
it.

On Nov 8, 3:12 am, jack jack.wid...@gmail.com wrote:
 I have a CometActor. render is called when it is supposed to be but I
 don't see the changes. If I refresh the page at anytime, I do see the
 changes. Any idea what might cause this?
--~--~-~--~~~---~--~~
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: CometActor and render

2009-11-08 Thread Jack Widman
Sorry. Here it is:   As I said, I know that when render is called,
foo.getValue has the right value. But it does not show on the screen, unless
I refresh the browser.

package com.foo.comet

import net.liftweb._
import http._
import js._
import JsCmds._
import net.liftweb.util._
import net.liftweb.http._
import _root_.scala.xml._
import scala.actors._
import com.authoritude.snippet._
import scala.collection.mutable.Queue
import net.liftweb.http.SessionVar


class MyComet extends CometActor {

  override def defaultPrefix = Full(auth)

  private var foos = FooManager.getFoos

  def createDisplay(foos:List[Foo]):NodeSeq = {
span id=gotable
{
  for {foo - foos} yield trtd{foo.getValue}/td/tr
}

/table/span
  }

  def render = { bind(foo - createDisplay(foos)) }

  override def localSetup = {
super.localSetup
this ! Tick
  }

  var foo:Foo = null
  override def lowPriority = {
case Tick = {
  foo=FooQueue.getLatest
  if (foo!=null  foo.getValue  -1) {
blogs = FooManager.process(foo, foos)
  } else if (foo!=null){
foos = foos.remove((f:Foo)=(f.id==foo.id))
  }
  reRender(false)
  this ! Tick
}
  }
}

case class Tick


On Sun, Nov 8, 2009 at 5:31 AM, Timothy Perrett timo...@getintheloop.euwrote:


 Without posting your code it's going to be tough to help you.

 Cheers, Tim

 Sent from my iPhone

 On 8 Nov 2009, at 08:14, jack jack.wid...@gmail.com wrote:

 
  By the way, I know that when render is called, all the variables have
  the right values. I just don't see it on the screen unless I refresh
  it.
 
  On Nov 8, 3:12 am, jack jack.wid...@gmail.com wrote:
  I have a CometActor. render is called when it is supposed to be but I
  don't see the changes. If I refresh the page at anytime, I do see the
  changes. Any idea what might cause this?
  
 

 



-- 
Jack Widman

co-founder / cto,  Authoritude, Inc.

203-641-9355

--~--~-~--~~~---~--~~
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: CometActor and render

2009-11-08 Thread jack

One more thing. 'foo's get added to the FooQueue periodically.

On Nov 8, 6:47 pm, Jack Widman jack.wid...@gmail.com wrote:
 Sorry. Here it is:   As I said, I know that when render is called,
 foo.getValue has the right value. But it does not show on the screen, unless
 I refresh the browser.

 package com.foo.comet

 import net.liftweb._
 import http._
 import js._
 import JsCmds._
 import net.liftweb.util._
 import net.liftweb.http._
 import _root_.scala.xml._
 import scala.actors._
 import com.authoritude.snippet._
 import scala.collection.mutable.Queue
 import net.liftweb.http.SessionVar

 class MyComet extends CometActor {

   override def defaultPrefix = Full(auth)

   private var foos = FooManager.getFoos

   def createDisplay(foos:List[Foo]):NodeSeq = {
     span id=gotable
     {
       for {foo - foos} yield trtd{foo.getValue}/td/tr
     }

     /table/span
   }

   def render = { bind(foo - createDisplay(foos)) }

   override def localSetup = {
     super.localSetup
     this ! Tick
   }

   var foo:Foo = null
   override def lowPriority = {
     case Tick = {
       foo=FooQueue.getLatest
       if (foo!=null  foo.getValue  -1) {
     blogs = FooManager.process(foo, foos)
       } else if (foo!=null){
     foos = foos.remove((f:Foo)=(f.id==foo.id))
       }
       reRender(false)
       this ! Tick
     }
   }

 }

 case class Tick

 On Sun, Nov 8, 2009 at 5:31 AM, Timothy Perrett 
 timo...@getintheloop.euwrote:





  Without posting your code it's going to be tough to help you.

  Cheers, Tim

  Sent from my iPhone

  On 8 Nov 2009, at 08:14, jack jack.wid...@gmail.com wrote:

   By the way, I know that when render is called, all the variables have
   the right values. I just don't see it on the screen unless I refresh
   it.

   On Nov 8, 3:12 am, jack jack.wid...@gmail.com wrote:
   I have a CometActor. render is called when it is supposed to be but I
   don't see the changes. If I refresh the page at anytime, I do see the
   changes. Any idea what might cause this?

 --
 Jack Widman

 co-founder / cto,  Authoritude, Inc.

 203-641-9355
--~--~-~--~~~---~--~~
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: CometActor and render

2009-11-08 Thread Jack Widman
Thanks David. This is a big help. Can you tell me exactly how lowPriority,
mediumPriorty and highPriority work? When are they called?

On Sun, Nov 8, 2009 at 11:35 PM, David Pollak feeder.of.the.be...@gmail.com
 wrote:

 Jack,

 I reproduced your code and it seems to work fine.  I've enclosed a working
 copy.

 Some comments about your code:

- The foos variable and the foo variable may be getting confused in the
code... the render method may be rendering the same thing based on the
unchanging foos variable.
- Doing null testing is a sign that you have logic errors in your
code.  I strongly recommend using either Box or Option for everything that
can logically not contain a value/reference.  If you're bridging out to 
 Java
code and are expecting null from the Java code, write a small bridge that
will wrapper the Java return values in Box/Option.
- You have a case class (Tick) that contains no parameters.  Please use
a case object instead.
- Your Tick look is a spin loop.  You fire a Tick message as part of
processing the Tick message.  I would suggest that if you're polling, that
you have a reasonable poll interval, otherwise you'll starve your CPU.
Further, having reRender on each loop through means that you're forcing a
lot of bytes over the wire rather than only doing a reRender on changed
values.

 Thanks,

 David

 On Sun, Nov 8, 2009 at 3:47 PM, Jack Widman jack.wid...@gmail.com wrote:

 Sorry. Here it is:   As I said, I know that when render is called,
 foo.getValue has the right value. But it does not show on the screen, unless
 I refresh the browser.

 package com.foo.comet

 import net.liftweb._
 import http._
 import js._
 import JsCmds._
 import net.liftweb.util._
 import net.liftweb.http._
 import _root_.scala.xml._
 import scala.actors._
 import com.authoritude.snippet._
 import scala.collection.mutable.Queue
 import net.liftweb.http.SessionVar


 class MyComet extends CometActor {

   override def defaultPrefix = Full(auth)

   private var foos = FooManager.getFoos

   def createDisplay(foos:List[Foo]):NodeSeq = {
 span id=gotable
 {
   for {foo - foos} yield trtd{foo.getValue}/td/tr
 }

 /table/span
   }

   def render = { bind(foo - createDisplay(foos)) }

   override def localSetup = {
 super.localSetup
 this ! Tick
   }

   var foo:Foo = null
   override def lowPriority = {
 case Tick = {
   foo=FooQueue.getLatest
   if (foo!=null  foo.getValue  -1) {
 blogs = FooManager.process(foo, foos)
   } else if (foo!=null){
 foos = foos.remove((f:Foo)=(f.id==foo.id))
   }
   reRender(false)
   this ! Tick
 }
   }
 }

 case class Tick



 On Sun, Nov 8, 2009 at 5:31 AM, Timothy Perrett 
 timo...@getintheloop.euwrote:


 Without posting your code it's going to be tough to help you.

 Cheers, Tim

 Sent from my iPhone

 On 8 Nov 2009, at 08:14, jack jack.wid...@gmail.com wrote:

 
  By the way, I know that when render is called, all the variables have
  the right values. I just don't see it on the screen unless I refresh
  it.
 
  On Nov 8, 3:12 am, jack jack.wid...@gmail.com wrote:
  I have a CometActor. render is called when it is supposed to be but I
  don't see the changes. If I refresh the page at anytime, I do see the
  changes. Any idea what might cause this?
  
 





 --
 Jack Widman

 co-founder / cto,  Authoritude, Inc.

 203-641-9355






 --
 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


 



-- 
Jack Widman

co-founder / cto,  Authoritude, Inc.

203-641-9355

--~--~-~--~~~---~--~~
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] using Dispatch library for Http

2009-11-05 Thread jack

I'm using the Dispatch Databinder library for Http.  http://bit.ly/NPWcW

My code is this simple method.

 def testCheckPage(url:String):String = {
try {
  var http = new Http
  var request = new Request
(url)
  val req_with_agent = request : Map(User-Agent - Mozilla/
5.0)
  val responseBody = Http (req_with_agent as_str)
  responseBody.length.toString
} catch {
   case ex: Exception = {
 Message:  + ex.getMessage
   }
}
  }

For some urls, e.g., http://bae.cf.huffingtonpost.com/ , an exception
is thrown but the exception message is null. Any ideas?
--~--~-~--~~~---~--~~
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: using Dispatch library for Http

2009-11-05 Thread Jack Widman
Thanks Ross, I'll try it.

On Thu, Nov 5, 2009 at 11:51 PM, Ross Mellgren dri...@gmail.com wrote:


 Many exceptions do not have a message, e.g. NullPointerException
 (unless thrown by hand).

 Maybe:

 try {
 ...
 } catch {
 case ex: Exception if ex.getMessage == null = Message:  +
 ex.toString
 case ex: Exception = Message:  + ex.getMessage
 }

 -Ross

 On Nov 5, 2009, at 11:45 PM, jack wrote:

 
  I'm using the Dispatch Databinder library for Http.  http://bit.ly/NPWcW
 
  My code is this simple method.
 
  def testCheckPage(url:String):String = {
 try {
   var http = new Http
   var request = new Request
  (url)
   val req_with_agent = request : Map(User-Agent - Mozilla/
  5.0)
   val responseBody = Http (req_with_agent as_str)
   responseBody.length.toString
 } catch {
case ex: Exception = {
 Message:  + ex.getMessage
}
 }
   }
 
  For some urls, e.g., http://bae.cf.huffingtonpost.com/ , an exception
  is thrown but the exception message is null. Any ideas?
  


 



-- 
Jack Widman

co-founder / cto,  Authoritude, Inc.

203-641-9355

--~--~-~--~~~---~--~~
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: using Dispatch library for Http

2009-11-05 Thread Jack Widman
Tried and I see now that the exception is java.nio.BufferUnderflowException
Any idea what might be causing this?

On Thu, Nov 5, 2009 at 11:51 PM, Ross Mellgren dri...@gmail.com wrote:


 Many exceptions do not have a message, e.g. NullPointerException
 (unless thrown by hand).

 Maybe:

 try {
 ...
 } catch {
 case ex: Exception if ex.getMessage == null = Message:  +
 ex.toString
  case ex: Exception = Message:  + ex.getMessage
 }

 -Ross

 On Nov 5, 2009, at 11:45 PM, jack wrote:

 
  I'm using the Dispatch Databinder library for Http.  http://bit.ly/NPWcW
 
  My code is this simple method.
 
  def testCheckPage(url:String):String = {
 try {
   var http = new Http
   var request = new Request
  (url)
   val req_with_agent = request : Map(User-Agent - Mozilla/
  5.0)
   val responseBody = Http (req_with_agent as_str)
   responseBody.length.toString
 } catch {
case ex: Exception = {
 Message:  + ex.getMessage
}
 }
   }
 
  For some urls, e.g., http://bae.cf.huffingtonpost.com/ , an exception
  is thrown but the exception message is null. Any ideas?
  


 



-- 
Jack Widman

co-founder / cto,  Authoritude, Inc.

203-641-9355

--~--~-~--~~~---~--~~
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] regular expression

2009-11-02 Thread jack

I am using the findAllIn function for regular expressions. How do I
make it ignore case? I know its simple but I can't find it.
--~--~-~--~~~---~--~~
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: regular expression

2009-11-02 Thread Jack Widman
Thanks Derek. Will do.

On Mon, Nov 2, 2009 at 3:45 PM, Derek Chen-Becker dchenbec...@gmail.comwrote:

 From the Scaladoc for scala.util.matching.Regex:

 You can use special pattern syntax construct (?idmsux-idmsux) to switch
 various regex compilation options like CASE_INSENSITIVE or UNICODE_CASE.
 See java.util.regex.Pattern javadoc for details.

 Probably better to ask Scala questions on the Scala list(s).


 On Mon, Nov 2, 2009 at 10:28 AM, jack jack.wid...@gmail.com wrote:


 I am using the findAllIn function for regular expressions. How do I
 make it ignore case? I know its simple but I can't find it.



 



-- 
Jack Widman

co-founder / cto,  Authoritude, Inc.

203-641-9355

--~--~-~--~~~---~--~~
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] global exception page

2009-10-28 Thread jack

I would like to have one error page that appears when any exception
occurs. How would I do that?
--~--~-~--~~~---~--~~
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: global exception page

2009-10-28 Thread Jack Widman
Yes. Thanks alot Tim.

On Wed, Oct 28, 2009 at 9:32 AM, Timothy Perrett timo...@getintheloop.euwrote:


 Jack,

 LiftRules.exceptionHandler.prepend {
   case (Props.RunModes.Production, r, e) = {
 Log.error(IMPORTANT IMPORTANT IMPORTANT: Unhandeled error
 occoured!!,e)
 // your LiftResponse here
RedirectResponse(/error)
   }
 }

 Does that clear it up for you...?

 Cheers, Tim

 On 28 Oct 2009, at 13:17, jack wrote:

 
  I would like to have one error page that appears when any exception
  occurs. How would I do that?
  
 


 



-- 
Jack Widman

co-founder / cto,  Authoritude, Inc.

203-641-9355

--~--~-~--~~~---~--~~
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] TextileParser

2009-10-25 Thread jack

I am trying to use TextileParser and so I am importing it but I'm
getting the error.

 value textile is not a member of package net.liftweb

What am I missing?

Jack
--~--~-~--~~~---~--~~
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] 1.1

2009-10-25 Thread jack

I have been using lift 1.0. What is the best way to upgrade to 1.1?
--~--~-~--~~~---~--~~
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: 1.1

2009-10-25 Thread Jack Widman
Thanks Tim. And next time I will search more before asking.

On Sun, Oct 25, 2009 at 2:26 PM, Timothy Perrett timo...@getintheloop.euwrote:


 Jack,

 This question has been asked quite a number of times recently on list.

 Change:

 version1.0/version

 on the liftweb dependencies in your pom.xml to be:

 version1.1-SNAPSHOT/version

 That will give you the latest HEAD build. If you want a known point in
 time, use M6:

 version1.1-M6/version

 Cheers, Tim

 On Oct 25, 6:00 pm, jack jack.wid...@gmail.com wrote:
  I have been using lift 1.0. What is the best way to upgrade to 1.1?
 



-- 
Jack Widman

co-founder / cto,  Authoritude, Inc.

203-641-9355

--~--~-~--~~~---~--~~
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: html not being evalutated

2009-10-21 Thread jack

Let's say source.body is ahref=google.comSearch/a.  If I put
source.body in a span like this -

span{source.body}/span

source.body will be converted to text and the actual link tags will be
displayed. What is the right way to do this?

On Oct 21, 9:06 am, David Pollak feeder.of.the.be...@gmail.com
wrote:
 On Tue, Oct 20, 2009 at 10:16 PM, jack jack.wid...@gmail.com wrote:

  OK, I see why this is happening. the {exp} in the NodeSeq convert exp
  to a String. So I did by creating a string and then converting it to a
  NodeSeq at the end. Is there a way to do this without using and
  intermediary string?

 I don't know what a source is, but you really, really have to be careful
 about promoting a String to a NodeSeq.  If the String has user-generated
 content in it, then you've got a cross-site scripting vulnerability waiting
 to happen.  For user-generated content, I suggest using Textile parser built
 into Lift.

 In any case, if you don't have a NodeSeq in your data structure, you'll have
 to parse it into XML before displaying it.





  On Oct 21, 1:03 am, jack jack.wid...@gmail.com wrote:
   I have the following method display. source.body has html tags in it
   but the actual tags are showing instead of being evaluated. e.g. I'm
   seeing things like 'bHey There/b' instead of 'Hey There' in bold.
   This method is in a CometActor and is running when the page is
   rendered. Am I missing something obvious?

    def display(sources:List[Source]):NodeSeq = {

       span id=jooptable
       {
          for {source - sources} yield trtd{source.body}/td/tr
       }

       /table
       /span
     }

 --
 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 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: html not being evalutated

2009-10-21 Thread Jack Widman
Oops. I just noticed I made source.body a String and not a NodeSeq.
Sometimes source.body is text with html tags in it. Like -

Hey dude, bwhat/b are you doing?
I guess I should make it a NodeSeq. Sorry about that.
Jack

On Wed, Oct 21, 2009 at 9:33 AM, David Pollak feeder.of.the.be...@gmail.com
 wrote:



 On Wed, Oct 21, 2009 at 6:32 AM, jack jack.wid...@gmail.com wrote:


 Let's say source.body is ahref=google.comSearch/a.  If I put
 source.body in a span like this -

 span{source.body}/span

 source.body will be converted to text and the actual link tags will be
 displayed. What is the right way to do this?


 How was source.body generated?


 On Oct 21, 9:06 am, David Pollak feeder.of.the.be...@gmail.com
 wrote:
  On Tue, Oct 20, 2009 at 10:16 PM, jack jack.wid...@gmail.com wrote:
 
   OK, I see why this is happening. the {exp} in the NodeSeq convert exp
   to a String. So I did by creating a string and then converting it to a
   NodeSeq at the end. Is there a way to do this without using and
   intermediary string?
 
  I don't know what a source is, but you really, really have to be careful
  about promoting a String to a NodeSeq.  If the String has user-generated
  content in it, then you've got a cross-site scripting vulnerability
 waiting
  to happen.  For user-generated content, I suggest using Textile parser
 built
  into Lift.
 
  In any case, if you don't have a NodeSeq in your data structure, you'll
 have
  to parse it into XML before displaying it.
 
 
 
 
 
   On Oct 21, 1:03 am, jack jack.wid...@gmail.com wrote:
I have the following method display. source.body has html tags in it
but the actual tags are showing instead of being evaluated. e.g. I'm
seeing things like 'bHey There/b' instead of 'Hey There' in
 bold.
This method is in a CometActor and is running when the page is
rendered. Am I missing something obvious?
 
 def display(sources:List[Source]):NodeSeq = {
 
span id=jooptable
{
   for {source - sources} yield trtd{source.body}/td/tr
}
 
/table
/span
  }
 
  --
  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




 --
 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

 



-- 
Jack

--~--~-~--~~~---~--~~
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: Newbie post: Where are the basics and best practices?

2009-10-21 Thread Jack Widman
Just wanted to say that I have never seen a community like this. Its
fantastic!

On Wed, Oct 21, 2009 at 11:05 PM, David Pollak 
feeder.of.the.be...@gmail.com wrote:



 On Wed, Oct 21, 2009 at 4:15 PM, Strom strommo...@gmail.com wrote:


 Hello everyone,
 I am pretty much brand new to lift and scala, and I come from a non-
 framework jsp/java servlet/hibernate background. I've been reading
 this board, Beginning Scala, The lift book, and googling how to use
 the lift framework, but I can't seem to find some basic info.


 That's why we're here.  Ask away!


 Please
 help me out. I know these are very basic questions, and posting on the
 group was a last resort after coming up empty on searches. I want to
 start off with best practices since I'm beginning from scratch.


 Doing some searching is great, but asking on list is heartily encouraged.



 1. Directory structure - where is everything?
 Looking at the PocketChange example and making a basic lift 1.0
 project via netbeans, I know that the DB schema go under model, the
 snippets in snippet, the templates in the corresponding webapp/
 templates-hidden directory, and the web pages in the webapp
 directory.

 What I don't know is where /classpath or lift:CSS.blueprint are
 actually going. Is classpath still going to src/main/resources/
 toserve, or is that old info? Looking at the default.html template,
 there's no jquery.js or CSS files in a toserve directory; in fact
 there is no toserve directory period, so I made my own. Also I see
 lift:CSS.blueprint, and I have no idea where that's going. I don't
 see any CSS class with blueprint method, but the syntax looks clean
 and I'd like to add my own custom stylesheet in the same fashion.


 The /classpath stuff is served out of the Lift JAR file rather than out of
 a directory.  If you want to have your own CSS, just put it in
 /src/webapp/css/xxx.css and then refer to /css/xxx.css in your web page.



 2. Dynamically generated HTML - what's the best practice, and how to
 do it?


 Snippets are the way that Lift does dynamic HTML.  It's not a templating
 system, but a binding between your XHTML file and methods on classes that
 substitute the dynamically generated HTML.


 I would like to know what the lift equivalent is for the following:

 a href=%=request.getContextPath()%/home/index.jspIndex/a


 In the case of Lift, you don't have to do this.  a
 href=/home/indexindex/a will automatically be rewritten for the correct
 context path. No work on your part.


 That's the way I was taught to link web pages together because it
 avoids hardcoding the page location, but the main point is the stuff
 inside %=...%. It looks like the lift uses {...}, but this example
 from the lift book causes an IllegalArgumentException (bad XML
 according to the msgs I've found on this board):
 link type=text/css rel=stylesheet href=
 {LiftRules.resourceServerPath + /css/style.css } /


 If you're writing Scala, then you can do substitutions like the one above,
 but Lift's views are not like JSP templates.  In the above case, you can
 simply say:
 link type=text/css rel=stylesheet href=/css/style.css/

 And it will be automatically updated based on the context path.


 How do I go about making this work, and in what scenarios should I be
 using this {...} approach vs snippets?

 Note: An earlier example in the lift book used href=/classpath/css/
 style.css, but later on said that the 1st method is better. The basic
 lift archetype references /classpath everywhere as well, so I don't
 know what to believe.

 I guess those are the glaring questions I have right now. In addition,
 what are some common search terms I could use to find this sort of
 basic info on the board, or where can I find best practices info and
 more examples of working sites? I'd rather see what documentation/
 tutorials already exists for beginners before I send more messages for
 the board, but my main issue is knowing whether or not I'm getting the
 right information; most every lift example document/wiki/tutorial I've
 seen is outdated code or incomplete. I'm looking for more code
 examples that comply with lift's current evolution. The lift book is
 helpful, but I also feel a little left out when I read it because I
 get the feeling the book assumes the reader knows certain lift and
 scala basics that are obvious to more seasoned users, but not to...me.

 Thank you so much for your help!


 Sure thing.

 Welcome to the community.

 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


 



-- 
Jack

--~--~-~--~~~---~--~~
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

[Lift] html not being evalutated

2009-10-20 Thread jack

I have the following method display. source.body has html tags in it
but the actual tags are showing instead of being evaluated. e.g. I'm
seeing things like 'bHey There/b' instead of 'Hey There' in bold.
This method is in a CometActor and is running when the page is
rendered. Am I missing something obvious?

 def display(sources:List[Source]):NodeSeq = {

span id=jooptable
{
   for {source - sources} yield trtd{source.body}/td/tr
}

/table
/span
  }
--~--~-~--~~~---~--~~
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: does this look ok?

2009-10-18 Thread Jack Widman
yes. I think I found the problem elsewhere in the logic. thanks.

On Sun, Oct 18, 2009 at 11:07 PM, Naftoli Gugenheim naftoli...@gmail.comwrote:

 I think so... Does it compile?


 On Sun, Oct 18, 2009 at 7:13 PM, jack jack.wid...@gmail.com wrote:


 Does this code look ok?


  def createDisplay(blogs:List[Blog]):NodeSeq = {

span id=scoretable
{
  for {blog - blogs} yield trtda href={blog.url}{blog.url}/
 a/tdtd {blog.title}/td/tr
 }
/table/span
  }

  def render  = { bind(joop - createDisplay(blogs)) }



 



-- 
Jack

--~--~-~--~~~---~--~~
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: The quality of the Lift list [was: Don't shoot the non-XML messenger ...]

2009-10-14 Thread Jack Widman
 at each
  insertion point as to whether the incoming String needs to be escaped.
   Because Strings are untyped, you don't know what they mean, if they're
  safe to be passed directly or if they need to be escaped.  On the other
  hand, keeping the output structure in XML, you know when you're promoting
 a
  String to an XML element and by default, it's done securely.  The
 developer
  has to affirmatively do something that will introduce a vulnerability.
   Here's an example:
 
  val inputFromBadUser = scriptalert('boo');/scriptval
  vulnerableStringTemplating = divThe other guy said:
  +inputFromBadUser+/div
  val safeXMLTemplating = divThe other guy said: {inputFromBadUser}/div
 
  Sure, it's possible to use the Unescaped class for a String and it's
  possible to parse the user's input as XML, but both of these cases are
 based
  on doing something other than the default.  The default if you're using
 XML
  for XHTML templating is that things are secure.  The default if you're
 using
  Strings to represent the output is is insecure unless the developer does
 the
  right thing at each insertion point.
 
  I thank you all for your participation in this community.  It's the kind
 of
  place I like being part of and that's because of the quality of the
 people
  and the discussions.  I want to make sure as we grow from 1,400+ members
 to
  5,000 members that the group retains the quality and energy that it has.
 
  David
 
  On Tue, Oct 13, 2009 at 7:21 PM, David Pollak 
 feeder.of.the.be...@gmail.com
 
 
 
   wrote:
   You are banned from this group.
 
   On Tue, Oct 13, 2009 at 6:24 PM, Aule grshipl...@gmail.com wrote:
 
   Bryan
 
   Been there, tried that.
   Oh - the mime type is text/vnd.curl
 
   Btw, actually a threat has been conveyed to me at mail.google.com and
   I have protested to Google
 
   I can't imagine Dave Hansen or MArtin Odersky or Bill Venners or Lex
   Spoon sending me a threat, but so it goes ...
 
   At least I will not get 4 years in an Egyptian prison for insulting
   Randy's Alma Mater (Madison).
 
   Oh Randy.  I read my Paul Valéry in the original.
 www.hsinfosystems.com
   is missing the accent on his surname.
 
   Lift is not Scala; I will continue to recommend Scala.
 
   For me, the jury on Lift is not yet in.  When some sycophants of
   Seaside got, nasty, I did not walk away from Seaside, warts and all.
 
   R
 
   On Oct 13, 8:10 pm, Bryan germ...@gmail.com wrote:
Hi Aule,
 
 I am still looking to see if I over-looked somewhere on the web
 where
 there is a 1.0.2 Boot.scala
 
   1) showing unambiguously how to flip the default Content-Type
   2) and having, in fact, the intended effect
 
  as I now know from a few trials over a few hours that this is not
 as
 simple as some web posts present.
 
I have not had a need for this, so I had to search some web posts
 to
find the answer.  Quckly, I found the following snippet:
 
LiftRules.determineContentType = {
  case _ = text/curl
 
}
 
I have not verified this, so please let us know if it does not help.
 
 Were it trivial, I had not mocked a framework, and you, Mr.
 Pollock,
 had not raged.
 
From my readings, Mr. Pollak has yet to show any rage.
 
--Bryan
 
   --
   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
 
  --
  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

 



-- 
Jack

--~--~-~--~~~---~--~~
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: The quality of the Lift list [was: Don't shoot the non-XML messenger ...]

2009-10-14 Thread Jack Widman
Not to harp on it  but:

*When some sycophants of
Seaside got, nasty, I did not walk away from Seaside, warts and all.
*
suggests this person has had this problem elsewhere.


On Wed, Oct 14, 2009 at 3:37 PM, Jack Widman jack.wid...@gmail.com wrote:

 The necessity of this kind of action (the banning) is absolutely no sign of
 anything having been done wrong. There will ALWAYS be people like that.


 On Wed, Oct 14, 2009 at 3:31 PM, koveen liep...@xs4all.nl wrote:


 I think that when someone enters a group, expecting to be shot,
 it is a very kind act only to ban him.

 Ko

 On Oct 14, 7:49 pm, David Pollak feeder.of.the.be...@gmail.com
 wrote:
  Folks,
 
  It is not lightly that I ban someone from the group... this is only the
  second time I've banned a substantive poster.  I'm going to discuss some
 of
  the process and then touch on some of the substance of the questions
 that
  the poster was getting at.
 
  The Lift community, reflected on this list, is an inquisitive, friendly
  place where people who have a passion for building great web apps
 converge
  and contribute to making Lift a really great open source framework.
  Newbies
  are the lifeblood of the group because they come with fresh perspectives
 and
  new ways of looking at things.  Questions from newbies help us refine
 and
  enhance Lift and the associated documentation.  Folks who are building
  production apps on Lift receive the fastest turn-around because these
 folks
  are betting their careers and their enterprises (even enterprises of
 one) on
  Lift and they deserve the best support in the industry for taking this
 risk.
 
  A big part of why this community is successful (in terms of size,
 quality of
  discussion, and quality of results) is because we keep the quality of
  discussion high.  How do we do this?  The folks who have been on the
 list
  generally keep the level of discussion to the Lift ideals.  We reward
  newbies with quick answers and encourage friendly discourse.  We are
  generally slower to respond to those that are less reflective of the
 list
  ideals.  I warn folks who are pushing boundaries (usually privately, but
  every once in a while publicly) and where the line is.
 
  In this case, nothing worked.  The poster was neither asking questions,
  giving usable feedback, or being polite in his engagement with the folks
 on
  the list.  I received a substantial number of private communications
 about
  this poster (which is pretty rare), and I took action.
 
  In terms of the substance, let me address to threat issue first.  I
  threatened to ban the poster from the list.  Perhaps DHH or Martin would
 not
  make such a threat.  I am very sure that the quality of discussion on
 the
  Lift list is higher than that on the Rails list (one of the reasons I
  started Lift was to be part of a nicer community.)  One cost of having a
  nicer place is excluding those who do not fit.  The second threat I
 made
  was to relay a tongue-in-cheek private communication I received about
 the
  poster to the list (after receiving the okay from the guy that made the
  communication to me.)  This threat was obvious, using video game
 rating
  language http://www.esrb.org/ratings/ratings_guide.jsp, Comic
 mischief
  and Cartoon violence.  It was something that even a 6 year old can
  distinguish from reality.  Put another way, the poster was talking about
  Kafkaesque experiences with using Lift and I responded with
  Jonesian
 http://www.youtube.com/watch?v=CrupqdGvsocfeature=PlayListp=62FED00..
 .language.
 
  In terms of the broader issue of Lift's HTML templating system being
 XHTML
  only, yes, that's true.  Lift treats HTML templates as XML.  Lift's
  templating system is not a String templating system but an XML
 templating
  system.  This satisfies the needs to render content to HTML browsers.
  If
  there are needs for generating other kinds of content, Lift is not as
 good,
  but in many cases there are better libraries for doing so.  Lift makes
 it
  very simple to integrate other rendering/templating engines into Lift,
  usually with a single line of code the dispatches the HTTP request to an
  alternate provider of a LiftResponse.  If the poster had simply said, I
  want to template non-HTML output, can you show me how? he would have
 gotten
  a nice example (and I might have even rolled it into demo.liftweb.netor
  maybe Tim might have blogged about it.
 
  Keeping things in XML has a number of advantages and a few
 disadvantages.
  First, the disadvantages: (1) you can't template non-XHTML responses and
 (2)
  everything must be well formed XML.  The advantages are (1) security (2)
  performance (it's easier to cache XML and the cost of mutating XML trees
 is
  O(log N)), (3) there is better separation of logic from the view
 (perhaps
  Terrance Parr's String Template library achieves this level of
 separation),
  and (4) the ability to mutate the resulting page (rewrite tags, move
 stuff
  to head/tail

[Lift] Re: The quality of the Lift list [was: Don't shoot the non-XML messenger ...]

2009-10-14 Thread Jack Widman
fyi

http://developers.curl.com/people/rshiplett

On Wed, Oct 14, 2009 at 3:40 PM, Jack Widman jack.wid...@gmail.com wrote:

 Not to harp on it  but:

 *When some sycophants of
 Seaside got, nasty, I did not walk away from Seaside, warts and all.
 *
 suggests this person has had this problem elsewhere.



 On Wed, Oct 14, 2009 at 3:37 PM, Jack Widman jack.wid...@gmail.comwrote:

 The necessity of this kind of action (the banning) is absolutely no sign
 of anything having been done wrong. There will ALWAYS be people like that.


 On Wed, Oct 14, 2009 at 3:31 PM, koveen liep...@xs4all.nl wrote:


 I think that when someone enters a group, expecting to be shot,
 it is a very kind act only to ban him.

 Ko

 On Oct 14, 7:49 pm, David Pollak feeder.of.the.be...@gmail.com
 wrote:
  Folks,
 
  It is not lightly that I ban someone from the group... this is only the
  second time I've banned a substantive poster.  I'm going to discuss
 some of
  the process and then touch on some of the substance of the questions
 that
  the poster was getting at.
 
  The Lift community, reflected on this list, is an inquisitive, friendly
  place where people who have a passion for building great web apps
 converge
  and contribute to making Lift a really great open source framework.
  Newbies
  are the lifeblood of the group because they come with fresh
 perspectives and
  new ways of looking at things.  Questions from newbies help us refine
 and
  enhance Lift and the associated documentation.  Folks who are building
  production apps on Lift receive the fastest turn-around because these
 folks
  are betting their careers and their enterprises (even enterprises of
 one) on
  Lift and they deserve the best support in the industry for taking this
 risk.
 
  A big part of why this community is successful (in terms of size,
 quality of
  discussion, and quality of results) is because we keep the quality of
  discussion high.  How do we do this?  The folks who have been on the
 list
  generally keep the level of discussion to the Lift ideals.  We reward
  newbies with quick answers and encourage friendly discourse.  We are
  generally slower to respond to those that are less reflective of the
 list
  ideals.  I warn folks who are pushing boundaries (usually privately,
 but
  every once in a while publicly) and where the line is.
 
  In this case, nothing worked.  The poster was neither asking questions,
  giving usable feedback, or being polite in his engagement with the
 folks on
  the list.  I received a substantial number of private communications
 about
  this poster (which is pretty rare), and I took action.
 
  In terms of the substance, let me address to threat issue first.  I
  threatened to ban the poster from the list.  Perhaps DHH or Martin
 would not
  make such a threat.  I am very sure that the quality of discussion on
 the
  Lift list is higher than that on the Rails list (one of the reasons I
  started Lift was to be part of a nicer community.)  One cost of having
 a
  nicer place is excluding those who do not fit.  The second threat I
 made
  was to relay a tongue-in-cheek private communication I received about
 the
  poster to the list (after receiving the okay from the guy that made the
  communication to me.)  This threat was obvious, using video game
 rating
  language http://www.esrb.org/ratings/ratings_guide.jsp, Comic
 mischief
  and Cartoon violence.  It was something that even a 6 year old can
  distinguish from reality.  Put another way, the poster was talking
 about
  Kafkaesque experiences with using Lift and I responded with
  Jonesian
 http://www.youtube.com/watch?v=CrupqdGvsocfeature=PlayListp=62FED00..
 .language.
 
  In terms of the broader issue of Lift's HTML templating system being
 XHTML
  only, yes, that's true.  Lift treats HTML templates as XML.  Lift's
  templating system is not a String templating system but an XML
 templating
  system.  This satisfies the needs to render content to HTML browsers.
  If
  there are needs for generating other kinds of content, Lift is not as
 good,
  but in many cases there are better libraries for doing so.  Lift makes
 it
  very simple to integrate other rendering/templating engines into Lift,
  usually with a single line of code the dispatches the HTTP request to
 an
  alternate provider of a LiftResponse.  If the poster had simply said,
 I
  want to template non-HTML output, can you show me how? he would have
 gotten
  a nice example (and I might have even rolled it into demo.liftweb.netor
  maybe Tim might have blogged about it.
 
  Keeping things in XML has a number of advantages and a few
 disadvantages.
  First, the disadvantages: (1) you can't template non-XHTML responses
 and (2)
  everything must be well formed XML.  The advantages are (1) security
 (2)
  performance (it's easier to cache XML and the cost of mutating XML
 trees is
  O(log N)), (3) there is better separation of logic from the view
 (perhaps
  Terrance Parr's String Template library

[Lift] Re: Naming CometActors

2009-10-07 Thread Jack Widman
The naming each CometActor with a different name is working quite nicely.

On Wed, Oct 7, 2009 at 5:51 PM, David Pollak
feeder.of.the.be...@gmail.comwrote:



 On Wed, Oct 7, 2009 at 2:39 PM, Derek Chen-Becker 
 dchenbec...@gmail.comwrote:

 It's been a while since I looked at this, but IIRC, the name for
 CometActor is there so that you can distinguish multiple actors on the same
 page. I don't think that you share a CometActor between multiple requests. I
 think that each request gets a new CometActor that's in place as long as the
 page is active.


 Multiple requests share the same CometActor given type/name.  The
 CometActor lives until the session ends or until it times out based on its
 lifespan.



 Derek


 On Tue, Oct 6, 2009 at 1:28 PM, Jack Widman jack.wid...@gmail.comwrote:


 So if give a  CometActor a static name, say Other, then every request
 will get the same running instance of the CometActor. But if I name it
 dynamically, say with a random string, each request will get its own
 instance of the CometActor. Right?
 --
 Jack








 --
 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


 



-- 
Jack

--~--~-~--~~~---~--~~
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: execute code when browser is closed

2009-10-06 Thread Jack Widman
I didn't mean to sound like I am justifying the way I am doing. I definitely
do not have a good feel for lift yet and  it feels hackey to me too. Part of
it is I'm rushing to get a demo done at the same time I am learning lift.
Thanks for your help.

On Tue, Oct 6, 2009 at 2:04 AM, Timothy Perrett timo...@getintheloop.euwrote:

 Hey jack,

 As I said before, I think the design you have is wrong if your needing to
 code in a hacky way such as this. The way you articulate the justification
 for using shutdown almost certianly clarifies an incorrect design.

 Personally I think you could use Ajax for this an have a much simpler
 design of system... I would tend to recomend using comet when you have some
 server side state that changes and needs update client side continually.
 Kinda feel it's hammer to crack a nut here, but perhaps that's just me.

 Hope you get it sorted :-)

 Cheers, Tim

 Sent from my iPhone

 On 6 Oct 2009, at 05:25, Jack Widman jack.wid...@gmail.com wrote:

 So I am using a snippet like this
  def go:NodeSeq = {
 var term:String = S.param(term).openOr()
 lift:surround with=default at=content
 lift:comet type=JoopComet name={term}
 auth:joop/auth:joop
 /lift:comet
 /lift:surround
   }

 And the term is indeed different each time. But I am still getting the same
 results from two different browsers with different terms.

 On Tue, Oct 6, 2009 at 12:18 AM, Naftoli Gugenheim naftoli...@gmail.com
 naftoli...@gmail.com wrote:


 You are correct that Comet is a way to update information after the page
 is loaded. I think there's a simpler way using ajax, but I haven't explored
 those areas of Lift yet. But meanwhile you need to have the xml specifying
 the comet actor be dynamic. So you need to have that xml be generated by a
 snippet. A snippet is an XML to XML function.


 -
 jack jack.wid...@gmail.comjack.wid...@gmail.com wrote:


 Let me start again. Maybe I am misunderstanding when Comet should be
 used. In my application, people search for web pages. I do a lot of
 processing for each resulting page. First I just display the links and
 then as the processing is finished, the links on the page are
 automatically modified with the data I just found for each link. This
 is all working fine.

 But, the session is being shared among all users so if I make one
 search in one browser, and then make another search from another
 browser, I get the results from the first browser.

 David suggested I name each CometActor differently. That is not
 working, though maybe I am not doing it right.

 On Oct 6, 12:01 am, Naftoli Gugenheim naftoli...@gmail.com wrote:
  What do you mean?
 
  -
 
  jackjack.wid...@gmail.com wrote:
 
  i guess you meant put the snippet right in the CometActor. Ok. Now I'm
  getting it.
 
  On Oct 5, 11:46 pm, Jack Widman jack.wid...@gmail.com wrote:
 
 
 
   Sorry if this is a dumb question but in lift:comet type=Search
   name={searchString}/, what is searchString? This is in an html file.
 I am
   obviously missing something.
 
   On Mon, Oct 5, 2009 at 2:40 PM, David Pollak
feeder.of.the.be...@gmail.comfeeder.of.the.be...@gmail.comwrote:
 
On Mon, Oct 5, 2009 at 10:27 AM, Jack Widman jack.wid...@gmail.com
 wrote:
 
Understood. My intention is to send a ShutDown message to the
 CometActor
when somebody closes the browser. I need this so that when they
 visit the
page in a browser again, the CometActor is 'reset'.
 
First, there's no way to determine if the browser window is closed.
 
Second, *DO NOT* send a ShutDown message to the CometActor.  This is
 an
internal Lift piece of housekeeping.  If you do this, you will break
 stuff.
 Don't do it.  (There is a reason the message is not private, but it
 should
not be used for this purpose.)
 
CometActors can be named:
 
lift:comet type=Search name={searchString}/
 
You can then have a separate CometActor for each searchString.
  Voila...
you get what you want.  Now, how do you make then CometActor go away
 when
it's not being used anymore?
 
In your CometActor:
 override def lifespan: Box[TimeSpan] = Full(3 minutes)
 
That means if a CometActor does not appear on a page for 3 minutes,
 it's
removed from the session.  If the named CometActor is requested
 again, a new
one will be created.
 
On Mon, Oct 5, 2009 at 1:18 PM, marius d. marius.dan...@gmail.com
 wrote:
 
HTTP session termination does not equate with browser-close event.
 
Br's,
Marius
 
On Oct 5, 3:22 pm, Jack Widman jack.wid...@gmail.com wrote:
 Yes, thats what I meant. Thanks
 
 On Mon, Oct 5, 2009 at 4:10 AM, Timothy Perrett
timo...@getintheloop.euwrote:
 
  But you can do it on session termination (which is what you
 probably
  want):
 
   http://scala-tools.org/mvnsites-snapshots/liftweb/lift-webkit/scalado.
 http://scala-tools.org/mvnsites-snapshots

[Lift] Re: Help!

2009-10-06 Thread Jack Widman
Thanks David. The command I was trying to remember was deploy-war but I kept
using run-war. The names are not quite precise. run-war should be called
build-and-run-war, and deploy-war is really run-with-war. If those names
were not so horribly long, that is.

On Tue, Oct 6, 2009 at 3:05 AM, David Bernard david.bernard...@gmail.comwrote:


 To create a war :
 mvn package

 To deploy (outline), (war are bundles that need a WebApp server to run
 (eg : jetty, tomcat, glassfish, jboss,...):
 # install jetty on your server (not maven)
 ## start jetty
 ## try http://jetty.host:jetty.port/  (eg: http://127.0.0.1:8080/)
 ## stop
 # put your .war into the jetty/webapp dir
 ## start jetty
 ## try http://jetty.host:jetty.port/mywebapp (mywebapp is the basename
 of your .war, if you don't want context (mywebapp prefix, named your
 war ROOT.war)
 # optional tweak the jetty configuration (read the jetty doc)

 FYI : Tim Perret is working on solution to create standalone jar with
 jetty embedded (search in the mailing-list)

 If you don't use Comet, you could try the winstone-maven-plugin to
 create a runnable jar

 /davidB

 On Tue, Oct 6, 2009 at 05:31, jack jack.wid...@gmail.com wrote:
 
  never mind.
  deploy-war, not run-war
  (been working too hard)
 
  On Oct 5, 11:09 pm, Jack Widman jack.wid...@gmail.com wrote:
  I meant to say jetty:run-war
 
  On Mon, Oct 5, 2009 at 10:52 PM, jack jack.wid...@gmail.com wrote:
 
   Is mvn jetty:run supposed to creat the war file? I want to upload a
   war file and just run it, not create another one. How do I do that?
 
  --
  Jack
  
 

 



-- 
Jack

--~--~-~--~~~---~--~~
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] Naming CometActors

2009-10-06 Thread Jack Widman
So if give a  CometActor a static name, say Other, then every request will
get the same running instance of the CometActor. But if I name it
dynamically, say with a random string, each request will get its own
instance of the CometActor. Right?
-- 
Jack

--~--~-~--~~~---~--~~
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: maven and jetty

2009-10-06 Thread Jack Widman
I thought run uses classes and run-war uses the war. no?

On Tue, Oct 6, 2009 at 4:54 PM, MarkChance mark.cha...@gmail.com wrote:


 I use mvn -Djetty.port=8090 jetty:run
 It builds the war and then runs jetty.  If you leave it running and re-
 build the war, say in your IDE, the Jetty generally restarts
 automatically.

 HTH, Mark

 On Oct 5, 8:44 pm, Jack Widman jack.wid...@gmail.com wrote:
  Well it seems that mvn run-war is creating the war and overriding the one
 I
  just uploaded. How do I just run with a given war and not create the war.
 

 



-- 
Jack

--~--~-~--~~~---~--~~
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: maven and jetty

2009-10-06 Thread Jack Widman
I am picking up a very subtle insinuation that that question was too easy
for this forum. I agree whole heartedly. Won't do it again. My next question
is - Is P=NP?  No wait, thats not appropriate.

On Tue, Oct 6, 2009 at 5:07 PM, Timothy Perrett timo...@getintheloop.euwrote:

 Correct. :run uses the stuff under src/main/webapp vs :run-war that uses
 what is bundled in the war (surprise surprise!)

 This should all be explained in the maven-jetty-plugin docs as this is not
 something lift specific by any means.

 Cheers, Tim

 Sent from my iPhone

 On 6 Oct 2009, at 21:57, Jack Widman jack.wid...@gmail.com wrote:

 I thought run uses classes and run-war uses the war. no?

 On Tue, Oct 6, 2009 at 4:54 PM, MarkChance  mark.cha...@gmail.com
 mark.cha...@gmail.com wrote:


 I use mvn -Djetty.port=8090 jetty:run
 It builds the war and then runs jetty.  If you leave it running and re-
 build the war, say in your IDE, the Jetty generally restarts
 automatically.

 HTH, Mark

 On Oct 5, 8:44 pm, Jack Widman jack.wid...@gmail.com wrote:
  Well it seems that mvn run-war is creating the war and overriding the
 one I
  just uploaded. How do I just run with a given war and not create the
 war.
 





 --
 Jack



 



-- 
Jack

--~--~-~--~~~---~--~~
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: ShutDown and CometActor

2009-10-05 Thread Jack Widman
Actually, this is working nicely now. Thanks.

On Mon, Oct 5, 2009 at 11:46 AM, David Pollak feeder.of.the.be...@gmail.com
 wrote:

 When you send the shutdown message, oddly enough, the CometActor shuts
 down.
 You don't have to do this (in fact, don't do it).  Lift will shut the
 CometActor down automatically.


 On Sun, Oct 4, 2009 at 7:32 PM, jack jack.wid...@gmail.com wrote:


 I am sending a ShutDown message to my CometActor to end the session.
 WHen I then go back to  the CometActor, it is not working properly the
 way it did the first time. Is there anything I have to do after
 shutting down the session, or should it just work when I load the
 CometActor again?




 --
 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

 



-- 
Jack

--~--~-~--~~~---~--~~
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 share request scope data among snippets in Lift

2009-10-05 Thread Jack Widman
Why don't we make Esperanto the official Lift language?

On Mon, Oct 5, 2009 at 11:52 AM, marius d. marius.dan...@gmail.com wrote:




 On Oct 5, 6:15 pm, David Pollak feeder.of.the.be...@gmail.com wrote:
  On Sun, Oct 4, 2009 at 2:41 AM, ishiijp yoshinori.is...@gmail.com
 wrote:
 
   Thank you for your example, David.
   It will work in my purpose.
 
  Cool.
 
 
 
   It seems that my poor English and less information let some people
   confused.
 
  I appreciate that you have put in the work to translate your thoughts to
  English.  I apologize that I only speak English, but would love to speak
  Japanese, German, Russian, and a few other languages.

 oh you gotta learn Romanian :)

 
   I need just a request scope data.
   It means I want to share information between snippets across a
   request.
   (Is the expression request scope not good for in this case...?)
 
  request scope is exactly the right phrase.
 
 
 
 
 
   Thank all responsed my post,
   and your suggestions are informative.
   I think very nice community is here.
 
   On 9月26日, 午後10:33, David Pollak feeder.of.the.be...@gmail.com wrote:
To share information between snippets during a request, use a
 RequestVar:
object MyInfo extends RequestVar(calculate_value)
 
so
 
object MyInfo extends RequestVar[Box[Invoice]](Empty)
 
in one snippet, you may calculate the Invoice and put it in the
 MyInfo:
 
MyInfo.set(Full(invoice))
 
In another snippet, you can extract:
 
for {
  invoice - MyInfo.is
  } yield ...
 
Note that the calculate_value is a call-by-name parameter, so it
 will
   be
invoked each time the RequestVar is uninitialized.  You can place
 lazy
calculation logic in here.
 
On Sat, Sep 26, 2009 at 12:14 AM, ishiijp yoshinori.is...@gmail.com
 
   wrote:
 
 Hi.
 
 If my lift application have some data that cost to create, and I
 want
 to share it among snippets, how to do in Lift?
 
 if such data are shared inside one snippet, I may use lazy val.
 But I have no nice idea to share it among different snippts.
 
 Thanks much.
 
--
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
 
  --
  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
 



-- 
Jack

--~--~-~--~~~---~--~~
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: execute code when browser is closed

2009-10-05 Thread Jack Widman
Understood. My intention is to send a ShutDown message to the CometActor
when somebody closes the browser. I need this so that when they visit the
page in a browser again, the CometActor is 'reset'.

On Mon, Oct 5, 2009 at 1:18 PM, marius d. marius.dan...@gmail.com wrote:


 HTTP session termination does not equate with browser-close event.

 Br's,
 Marius

 On Oct 5, 3:22 pm, Jack Widman jack.wid...@gmail.com wrote:
  Yes, thats what I meant. Thanks
 
  On Mon, Oct 5, 2009 at 4:10 AM, Timothy Perrett timo...@getintheloop.eu
 wrote:
 
 
 
 
 
   But you can do it on session termination (which is what you probably
   want):
 
  http://scala-tools.org/mvnsites-snapshots/liftweb/lift-webkit/scalado.
 ..
 
   Checkout the method:
 
   registerCleanupFunc
 
   Cheers, Tim
 
   On Oct 5, 8:54 am, Viktor Klang viktor.kl...@gmail.com wrote:
On Mon, Oct 5, 2009 at 6:50 AM, jack jack.wid...@gmail.com wrote:
 
 I would like to call a function when the browser is closed. How do
 I
 do this?
 
You cannot reliably do this.
 
--
Viktor Klang
 
Blog: klangism.blogspot.com
Twttr: viktorklang
 
Lift Committer - liftweb.com
AKKA Committer - akkasource.org
Cassidy - github.com/viktorklang/Cassidy.git
SoftPub founder:http://groups.google.com/group/softpub
 
  --
  Jack
 



-- 
Jack

--~--~-~--~~~---~--~~
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: execute code when browser is closed

2009-10-05 Thread Jack Widman
Interesting. I will try that. And I won't send any more ShutDownMessages :)
Though I should add that each CometActor is doing a lot of processing. So I
it would be good if I could shut one down somehow when the user searches on
a new term. Timeout won't work because there is no way to know how long it
will take.

Maybe I could just kill all the actors directly that are doing the
processing.

On Mon, Oct 5, 2009 at 2:40 PM, David Pollak
feeder.of.the.be...@gmail.comwrote:



 On Mon, Oct 5, 2009 at 10:27 AM, Jack Widman jack.wid...@gmail.comwrote:

 Understood. My intention is to send a ShutDown message to the CometActor
 when somebody closes the browser. I need this so that when they visit the
 page in a browser again, the CometActor is 'reset'.


 First, there's no way to determine if the browser window is closed.

 Second, *DO NOT* send a ShutDown message to the CometActor.  This is an
 internal Lift piece of housekeeping.  If you do this, you will break stuff.
  Don't do it.  (There is a reason the message is not private, but it should
 not be used for this purpose.)

 CometActors can be named:

 lift:comet type=Search name={searchString}/

 You can then have a separate CometActor for each searchString.  Voila...
 you get what you want.  Now, how do you make then CometActor go away when
 it's not being used anymore?

 In your CometActor:
  override def lifespan: Box[TimeSpan] = Full(3 minutes)

 That means if a CometActor does not appear on a page for 3 minutes, it's
 removed from the session.  If the named CometActor is requested again, a new
 one will be created.




 On Mon, Oct 5, 2009 at 1:18 PM, marius d. marius.dan...@gmail.comwrote:


 HTTP session termination does not equate with browser-close event.

 Br's,
 Marius

 On Oct 5, 3:22 pm, Jack Widman jack.wid...@gmail.com wrote:
  Yes, thats what I meant. Thanks
 
  On Mon, Oct 5, 2009 at 4:10 AM, Timothy Perrett
 timo...@getintheloop.euwrote:
 
 
 
 
 
   But you can do it on session termination (which is what you probably
   want):
 
  
 http://scala-tools.org/mvnsites-snapshots/liftweb/lift-webkit/scalado...
 
   Checkout the method:
 
   registerCleanupFunc
 
   Cheers, Tim
 
   On Oct 5, 8:54 am, Viktor Klang viktor.kl...@gmail.com wrote:
On Mon, Oct 5, 2009 at 6:50 AM, jack jack.wid...@gmail.com
 wrote:
 
 I would like to call a function when the browser is closed. How
 do I
 do this?
 
You cannot reliably do this.
 
--
Viktor Klang
 
Blog: klangism.blogspot.com
Twttr: viktorklang
 
Lift Committer - liftweb.com
AKKA Committer - akkasource.org
Cassidy - github.com/viktorklang/Cassidy.git
SoftPub founder:http://groups.google.com/group/softpub
 
  --
  Jack




 --
 Jack





 --
 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


 



-- 
Jack

--~--~-~--~~~---~--~~
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: execute code when browser is closed

2009-10-05 Thread Jack Widman
In my app, when the user is done searching on one keyword, they click a link
which takes them back to the main search page. Thats the time when I wanted
the CometActor to stop. Otherwise there will be too many threads floating
around and performance will suffer.

On Mon, Oct 5, 2009 at 2:50 PM, David Pollak
feeder.of.the.be...@gmail.comwrote:



 On Mon, Oct 5, 2009 at 11:45 AM, Jack Widman jack.wid...@gmail.comwrote:

 Interesting. I will try that. And I won't send any more ShutDownMessages
 :)
 Though I should add that each CometActor is doing a lot of processing. So
 I it would be good if I could shut one down somehow when the user searches
 on a new term. Timeout won't work because there is no way to know how long
 it will take.

 Maybe I could just kill all the actors directly that are doing the
 processing.


 That's going to be even worse.  You'll kill something out from under
 Lift... it's going to cause a huge pile of pain.

 You can remove an Actor from the session and that will cause ShutDown to be
 sent to it, but depending on how the Actor was written it's not going to
 stop processing its mailbox.

 Bottom line... there's no way to tell if a user is not looking at a page
 with an Actor anymore.  The best way to deal with that is timing the Actor
 out.  It's going to take time (your timeout period), but it's the best way
 to do it.



 On Mon, Oct 5, 2009 at 2:40 PM, David Pollak 
 feeder.of.the.be...@gmail.com wrote:



 On Mon, Oct 5, 2009 at 10:27 AM, Jack Widman jack.wid...@gmail.comwrote:

 Understood. My intention is to send a ShutDown message to the CometActor
 when somebody closes the browser. I need this so that when they visit the
 page in a browser again, the CometActor is 'reset'.


 First, there's no way to determine if the browser window is closed.

 Second, *DO NOT* send a ShutDown message to the CometActor.  This is an
 internal Lift piece of housekeeping.  If you do this, you will break stuff.
  Don't do it.  (There is a reason the message is not private, but it should
 not be used for this purpose.)

 CometActors can be named:

 lift:comet type=Search name={searchString}/

 You can then have a separate CometActor for each searchString.  Voila...
 you get what you want.  Now, how do you make then CometActor go away when
 it's not being used anymore?

 In your CometActor:
  override def lifespan: Box[TimeSpan] = Full(3 minutes)

 That means if a CometActor does not appear on a page for 3 minutes, it's
 removed from the session.  If the named CometActor is requested again, a new
 one will be created.




 On Mon, Oct 5, 2009 at 1:18 PM, marius d. marius.dan...@gmail.comwrote:


 HTTP session termination does not equate with browser-close event.

 Br's,
 Marius

 On Oct 5, 3:22 pm, Jack Widman jack.wid...@gmail.com wrote:
  Yes, thats what I meant. Thanks
 
  On Mon, Oct 5, 2009 at 4:10 AM, Timothy Perrett
 timo...@getintheloop.euwrote:
 
 
 
 
 
   But you can do it on session termination (which is what you
 probably
   want):
 
  
 http://scala-tools.org/mvnsites-snapshots/liftweb/lift-webkit/scalado.
 ..
 
   Checkout the method:
 
   registerCleanupFunc
 
   Cheers, Tim
 
   On Oct 5, 8:54 am, Viktor Klang viktor.kl...@gmail.com wrote:
On Mon, Oct 5, 2009 at 6:50 AM, jack jack.wid...@gmail.com
 wrote:
 
 I would like to call a function when the browser is closed. How
 do I
 do this?
 
You cannot reliably do this.
 
--
Viktor Klang
 
Blog: klangism.blogspot.com
Twttr: viktorklang
 
Lift Committer - liftweb.com
AKKA Committer - akkasource.org
Cassidy - github.com/viktorklang/Cassidy.git
SoftPub founder:http://groups.google.com/group/softpub
 
  --
  Jack




 --
 Jack





 --
 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






 --
 Jack





 --
 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

 



-- 
Jack

--~--~-~--~~~---~--~~
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: execute code when browser is closed

2009-10-05 Thread Jack Widman
Because when the users searches on a new keyword, the actors that were
processing the results for the last keyword are still processing (some of
them). But I can just send each of those a message to stop processing,  no?
No problem with that, right?

On Mon, Oct 5, 2009 at 3:02 PM, David Pollak
feeder.of.the.be...@gmail.comwrote:



 On Mon, Oct 5, 2009 at 11:53 AM, Jack Widman jack.wid...@gmail.comwrote:

 In my app, when the user is done searching on one keyword, they click a
 link which takes them back to the main search page. Thats the time when I
 wanted the CometActor to stop. Otherwise there will be too many threads
 floating around and performance will suffer.


 Why?  Actors do not consume threads, they consume memory unless they are
 actively processing a message.




 On Mon, Oct 5, 2009 at 2:50 PM, David Pollak 
 feeder.of.the.be...@gmail.com wrote:



 On Mon, Oct 5, 2009 at 11:45 AM, Jack Widman jack.wid...@gmail.comwrote:

 Interesting. I will try that. And I won't send any more ShutDownMessages
 :)
 Though I should add that each CometActor is doing a lot of processing.
 So I it would be good if I could shut one down somehow when the user
 searches on a new term. Timeout won't work because there is no way to know
 how long it will take.

 Maybe I could just kill all the actors directly that are doing the
 processing.


 That's going to be even worse.  You'll kill something out from under
 Lift... it's going to cause a huge pile of pain.

 You can remove an Actor from the session and that will cause ShutDown to
 be sent to it, but depending on how the Actor was written it's not going to
 stop processing its mailbox.

 Bottom line... there's no way to tell if a user is not looking at a page
 with an Actor anymore.  The best way to deal with that is timing the Actor
 out.  It's going to take time (your timeout period), but it's the best way
 to do it.



 On Mon, Oct 5, 2009 at 2:40 PM, David Pollak 
 feeder.of.the.be...@gmail.com wrote:



 On Mon, Oct 5, 2009 at 10:27 AM, Jack Widman jack.wid...@gmail.comwrote:

 Understood. My intention is to send a ShutDown message to the
 CometActor when somebody closes the browser. I need this so that when 
 they
 visit the page in a browser again, the CometActor is 'reset'.


 First, there's no way to determine if the browser window is closed.

 Second, *DO NOT* send a ShutDown message to the CometActor.  This is an
 internal Lift piece of housekeeping.  If you do this, you will break 
 stuff.
  Don't do it.  (There is a reason the message is not private, but it 
 should
 not be used for this purpose.)

 CometActors can be named:

 lift:comet type=Search name={searchString}/

 You can then have a separate CometActor for each searchString.
  Voila... you get what you want.  Now, how do you make then CometActor go
 away when it's not being used anymore?

 In your CometActor:
  override def lifespan: Box[TimeSpan] = Full(3 minutes)

 That means if a CometActor does not appear on a page for 3 minutes,
 it's removed from the session.  If the named CometActor is requested 
 again,
 a new one will be created.




 On Mon, Oct 5, 2009 at 1:18 PM, marius d. marius.dan...@gmail.comwrote:


 HTTP session termination does not equate with browser-close event.

 Br's,
 Marius

 On Oct 5, 3:22 pm, Jack Widman jack.wid...@gmail.com wrote:
  Yes, thats what I meant. Thanks
 
  On Mon, Oct 5, 2009 at 4:10 AM, Timothy Perrett
 timo...@getintheloop.euwrote:
 
 
 
 
 
   But you can do it on session termination (which is what you
 probably
   want):
 
  
 http://scala-tools.org/mvnsites-snapshots/liftweb/lift-webkit/scalado.
 ..
 
   Checkout the method:
 
   registerCleanupFunc
 
   Cheers, Tim
 
   On Oct 5, 8:54 am, Viktor Klang viktor.kl...@gmail.com wrote:
On Mon, Oct 5, 2009 at 6:50 AM, jack jack.wid...@gmail.com
 wrote:
 
 I would like to call a function when the browser is closed.
 How do I
 do this?
 
You cannot reliably do this.
 
--
Viktor Klang
 
Blog: klangism.blogspot.com
Twttr: viktorklang
 
Lift Committer - liftweb.com
AKKA Committer - akkasource.org
Cassidy - github.com/viktorklang/Cassidy.git
SoftPub founder:http://groups.google.com/group/softpub
 
  --
  Jack




 --
 Jack





 --
 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






 --
 Jack





 --
 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





 --
 Jack





 --
 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

 



-- 
Jack

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
Lift group

[Lift] Re: execute code when browser is closed

2009-10-05 Thread Jack Widman
Good. Only thing is that if their job was to start an actor to go out and
search some pages, say, then 'stop your job' means '   'call your 'exit'
method, no?Not trying to be a wise guy. I actually have a number of VCs
lined up to look at my app. Overall I am very glad to be using Lift. On the
Comet alone it save me a LOT of time.
Of course, I  have a lot to learn.

On Mon, Oct 5, 2009 at 3:08 PM, David Pollak
feeder.of.the.be...@gmail.comwrote:



 On Mon, Oct 5, 2009 at 12:06 PM, Jack Widman jack.wid...@gmail.comwrote:

 Because when the users searches on a new keyword, the actors that were
 processing the results for the last keyword are still processing (some of
 them). But I can just send each of those a message to stop processing,  no?
 No problem with that, right?


 Sure... send them a message that says tell all your jobs to stop.  This
 has nothing to do with the CometActor lifecycle.  It is all your application
 level stuff.




 On Mon, Oct 5, 2009 at 3:02 PM, David Pollak 
 feeder.of.the.be...@gmail.com wrote:



 On Mon, Oct 5, 2009 at 11:53 AM, Jack Widman jack.wid...@gmail.comwrote:

 In my app, when the user is done searching on one keyword, they click a
 link which takes them back to the main search page. Thats the time when I
 wanted the CometActor to stop. Otherwise there will be too many threads
 floating around and performance will suffer.


 Why?  Actors do not consume threads, they consume memory unless they are
 actively processing a message.




 On Mon, Oct 5, 2009 at 2:50 PM, David Pollak 
 feeder.of.the.be...@gmail.com wrote:



 On Mon, Oct 5, 2009 at 11:45 AM, Jack Widman jack.wid...@gmail.comwrote:

 Interesting. I will try that. And I won't send any more
 ShutDownMessages :)
 Though I should add that each CometActor is doing a lot of processing.
 So I it would be good if I could shut one down somehow when the user
 searches on a new term. Timeout won't work because there is no way to 
 know
 how long it will take.

 Maybe I could just kill all the actors directly that are doing the
 processing.


 That's going to be even worse.  You'll kill something out from under
 Lift... it's going to cause a huge pile of pain.

 You can remove an Actor from the session and that will cause ShutDown
 to be sent to it, but depending on how the Actor was written it's not 
 going
 to stop processing its mailbox.

 Bottom line... there's no way to tell if a user is not looking at a
 page with an Actor anymore.  The best way to deal with that is timing the
 Actor out.  It's going to take time (your timeout period), but it's the 
 best
 way to do it.



 On Mon, Oct 5, 2009 at 2:40 PM, David Pollak 
 feeder.of.the.be...@gmail.com wrote:



 On Mon, Oct 5, 2009 at 10:27 AM, Jack Widman 
 jack.wid...@gmail.comwrote:

 Understood. My intention is to send a ShutDown message to the
 CometActor when somebody closes the browser. I need this so that when 
 they
 visit the page in a browser again, the CometActor is 'reset'.


 First, there's no way to determine if the browser window is closed.

 Second, *DO NOT* send a ShutDown message to the CometActor.  This is
 an internal Lift piece of housekeeping.  If you do this, you will break
 stuff.  Don't do it.  (There is a reason the message is not private, 
 but it
 should not be used for this purpose.)

 CometActors can be named:

 lift:comet type=Search name={searchString}/

 You can then have a separate CometActor for each searchString.
  Voila... you get what you want.  Now, how do you make then CometActor 
 go
 away when it's not being used anymore?

 In your CometActor:
  override def lifespan: Box[TimeSpan] = Full(3 minutes)

 That means if a CometActor does not appear on a page for 3 minutes,
 it's removed from the session.  If the named CometActor is requested 
 again,
 a new one will be created.




 On Mon, Oct 5, 2009 at 1:18 PM, marius d. 
 marius.dan...@gmail.comwrote:


 HTTP session termination does not equate with browser-close event.

 Br's,
 Marius

 On Oct 5, 3:22 pm, Jack Widman jack.wid...@gmail.com wrote:
  Yes, thats what I meant. Thanks
 
  On Mon, Oct 5, 2009 at 4:10 AM, Timothy Perrett
 timo...@getintheloop.euwrote:
 
 
 
 
 
   But you can do it on session termination (which is what you
 probably
   want):
 
  
 http://scala-tools.org/mvnsites-snapshots/liftweb/lift-webkit/scalado.
 ..
 
   Checkout the method:
 
   registerCleanupFunc
 
   Cheers, Tim
 
   On Oct 5, 8:54 am, Viktor Klang viktor.kl...@gmail.com
 wrote:
On Mon, Oct 5, 2009 at 6:50 AM, jack jack.wid...@gmail.com
 wrote:
 
 I would like to call a function when the browser is closed.
 How do I
 do this?
 
You cannot reliably do this.
 
--
Viktor Klang
 
Blog: klangism.blogspot.com
Twttr: viktorklang
 
Lift Committer - liftweb.com
AKKA Committer - akkasource.org
Cassidy - github.com/viktorklang/Cassidy.git
SoftPub founder:http://groups.google.com/group/softpub
 
  --
  Jack




 --
 Jack





 --
 Lift, the simply

[Lift] Re: How to share request scope data among snippets in Lift

2009-10-05 Thread Jack Widman
Well it is high enough level! [?]

On Mon, Oct 5, 2009 at 3:49 PM, Viktor Klang viktor.kl...@gmail.com wrote:



 On Mon, Oct 5, 2009 at 6:02 PM, Jack Widman jack.wid...@gmail.com wrote:

 Why don't we make Esperanto the official Lift language?


 I'd say make Scala the official language ;)



 On Mon, Oct 5, 2009 at 11:52 AM, marius d. marius.dan...@gmail.comwrote:




 On Oct 5, 6:15 pm, David Pollak feeder.of.the.be...@gmail.com wrote:
  On Sun, Oct 4, 2009 at 2:41 AM, ishiijp yoshinori.is...@gmail.com
 wrote:
 
   Thank you for your example, David.
   It will work in my purpose.
 
  Cool.
 
 
 
   It seems that my poor English and less information let some people
   confused.
 
  I appreciate that you have put in the work to translate your thoughts
 to
  English.  I apologize that I only speak English, but would love to
 speak
  Japanese, German, Russian, and a few other languages.

 oh you gotta learn Romanian :)

 
   I need just a request scope data.
   It means I want to share information between snippets across a
   request.
   (Is the expression request scope not good for in this case...?)
 
  request scope is exactly the right phrase.
 
 
 
 
 
   Thank all responsed my post,
   and your suggestions are informative.
   I think very nice community is here.
 
   On 9月26日, 午後10:33, David Pollak feeder.of.the.be...@gmail.com
 wrote:
To share information between snippets during a request, use a
 RequestVar:
object MyInfo extends RequestVar(calculate_value)
 
so
 
object MyInfo extends RequestVar[Box[Invoice]](Empty)
 
in one snippet, you may calculate the Invoice and put it in the
 MyInfo:
 
MyInfo.set(Full(invoice))
 
In another snippet, you can extract:
 
for {
  invoice - MyInfo.is
  } yield ...
 
Note that the calculate_value is a call-by-name parameter, so it
 will
   be
invoked each time the RequestVar is uninitialized.  You can place
 lazy
calculation logic in here.
 
On Sat, Sep 26, 2009 at 12:14 AM, ishiijp 
 yoshinori.is...@gmail.com
   wrote:
 
 Hi.
 
 If my lift application have some data that cost to create, and I
 want
 to share it among snippets, how to do in Lift?
 
 if such data are shared inside one snippet, I may use lazy val.
 But I have no nice idea to share it among different snippts.
 
 Thanks much.
 
--
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
 
  --
  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




 --
 Jack






 --
 Viktor Klang

 Blog: klangism.blogspot.com
 Twttr: viktorklang

 Lift Committer - liftweb.com
 AKKA Committer - akkasource.org
 Cassidy - github.com/viktorklang/Cassidy.git
 SoftPub founder: http://groups.google.com/group/softpub


 



-- 
Jack

--~--~-~--~~~---~--~~
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
-~--~~~~--~~--~--~---

inline: 330.gif

[Lift] Re: How to share request scope data among snippets in Lift

2009-10-05 Thread Jack Widman
I'm not sure English is Turing Complete. Also not sure how prominent it will
be in 50 years ... :)

On Mon, Oct 5, 2009 at 5:51 PM, David Pollak
feeder.of.the.be...@gmail.comwrote:



 On Mon, Oct 5, 2009 at 9:35 AM, Timothy Perrett 
 timo...@getintheloop.euwrote:


 Call me old fashioned, but good ol' English seems to be quite
 prevalent these days ;-)


 Is this the Queen's English? ;-)



 On 5 Oct 2009, at 17:02, Jack Widman wrote:

  Why don't we make Esperanto the official Lift language?






 --
 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

 



-- 
Jack

--~--~-~--~~~---~--~~
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] maven and jetty

2009-10-05 Thread jack

I have been working locally for a long time and I seem to have
forgotten how to deploy and run a war on Jetty!

I am ftping the war to my server and putting it in the target
directory.

I then run mvn jetty:run-war -Djetty.port=80 and I keep getting the
default app.

What am I doing wrong?
--~--~-~--~~~---~--~~
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: maven and jetty

2009-10-05 Thread Jack Widman
Well it seems that mvn run-war is creating the war and overriding the one I
just uploaded. How do I just run with a given war and not create the war.

On Mon, Oct 5, 2009 at 10:37 PM, Ryan Stradling ryanstradl...@gmail.comwrote:


 Have you verified another server is not running on that port?

 Have you tried http://url:80/name of app   Just to see if that works

 Sent from my iPhone

 On Oct 5, 2009, at 10:12 PM, jack jack.wid...@gmail.com wrote:

 
  I have been working locally for a long time and I seem to have
  forgotten how to deploy and run a war on Jetty!
 
  I am ftping the war to my server and putting it in the target
  directory.
 
  I then run mvn jetty:run-war -Djetty.port=80 and I keep getting the
  default app.
 
  What am I doing wrong?
  

 



-- 
Jack

--~--~-~--~~~---~--~~
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] Help!

2009-10-05 Thread jack

Is mvn jetty:run supposed to creat the war file? I want to upload a
war file and just run it, not create another one. How do I do that?
--~--~-~--~~~---~--~~
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: Help!

2009-10-05 Thread Jack Widman
I meant to say jetty:run-war

On Mon, Oct 5, 2009 at 10:52 PM, jack jack.wid...@gmail.com wrote:


 Is mvn jetty:run supposed to creat the war file? I want to upload a
 war file and just run it, not create another one. How do I do that?
 



-- 
Jack

--~--~-~--~~~---~--~~
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: Help!

2009-10-05 Thread jack

never mind.
deploy-war, not run-war
(been working too hard)

On Oct 5, 11:09 pm, Jack Widman jack.wid...@gmail.com wrote:
 I meant to say jetty:run-war

 On Mon, Oct 5, 2009 at 10:52 PM, jack jack.wid...@gmail.com wrote:

  Is mvn jetty:run supposed to creat the war file? I want to upload a
  war file and just run it, not create another one. How do I do that?

 --
 Jack
--~--~-~--~~~---~--~~
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: execute code when browser is closed

2009-10-05 Thread Jack Widman
Sorry if this is a dumb question but in lift:comet type=Search
name={searchString}/, what is searchString? This is in an html file. I am
obviously missing something.

On Mon, Oct 5, 2009 at 2:40 PM, David Pollak
feeder.of.the.be...@gmail.comwrote:



 On Mon, Oct 5, 2009 at 10:27 AM, Jack Widman jack.wid...@gmail.comwrote:

 Understood. My intention is to send a ShutDown message to the CometActor
 when somebody closes the browser. I need this so that when they visit the
 page in a browser again, the CometActor is 'reset'.


 First, there's no way to determine if the browser window is closed.

 Second, *DO NOT* send a ShutDown message to the CometActor.  This is an
 internal Lift piece of housekeeping.  If you do this, you will break stuff.
  Don't do it.  (There is a reason the message is not private, but it should
 not be used for this purpose.)

 CometActors can be named:

 lift:comet type=Search name={searchString}/

 You can then have a separate CometActor for each searchString.  Voila...
 you get what you want.  Now, how do you make then CometActor go away when
 it's not being used anymore?

 In your CometActor:
  override def lifespan: Box[TimeSpan] = Full(3 minutes)

 That means if a CometActor does not appear on a page for 3 minutes, it's
 removed from the session.  If the named CometActor is requested again, a new
 one will be created.




 On Mon, Oct 5, 2009 at 1:18 PM, marius d. marius.dan...@gmail.comwrote:


 HTTP session termination does not equate with browser-close event.

 Br's,
 Marius

 On Oct 5, 3:22 pm, Jack Widman jack.wid...@gmail.com wrote:
  Yes, thats what I meant. Thanks
 
  On Mon, Oct 5, 2009 at 4:10 AM, Timothy Perrett
 timo...@getintheloop.euwrote:
 
 
 
 
 
   But you can do it on session termination (which is what you probably
   want):
 
  
 http://scala-tools.org/mvnsites-snapshots/liftweb/lift-webkit/scalado...
 
   Checkout the method:
 
   registerCleanupFunc
 
   Cheers, Tim
 
   On Oct 5, 8:54 am, Viktor Klang viktor.kl...@gmail.com wrote:
On Mon, Oct 5, 2009 at 6:50 AM, jack jack.wid...@gmail.com
 wrote:
 
 I would like to call a function when the browser is closed. How
 do I
 do this?
 
You cannot reliably do this.
 
--
Viktor Klang
 
Blog: klangism.blogspot.com
Twttr: viktorklang
 
Lift Committer - liftweb.com
AKKA Committer - akkasource.org
Cassidy - github.com/viktorklang/Cassidy.git
SoftPub founder:http://groups.google.com/group/softpub
 
  --
  Jack




 --
 Jack





 --
 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


 



-- 
Jack

--~--~-~--~~~---~--~~
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: execute code when browser is closed

2009-10-05 Thread jack

i guess you meant put the snippet right in the CometActor. Ok. Now I'm
getting it.

On Oct 5, 11:46 pm, Jack Widman jack.wid...@gmail.com wrote:
 Sorry if this is a dumb question but in lift:comet type=Search
 name={searchString}/, what is searchString? This is in an html file. I am
 obviously missing something.

 On Mon, Oct 5, 2009 at 2:40 PM, David Pollak
 feeder.of.the.be...@gmail.comwrote:







  On Mon, Oct 5, 2009 at 10:27 AM, Jack Widman jack.wid...@gmail.comwrote:

  Understood. My intention is to send a ShutDown message to the CometActor
  when somebody closes the browser. I need this so that when they visit the
  page in a browser again, the CometActor is 'reset'.

  First, there's no way to determine if the browser window is closed.

  Second, *DO NOT* send a ShutDown message to the CometActor.  This is an
  internal Lift piece of housekeeping.  If you do this, you will break stuff.
   Don't do it.  (There is a reason the message is not private, but it should
  not be used for this purpose.)

  CometActors can be named:

  lift:comet type=Search name={searchString}/

  You can then have a separate CometActor for each searchString.  Voila...
  you get what you want.  Now, how do you make then CometActor go away when
  it's not being used anymore?

  In your CometActor:
   override def lifespan: Box[TimeSpan] = Full(3 minutes)

  That means if a CometActor does not appear on a page for 3 minutes, it's
  removed from the session.  If the named CometActor is requested again, a new
  one will be created.

  On Mon, Oct 5, 2009 at 1:18 PM, marius d. marius.dan...@gmail.comwrote:

  HTTP session termination does not equate with browser-close event.

  Br's,
  Marius

  On Oct 5, 3:22 pm, Jack Widman jack.wid...@gmail.com wrote:
   Yes, thats what I meant. Thanks

   On Mon, Oct 5, 2009 at 4:10 AM, Timothy Perrett
  timo...@getintheloop.euwrote:

But you can do it on session termination (which is what you probably
want):

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

Checkout the method:

registerCleanupFunc

Cheers, Tim

On Oct 5, 8:54 am, Viktor Klang viktor.kl...@gmail.com wrote:
 On Mon, Oct 5, 2009 at 6:50 AM, jack jack.wid...@gmail.com
  wrote:

  I would like to call a function when the browser is closed. How
  do I
  do this?

 You cannot reliably do this.

 --
 Viktor Klang

 Blog: klangism.blogspot.com
 Twttr: viktorklang

 Lift Committer - liftweb.com
 AKKA Committer - akkasource.org
 Cassidy - github.com/viktorklang/Cassidy.git
 SoftPub founder:http://groups.google.com/group/softpub

   --
   Jack

  --
  Jack

  --
  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

 --
 Jack
--~--~-~--~~~---~--~~
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: execute code when browser is closed

2009-10-05 Thread jack

Let me start again. Maybe I am misunderstanding when Comet should be
used. In my application, people search for web pages. I do a lot of
processing for each resulting page. First I just display the links and
then as the processing is finished, the links on the page are
automatically modified with the data I just found for each link. This
is all working fine.

But, the session is being shared among all users so if I make one
search in one browser, and then make another search from another
browser, I get the results from the first browser.

David suggested I name each CometActor differently. That is not
working, though maybe I am not doing it right.

On Oct 6, 12:01 am, Naftoli Gugenheim naftoli...@gmail.com wrote:
 What do you mean?

 -

 jackjack.wid...@gmail.com wrote:

 i guess you meant put the snippet right in the CometActor. Ok. Now I'm
 getting it.

 On Oct 5, 11:46 pm, Jack Widman jack.wid...@gmail.com wrote:



  Sorry if this is a dumb question but in lift:comet type=Search
  name={searchString}/, what is searchString? This is in an html file. I am
  obviously missing something.

  On Mon, Oct 5, 2009 at 2:40 PM, David Pollak
  feeder.of.the.be...@gmail.comwrote:

   On Mon, Oct 5, 2009 at 10:27 AM, Jack Widman jack.wid...@gmail.comwrote:

   Understood. My intention is to send a ShutDown message to the CometActor
   when somebody closes the browser. I need this so that when they visit the
   page in a browser again, the CometActor is 'reset'.

   First, there's no way to determine if the browser window is closed.

   Second, *DO NOT* send a ShutDown message to the CometActor.  This is an
   internal Lift piece of housekeeping.  If you do this, you will break 
   stuff.
    Don't do it.  (There is a reason the message is not private, but it 
   should
   not be used for this purpose.)

   CometActors can be named:

   lift:comet type=Search name={searchString}/

   You can then have a separate CometActor for each searchString.  Voila...
   you get what you want.  Now, how do you make then CometActor go away when
   it's not being used anymore?

   In your CometActor:
    override def lifespan: Box[TimeSpan] = Full(3 minutes)

   That means if a CometActor does not appear on a page for 3 minutes, it's
   removed from the session.  If the named CometActor is requested again, a 
   new
   one will be created.

   On Mon, Oct 5, 2009 at 1:18 PM, marius d. marius.dan...@gmail.comwrote:

   HTTP session termination does not equate with browser-close event.

   Br's,
   Marius

   On Oct 5, 3:22 pm, Jack Widman jack.wid...@gmail.com wrote:
Yes, thats what I meant. Thanks

On Mon, Oct 5, 2009 at 4:10 AM, Timothy Perrett
   timo...@getintheloop.euwrote:

 But you can do it on session termination (which is what you probably
 want):

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

 Checkout the method:

 registerCleanupFunc

 Cheers, Tim

 On Oct 5, 8:54 am, Viktor Klang viktor.kl...@gmail.com wrote:
  On Mon, Oct 5, 2009 at 6:50 AM, jack jack.wid...@gmail.com
   wrote:

   I would like to call a function when the browser is closed. How
   do I
   do this?

  You cannot reliably do this.

  --
  Viktor Klang

  Blog: klangism.blogspot.com
  Twttr: viktorklang

  Lift Committer - liftweb.com
  AKKA Committer - akkasource.org
  Cassidy - github.com/viktorklang/Cassidy.git
  SoftPub founder:http://groups.google.com/group/softpub

--
Jack

   --
   Jack

   --
   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

  --
  Jack
--~--~-~--~~~---~--~~
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: execute code when browser is closed

2009-10-05 Thread Jack Widman
So I am using a snippet like this
 def go:NodeSeq = {
var term:String = S.param(term).openOr()
lift:surround with=default at=content
lift:comet type=JoopComet name={term}
auth:joop/auth:joop
/lift:comet
/lift:surround
  }

And the term is indeed different each time. But I am still getting the same
results from two different browsers with different terms.

On Tue, Oct 6, 2009 at 12:18 AM, Naftoli Gugenheim naftoli...@gmail.comwrote:


 You are correct that Comet is a way to update information after the page is
 loaded. I think there's a simpler way using ajax, but I haven't explored
 those areas of Lift yet. But meanwhile you need to have the xml specifying
 the comet actor be dynamic. So you need to have that xml be generated by a
 snippet. A snippet is an XML to XML function.


 -
 jackjack.wid...@gmail.com wrote:


 Let me start again. Maybe I am misunderstanding when Comet should be
 used. In my application, people search for web pages. I do a lot of
 processing for each resulting page. First I just display the links and
 then as the processing is finished, the links on the page are
 automatically modified with the data I just found for each link. This
 is all working fine.

 But, the session is being shared among all users so if I make one
 search in one browser, and then make another search from another
 browser, I get the results from the first browser.

 David suggested I name each CometActor differently. That is not
 working, though maybe I am not doing it right.

 On Oct 6, 12:01 am, Naftoli Gugenheim naftoli...@gmail.com wrote:
  What do you mean?
 
  -
 
  jackjack.wid...@gmail.com wrote:
 
  i guess you meant put the snippet right in the CometActor. Ok. Now I'm
  getting it.
 
  On Oct 5, 11:46 pm, Jack Widman jack.wid...@gmail.com wrote:
 
 
 
   Sorry if this is a dumb question but in lift:comet type=Search
   name={searchString}/, what is searchString? This is in an html file. I
 am
   obviously missing something.
 
   On Mon, Oct 5, 2009 at 2:40 PM, David Pollak
   feeder.of.the.be...@gmail.comwrote:
 
On Mon, Oct 5, 2009 at 10:27 AM, Jack Widman jack.wid...@gmail.com
 wrote:
 
Understood. My intention is to send a ShutDown message to the
 CometActor
when somebody closes the browser. I need this so that when they
 visit the
page in a browser again, the CometActor is 'reset'.
 
First, there's no way to determine if the browser window is closed.
 
Second, *DO NOT* send a ShutDown message to the CometActor.  This is
 an
internal Lift piece of housekeeping.  If you do this, you will break
 stuff.
 Don't do it.  (There is a reason the message is not private, but it
 should
not be used for this purpose.)
 
CometActors can be named:
 
lift:comet type=Search name={searchString}/
 
You can then have a separate CometActor for each searchString.
  Voila...
you get what you want.  Now, how do you make then CometActor go away
 when
it's not being used anymore?
 
In your CometActor:
 override def lifespan: Box[TimeSpan] = Full(3 minutes)
 
That means if a CometActor does not appear on a page for 3 minutes,
 it's
removed from the session.  If the named CometActor is requested
 again, a new
one will be created.
 
On Mon, Oct 5, 2009 at 1:18 PM, marius d. marius.dan...@gmail.com
 wrote:
 
HTTP session termination does not equate with browser-close event.
 
Br's,
Marius
 
On Oct 5, 3:22 pm, Jack Widman jack.wid...@gmail.com wrote:
 Yes, thats what I meant. Thanks
 
 On Mon, Oct 5, 2009 at 4:10 AM, Timothy Perrett
timo...@getintheloop.euwrote:
 
  But you can do it on session termination (which is what you
 probably
  want):
 
   
 http://scala-tools.org/mvnsites-snapshots/liftweb/lift-webkit/scalado...
 
  Checkout the method:
 
  registerCleanupFunc
 
  Cheers, Tim
 
  On Oct 5, 8:54 am, Viktor Klang viktor.kl...@gmail.com
 wrote:
   On Mon, Oct 5, 2009 at 6:50 AM, jack jack.wid...@gmail.com
wrote:
 
I would like to call a function when the browser is closed.
 How
do I
do this?
 
   You cannot reliably do this.
 
   --
   Viktor Klang
 
   Blog: klangism.blogspot.com
   Twttr: viktorklang
 
   Lift Committer - liftweb.com
   AKKA Committer - akkasource.org
   Cassidy - github.com/viktorklang/Cassidy.git
   SoftPub founder:http://groups.google.com/group/softpub
 
 --
 Jack
 
--
Jack
 
--
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
 
   --
   Jack


 



-- 
Jack

--~--~-~--~~~---~--~~
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

[Lift] comet

2009-10-04 Thread jack

How can assure that every time a comet page is loaded, it starts again
fresh? I.e. as if the page were being loaded for the first time?
--~--~-~--~~~---~--~~
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: comet

2009-10-04 Thread jack

Well the way I have it render is being called multiple times so I can
put initial code there. I have some code near the top of my Comet
class and thats the code I want to run every time I load the page.
Currently, it is only run the first time.

On Oct 4, 11:50 am, marius d. marius.dan...@gmail.com wrote:
 Well render will be called for sure ... but if you build your comet
 component to rely only with partial updates when updating coment's
 real estate and don't call re-render then render should be called only
 when page is loaded, meaning that you can reset any state there. ...
 of course unless something escapes me :)

 Br's,
 Marius

 On Oct 4, 6:12 pm, jack jack.wid...@gmail.com wrote:



  How can assure that every time a comet page is loaded, it starts again
  fresh? I.e. as if the page were being loaded for the first time?
--~--~-~--~~~---~--~~
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] a very simple question

2009-10-04 Thread jack

I put the line

println(dude)

in a Comet class write under the class declaration.

i.e.

class JoopComet extends CometActor with CometListenee {

 println(INSIDE COMET CLASS)


When the class runs and all the activity is complete, I hit the back
button and that loads the JoopComet class again.

But I do not see dude printed.

Why not?
--~--~-~--~~~---~--~~
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: a very simple question

2009-10-04 Thread Jack Widman
Well my app is a search application. You search for certain web pages and I
do some processing after the results are displayed. Thats why I am using
Comet. Certain information is added to each result link.
I want the user to be able to either hit the back button or click on alink
that goes to the search page again. When they enter a search term and click
submit, I want to load the CometActor class again.

Do you think sending a ShutDown message will accomplish this?
After the session is killed, how do I get the CometActor to automatically
load again. Do I send the message and then redirect to the page?

I am just not comfortable yet with the mechanics of how Lift handles comet.
Thanks in advance.

Jack


On Sun, Oct 4, 2009 at 6:50 PM, Timothy Perrett timo...@getintheloop.euwrote:


 If memory serves, the comet actor lives on in the session scope until
 its either sent the ShutDown message explicitly, or it times out (you
 can set the timeout).

 Does that help?

 Cheers, Tim

 On 4 Oct 2009, at 23:17, jack wrote:

 
  I put the line
 
  println(dude)
 
  in a Comet class write under the class declaration.
 
  i.e.
 
  class JoopComet extends CometActor with CometListenee {
 
  println(INSIDE COMET CLASS)
 
 
  When the class runs and all the activity is complete, I hit the back
  button and that loads the JoopComet class again.
 
  But I do not see dude printed.
 
  Why not?
  
 


 



-- 
Jack

--~--~-~--~~~---~--~~
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: CometActor timeout problem

2009-10-04 Thread jack

Atsuhiko,

With the code exactly as you wrote it, how would you modify it to do
this?

Whenver the Comet Page gets loaded, it resets itself.

On Oct 3, 12:47 am, Atsuhiko Yamanaka atsuhiko.yaman...@gmail.com
wrote:
 Hi,

 On Sat, Oct 3, 2009 at 1:05 PM, jack jack.wid...@gmail.com wrote:

  Atsuhiko,

  The way I have modified the code, each thread is returning its Package
  object at different times. But its seems the screen updates only when
  they all have completed. Could you tell me what piece of the code
  makes the screen update?

 Can you show your code?
--~--~-~--~~~---~--~~
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: CometActor timeout problem

2009-10-04 Thread jack

Excellent. Thanks.

On Oct 5, 12:14 am, Atsuhiko Yamanaka atsuhiko.yaman...@gmail.com
wrote:
 Hi,

 On Mon, Oct 5, 2009 at 8:16 AM, jack jack.wid...@gmail.com wrote:
  With the code exactly as you wrote it, how would you modify it to do
  this?

  Whenver the Comet Page gets loaded, it resets itself.

 How about wrapping your CometActor page with the snippet?

 Please refer to attached diff file.

 Sincerely,
 --
 Atsuhiko Yamanaka
 JCraft,Inc.
 1-14-20 HONCHO AOBA-KU,
 SENDAI, MIYAGI 980-0014 Japan.
 Tel +81-22-723-2150
     +1-415-578-3454
 Skype callto://jcraft/

  diff.txt
 1KViewDownload
--~--~-~--~~~---~--~~
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] execute code when browser is closed

2009-10-04 Thread jack

I would like to call a function when the browser is closed. How do I
do this?
--~--~-~--~~~---~--~~
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: CometActor timeout problem

2009-10-03 Thread jack

Yes, I will send you this. In the mean time, could you at least tell
me how to reset the code. I.E. I would like that everytime you refresh
the page, it starts again.

On Oct 3, 12:47 am, Atsuhiko Yamanaka atsuhiko.yaman...@gmail.com
wrote:
 Hi,

 On Sat, Oct 3, 2009 at 1:05 PM, jack jack.wid...@gmail.com wrote:

  Atsuhiko,

  The way I have modified the code, each thread is returning its Package
  object at different times. But its seems the screen updates only when
  they all have completed. Could you tell me what piece of the code
  makes the screen update?

 Can you show your code?
--~--~-~--~~~---~--~~
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: CometActor timeout problem

2009-10-02 Thread jack

Atsuhiko,

The way I have modified the code, each thread is returning its Package
object at different times. But its seems the screen updates only when
they all have completed. Could you tell me what piece of the code
makes the screen update?
Thanks.

Jack

On Oct 1, 11:19 am, David Pollak feeder.of.the.be...@gmail.com
wrote:
 Thanks!

 On Thu, Oct 1, 2009 at 1:11 AM, Atsuhiko Yamanaka 





 atsuhiko.yaman...@gmail.com wrote:
  Hi,

  On Thu, Oct 1, 2009 at 1:11 PM, Jack Widman jack.wid...@gmail.com wrote:
   David,
   I have attached a (non) working example. It compiles and runs and does a
   part of what I want it to do but not completely. It first displays a
  couple
   of links and the link body for both links is just 0. It then spawns a
  couple
   of threads each of which generates a random number and then   puts two
  Page
   objects on a PageQueue. The comet page is supposed to reRender the screen
   whenever a new page object is added to the Queue. Before it does this it
   calls a method called insertRandomNumber which changes the zero to some
   random value.
   There is not much code and i think its pretty self-explanatory. The html
   page is test.html.
   I really do appreciate your help and understand if you can't go through
  the
   whole thing.

  Frankly to say, I could not understand the internal logic, and it
  seems it has be broken,
  but attached modified src.zip will work as the demonstration of
  CometActor at least.
   * JoopComet implements CometListenee
   * TSGetterLauncer has been rewritten, and will start TSGetters in
  every 3 seconds.
     The previous version has really short life.
   * TSCatcher implements ListenerManager.
   * url links on the web page will be updated in every 3 seconds.

  Sincerely,
  --
  Atsuhiko Yamanaka
  JCraft,Inc.
  1-14-20 HONCHO AOBA-KU,
  SENDAI, MIYAGI 980-0014 Japan.
  Tel +81-22-723-2150
     +1-415-578-3454
  Skype callto://jcraft/

 --
 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 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: CometActor timeout problem

2009-10-01 Thread Jack Widman
Thanks Atsuhiko very much. I really appreciate your effort and this helps
alot.
Jack

On Thu, Oct 1, 2009 at 4:11 AM, Atsuhiko Yamanaka 
atsuhiko.yaman...@gmail.com wrote:

 Hi,

 On Thu, Oct 1, 2009 at 1:11 PM, Jack Widman jack.wid...@gmail.com wrote:
  David,
  I have attached a (non) working example. It compiles and runs and does a
  part of what I want it to do but not completely. It first displays a
 couple
  of links and the link body for both links is just 0. It then spawns a
 couple
  of threads each of which generates a random number and then   puts two
 Page
  objects on a PageQueue. The comet page is supposed to reRender the screen
  whenever a new page object is added to the Queue. Before it does this it
  calls a method called insertRandomNumber which changes the zero to some
  random value.
  There is not much code and i think its pretty self-explanatory. The html
  page is test.html.
  I really do appreciate your help and understand if you can't go through
 the
  whole thing.

 Frankly to say, I could not understand the internal logic, and it
 seems it has be broken,
 but attached modified src.zip will work as the demonstration of
 CometActor at least.
  * JoopComet implements CometListenee
  * TSGetterLauncer has been rewritten, and will start TSGetters in
 every 3 seconds.
The previous version has really short life.
  * TSCatcher implements ListenerManager.
  * url links on the web page will be updated in every 3 seconds.


 Sincerely,
 --
 Atsuhiko Yamanaka
 JCraft,Inc.
 1-14-20 HONCHO AOBA-KU,
 SENDAI, MIYAGI 980-0014 Japan.
 Tel +81-22-723-2150
+1-415-578-3454
 Skype callto://jcraft/

 


--~--~-~--~~~---~--~~
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: CometActor timeout problem

2009-10-01 Thread Jack Widman
Atsuhiko,
How would I make one small change? I would like each link to refresh only
once and I would like that to happen as soon as the TSCatcher objects catch
a package. Thanks in advance.

Jack

On Thu, Oct 1, 2009 at 4:11 AM, Atsuhiko Yamanaka 
atsuhiko.yaman...@gmail.com wrote:

 Hi,

 On Thu, Oct 1, 2009 at 1:11 PM, Jack Widman jack.wid...@gmail.com wrote:
  David,
  I have attached a (non) working example. It compiles and runs and does a
  part of what I want it to do but not completely. It first displays a
 couple
  of links and the link body for both links is just 0. It then spawns a
 couple
  of threads each of which generates a random number and then   puts two
 Page
  objects on a PageQueue. The comet page is supposed to reRender the screen
  whenever a new page object is added to the Queue. Before it does this it
  calls a method called insertRandomNumber which changes the zero to some
  random value.
  There is not much code and i think its pretty self-explanatory. The html
  page is test.html.
  I really do appreciate your help and understand if you can't go through
 the
  whole thing.

 Frankly to say, I could not understand the internal logic, and it
 seems it has be broken,
 but attached modified src.zip will work as the demonstration of
 CometActor at least.
  * JoopComet implements CometListenee
  * TSGetterLauncer has been rewritten, and will start TSGetters in
 every 3 seconds.
The previous version has really short life.
  * TSCatcher implements ListenerManager.
  * url links on the web page will be updated in every 3 seconds.


 Sincerely,
 --
 Atsuhiko Yamanaka
 JCraft,Inc.
 1-14-20 HONCHO AOBA-KU,
 SENDAI, MIYAGI 980-0014 Japan.
 Tel +81-22-723-2150
+1-415-578-3454
 Skype callto://jcraft/

 


--~--~-~--~~~---~--~~
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: CometActor timeout problem

2009-10-01 Thread Jack Widman
Thanks so much Atsuhiko. You are very kind.

On Thu, Oct 1, 2009 at 11:01 AM, Atsuhiko Yamanaka 
atsuhiko.yaman...@gmail.com wrote:

 Hi,

 On Thu, Oct 1, 2009 at 9:42 PM, Jack Widman jack.wid...@gmail.com wrote:
  Atsuhiko,
  How would I make one small change? I would like each link to refresh only
  once and I would like that to happen as soon as the TSCatcher objects
 catch
  a package. Thanks in advance.

 How about the attached src.zip?
 It will refresh each links only once.
 A package will be sent from JoopComet#localSetup and
 that method will be invoked only once during the life of JoopComet.
 This means that even if you leave test.html page and re-vist there,
 that method will not be invoked again.


 Sincerely,
 --
 Atsuhiko Yamanaka
 JCraft,Inc.
 1-14-20 HONCHO AOBA-KU,
 SENDAI, MIYAGI 980-0014 Japan.
 Tel +81-22-723-2150
+1-415-578-3454
 Skype callto://jcraft

 


--~--~-~--~~~---~--~~
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: CometActor timeout problem

2009-09-27 Thread jack

I am still having this problem so I will post a simple example. Say I
want to display a list of the numbers 1 to 100. And suppose I have an
object Foo and a method bar, which takes an integer and returns an
integer. And bar takes about 10 seconds to return. So I want to
display the numbers, run Foo.bar on each of them in the background,
and then update the display via comet to replace each integer with bar
of it. I got the Clock example to work and I think I understand what
is going on there. Could somebody show me how to do this example in
terms of the Clock example? Or just a few lines of code to suggest how
to do it?








On Sep 18, 12:09 pm, marius d. marius.dan...@gmail.com wrote:
 On Sep 17, 11:09 pm,jackjack.wid...@gmail.com wrote:

  I have a CometActor which displays a list of urls and at the same time
  launches a bunch of threads each of which gets information about the
  urls and then puts messages about that information in a Queue. On each
  new tick, the CometActor checks the queue and updates its urls.

  The problem is that I am launching the threads from the CometActor and
  the page is never coming back. It times out.

 So the page never gets rendered? I would recommend using actors and
 not really threads but even with threads it shouldn't impact you. But
 it also depends on what your code does. Can you post a minimalistic
 example?





  Is there some general principle about launching threads from a
  CometActor that might explain this behavior?
--~--~-~--~~~---~--~~
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: CometActor timeout problem

2009-09-18 Thread Jack Widman
Yes, the page never gets rendered. I am actually using Actors. I will post a
code example tonight. Thanks for your response.

On Fri, Sep 18, 2009 at 12:09 PM, marius d. marius.dan...@gmail.com wrote:




 On Sep 17, 11:09 pm, jack jack.wid...@gmail.com wrote:
  I have a CometActor which displays a list of urls and at the same time
  launches a bunch of threads each of which gets information about the
  urls and then puts messages about that information in a Queue. On each
  new tick, the CometActor checks the queue and updates its urls.
 
  The problem is that I am launching the threads from the CometActor and
  the page is never coming back. It times out.

 So the page never gets rendered? I would recommend using actors and
 not really threads but even with threads it shouldn't impact you. But
 it also depends on what your code does. Can you post a minimalistic
 example?

 
  Is there some general principle about launching threads from a
  CometActor that might explain this behavior?
 


--~--~-~--~~~---~--~~
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] CometActor timeout problem

2009-09-17 Thread jack

I have a CometActor which displays a list of urls and at the same time
launches a bunch of threads each of which gets information about the
urls and then puts messages about that information in a Queue. On each
new tick, the CometActor checks the queue and updates its urls.

The problem is that I am launching the threads from the CometActor and
the page is never coming back. It times out.

Is there some general principle about launching threads from a
CometActor that might explain this behavior?
--~--~-~--~~~---~--~~
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: trouble with comet Clock example

2009-09-15 Thread Jack Widman
The package is correct. Here is the error
XML parsing failed: syntax error (Line: 13, Character: 4)

Reparse document as HTML
Error:undeclared XML namespace prefix used in attribute name
Specification:http://www.w3.org/TR/xml-names11/#nsc-NSDeclared
 10:   body
 11:
 12:   !--FIXME - comet type: Full(com.authoritude.snippet.Clock) name:
Full(Other) Not Found --
 13: clk:timeMissing Clock/clk:time
 14:
 15:
 16:   script type=text/javascript
I tried it both with the full class name and just Clock. I get the same
error in both cases.
Its seems to be saying clk is an undeclared namespace?


On Tue, Sep 15, 2009 at 4:46 AM, Timothy Perrett timo...@getintheloop.euwrote:


 Its telling you that the class Clock could not be found - if i were
 you, check the package definitions on the clock class to make sure its
 in the right namespace.

 Cheers, Tim

 On Sep 15, 3:38 am, jack jack.wid...@gmail.com wrote:
  I compiled the comet Clock app and used the following markup
 
  lift:surround with=default at=content
lift:comet type=Clock name=Other
  clk:timeMissing Clock/clk:time
/lift:comet
  /lift:surround
 
  I also used the standard default.html
 
  When I ran it, I got the error
 
  XML parsing failed: syntax error (Line: 13, Character: 4)
 
  Error:undeclared XML namespace prefix used in attribute name
  Specification:http://www.w3.org/TR/xml-names11/#nsc-NSDeclared
   10:   body
   11:
   12:   !--FIXME - comet type: Full(Clock) name: Full(Other) Not Found
  --
   13: clk:timeMissing Clock/clk:time
   14:
   15:
   16:   script type=text/javascript
 
  Any ideas?
 


--~--~-~--~~~---~--~~
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
-~--~~~~--~~--~--~---



  1   2   >