[Lift] Re: Hook into snippet creation

2010-01-19 Thread ced
Do you perhaps have an example function at hand?


On 19 Jan., 06:12, David Pollak feeder.of.the.be...@gmail.com wrote:
 On Sun, Jan 17, 2010 at 12:24 PM, ced docpom...@googlemail.com wrote:
  Hi all,
  is there a way to hook into the creation of snippets? I'd like to gain
  control over their creation.
  I tried to find something in LiftRules but couldn't find anything that
  might be suitable for this purpose.

 LiftRules.snippets
 LiftRules.snippetDispatch

 No need for DI.  You add PartialFunctions and Lift takes care of the rest.





  But maybe I missed something. Any
  hints?

  Cheers,
  Chris

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

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




[Lift] Database Default for MappedDateTime

2010-01-19 Thread aw
I have an Oracle table that has a timestamp column with a default
value (current_timestamp).  Mapper doesn't allow a save operation
unless I specifically specify a value for the timestamp column.  I
would prefer to leverage the database's timestamp vs. the middle
tier's.  Is there a way that I can get the save operation to work?
Note that it doesn't fail -- an exception was thrown.
-- 
You received this message because you are subscribed to the Google Groups 
Lift group.
To post to this group, send email to lift...@googlegroups.com.
To unsubscribe from this group, send email to 
liftweb+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/liftweb?hl=en.




Re: [Lift] Re: Ajax forms and (multiple) submit buttons

2010-01-19 Thread Adam Warski
Hello,

 1. HTTP parameters MAY arrive in an unpredictable order into the
 servlet. Container may alter their order due to use of maps etc, or
 browsers may even alter it. The point is that parameters order for
 application/x-www-form-urlencoded is not specified.
didn't know that - something new every day :).

 2. Even if the ajax request was sent with the right order (the one
 that we expected) Lift DOES the parameter sorting. This is imperative
 to ensure proper execution order for form functions. Thus since the
 function names that were added after you press the Add button are
 lexicographically  then your submit function name (there is an
 algorithm generating form function names), your submit function was
 processed BEFORE those fields function.
 
 To cope with this I modified your ajaxButton to:
 
  def ajaxButton(text: NodeSeq, formId: String, func: () = JsCmd,
 attrs: (String, String)*): Elem = {
val name = Z + Helpers.nextFuncName
addFunctionMap(name, contextFuncBuilder(func))
 
attrs.foldLeft(
button onclick={makeAjaxCall(JsRaw(
  LiftRules.jsArtifacts.serialize(formId).toJsCmd +  + 
 + Str( + name + =true).toJsCmd)).toJsCmd +
; return false;}{text}/button)(_ % _)
  }
I see - I'll have to take a look at the algorithm, may be quite interesting.
Although it's logical (and now clear to me) that the functions have to be 
executed in the order they were defined; lift had no way to know that the 
button function should be called after the update functions, as the function's 
name was generated the same way as the button functions.

-- 
Thanks a lot!
Adam-- 
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] Database Default for MappedDateTime

2010-01-19 Thread Jeppe Nejsum Madsen
aw anth...@whitford.com writes:

 I have an Oracle table that has a timestamp column with a default
 value (current_timestamp).  Mapper doesn't allow a save operation
 unless I specifically specify a value for the timestamp column.  I
 would prefer to leverage the database's timestamp vs. the middle
 tier's.  Is there a way that I can get the save operation to work?
 Note that it doesn't fail -- an exception was thrown.

Not afaik. If it was indeed possible to use the db default value, Mapper
would have to read the contents back in order to get the in memory
object consistent.

If you really need to use the DB value, there's always the option to do
a manual SQL :-)

/Jeppe

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




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

2010-01-19 Thread Yu-Shan Fung
Hi All,

I have a lift app, where one of the functions performs sub-computations
(including network operations) in parallel via future(s)  Futures.awaitAll.
It runs fine on the first request, but subsequent requests throws a
IllegalStateException:

Exception in thread Thread-30 java.lang.IllegalStateException: Timer
already cancelled.
at java.util.Timer.sched(Timer.java:376)
at java.util.Timer.schedule(Timer.java:192)
at scala.actors.Futures$.awaitAll(Future.scala:76)
at MyWorker.run(MyWorker.scala:20)
at java.lang.Thread.run(Thread.java:636)

I dug up more documentation and it looks like this exception indicates an
attempt to schedule a task on a timer that has already been cancelled
(associated daemon thread terminated?). Any idea why, or if I'm doing
something wrong?

In case it matters, I'm running Scala code runner version 2.7.7.final,
Liftweb 1.0, Jetty 6.1.22.

Any tips/pointers would be appreciated. Thanks!
Yu-Shan



-- 
“When nothing seems to help, I go look at a stonecutter hammering away at
his rock perhaps a hundred times without as much as a crack showing in it.
Yet at the hundred and first blow it will split in two, and I know it was
not that blow that did it, but all that had gone before.” — Jacob Riis

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




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

2010-01-19 Thread Marius
I'd recommend using Lisft 1.1-SNAPSHOT or 2.0-SNAPSHOT

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

Br's,
Marius

On Jan 19, 8:04 am, Yu-Shan Fung ambivale...@gmail.com wrote:
 Hi All,

 I have a lift app, where one of the functions performs sub-computations
 (including network operations) in parallel via future(s)  Futures.awaitAll.
 It runs fine on the first request, but subsequent requests throws a
 IllegalStateException:

 Exception in thread Thread-30 java.lang.IllegalStateException: Timer
 already cancelled.
         at java.util.Timer.sched(Timer.java:376)
         at java.util.Timer.schedule(Timer.java:192)
         at scala.actors.Futures$.awaitAll(Future.scala:76)
         at MyWorker.run(MyWorker.scala:20)
         at java.lang.Thread.run(Thread.java:636)

 I dug up more documentation and it looks like this exception indicates an
 attempt to schedule a task on a timer that has already been cancelled
 (associated daemon thread terminated?). Any idea why, or if I'm doing
 something wrong?

 In case it matters, I'm running Scala code runner version 2.7.7.final,
 Liftweb 1.0, Jetty 6.1.22.

 Any tips/pointers would be appreciated. Thanks!
 Yu-Shan

 --
 “When nothing seems to help, I go look at a stonecutter hammering away at
 his rock perhaps a hundred times without as much as a crack showing in it.
 Yet at the hundred and first blow it will split in two, and I know it was
 not that blow that did it, but all that had gone before.” — Jacob Riis
-- 
You received this message because you are subscribed to the Google Groups 
Lift group.
To post to this group, send email to lift...@googlegroups.com.
To unsubscribe from this group, send email to 
liftweb+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/liftweb?hl=en.




Re: [Lift] Re: Hook into snippet creation

2010-01-19 Thread David Pollak
On Tue, Jan 19, 2010 at 2:36 AM, ced docpom...@googlemail.com wrote:

 Do you perhaps have an example function at hand?


LiftRules.snippets.append {
  case Foo = xml = bind(foo, xml, bar - baz)
}




 On 19 Jan., 06:12, David Pollak feeder.of.the.be...@gmail.com wrote:
  On Sun, Jan 17, 2010 at 12:24 PM, ced docpom...@googlemail.com wrote:
   Hi all,
   is there a way to hook into the creation of snippets? I'd like to gain
   control over their creation.
   I tried to find something in LiftRules but couldn't find anything that
   might be suitable for this purpose.
 
  LiftRules.snippets
  LiftRules.snippetDispatch
 
  No need for DI.  You add PartialFunctions and Lift takes care of the
 rest.
 
 
 
 
 
   But maybe I missed something. Any
   hints?
 
   Cheers,
   Chris
 
   --
   You received this message because you are subscribed to the Google
 Groups
   Lift group.
   To post to this group, send email to lift...@googlegroups.com.
   To unsubscribe from this group, send email to
   liftweb+unsubscr...@googlegroups.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=en.
 
  --
  Lift, the simply functional web frameworkhttp://liftweb.net
  Beginning Scalahttp://www.apress.com/book/view/1430219890
  Follow me:http://twitter.com/dpp
  Surf the harmonics

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






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

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

To post to this group, send email to lift...@googlegroups.com.

To unsubscribe from this group, send email to liftweb+unsubscr...@googlegroups.com.

For more options, visit this group at http://groups.google.com/group/liftweb?hl=en.



[Lift] Why doesn't ProtoUser use IdPK?

2010-01-19 Thread Franz Bettag
Hey guys,

i am trying to extend my logging trait. The Problem is, i can't say
something like A : LongKeyedMapper[A] in my trait since ProtoUser
doesn't use IdPK but uses it's own declarations (which look the same
to me).

If i read that piece of code right, it should be no problem to extend
ProtoUser with IdPK.

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




Re: [Lift] Why doesn't ProtoUser use IdPK?

2010-01-19 Thread David Pollak
On Tue, Jan 19, 2010 at 9:53 AM, Franz Bettag fr...@bett.ag wrote:

 Hey guys,

 i am trying to extend my logging trait. The Problem is, i can't say
 something like A : LongKeyedMapper[A] in my trait since ProtoUser
 doesn't use IdPK but uses it's own declarations (which look the same
 to me).


Why do you need ProtoUser extended with IdPK?  Why can't your trait work
with LongKeyedMapper?

If you want to include your code, I'll work it to make it right.



 If i read that piece of code right, it should be no problem to extend
 ProtoUser with IdPK.


ProtoUser existed before IdPK.  IdPK is merely a convenience if you want
your primary key to be named id.



 Best regards

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






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

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

To post to this group, send email to lift...@googlegroups.com.

To unsubscribe from this group, send email to liftweb+unsubscr...@googlegroups.com.

For more options, visit this group at http://groups.google.com/group/liftweb?hl=en.



[Lift] Lift-Wizard Fields incompatible with lift-record fields

2010-01-19 Thread Tim Maxwell
The lift-wizard and lift-record packages both have Field traits that
appear to do very similar things, with the end result being that the
lift-wizard currently can't use the existing EmailField,
PasswordField, UploadField traits.

Will these types be unified at some point? Will we be able to use the
existing Field types or should we start writing our own?

Sorry for the repost, my original title was not very descriptive.

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




Re: [Lift] An experience report using Scala Lift

2010-01-19 Thread jlist9
I'm new to maven so I just followed the Lift Getting Started
guide, which uses mvn jetty:run to start jetty and ctrl-c to stop it.

I used sbt before for another project that uses a different framework
and like it that it auto-compiles the changed files and restarts jetty
(as far as I remember - it's been a while.) So far I haven't tried JRebel
yet so I'm not sure if it offers more than what sbt does but I'm
interested in finding out.

When doing that project, I pretty much used a simple text editor
to write scala code and I missed the features provided by eclipse
or netbeans. So I'm hoping that there is a way to use sbt and
eclipse or netbeans (I think the netbeans scala plug-in works better
than the eclipse's plugin but I'm OK with usine eclipse since that's
my default Java environment), and maybe add JRebel to the picture
if it does something that sbt doesn't offer.

I understand that the dev environment is a personal choice but I
think it would be nice to have a recommended set up that makes
use of neat tools like sbt and the free JRebel library. It would be
helpful for people who are new to Lift or Scala in general.

On Mon, Jan 18, 2010 at 10:58 PM, Naftoli Gugenheim
naftoli...@gmail.com wrote:
 How do you launch jetty? If it's an eclipse maven launch, specify JRebel in 
 the JVM arguments. For command-line maven, specify it in the MAVEN_OPTS 
 environment variable.
 If you launch via sbt (assuming there's such a thing) then you have to check 
 the sbt docs.
 Ultimately the command line that launches java.exe (or equivalent) to run 
 jetty should have -noverify -javaagent:path/to/jrebel.jar in it.
 If the question was about sbt with eclipse, there's a plugin that provides 
 sbt dependencies as classpath container.
 It is indeed very convenient to use JRebel. Most changes are viewable 
 immediately (though at times reloading classes is slow). Exceptions are 
 significant changes to a class like implementing a new interface (and due to 
 scala's abundance of syntactic sugar these are more often than you'd thin), 
 and changes to things set in Boot, since it's only run once. That doesn't 
 include functions etc. defined in Boot--if you pass a PartialFunction to a 
 LiftRules configuration, changes to its body will be reflected immediately.

 -
 jlist9jli...@gmail.com wrote:

 Thanks.

 The Eclipse incremental compiler, Jetty  the JRebel plugin makes for
 fairly rapid turnaround times.

 This is interesting. I wonder if there are instructions somewhere online
 about how to use Eclipse + sbt + JRebel for Lift development. The Lift
 Get Started Guide mentions a lot of start and stop Jetty. The impression
 I got from reading it is that's how Lift development is done. I'm sure
 there is a better way :-)

 On Mon, Jan 18, 2010 at 12:44 PM, Jeppe Nejsum Madsen je...@ingolfs.dk 
 wrote:
 Hi,

 A while ago, I started writing an experience report on using Scala 
 Lift. I finally finished this (it has been a little more than 6 months
 now, time is flying :-)

 http://jeppenejsum.wordpress.com/2010/01/18/scala-and-lift-status-after-six-months/

 /Jeppe

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




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


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



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




Re: [Lift] Lift-Wizard Fields incompatible with lift-record fields

2010-01-19 Thread David Pollak
On Tue, Jan 19, 2010 at 10:56 AM, Tim Maxwell truthspi...@gmail.com wrote:

 The lift-wizard and lift-record packages both have Field traits that
 appear to do very similar things, with the end result being that the
 lift-wizard currently can't use the existing EmailField,
 PasswordField, UploadField traits.


What EmailField?



 Will these types be unified at some point? Will we be able to use the
 existing Field types or should we start writing our own?

 Sorry for the repost, my original title was not very descriptive.

 Cheers,
 Tim

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






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

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

To post to this group, send email to lift...@googlegroups.com.

To unsubscribe from this group, send email to liftweb+unsubscr...@googlegroups.com.

For more options, visit this group at http://groups.google.com/group/liftweb?hl=en.



[Lift] Re: Lift-Wizard Fields incompatible with lift-record fields

2010-01-19 Thread Tim Maxwell
net.liftweb.record.field.EmailField

Am I wrong about these fields being what the UI layer uses to generate
forms?

On Jan 19, 1:02 pm, David Pollak feeder.of.the.be...@gmail.com
wrote:
 On Tue, Jan 19, 2010 at 10:56 AM, Tim Maxwell truthspi...@gmail.com wrote:
  The lift-wizard and lift-record packages both have Field traits that
  appear to do very similar things, with the end result being that the
  lift-wizard currently can't use the existing EmailField,
  PasswordField, UploadField traits.

 What EmailField?







  Will these types be unified at some point? Will we be able to use the
  existing Field types or should we start writing our own?

  Sorry for the repost, my original title was not very descriptive.

  Cheers,
  Tim

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

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




Re: [Lift] Re: Lift-Wizard Fields incompatible with lift-record fields

2010-01-19 Thread David Pollak
On Tue, Jan 19, 2010 at 11:06 AM, Tim Maxwell truthspi...@gmail.com wrote:

 net.liftweb.record.field.EmailField


The record stuff is not yet integrated into the Screen/Wizard stuff.  I'm
likely to be the person to do that work and I'm massively behind due to a
bunch of personal stuff.  I doubt any of the Record stuff will be integrated
in the next month.



 Am I wrong about these fields being what the UI layer uses to generate
 forms?

 On Jan 19, 1:02 pm, David Pollak feeder.of.the.be...@gmail.com
 wrote:
  On Tue, Jan 19, 2010 at 10:56 AM, Tim Maxwell truthspi...@gmail.com
 wrote:
   The lift-wizard and lift-record packages both have Field traits that
   appear to do very similar things, with the end result being that the
   lift-wizard currently can't use the existing EmailField,
   PasswordField, UploadField traits.
 
  What EmailField?
 
 
 
 
 
 
 
   Will these types be unified at some point? Will we be able to use the
   existing Field types or should we start writing our own?
 
   Sorry for the repost, my original title was not very descriptive.
 
   Cheers,
   Tim
 
   --
   You received this message because you are subscribed to the Google
 Groups
   Lift group.
   To post to this group, send email to lift...@googlegroups.com.
   To unsubscribe from this group, send email to
   liftweb+unsubscr...@googlegroups.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=en.
 
  --
  Lift, the simply functional web frameworkhttp://liftweb.net
  Beginning Scalahttp://www.apress.com/book/view/1430219890
  Follow me:http://twitter.com/dpp
  Surf the harmonics

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






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

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

To post to this group, send email to lift...@googlegroups.com.

To unsubscribe from this group, send email to liftweb+unsubscr...@googlegroups.com.

For more options, visit this group at http://groups.google.com/group/liftweb?hl=en.



[Lift] Welcome Mads Hartmann Jensen to the Lift Committers

2010-01-19 Thread David Pollak
Folks,

Please join me in welcoming Mads to the Lift committers.

Thanks,

David

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

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

To post to this group, send email to lift...@googlegroups.com.

To unsubscribe from this group, send email to liftweb+unsubscr...@googlegroups.com.

For more options, visit this group at http://groups.google.com/group/liftweb?hl=en.



Re: [Lift] Welcome Mads Hartmann Jensen to the Lift Committers

2010-01-19 Thread Ross Mellgren
Welcome, Mads!

-Ross

On Jan 19, 2010, at 2:15 PM, David Pollak wrote:

 Folks,
 
 Please join me in welcoming Mads to the Lift committers.
 
 Thanks,
 
 David
 
 -- 
 Lift, the simply functional web framework http://liftweb.net
 Beginning Scala http://www.apress.com/book/view/1430219890
 Follow me: http://twitter.com/dpp
 Surf the harmonics
 -- 
 You received this message because you are subscribed to the Google Groups 
 Lift group.
 To post to this group, send email to lift...@googlegroups.com.
 To unsubscribe from this group, send email to 
 liftweb+unsubscr...@googlegroups.com.
 For more options, visit this group at 
 http://groups.google.com/group/liftweb?hl=en.

-- 

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

To post to this group, send email to lift...@googlegroups.com.

To unsubscribe from this group, send email to liftweb+unsubscr...@googlegroups.com.

For more options, visit this group at http://groups.google.com/group/liftweb?hl=en.



[Lift] Re: Welcome Mads Hartmann Jensen to the Lift Committers

2010-01-19 Thread Mads Hartmann
Thanks! It's an honor to be part of the team :)

I'm really excited that I'll be able to contribute to such a great
project

Cheers

On Jan 19, 8:17 pm, Ross Mellgren dri...@gmail.com wrote:
 Welcome, Mads!

 -Ross

 On Jan 19, 2010, at 2:15 PM, David Pollak wrote:



  Folks,

  Please join me in welcoming Mads to the Lift committers.

  Thanks,

  David

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




[Lift] Re: Why doesn't ProtoUser use IdPK?

2010-01-19 Thread Franz Bettag


On 19 Jan., 19:32, David Pollak feeder.of.the.be...@gmail.com wrote:
  i am trying to extend my logging trait. The Problem is, i can't say
  something like A : LongKeyedMapper[A] in my trait since ProtoUser
  doesn't use IdPK but uses it's own declarations (which look the same
  to me).

 Why do you need ProtoUser extended with IdPK?  Why can't your trait work
 with LongKeyedMapper?

The code relies on having a .id method on the passed object. The Three
Traits are below. It works fine with anything having IdPK. At the
moment i have this code copied into my User singleton which is exactly
what i want to avoid.

I don't know how i would dynamify the use of the .id method. In
ActionLog and the Stamped trait.

trait Stamped[A : LongKeyedMapper[A] with IdPK]
extends SkipLogging with KeyedMetaMapper[Long, A] {

self: A with MetaMapper[A] with KeyedMapper[Long, A] =

override def afterCreate = (crudLog(_: A, create)) ::
super.afterCreate

override def afterUpdate = (crudLog(_: A, update)) ::
super.afterUpdate

override def afterDelete = (crudLog(_: A, delete)) ::
super.afterDelete

private def crudLog(obj: A, action: String): Unit = {
if (!self.skipLogging) {
val log = new ActionLog

log.action(action).klass(obj.getClass.getName).record(obj.id).save
}
}

}


trait SkipLogging {

var skipLogging = false
}


trait ActionLogs[A : Mapper[A] with IdPK] {

this: A =

def logs: List[ActionLog] = ActionLog.findAll(
By(ActionLog.klass, this.getClass.getName),
By(ActionLog.record, this.id)
)

}



-- 
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: Why doesn't ProtoUser use IdPK?

2010-01-19 Thread Ross Mellgren
How about structural typing?

trait Stamped[A : LongKeyedMapper[A] with { val id: MappedLongIndex[A] }] ...

I haven't tried it, but maybe it will work.

-Ross

On Jan 19, 2010, at 2:47 PM, Franz Bettag wrote:

 
 
 On 19 Jan., 19:32, David Pollak feeder.of.the.be...@gmail.com wrote:
 i am trying to extend my logging trait. The Problem is, i can't say
 something like A : LongKeyedMapper[A] in my trait since ProtoUser
 doesn't use IdPK but uses it's own declarations (which look the same
 to me).
 
 Why do you need ProtoUser extended with IdPK?  Why can't your trait work
 with LongKeyedMapper?
 
 The code relies on having a .id method on the passed object. The Three
 Traits are below. It works fine with anything having IdPK. At the
 moment i have this code copied into my User singleton which is exactly
 what i want to avoid.
 
 I don't know how i would dynamify the use of the .id method. In
 ActionLog and the Stamped trait.
 
 trait Stamped[A : LongKeyedMapper[A] with IdPK]
   extends SkipLogging with KeyedMetaMapper[Long, A] {
 
   self: A with MetaMapper[A] with KeyedMapper[Long, A] =
 
   override def afterCreate = (crudLog(_: A, create)) ::
 super.afterCreate
 
   override def afterUpdate = (crudLog(_: A, update)) ::
 super.afterUpdate
 
   override def afterDelete = (crudLog(_: A, delete)) ::
 super.afterDelete
 
   private def crudLog(obj: A, action: String): Unit = {
   if (!self.skipLogging) {
   val log = new ActionLog
   
 log.action(action).klass(obj.getClass.getName).record(obj.id).save
   }
   }
 
 }
 
 
 trait SkipLogging {
 
   var skipLogging = false
 }
 
 
 trait ActionLogs[A : Mapper[A] with IdPK] {
 
   this: A =
 
   def logs: List[ActionLog] = ActionLog.findAll(
   By(ActionLog.klass, this.getClass.getName),
   By(ActionLog.record, this.id)
   )
 
 }
 
 
 
 -- 
 You received this message because you are subscribed to the Google Groups 
 Lift group.
 To post to this group, send email to lift...@googlegroups.com.
 To unsubscribe from this group, send email to 
 liftweb+unsubscr...@googlegroups.com.
 For more options, visit this group at 
 http://groups.google.com/group/liftweb?hl=en.
 
 

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




[Lift] Re: Why doesn't ProtoUser use IdPK?

2010-01-19 Thread Franz Bettag
Damn, i tried Long all day long with structural typing.. gnarf.

On 19 Jan., 20:55, Ross Mellgren dri...@gmail.com wrote:
 How about structural typing?

 trait Stamped[A : LongKeyedMapper[A] with { val id: MappedLongIndex[A] }] ...

 I haven't tried it, but maybe it will work.

 -Ross

 On Jan 19, 2010, at 2:47 PM, Franz Bettag wrote:



  On 19 Jan., 19:32, David Pollak feeder.of.the.be...@gmail.com wrote:
  i am trying to extend my logging trait. The Problem is, i can't say
  something like A : LongKeyedMapper[A] in my trait since ProtoUser
  doesn't use IdPK but uses it's own declarations (which look the same
  to me).

  Why do you need ProtoUser extended with IdPK?  Why can't your trait work
  with LongKeyedMapper?

  The code relies on having a .id method on the passed object. The Three
  Traits are below. It works fine with anything having IdPK. At the
  moment i have this code copied into my User singleton which is exactly
  what i want to avoid.

  I don't know how i would dynamify the use of the .id method. In
  ActionLog and the Stamped trait.

  trait Stamped[A : LongKeyedMapper[A] with IdPK]
     extends SkipLogging with KeyedMetaMapper[Long, A] {

     self: A with MetaMapper[A] with KeyedMapper[Long, A] =

     override def afterCreate = (crudLog(_: A, create)) ::
  super.afterCreate

     override def afterUpdate = (crudLog(_: A, update)) ::
  super.afterUpdate

     override def afterDelete = (crudLog(_: A, delete)) ::
  super.afterDelete

     private def crudLog(obj: A, action: String): Unit = {
             if (!self.skipLogging) {
                     val log = new ActionLog
                     
  log.action(action).klass(obj.getClass.getName).record(obj.id).save
             }
     }

  }

  trait SkipLogging {

     var skipLogging = false
  }

  trait ActionLogs[A : Mapper[A] with IdPK] {

     this: A =

     def logs: List[ActionLog] = ActionLog.findAll(
             By(ActionLog.klass, this.getClass.getName),
             By(ActionLog.record, this.id)
             )

  }

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




[Lift] Re: Why doesn't ProtoUser use IdPK?

2010-01-19 Thread Franz Bettag
Btw. without the with ;) And it doesn't work.

error: type arguments [bettag.lift.kundenlogin.model.Customer] do not
conform to trait Stamped's type parameter bounds [A :
net.liftweb.mapper.LongKeyedMapper[A]{def id:
net.liftweb.mapper.MappedLongIndex[A]}]

class Customer extends LongKeyedMapper[Customer]
with IdPK
with ActivateFields[Customer] {..}

object Customer extends Customer
with LongKeyedMetaMapper[Customer]
with Stamped[Customer]
with Activatable[Customer] {}


On 19 Jan., 20:55, Ross Mellgren dri...@gmail.com wrote:
 How about structural typing?

 trait Stamped[A : LongKeyedMapper[A] with { val id: MappedLongIndex[A] }] ...

 I haven't tried it, but maybe it will work.

 -Ross

 On Jan 19, 2010, at 2:47 PM, Franz Bettag wrote:



  On 19 Jan., 19:32, David Pollak feeder.of.the.be...@gmail.com wrote:
  i am trying to extend my logging trait. The Problem is, i can't say
  something like A : LongKeyedMapper[A] in my trait since ProtoUser
  doesn't use IdPK but uses it's own declarations (which look the same
  to me).

  Why do you need ProtoUser extended with IdPK?  Why can't your trait work
  with LongKeyedMapper?

  The code relies on having a .id method on the passed object. The Three
  Traits are below. It works fine with anything having IdPK. At the
  moment i have this code copied into my User singleton which is exactly
  what i want to avoid.

  I don't know how i would dynamify the use of the .id method. In
  ActionLog and the Stamped trait.

  trait Stamped[A : LongKeyedMapper[A] with IdPK]
     extends SkipLogging with KeyedMetaMapper[Long, A] {

     self: A with MetaMapper[A] with KeyedMapper[Long, A] =

     override def afterCreate = (crudLog(_: A, create)) ::
  super.afterCreate

     override def afterUpdate = (crudLog(_: A, update)) ::
  super.afterUpdate

     override def afterDelete = (crudLog(_: A, delete)) ::
  super.afterDelete

     private def crudLog(obj: A, action: String): Unit = {
             if (!self.skipLogging) {
                     val log = new ActionLog
                     
  log.action(action).klass(obj.getClass.getName).record(obj.id).save
             }
     }

  }

  trait SkipLogging {

     var skipLogging = false
  }

  trait ActionLogs[A : Mapper[A] with IdPK] {

     this: A =

     def logs: List[ActionLog] = ActionLog.findAll(
             By(ActionLog.klass, this.getClass.getName),
             By(ActionLog.record, this.id)
             )

  }

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




Re: [Lift] Re: Why doesn't ProtoUser use IdPK?

2010-01-19 Thread David Pollak
You don't need to use structural typing.

Any KeyedMapper has a primaryKey method that returns a Mapped field of the
type of the key.  To get the primary key field of a given KeyedMapper
instance, just call primaryKey.

On Tue, Jan 19, 2010 at 11:55 AM, Ross Mellgren dri...@gmail.com wrote:

 How about structural typing?

 trait Stamped[A : LongKeyedMapper[A] with { val id: MappedLongIndex[A] }]
 ...

 I haven't tried it, but maybe it will work.

 -Ross

 On Jan 19, 2010, at 2:47 PM, Franz Bettag wrote:

 
 
  On 19 Jan., 19:32, David Pollak feeder.of.the.be...@gmail.com wrote:
  i am trying to extend my logging trait. The Problem is, i can't say
  something like A : LongKeyedMapper[A] in my trait since ProtoUser
  doesn't use IdPK but uses it's own declarations (which look the same
  to me).
 
  Why do you need ProtoUser extended with IdPK?  Why can't your trait work
  with LongKeyedMapper?
 
  The code relies on having a .id method on the passed object. The Three
  Traits are below. It works fine with anything having IdPK. At the
  moment i have this code copied into my User singleton which is exactly
  what i want to avoid.
 
  I don't know how i would dynamify the use of the .id method. In
  ActionLog and the Stamped trait.
 
  trait Stamped[A : LongKeyedMapper[A] with IdPK]
extends SkipLogging with KeyedMetaMapper[Long, A] {
 
self: A with MetaMapper[A] with KeyedMapper[Long, A] =
 
override def afterCreate = (crudLog(_: A, create)) ::
  super.afterCreate
 
override def afterUpdate = (crudLog(_: A, update)) ::
  super.afterUpdate
 
override def afterDelete = (crudLog(_: A, delete)) ::
  super.afterDelete
 
private def crudLog(obj: A, action: String): Unit = {
if (!self.skipLogging) {
val log = new ActionLog
 
 log.action(action).klass(obj.getClass.getName).record(obj.id).save
}
}
 
  }
 
 
  trait SkipLogging {
 
var skipLogging = false
  }
 
 
  trait ActionLogs[A : Mapper[A] with IdPK] {
 
this: A =
 
def logs: List[ActionLog] = ActionLog.findAll(
By(ActionLog.klass, this.getClass.getName),
By(ActionLog.record, this.id)
)
 
  }
 
 
 
  --
  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.comliftweb%2bunsubscr...@googlegroups.com
 .
 For more options, visit this group at
 http://groups.google.com/group/liftweb?hl=en.






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

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

To post to this group, send email to lift...@googlegroups.com.

To unsubscribe from this group, send email to liftweb+unsubscr...@googlegroups.com.

For more options, visit this group at http://groups.google.com/group/liftweb?hl=en.



[Lift] Re: Why doesn't ProtoUser use IdPK?

2010-01-19 Thread Franz Bettag
trait Stamped[A : LongKeyedMapper[A]]
extends SkipLogging with KeyedMetaMapper[Long, A] {

self: A with MetaMapper[A] with KeyedMapper[Long, A] =

override def afterCreate = (crudLog(_: A, create)) ::
super.afterCreate

override def afterUpdate = (crudLog(_: A, update)) ::
super.afterUpdate

override def afterDelete = (crudLog(_: A, delete)) ::
super.afterDelete

private def crudLog(obj: A, action: String): Unit = {
if (!self.skipLogging) {
val log = new ActionLog
log.action(action).klass(obj.getClass.getName).record
(obj.primaryKey).save
// Stamped.scala:54: error: value primaryKey is not a member of A
}
}

}




On 19 Jan., 21:22, David Pollak feeder.of.the.be...@gmail.com wrote:
 You don't need to use structural typing.

 Any KeyedMapper has a primaryKey method that returns a Mapped field of the
 type of the key.  To get the primary key field of a given KeyedMapper
 instance, just call primaryKey.



 On Tue, Jan 19, 2010 at 11:55 AM, Ross Mellgren dri...@gmail.com wrote:
  How about structural typing?

  trait Stamped[A : LongKeyedMapper[A] with { val id: MappedLongIndex[A] }]
  ...

  I haven't tried it, but maybe it will work.

  -Ross

  On Jan 19, 2010, at 2:47 PM, Franz Bettag wrote:

   On 19 Jan., 19:32, David Pollak feeder.of.the.be...@gmail.com wrote:
   i am trying to extend my logging trait. The Problem is, i can't say
   something like A : LongKeyedMapper[A] in my trait since ProtoUser
   doesn't use IdPK but uses it's own declarations (which look the same
   to me).

   Why do you need ProtoUser extended with IdPK?  Why can't your trait work
   with LongKeyedMapper?

   The code relies on having a .id method on the passed object. The Three
   Traits are below. It works fine with anything having IdPK. At the
   moment i have this code copied into my User singleton which is exactly
   what i want to avoid.

   I don't know how i would dynamify the use of the .id method. In
   ActionLog and the Stamped trait.

   trait Stamped[A : LongKeyedMapper[A] with IdPK]
         extends SkipLogging with KeyedMetaMapper[Long, A] {

         self: A with MetaMapper[A] with KeyedMapper[Long, A] =

         override def afterCreate = (crudLog(_: A, create)) ::
   super.afterCreate

         override def afterUpdate = (crudLog(_: A, update)) ::
   super.afterUpdate

         override def afterDelete = (crudLog(_: A, delete)) ::
   super.afterDelete

         private def crudLog(obj: A, action: String): Unit = {
                 if (!self.skipLogging) {
                         val log = new ActionLog

  log.action(action).klass(obj.getClass.getName).record(obj.id).save
                 }
         }

   }

   trait SkipLogging {

         var skipLogging = false
   }

   trait ActionLogs[A : Mapper[A] with IdPK] {

         this: A =

         def logs: List[ActionLog] = ActionLog.findAll(
                 By(ActionLog.klass, this.getClass.getName),
                 By(ActionLog.record, this.id)
                 )

   }

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

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




Re: [Lift] Re: ConversionRules

2010-01-19 Thread Naftoli Gugenheim
Hi Marius and Tim (and anyone who has an opinion on this). Sorry for not 
responding earlier.
To clarify, there's no question that parseXXX will continue to return a box. 
The call to the DateFormat's parse method is wrapped in tryo in the default 
implementation.
The real question is if formatXXX should return a Box. The *only* justification 
for it returning a Box is because the input could be null, and thus the output 
would be Empty.
Now in my understanding the only realistic reason to expect a null input is 
because these functions are used my Mapped(Date)(Time), whose values can be 
NULL, a.k.a. null. My opinion, after thinking about it more, is this. In Scala 
null is generally seen as an undesirable artifact of Java interopability which 
should be contained in the smallest area of code possible. Also, it's easier 
(though doubtfully smarter) to use null rather than Option when dealing with 
databases because it's the most 1:1 with the backend format and the most 
lightweight API. In any case apparently the design decision in Mapper was to 
represent the data as nullable values.
But I don't think this puts the responsibility of dealing with null on 
ConversionRules. My opinion would be that MappedXXX should have its own way of 
formatting nulls.
What do you think?


-
Timothy Perretttimo...@getintheloop.eu wrote:

+1 on the Box... that is the lift idiom.

Cheers, Tim

On 15 Jan 2010, at 07:18, Marius wrote:

 I'd strongly suggest:
 
 1. All should return Box. In case of parsing failure for example
 return a Failure.
 2. If a param is null, inside your method use (Box !! param) which
 would give you an Empty if param is null.
 
 We should not assume dumb default values for input that doesn't make
 sense.
 
 Br's,
 Marius
 
 On Jan 15, 4:38 am, Naftoli Gugenheim naftoli...@gmail.com wrote:
 As suggested I am with G-d's help working on a new 
 net.liftweb.http.ConversionRules object, to contain factories for parsers 
 and formatters for date, date-time, time java.util.Date objects. Then 
 LiftRules.formateDate and .parseDate would be deprecated I suppose.
 One question is how to deal with null. The LiftRules implementation for 
 formatDate replaces null with new Date(0L), and parseDate returns Empty for 
 a null input.
 1. Should these functions worry about null? Maybe it's the caller's 
 responsibility, such as net.liftweb.mapper.MappedDate.
 2. If they should think about null, parseXXX returns a Box anyway because a 
 string may not parse, and null certainly doesn't parse and should thus 
 return Empty. However how should formatXXX deal with null? Here are some 
 suggestions; any others are welcome.
   (a) Return an empty string - 
   (b) Return something like  (no selection) etc.
   (c) formatXXX should also return a Box, which would be Empty for null
   (d) Behave as though new Date(0L) was passed in
   (e) Behave as though new Date was passed in
 -- 
 You received this message because you are subscribed to the Google Groups 
 Lift group.
 To post to this group, send email to lift...@googlegroups.com.
 To unsubscribe from this group, send email to 
 liftweb+unsubscr...@googlegroups.com.
 For more options, visit this group at 
 http://groups.google.com/group/liftweb?hl=en.
 
 

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


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




[Lift] Re: Why doesn't ProtoUser use IdPK?

2010-01-19 Thread Franz Bettag
That works! Thank you!

On 19 Jan., 21:39, Ross Mellgren dri...@gmail.com wrote:
 I see primaryKeyField in the docs, maybe try .record(obj.primaryKeyField.is) ?

 -Ross

 On Jan 19, 2010, at 3:31 PM, Franz Bettag wrote:

  trait Stamped[A : LongKeyedMapper[A]]
     extends SkipLogging with KeyedMetaMapper[Long, A] {

     self: A with MetaMapper[A] with KeyedMapper[Long, A] =

     override def afterCreate = (crudLog(_: A, create)) ::
  super.afterCreate

     override def afterUpdate = (crudLog(_: A, update)) ::
  super.afterUpdate

     override def afterDelete = (crudLog(_: A, delete)) ::
  super.afterDelete

     private def crudLog(obj: A, action: String): Unit = {
             if (!self.skipLogging) {
                     val log = new ActionLog
                     log.action(action).klass(obj.getClass.getName).record
  (obj.primaryKey).save
  // Stamped.scala:54: error: value primaryKey is not a member of A
             }
     }

  }

  On 19 Jan., 21:22, David Pollak feeder.of.the.be...@gmail.com wrote:
  You don't need to use structural typing.

  Any KeyedMapper has a primaryKey method that returns a Mapped field of the
  type of the key.  To get the primary key field of a given KeyedMapper
  instance, just call primaryKey.

  On Tue, Jan 19, 2010 at 11:55 AM, Ross Mellgren dri...@gmail.com wrote:
  How about structural typing?

  trait Stamped[A : LongKeyedMapper[A] with { val id: MappedLongIndex[A] }]
  ...

  I haven't tried it, but maybe it will work.

  -Ross

  On Jan 19, 2010, at 2:47 PM, Franz Bettag wrote:

  On 19 Jan., 19:32, David Pollak feeder.of.the.be...@gmail.com wrote:
  i am trying to extend my logging trait. The Problem is, i can't say
  something like A : LongKeyedMapper[A] in my trait since ProtoUser
  doesn't use IdPK but uses it's own declarations (which look the same
  to me).

  Why do you need ProtoUser extended with IdPK?  Why can't your trait work
  with LongKeyedMapper?

  The code relies on having a .id method on the passed object. The Three
  Traits are below. It works fine with anything having IdPK. At the
  moment i have this code copied into my User singleton which is exactly
  what i want to avoid.

  I don't know how i would dynamify the use of the .id method. In
  ActionLog and the Stamped trait.

  trait Stamped[A : LongKeyedMapper[A] with IdPK]
        extends SkipLogging with KeyedMetaMapper[Long, A] {

        self: A with MetaMapper[A] with KeyedMapper[Long, A] =

        override def afterCreate = (crudLog(_: A, create)) ::
  super.afterCreate

        override def afterUpdate = (crudLog(_: A, update)) ::
  super.afterUpdate

        override def afterDelete = (crudLog(_: A, delete)) ::
  super.afterDelete

        private def crudLog(obj: A, action: String): Unit = {
                if (!self.skipLogging) {
                        val log = new ActionLog

  log.action(action).klass(obj.getClass.getName).record(obj.id).save
                }
        }

  }

  trait SkipLogging {

        var skipLogging = false
  }

  trait ActionLogs[A : Mapper[A] with IdPK] {

        this: A =

        def logs: List[ActionLog] = ActionLog.findAll(
                By(ActionLog.klass, this.getClass.getName),
                By(ActionLog.record, this.id)
                )

  }

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

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




[Lift] Re: Why doesn't ProtoUser use IdPK?

2010-01-19 Thread Franz Bettag
may i ask what the is method exactly does? googling for it is a bit
hard since is is quite commonly used ;)

On 19 Jan., 21:39, Ross Mellgren dri...@gmail.com wrote:
 I see primaryKeyField in the docs, maybe try .record(obj.primaryKeyField.is) ?

 -Ross

 On Jan 19, 2010, at 3:31 PM, Franz Bettag wrote:

  trait Stamped[A : LongKeyedMapper[A]]
     extends SkipLogging with KeyedMetaMapper[Long, A] {

     self: A with MetaMapper[A] with KeyedMapper[Long, A] =

     override def afterCreate = (crudLog(_: A, create)) ::
  super.afterCreate

     override def afterUpdate = (crudLog(_: A, update)) ::
  super.afterUpdate

     override def afterDelete = (crudLog(_: A, delete)) ::
  super.afterDelete

     private def crudLog(obj: A, action: String): Unit = {
             if (!self.skipLogging) {
                     val log = new ActionLog
                     log.action(action).klass(obj.getClass.getName).record
  (obj.primaryKey).save
  // Stamped.scala:54: error: value primaryKey is not a member of A
             }
     }

  }

  On 19 Jan., 21:22, David Pollak feeder.of.the.be...@gmail.com wrote:
  You don't need to use structural typing.

  Any KeyedMapper has a primaryKey method that returns a Mapped field of the
  type of the key.  To get the primary key field of a given KeyedMapper
  instance, just call primaryKey.

  On Tue, Jan 19, 2010 at 11:55 AM, Ross Mellgren dri...@gmail.com wrote:
  How about structural typing?

  trait Stamped[A : LongKeyedMapper[A] with { val id: MappedLongIndex[A] }]
  ...

  I haven't tried it, but maybe it will work.

  -Ross

  On Jan 19, 2010, at 2:47 PM, Franz Bettag wrote:

  On 19 Jan., 19:32, David Pollak feeder.of.the.be...@gmail.com wrote:
  i am trying to extend my logging trait. The Problem is, i can't say
  something like A : LongKeyedMapper[A] in my trait since ProtoUser
  doesn't use IdPK but uses it's own declarations (which look the same
  to me).

  Why do you need ProtoUser extended with IdPK?  Why can't your trait work
  with LongKeyedMapper?

  The code relies on having a .id method on the passed object. The Three
  Traits are below. It works fine with anything having IdPK. At the
  moment i have this code copied into my User singleton which is exactly
  what i want to avoid.

  I don't know how i would dynamify the use of the .id method. In
  ActionLog and the Stamped trait.

  trait Stamped[A : LongKeyedMapper[A] with IdPK]
        extends SkipLogging with KeyedMetaMapper[Long, A] {

        self: A with MetaMapper[A] with KeyedMapper[Long, A] =

        override def afterCreate = (crudLog(_: A, create)) ::
  super.afterCreate

        override def afterUpdate = (crudLog(_: A, update)) ::
  super.afterUpdate

        override def afterDelete = (crudLog(_: A, delete)) ::
  super.afterDelete

        private def crudLog(obj: A, action: String): Unit = {
                if (!self.skipLogging) {
                        val log = new ActionLog

  log.action(action).klass(obj.getClass.getName).record(obj.id).save
                }
        }

  }

  trait SkipLogging {

        var skipLogging = false
  }

  trait ActionLogs[A : Mapper[A] with IdPK] {

        this: A =

        def logs: List[ActionLog] = ActionLog.findAll(
                By(ActionLog.klass, this.getClass.getName),
                By(ActionLog.record, this.id)
                )

  }

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

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




Re: [Lift] Re: Why doesn't ProtoUser use IdPK?

2010-01-19 Thread David Pollak
On Tue, Jan 19, 2010 at 12:47 PM, Franz Bettag fr...@bett.ag wrote:

 may i ask what the is method exactly does? googling for it is a bit
 hard since is is quite commonly used ;)


Each of the fields is a container that contains the given value (String,
Long, etc.)  The is method fetches the contained value.  See
http://blog.lostlake.org/index.php?/archives/19-Keeping-the-meaning-with-the-bytes.html


 On 19 Jan., 21:39, Ross Mellgren dri...@gmail.com wrote:
  I see primaryKeyField in the docs, maybe try .record(
 obj.primaryKeyField.is) ?
 
  -Ross
 
  On Jan 19, 2010, at 3:31 PM, Franz Bettag wrote:
 
   trait Stamped[A : LongKeyedMapper[A]]
  extends SkipLogging with KeyedMetaMapper[Long, A] {
 
  self: A with MetaMapper[A] with KeyedMapper[Long, A] =
 
  override def afterCreate = (crudLog(_: A, create)) ::
   super.afterCreate
 
  override def afterUpdate = (crudLog(_: A, update)) ::
   super.afterUpdate
 
  override def afterDelete = (crudLog(_: A, delete)) ::
   super.afterDelete
 
  private def crudLog(obj: A, action: String): Unit = {
  if (!self.skipLogging) {
  val log = new ActionLog
  
  log.action(action).klass(obj.getClass.getName).record
   (obj.primaryKey).save
   // Stamped.scala:54: error: value primaryKey is not a member of A
  }
  }
 
   }
 
   On 19 Jan., 21:22, David Pollak feeder.of.the.be...@gmail.com wrote:
   You don't need to use structural typing.
 
   Any KeyedMapper has a primaryKey method that returns a Mapped field of
 the
   type of the key.  To get the primary key field of a given KeyedMapper
   instance, just call primaryKey.
 
   On Tue, Jan 19, 2010 at 11:55 AM, Ross Mellgren dri...@gmail.com
 wrote:
   How about structural typing?
 
   trait Stamped[A : LongKeyedMapper[A] with { val id:
 MappedLongIndex[A] }]
   ...
 
   I haven't tried it, but maybe it will work.
 
   -Ross
 
   On Jan 19, 2010, at 2:47 PM, Franz Bettag wrote:
 
   On 19 Jan., 19:32, David Pollak feeder.of.the.be...@gmail.com
 wrote:
   i am trying to extend my logging trait. The Problem is, i can't
 say
   something like A : LongKeyedMapper[A] in my trait since ProtoUser
   doesn't use IdPK but uses it's own declarations (which look the
 same
   to me).
 
   Why do you need ProtoUser extended with IdPK?  Why can't your trait
 work
   with LongKeyedMapper?
 
   The code relies on having a .id method on the passed object. The
 Three
   Traits are below. It works fine with anything having IdPK. At the
   moment i have this code copied into my User singleton which is
 exactly
   what i want to avoid.
 
   I don't know how i would dynamify the use of the .id method. In
   ActionLog and the Stamped trait.
 
   trait Stamped[A : LongKeyedMapper[A] with IdPK]
 extends SkipLogging with KeyedMetaMapper[Long, A] {
 
 self: A with MetaMapper[A] with KeyedMapper[Long, A] =
 
 override def afterCreate = (crudLog(_: A, create)) ::
   super.afterCreate
 
 override def afterUpdate = (crudLog(_: A, update)) ::
   super.afterUpdate
 
 override def afterDelete = (crudLog(_: A, delete)) ::
   super.afterDelete
 
 private def crudLog(obj: A, action: String): Unit = {
 if (!self.skipLogging) {
 val log = new ActionLog
 
   log.action(action).klass(obj.getClass.getName).record(obj.id).save
 }
 }
 
   }
 
   trait SkipLogging {
 
 var skipLogging = false
   }
 
   trait ActionLogs[A : Mapper[A] with IdPK] {
 
 this: A =
 
 def logs: List[ActionLog] = ActionLog.findAll(
 By(ActionLog.klass, this.getClass.getName),
 By(ActionLog.record, this.id)
 )
 
   }
 
   --
   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=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.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=en.
 
   --
   Lift, the simply functional web frameworkhttp://liftweb.net
   Beginning Scalahttp://www.apress.com/book/view/1430219890
   Follow me:http://twitter.com/dpp
   Surf the harmonics
   --
   You received this message because you are subscribed to the Google
 Groups Lift group.
   To post to 

Re: [Lift] Welcome Mads Hartmann Jensen to the Lift Committers

2010-01-19 Thread Heiko Seeberger
Hi Mads!

2010/1/19 David Pollak feeder.of.the.be...@gmail.com

 Folks,

 Please join me in welcoming Mads to the Lift committers.

 Thanks,

 David

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

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




-- 
Heiko Seeberger

Work: weiglewilczek.com
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.com.

For more options, visit this group at http://groups.google.com/group/liftweb?hl=en.



Re: [Lift] Re: [Lift committers] Re: Image resize code

2010-01-19 Thread Naftoli Gugenheim
Does JAI need everything in RAM?
Also, how do you deal with DPI?

-
Ross Mellgrendri...@gmail.com wrote:

Well, it has to keep the whole source (packed) in memory and the target 
(unpacked / 32 bit RGBA) in memory, so I would assume that as long as 
AffineTransformOp is not doing something untoward it's probably around (src 
width * src height * src bytes/pixel) + (dest width * dest height * 4 bytes) 
plus a little bit extra.

I'm not a Java2D guru or anything, so I'm not sure how that could be improved 
offhand.

If you want to wrap it up and put it in, that'd be awesome!

-Ross

On Jan 15, 2010, at 10:17 AM, Timothy Perrett wrote:

 Cool stuff Ross, whats the overhead like in terms of memory etc? 
 
 I might have a bit of time to put this into a module and stuff it on review 
 board. 
 
 Cheers, Tim
 
 On 15 Jan 2010, at 15:03, Ross Mellgren wrote:
 
 According to Jon on the call, he said he was putting together just such a 
 lift module (for image stuff), so I figured I'd toss this over in case it 
 was of use to him in that module.
 
 If anyone else wants to use it independently, consider it a contribution to 
 lift, and licensed the same way.
 
 -Ross
 
 On Jan 15, 2010, at 9:51 AM, Peter Robinett wrote:
 
 Ross, this looks nice. Imagine resizing code is something that I've
 personally had to do many times and is always annoying, so perhaps
 this would make a good Lift module? Anyway, this is probably best
 discussed on the main list...
 
 Peter
 
 On Jan 14, 3:01 am, Ross Mellgren dri...@gmail.com wrote:
 Oh I nearly forgot I said on the conference call the other day that I'd 
 send the image resize code we built at work, in case it would be helpful. 
 Here it is:
 
 import java.awt.{Graphics, RenderingHints, Transparency}
 import java.awt.geom.AffineTransform
 import java.awt.image.{AffineTransformOp, BufferedImage, ColorModel, 
 IndexColorModel}
 
 /**
 * Helpers for manipulating images
 */
 object ImageHelpers
 {
 // Some code here omitted -- Ed.
 
   /** Rendering hints set up for the highest quality rendering */
   val highQualityHints = {
   val h = new RenderingHints(null)
   h.put(RenderingHints.KEY_ALPHA_INTERPOLATION, 
 RenderingHints.VALUE_ALPHA_INTERPOLATION_QUALITY)
   h.put(RenderingHints.KEY_COLOR_RENDERING, 
 RenderingHints.VALUE_COLOR_RENDER_QUALITY)
   h.put(RenderingHints.KEY_INTERPOLATION, 
 RenderingHints.VALUE_INTERPOLATION_BICUBIC)
   h.put(RenderingHints.KEY_ANTIALIASING, 
 RenderingHints.VALUE_ANTIALIAS_ON)
   h.put(RenderingHints.KEY_RENDERING, 
 RenderingHints.VALUE_RENDER_QUALITY)
   h
   }
 
 // Some code here omitted -- Ed.
 
   /**
* Resize an image of the given source type by the given ratios, 
 properly handling GIF transparency, giving back the resized
* image and the new image format type that should be used.
*
* The image type might change if the input type is an indexed color 
 model, because it is a hard problem to choose an optimized
* palette, and currently we don't. This function will return png as 
 the new type in this case.
*
* If the input image is not using an indexed color model with 
 transparency, then the target format and color model will be
* identical to the source.
*/
   def resize(source: BufferedImage, inputFormat: String, dx: Double, dy: 
 Double): (BufferedImage, String) = {
   var sourceColorModel = source.getColorModel
   val targetColorModel = source.getColorModel
   val standardColorModel = ColorModel.getRGBdefault
 
   val (targetWidth, targetHeight) = (((source.getWidth: Double) * 
 dx).asInstanceOf[Int], ((source.getHeight: Double) * dy).asInstanceOf[Int])
 
   def resize(src: BufferedImage, dst: BufferedImage) {
   val g = dst.createGraphics
   try {
   g.setRenderingHints(highQualityHints)
   g.drawImage(src, new 
 AffineTransformOp(AffineTransform.getScaleInstance(dx, dy), 
 AffineTransformOp.TYPE_BICUBIC), 0, 0)
   } finally {
   g.dispose
   }
   }
 
   // GIF support in Java is very ornery. For GIFs we have to manually 
 do the masking on input, and then just punt on outputting GIFs and instead 
 output PNGs.
   if (sourceColorModel.isInstanceOf[IndexColorModel] 
   sourceColorModel.hasAlpha 
   sourceColorModel.getTransparency == Transparency.BITMASK 
   
 sourceColorModel.asInstanceOf[IndexColorModel].getTransparentPixel = 0) {
 
   val indexColorModel = 
 sourceColorModel.asInstanceOf[IndexColorModel]
   val transparent = 
 indexColorModel.getRGB(indexColorModel.getTransparentPixel)
 
   val masked = new BufferedImage(standardColorModel, 
 standardColorModel.createCompatibleWritableRaster(source.getWidth, 
 source.getHeight), standardColorModel.isAlphaPremultiplied, null)
   var w = masked.getWidth
   var h = masked.getHeight
 
   val buf  = new Array[Int](w)
 

Re: [Lift] Re: [Lift committers] Re: Image resize code

2010-01-19 Thread Naftoli Gugenheim
I think both Java2D and JAI have API for tiles. Do you know if that has 
anything to do with loading only part at a time, or what they're for?

-
Ross Mellgrendri...@gmail.com wrote:

Well, it has to keep the whole source (packed) in memory and the target 
(unpacked / 32 bit RGBA) in memory, so I would assume that as long as 
AffineTransformOp is not doing something untoward it's probably around (src 
width * src height * src bytes/pixel) + (dest width * dest height * 4 bytes) 
plus a little bit extra.

I'm not a Java2D guru or anything, so I'm not sure how that could be improved 
offhand.

If you want to wrap it up and put it in, that'd be awesome!

-Ross

On Jan 15, 2010, at 10:17 AM, Timothy Perrett wrote:

 Cool stuff Ross, whats the overhead like in terms of memory etc? 
 
 I might have a bit of time to put this into a module and stuff it on review 
 board. 
 
 Cheers, Tim
 
 On 15 Jan 2010, at 15:03, Ross Mellgren wrote:
 
 According to Jon on the call, he said he was putting together just such a 
 lift module (for image stuff), so I figured I'd toss this over in case it 
 was of use to him in that module.
 
 If anyone else wants to use it independently, consider it a contribution to 
 lift, and licensed the same way.
 
 -Ross
 
 On Jan 15, 2010, at 9:51 AM, Peter Robinett wrote:
 
 Ross, this looks nice. Imagine resizing code is something that I've
 personally had to do many times and is always annoying, so perhaps
 this would make a good Lift module? Anyway, this is probably best
 discussed on the main list...
 
 Peter
 
 On Jan 14, 3:01 am, Ross Mellgren dri...@gmail.com wrote:
 Oh I nearly forgot I said on the conference call the other day that I'd 
 send the image resize code we built at work, in case it would be helpful. 
 Here it is:
 
 import java.awt.{Graphics, RenderingHints, Transparency}
 import java.awt.geom.AffineTransform
 import java.awt.image.{AffineTransformOp, BufferedImage, ColorModel, 
 IndexColorModel}
 
 /**
 * Helpers for manipulating images
 */
 object ImageHelpers
 {
 // Some code here omitted -- Ed.
 
   /** Rendering hints set up for the highest quality rendering */
   val highQualityHints = {
   val h = new RenderingHints(null)
   h.put(RenderingHints.KEY_ALPHA_INTERPOLATION, 
 RenderingHints.VALUE_ALPHA_INTERPOLATION_QUALITY)
   h.put(RenderingHints.KEY_COLOR_RENDERING, 
 RenderingHints.VALUE_COLOR_RENDER_QUALITY)
   h.put(RenderingHints.KEY_INTERPOLATION, 
 RenderingHints.VALUE_INTERPOLATION_BICUBIC)
   h.put(RenderingHints.KEY_ANTIALIASING, 
 RenderingHints.VALUE_ANTIALIAS_ON)
   h.put(RenderingHints.KEY_RENDERING, 
 RenderingHints.VALUE_RENDER_QUALITY)
   h
   }
 
 // Some code here omitted -- Ed.
 
   /**
* Resize an image of the given source type by the given ratios, 
 properly handling GIF transparency, giving back the resized
* image and the new image format type that should be used.
*
* The image type might change if the input type is an indexed color 
 model, because it is a hard problem to choose an optimized
* palette, and currently we don't. This function will return png as 
 the new type in this case.
*
* If the input image is not using an indexed color model with 
 transparency, then the target format and color model will be
* identical to the source.
*/
   def resize(source: BufferedImage, inputFormat: String, dx: Double, dy: 
 Double): (BufferedImage, String) = {
   var sourceColorModel = source.getColorModel
   val targetColorModel = source.getColorModel
   val standardColorModel = ColorModel.getRGBdefault
 
   val (targetWidth, targetHeight) = (((source.getWidth: Double) * 
 dx).asInstanceOf[Int], ((source.getHeight: Double) * dy).asInstanceOf[Int])
 
   def resize(src: BufferedImage, dst: BufferedImage) {
   val g = dst.createGraphics
   try {
   g.setRenderingHints(highQualityHints)
   g.drawImage(src, new 
 AffineTransformOp(AffineTransform.getScaleInstance(dx, dy), 
 AffineTransformOp.TYPE_BICUBIC), 0, 0)
   } finally {
   g.dispose
   }
   }
 
   // GIF support in Java is very ornery. For GIFs we have to manually 
 do the masking on input, and then just punt on outputting GIFs and instead 
 output PNGs.
   if (sourceColorModel.isInstanceOf[IndexColorModel] 
   sourceColorModel.hasAlpha 
   sourceColorModel.getTransparency == Transparency.BITMASK 
   
 sourceColorModel.asInstanceOf[IndexColorModel].getTransparentPixel = 0) {
 
   val indexColorModel = 
 sourceColorModel.asInstanceOf[IndexColorModel]
   val transparent = 
 indexColorModel.getRGB(indexColorModel.getTransparentPixel)
 
   val masked = new BufferedImage(standardColorModel, 
 standardColorModel.createCompatibleWritableRaster(source.getWidth, 
 source.getHeight), standardColorModel.isAlphaPremultiplied, null)
   var w = masked.getWidth
 

[Lift] Re: Lift-Wizard Fields incompatible with lift-record fields

2010-01-19 Thread Tim Maxwell
Thanks for the update. Good luck with all the personal stuff. If I
decide to go the route of integrating I will report back on any
progress I make.

Cheers,
Tim

On Jan 19, 1:13 pm, David Pollak feeder.of.the.be...@gmail.com
wrote:
 On Tue, Jan 19, 2010 at 11:06 AM, Tim Maxwell truthspi...@gmail.com wrote:
  net.liftweb.record.field.EmailField

 The record stuff is not yet integrated into the Screen/Wizard stuff.  I'm
 likely to be the person to do that work and I'm massively behind due to a
 bunch of personal stuff.  I doubt any of the Record stuff will be integrated
 in the next month.







  Am I wrong about these fields being what the UI layer uses to generate
  forms?

  On Jan 19, 1:02 pm, David Pollak feeder.of.the.be...@gmail.com
  wrote:
   On Tue, Jan 19, 2010 at 10:56 AM, Tim Maxwell truthspi...@gmail.com
  wrote:
The lift-wizard and lift-record packages both have Field traits that
appear to do very similar things, with the end result being that the
lift-wizard currently can't use the existing EmailField,
PasswordField, UploadField traits.

   What EmailField?

Will these types be unified at some point? Will we be able to use the
existing Field types or should we start writing our own?

Sorry for the repost, my original title was not very descriptive.

Cheers,
Tim

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

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

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

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




Re: [Lift] Welcome Mads Hartmann Jensen to the Lift Committers

2010-01-19 Thread Timothy Perrett

Welcome Mads, what are you planning on contributing to start with?

Send me offline a picture and description of yourself so I can add you  
to liftweb.net


Cheers, Tim

Sent from my iPhone

On 19 Jan 2010, at 19:15, David Pollak feeder.of.the.be...@gmail.com  
wrote:



Folks,

Please join me in welcoming Mads to the Lift committers.

Thanks,

David

--
Lift, the simply functional web framework http://liftweb.net
Beginning Scala http://www.apress.com/book/view/1430219890
Follow me: http://twitter.com/dpp
Surf the harmonics
--
You received this message because you are subscribed to the Google  
Groups Lift group.

To post to this group, send email to lift...@googlegroups.com.
To unsubscribe from this group, send email to liftweb+unsubscr...@googlegroups.com 
.
For more options, visit this group at http://groups.google.com/group/liftweb?hl=en 
.
-- 

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

To post to this group, send email to lift...@googlegroups.com.

To unsubscribe from this group, send email to liftweb+unsubscr...@googlegroups.com.

For more options, visit this group at http://groups.google.com/group/liftweb?hl=en.



[Lift] Any scala coders in the greater Sacramento region?

2010-01-19 Thread Phillip Stephen
To whom it may concern:

My name is Phillip Stephen I am looking for some developers to work
with my new exciting invention called tengo tea.


This will be the first UI available in the market that will allow baby
boomers to access their day to day tasks in an argumentative
reality.

-- 
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] Welcome Mads Hartmann Jensen to the Lift Committers

2010-01-19 Thread Phillip Stephen
I own www.pacnboxmoving.com My innovation is in the Streaming Music
industry.  Looking to get a developer on Scales/ Lift for equity on my
project ASAP!

Thanks,

Phillip

2010/1/19 Timothy Perrett timo...@getintheloop.eu

 Welcome Mads, what are you planning on contributing to start with?

 Send me offline a picture and description of yourself so I can add you to
 liftweb.net

 Cheers, Tim

 Sent from my iPhone

 On 19 Jan 2010, at 19:15, David Pollak feeder.of.the.be...@gmail.com
 wrote:

 Folks,

 Please join me in welcoming Mads to the Lift committers.

 Thanks,

 David

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

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


 --
 You received this message because you are subscribed to the Google Groups
 Lift group.
 To post to this group, send email to lift...@googlegroups.com.
 To unsubscribe from this group, send email to
 liftweb+unsubscr...@googlegroups.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.



Re: [Lift] Welcome Mads Hartmann Jensen to the Lift Committers

2010-01-19 Thread Naftoli Gugenheim
I assume you meant to post this in your own thread?

-
Phillip Stephenichibanze...@gmail.com wrote:

I own www.pacnboxmoving.com My innovation is in the Streaming Music
industry.  Looking to get a developer on Scales/ Lift for equity on my
project ASAP!

Thanks,

Phillip

2010/1/19 Timothy Perrett timo...@getintheloop.eu

 Welcome Mads, what are you planning on contributing to start with?

 Send me offline a picture and description of yourself so I can add you to
 liftweb.net

 Cheers, Tim

 Sent from my iPhone

 On 19 Jan 2010, at 19:15, David Pollak feeder.of.the.be...@gmail.com
 wrote:

 Folks,

 Please join me in welcoming Mads to the Lift committers.

 Thanks,

 David

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

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


 --
 You received this message because you are subscribed to the Google Groups
 Lift group.
 To post to this group, send email to lift...@googlegroups.com.
 To unsubscribe from this group, send email to
 liftweb+unsubscr...@googlegroups.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.

-- 
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: how to retrieve value from a text field having attribute readonly ?

2010-01-19 Thread Naftoli Gugenheim
So why don't you calculate it on the server independently?
The other option would be javascript to copy the value into a hidden field.

-
Madhavmail.madhavsha...@gmail.com wrote:

hi
Value is result of calculation done by jquery plugin in the html
template . It  can be thought of simple addition of numbers in two
fields and display of value in a third readonly field and i need  to
capture this value in readonly field during submit call .

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


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




[Lift] Need Scala developer

2010-01-19 Thread Phillip Stephen
I have money looking for someone with some balls (figurative)  I have
some ambitious ideas for a UI just need some traction for android
common sense to what is or is not possible for the Nexus One.
415-891-7044 Call me anytime... the name is Phillip Stephen.
-- 
You received this message because you are subscribed to the Google Groups 
Lift group.
To post to this group, send email to lift...@googlegroups.com.
To unsubscribe from this group, send email to 
liftweb+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/liftweb?hl=en.




[Lift] Re: Welcome Mads Hartmann Jensen to the Lift Committers

2010-01-19 Thread Mads Hartmann
Thanks guys :)

@Timothy Perrett
Unless someone beats me to the punch I was thinking about solving
this:
http://github.com/dpp/liftweb/issues#issue/46

I already have a local version which should solve it but unfortunately
I have an exam the 21. of Jan so can't really work on it without my
conscience getting the better of me ;)

I'll send you a picture and an description as soon as I've passed my
exam :)


On Jan 19, 10:54 pm, Naftoli Gugenheim naftoli...@gmail.com wrote:
 I assume you meant to post this in your own thread?

 -

 Phillip Stephenichibanze...@gmail.com wrote:

 I ownwww.pacnboxmoving.comMy innovation is in the Streaming Music
 industry.  Looking to get a developer on Scales/ Lift for equity on my
 project ASAP!

 Thanks,

 Phillip

 2010/1/19 Timothy Perrett timo...@getintheloop.eu





  Welcome Mads, what are you planning on contributing to start with?

  Send me offline a picture and description of yourself so I can add you to
  liftweb.net

  Cheers, Tim

  Sent from my iPhone

  On 19 Jan 2010, at 19:15, David Pollak feeder.of.the.be...@gmail.com
  wrote:

  Folks,

  Please join me in welcoming Mads to the Lift committers.

  Thanks,

  David

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

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

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




Re: [Lift] Database Default for MappedDateTime

2010-01-19 Thread Naftoli Gugenheim
It would be nice if a MappedField could be set to not be included in an 
update/insert statement.
Maybe instead of Mapper having nullable fields, and a default with a check if 
the current value is the default, we need a new type in the spirit of Option 
and Box, with four states: A value, null, skip, and default. Does that make any 
sense?

-
awanth...@whitford.com wrote:

I have an Oracle table that has a timestamp column with a default
value (current_timestamp).  Mapper doesn't allow a save operation
unless I specifically specify a value for the timestamp column.  I
would prefer to leverage the database's timestamp vs. the middle
tier's.  Is there a way that I can get the save operation to work?
Note that it doesn't fail -- an exception was thrown.
-- 
You received this message because you are subscribed to the Google Groups 
Lift group.
To post to this group, send email to lift...@googlegroups.com.
To unsubscribe from this group, send email to 
liftweb+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/liftweb?hl=en.


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




[Lift] Re: Welcome Mads Hartmann Jensen to the Lift Committers

2010-01-19 Thread Timothy Perrett
I see - cool. Anything else you wanted to work on or contribute?

Cheers, Tim

On Jan 19, 10:12 pm, Mads Hartmann mads...@gmail.com wrote:
 Thanks guys :)

 @Timothy Perrett
 Unless someone beats me to the punch I was thinking about solving
 this:http://github.com/dpp/liftweb/issues#issue/46

 I already have a local version which should solve it but unfortunately
 I have an exam the 21. of Jan so can't really work on it without my
 conscience getting the better of me ;)

 I'll send you a picture and an description as soon as I've passed my
 exam :)

 On Jan 19, 10:54 pm, Naftoli Gugenheim naftoli...@gmail.com wrote:



  I assume you meant to post this in your own thread?

  -

  Phillip Stephenichibanze...@gmail.com wrote:

  I ownwww.pacnboxmoving.comMyinnovation is in the Streaming Music
  industry.  Looking to get a developer on Scales/ Lift for equity on my
  project ASAP!

  Thanks,

  Phillip

  2010/1/19 Timothy Perrett timo...@getintheloop.eu

   Welcome Mads, what are you planning on contributing to start with?

   Send me offline a picture and description of yourself so I can add you to
   liftweb.net

   Cheers, Tim

   Sent from my iPhone

   On 19 Jan 2010, at 19:15, David Pollak feeder.of.the.be...@gmail.com
   wrote:

   Folks,

   Please join me in welcoming Mads to the Lift committers.

   Thanks,

   David

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

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

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




Re: [Lift] An experience report using Scala Lift

2010-01-19 Thread Naftoli Gugenheim
JRebel and sbt do very different things.
Sbt is an alternative to maven. It's a build tool. You can get continuous 
compilation with maven by typing mvn scala:cc. Sbt currently has better 
dependency analysis, to know when to recompile what. Maven currently has two 
modes: -Drecompilation-mode=modified-only, which only recompiles changed files, 
no dependencies; and the default, which recompiles everything.
Eclipse also provides continuous compilation.
JRebel has a different purpose. By default a running Java program remembers 
classes that it loads into memory, so recompiling a class doesn't impact the 
running program. By attaching JRebel, it will detect changed .class files and 
the JVM will use the new ones.
As I said there are still some occasions when you must stop and restart jetty.
I use eclipse, m2eclipse (maven), and JRebel.
Maven integration with eclipse has the important advantage of putting the 
dependencies in the project's classpath. There is a plugin for eclipse that 
does the equivalent via sbt instead of maven.


-
jlist9jli...@gmail.com wrote:

I'm new to maven so I just followed the Lift Getting Started
guide, which uses mvn jetty:run to start jetty and ctrl-c to stop it.

I used sbt before for another project that uses a different framework
and like it that it auto-compiles the changed files and restarts jetty
(as far as I remember - it's been a while.) So far I haven't tried JRebel
yet so I'm not sure if it offers more than what sbt does but I'm
interested in finding out.

When doing that project, I pretty much used a simple text editor
to write scala code and I missed the features provided by eclipse
or netbeans. So I'm hoping that there is a way to use sbt and
eclipse or netbeans (I think the netbeans scala plug-in works better
than the eclipse's plugin but I'm OK with usine eclipse since that's
my default Java environment), and maybe add JRebel to the picture
if it does something that sbt doesn't offer.

I understand that the dev environment is a personal choice but I
think it would be nice to have a recommended set up that makes
use of neat tools like sbt and the free JRebel library. It would be
helpful for people who are new to Lift or Scala in general.

On Mon, Jan 18, 2010 at 10:58 PM, Naftoli Gugenheim
naftoli...@gmail.com wrote:
 How do you launch jetty? If it's an eclipse maven launch, specify JRebel in 
 the JVM arguments. For command-line maven, specify it in the MAVEN_OPTS 
 environment variable.
 If you launch via sbt (assuming there's such a thing) then you have to check 
 the sbt docs.
 Ultimately the command line that launches java.exe (or equivalent) to run 
 jetty should have -noverify -javaagent:path/to/jrebel.jar in it.
 If the question was about sbt with eclipse, there's a plugin that provides 
 sbt dependencies as classpath container.
 It is indeed very convenient to use JRebel. Most changes are viewable 
 immediately (though at times reloading classes is slow). Exceptions are 
 significant changes to a class like implementing a new interface (and due to 
 scala's abundance of syntactic sugar these are more often than you'd thin), 
 and changes to things set in Boot, since it's only run once. That doesn't 
 include functions etc. defined in Boot--if you pass a PartialFunction to a 
 LiftRules configuration, changes to its body will be reflected immediately.

 -
 jlist9jli...@gmail.com wrote:

 Thanks.

 The Eclipse incremental compiler, Jetty  the JRebel plugin makes for
 fairly rapid turnaround times.

 This is interesting. I wonder if there are instructions somewhere online
 about how to use Eclipse + sbt + JRebel for Lift development. The Lift
 Get Started Guide mentions a lot of start and stop Jetty. The impression
 I got from reading it is that's how Lift development is done. I'm sure
 there is a better way :-)

 On Mon, Jan 18, 2010 at 12:44 PM, Jeppe Nejsum Madsen je...@ingolfs.dk 
 wrote:
 Hi,

 A while ago, I started writing an experience report on using Scala 
 Lift. I finally finished this (it has been a little more than 6 months
 now, time is flying :-)

 http://jeppenejsum.wordpress.com/2010/01/18/scala-and-lift-status-after-six-months/

 /Jeppe

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




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


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

[Lift] Re: Welcome Mads Hartmann Jensen to the Lift Committers

2010-01-19 Thread Mads Hartmann
I'm fancying this on too: http://github.com/dpp/liftweb/issues#issue/281

And that's it I think, for now at-least :)

On Jan 19, 11:19 pm, Timothy Perrett timo...@getintheloop.eu wrote:
 I see - cool. Anything else you wanted to work on or contribute?

 Cheers, Tim

 On Jan 19, 10:12 pm, Mads Hartmann mads...@gmail.com wrote:



  Thanks guys :)

  @Timothy Perrett
  Unless someone beats me to the punch I was thinking about solving
  this:http://github.com/dpp/liftweb/issues#issue/46

  I already have a local version which should solve it but unfortunately
  I have an exam the 21. of Jan so can't really work on it without my
  conscience getting the better of me ;)

  I'll send you a picture and an description as soon as I've passed my
  exam :)

  On Jan 19, 10:54 pm, Naftoli Gugenheim naftoli...@gmail.com wrote:

   I assume you meant to post this in your own thread?

   -

   Phillip Stephenichibanze...@gmail.com wrote:

   I ownwww.pacnboxmoving.comMyinnovationis in the Streaming Music
   industry.  Looking to get a developer on Scales/ Lift for equity on my
   project ASAP!

   Thanks,

   Phillip

   2010/1/19 Timothy Perrett timo...@getintheloop.eu

Welcome Mads, what are you planning on contributing to start with?

Send me offline a picture and description of yourself so I can add you 
to
liftweb.net

Cheers, Tim

Sent from my iPhone

On 19 Jan 2010, at 19:15, David Pollak feeder.of.the.be...@gmail.com
wrote:

Folks,

Please join me in welcoming Mads to the Lift committers.

Thanks,

David

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

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

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




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

2010-01-19 Thread Yu-Shan Fung
Thanks for the reply, Marius. Where can I get the 1.1 or 2.0 snapshot?

I'm not doing any scheduling myself. I just created a bunch of Future's, and
then call Futures.awaitAll. But my understanding is that Future is
implemented with Actor's.

val fResults = ids.map { id = future(computeStuff(id)) }
val fList = fResults.toList // forces creation of the future
variables. otherwise they are created lazily, defeating parallelism
val finalResults = Futures.awaitAll(5000, fList: _*)

This works the first time (and sometimes for a few times). But pretty soon,
the call to awaitAll would fail with the aforementioned exception.

I dug a bit into the scala code, and the code that fails within
Futures.awaitAll is this:

   Actor.timer.schedule(new java.util.TimerTask {
 def run() { thisActor ! TIMEOUT }
   }, timeout)

And Actor.timer is defined as such:

object Actor {
...
  private[actors] val timer = new Timer(true)
...
}


I'm pretty new to both scala and lift, but it looks like the Actor.timer is
initialized once (created as a daemon), and expected to always be available.
But I don't fully understand what aspects of the lift environment persists
across requests, and how, if at all, would Actor.timer end up in a
cancelled/terminated state.

Any idea? Thanks in advance!




On Tue, Jan 19, 2010 at 6:40 AM, Marius marius.dan...@gmail.com wrote:

 I'd recommend using Lisft 1.1-SNAPSHOT or 2.0-SNAPSHOT

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

 Br's,
 Marius

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

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






-- 
“When nothing seems to help, I go look at a stonecutter hammering away at
his rock perhaps a hundred times without as much as a crack showing in it.
Yet at the hundred and first blow it will split in two, and I know it was
not that blow that did it, but all that had gone before.” — Jacob Riis

-- 
You received this message because you are subscribed to the Google Groups 
Lift group.
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: Welcome Mads Hartmann Jensen to the Lift Committers

2010-01-19 Thread Indrajit Raychaudhuri

Welcome on board, Mads!

Looking forward to the outcome of what you are fancying.
And all the best for your exams.

Cheers, Indrajit


On 20/01/10 3:56 AM, Mads Hartmann wrote:

I'm fancying this on too: http://github.com/dpp/liftweb/issues#issue/281

And that's it I think, for now at-least :)

On Jan 19, 11:19 pm, Timothy Perretttimo...@getintheloop.eu  wrote:

I see - cool. Anything else you wanted to work on or contribute?

Cheers, Tim

On Jan 19, 10:12 pm, Mads Hartmannmads...@gmail.com  wrote:




Thanks guys :)



@Timothy Perrett
Unless someone beats me to the punch I was thinking about solving
this:http://github.com/dpp/liftweb/issues#issue/46



I already have a local version which should solve it but unfortunately
I have an exam the 21. of Jan so can't really work on it without my
conscience getting the better of me ;)



I'll send you a picture and an description as soon as I've passed my
exam :)



On Jan 19, 10:54 pm, Naftoli Gugenheimnaftoli...@gmail.com  wrote:



I assume you meant to post this in your own thread?



-



Phillip Stephenichibanze...@gmail.com  wrote:



I ownwww.pacnboxmoving.comMyinnovationis in the Streaming Music
industry.  Looking to get a developer on Scales/ Lift for equity on my
project ASAP!



Thanks,



Phillip



2010/1/19 Timothy Perretttimo...@getintheloop.eu



Welcome Mads, what are you planning on contributing to start with?



Send me offline a picture and description of yourself so I can add you to
liftweb.net



Cheers, Tim



Sent from my iPhone



On 19 Jan 2010, at 19:15, David Pollakfeeder.of.the.be...@gmail.com
wrote:



Folks,



Please join me in welcoming Mads to the Lift committers.



Thanks,



David



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



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



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




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

2010-01-19 Thread David Pollak
Howdy,

The short (and not politically popular) answer is that Scala's Actor
implementation is generally fragile and often broken.  Lift made the painful
switch away from Scala Actors 4 or so months ago for this reason.

If you can put together a simple example of the failure (basically something
that we can run with mvn jetty:run) and make it available on GitHub, we can
take a look at it.

Thanks,

David

On Tue, Jan 19, 2010 at 5:02 PM, Yu-Shan Fung ambivale...@gmail.com wrote:

 Thanks for the reply, Marius. Where can I get the 1.1 or 2.0 snapshot?

 I'm not doing any scheduling myself. I just created a bunch of Future's,
 and then call Futures.awaitAll. But my understanding is that Future is
 implemented with Actor's.

 val fResults = ids.map { id = future(computeStuff(id)) }
 val fList = fResults.toList // forces creation of the future
 variables. otherwise they are created lazily, defeating parallelism
 val finalResults = Futures.awaitAll(5000, fList: _*)

 This works the first time (and sometimes for a few times). But pretty soon,
 the call to awaitAll would fail with the aforementioned exception.

 I dug a bit into the scala code, and the code that fails within
 Futures.awaitAll is this:

Actor.timer.schedule(new java.util.TimerTask {
  def run() { thisActor ! TIMEOUT }
}, timeout)

 And Actor.timer is defined as such:

 object Actor {
 ...
   private[actors] val timer = new Timer(true)
 ...
 }


 I'm pretty new to both scala and lift, but it looks like the Actor.timer is
 initialized once (created as a daemon), and expected to always be available.
 But I don't fully understand what aspects of the lift environment persists
 across requests, and how, if at all, would Actor.timer end up in a
 cancelled/terminated state.

 Any idea? Thanks in advance!




 On Tue, Jan 19, 2010 at 6:40 AM, Marius marius.dan...@gmail.com wrote:

 I'd recommend using Lisft 1.1-SNAPSHOT or 2.0-SNAPSHOT

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

 Br's,
 Marius

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

 --

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






 --
 “When nothing seems to help, I go look at a stonecutter hammering away at
 his rock perhaps a hundred times without as much as a crack showing in it.
 Yet at the hundred and first blow it will split in two, and I know it was
 not that blow that did it, but all that had gone before.” — Jacob Riis

 --
 You received this message because you are subscribed to the Google Groups
 Lift group.
 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.




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