[Lift] Fwd: [scala-internals] Re: Scala advertising at Stack Overflow

2009-12-19 Thread Jorge Ortiz
Lift might be interested in this too.

--j

Forwarded conversation
Subject: [scala-internals] Scala advertising at Stack Overflow


From: *Daniel Sobral* dcsob...@gmail.com
Date: Sat, Dec 19, 2009 at 8:29 AM
To: scala-internals scala-intern...@listes.epfl.ch


Should EPFL endeavor to get some free advertising for Scala at Stack
Overflow, as described at
http://blog.stackoverflow.com/2009/12/free-vote-based-advertising-for-open-source-projects/
?

The required work consists of little more than producing a 220x220 Scala
advertising image and posting it at the proper (time-wise) thread tagged
open-source-advertising on meta.stackoverflow.com (
http://meta.stackoverflow.com/questions/tagged/open-source-advertising). The
exact details can be found in that post (presently,
http://meta.stackoverflow.com/questions/31913/open-source-advertising-sidebar-1h-2010
).

-- 
Daniel C. Sobral

I travel to the future all the time.

--
From: *Daniel Sobral* dcsob...@gmail.com
Date: Sat, Dec 19, 2009 at 8:48 AM
To: scala-internals scala-intern...@listes.epfl.ch


Looking at some ads already posted, I think it is necessary to make a
clarification. These ads are not intended to be product ads, but open source
projects ads. Or, in other words, to attract interest from people interested
in working at these projects.

--

You received this message because you are subscribed to the Google Groups 
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] foursquare.com now basically all on Lift

2009-11-17 Thread Jorge Ortiz
I've been MIA from the Lift community recently, but I've gotta say I love
Foursquare and use it almost every day. It gives me even more warm fuzzies
to know that it's using Lift under the hood :)

Thanks for a great app!

--j

On Tue, Nov 17, 2009 at 12:16 PM, harryh har...@gmail.com wrote:

 I've been a bit coy about it on the list, but three months ago when I
 joined the team at foursquare.com I made the final decision that we
 would port our webservers to Scala/Lift.  It took about 3 months, but
 foursquare.com is now basically running only on Lift(1).  This
 includes the website, a mobile website (m.foursquare.com) and a simple
 (but growing!) REST api (api.foursquare.com).

 I'd like the send a huge thank you to dpp and the rest of the Lift
 team. You've built a really great framework here, and I look forward
 to using it and seeing it grow for many years to come. An additional
 thanks goes out to all those who have answered my many random
 questions over the past couple of months.

 For those who haven't yet found out about foursquare, you can read
 more about it here: http://foursquare.com/learn_more

 Anyways, that's about enough self promotion, but I did want to
 officially let the community know about what I hope will be a fairly
 high profile site that is using Lift.

 -harryh

 (1) Haven't quite ported feeds.foursquare.com, and there is a legacy
 PHP based REST api that will live on for a bit longer as it supports
 current versions of our iPhone app.

 --

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




--

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




Re: Lift + Scala 2.8 (Was: Re: [Lift] Re: Is there any eclipse setup that actually works for lift?)

2009-07-24 Thread Jorge Ortiz
No, sorry. I haven't spent any more time on this.

--j

On Thu, Jul 23, 2009 at 10:13 PM, Naftoli Gugenheim naftoli...@gmail.comwrote:

 Any update on this?


 On Mon, Jun 22, 2009 at 10:55 PM, David Pollak 
 feeder.of.the.be...@gmail.com wrote:



 On Mon, Jun 22, 2009 at 7:51 PM, Jorge Ortiz jorge.or...@gmail.comwrote:

 I just spent all afternoon trying to get stuff to compile with Scala 2.8.

 Since Lift depends on Specs, and Specs depends on Scalacheck, I started
 trying to port Scalacheck to 2.8 so I could port Specs to 2.8 so I could
 port Lift. It was unable to get Scalacheck to compile due to bugs which
 cause the compiler to choke and throw an exception. Apparently both paulp
 and Iulian have tried to compile Scalacheck with 2.8 before and failed.

 Giving up on Specs and Scalacheck, I decided to try to compile Lift (sans
 tests) with 2.8. After fixing some of the breaking changes that 2.8
 introduces, I again ran into compiler troubles. In principle, with a lot of
 sleuthing I could figure out what code is causing the compiler to choke and
 give the compiler more type hints or whatever. Unfortunately this requires
 more work than I can put in today.

 Conclusion: 2.8 is basically unusable right now.

 (I'll check in my progress to GitHub later tonight or tomorrow.)


 Thanks for your hard work!




 --j

 On Mon, Jun 22, 2009 at 11:35 AM, David Pollak 
 feeder.of.the.be...@gmail.com wrote:



 On Mon, Jun 22, 2009 at 11:25 AM, Ellis ellis.whiteh...@gmail.comwrote:


 Hello David,

 Thanks for your reply.  Do you know whether lift *should* work with
 scala 2.8 when we pull it from the maven repositories?


 Lift currently only works with Scala 2.7.4.  You can use Eclipse and
 2.7.5 to edit Lift files, but Lift must be deployed against 2.7.4.

 We will have a branch of Lift (Jorge... you got this running yet)
 building against 2.8, but it will be experimental.

 I have experienced a fair number of suboptimalities with Lift and
 Eclipse in the last 3 weeks with the 2.7.5 stable plugin.  I have had
 success recently with NetBeans, IntelliJ, and emacs.


  If so, then
 I'll try deleting my ~/.m2 as Tim suggested.

 Thanks,
 Ellis


 On Jun 22, 8:14 pm, David Pollak feeder.of.the.be...@gmail.com
 wrote:
  Ellis,
  Miles will be back online in a few days, but I suspect that the
 answer is
  that the 2.8 plugin is the new generation and the 2.7.5 stuff is
 going to
  have bugs. :-(
 
  Sorry.
 
  David
 
 
 
  On Mon, Jun 22, 2009 at 11:08 AM, Ellis ellis.whiteh...@gmail.com
 wrote:
 
   Hello everyone,
 
   Does anyone have a setup for eclipse that works like it should?  By
   like it should, I mostly mean that the scala plugin doesn't crash
   regularly AND it works with lift/maven.  If so, which versions of
   which plugins are you using?
 
   The nightly build of the scala plugin seems to work better than
   2.7.4/2.7.5 in some ways, but I couldn't get it working with lift/
   maven due to signature differences between the scala libraries.
 
   Best regards,
   Ellis
 
  --
  Lift, the simply functional web frameworkhttp://liftweb.net
  Beginning Scalahttp://www.apress.com/book/view/1430219890
  Follow me:http://twitter.com/dpp
  Git some:http://github.com/dpp





 --
 Lift, the simply functional web framework http://liftweb.net
 Beginning Scala http://www.apress.com/book/view/1430219890

 Follow me: http://twitter.com/dpp
 Git some: http://github.com/dpp








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




 


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



[Lift] Re: http://wiki.liftweb.net request

2009-07-11 Thread Jorge Ortiz
All you have to do is register for an account. Anonymous edits aren't
allowed.

--j

On Fri, Jul 10, 2009 at 11:09 PM, DFectuoso santiago1...@gmail.com wrote:


 How can people get editing power on the wiki? Is it intended to be
 used as a (real) wiki? Who is responsable right now for hosting that
 and keeping it up?

 I was fizzling around today with mySql and lift following the advice
 there and decided I would like to expand the article with some
 problems I had and how i solved and that kind of stuff =)

 


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



[Lift] Re: Using Mapper outside Lift?

2009-06-23 Thread Jorge Ortiz
I've used Mapper in desktop apps too. It works fine.

--j

On Tue, Jun 23, 2009 at 9:56 AM, Naftoli Gugenhem naftoli...@gmail.comwrote:


 I used mapper in an offline (demo) app. You have to include the util and
 http jars IIRC but it's a desktop app. If you're subcribed to scala-user, I
 posted it (I think last week) in the thread about a scala SWT DSL.

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


 Hi Joe,

 Mapper does not work standalone, its not like ActiveRecord in that
 sense - its tied to lift-webkit. Your best bet would be to go with
 JPA; I think that will serve you better anyway.

 Cheers, Tim

 On Jun 23, 4:47 pm, Joe Wass j...@folktunefinder.com wrote:
  Good afternoon (at least in England),
 
  I'm writing an application which has a significant Lift manifestation,
  but also some stand-alone Scala (maybe even Java but I'll exclude this
  from the conversation). The stand-alone code is a set of tools that
  hang off the database and do some heavy-lifting with the data in the
  database, out of sync with the site. Something like periodic data-
  crunching from the data on the site. The question comes down to
  database mapping.
 
  I was wondering what people think is a sensible way of doing this. My
  data model is simple enough that Mapper could work and I could use the
  same classes. I'm aware there are many different ways I could do it,
  but it would be nice to do it that way for the sake of simplicity.
 
  Does this sound a sensible approach? Has anyone else written an app
  that's half online, half offline? Are there any obvious pitfalls?
 
  Cheers
 
  Joe


 


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



[Lift] Re: Using Mapper outside Lift?

2009-06-23 Thread Jorge Ortiz
The OP claims his data model is simple enough for Mapper.

If he doesn't mind adding the lift-webkit jar to his classpath, I don't see
a problem with using Mapper.

--j

On Tue, Jun 23, 2009 at 10:46 AM, Timothy Perrett
timo...@getintheloop.euwrote:



 I didn¹t say that it *wouldn¹t* work, just that its tied to lift-webkit...
 Besides, he says that he will be doing a lot of data intensive processing -
 seems like JPA would play better there as Mapper is usually has a ceiling
 of
 functionality and then it becomes necessary to move to JPA anyway. IMHO,
 might as well save the recoding time and just work with JPA right away if
 he
 knows from the start that he will have tricky data ORM tasks.

 Cheers, Tim

 On 23/06/2009 18:28, Jorge Ortiz jorge.or...@gmail.com wrote:

  I've used Mapper in desktop apps too. It works fine.
 
  --j
 
  On Tue, Jun 23, 2009 at 9:56 AM, Naftoli Gugenhem naftoli...@gmail.com
  wrote:
 
  I used mapper in an offline (demo) app. You have to include the util and
 http
  jars IIRC but it's a desktop app. If you're subcribed to scala-user, I
 posted
  it (I think last week) in the thread about a scala SWT DSL.
 
  -
  Timothy Perretttimo...@getintheloop.eu wrote:
 
 
  Hi Joe,
 
  Mapper does not work standalone, its not like ActiveRecord in that
  sense - its tied to lift-webkit. Your best bet would be to go with
  JPA; I think that will serve you better anyway.
 
  Cheers, Tim
 
  On Jun 23, 4:47 pm, Joe Wass j...@folktunefinder.com wrote:
  Good afternoon (at least in England),
 
  I'm writing an application which has a significant Lift manifestation,
  but also some stand-alone Scala (maybe even Java but I'll exclude this
  from the conversation). The stand-alone code is a set of tools that
  hang off the database and do some heavy-lifting with the data in the
  database, out of sync with the site. Something like periodic data-
  crunching from the data on the site. The question comes down to
  database mapping.
 
  I was wondering what people think is a sensible way of doing this. My
  data model is simple enough that Mapper could work and I could use the
  same classes. I'm aware there are many different ways I could do it,
  but it would be nice to do it that way for the sake of simplicity.
 
  Does this sound a sensible approach? Has anyone else written an app
  that's half online, half offline? Are there any obvious pitfalls?
 
  Cheers
 
  Joe
 
 
 
 
 
  
 



 


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



Lift + Scala 2.8 (Was: Re: [Lift] Re: Is there any eclipse setup that actually works for lift?)

2009-06-22 Thread Jorge Ortiz
I just spent all afternoon trying to get stuff to compile with Scala 2.8.

Since Lift depends on Specs, and Specs depends on Scalacheck, I started
trying to port Scalacheck to 2.8 so I could port Specs to 2.8 so I could
port Lift. It was unable to get Scalacheck to compile due to bugs which
cause the compiler to choke and throw an exception. Apparently both paulp
and Iulian have tried to compile Scalacheck with 2.8 before and failed.

Giving up on Specs and Scalacheck, I decided to try to compile Lift (sans
tests) with 2.8. After fixing some of the breaking changes that 2.8
introduces, I again ran into compiler troubles. In principle, with a lot of
sleuthing I could figure out what code is causing the compiler to choke and
give the compiler more type hints or whatever. Unfortunately this requires
more work than I can put in today.

Conclusion: 2.8 is basically unusable right now.

(I'll check in my progress to GitHub later tonight or tomorrow.)

--j

On Mon, Jun 22, 2009 at 11:35 AM, David Pollak 
feeder.of.the.be...@gmail.com wrote:



 On Mon, Jun 22, 2009 at 11:25 AM, Ellis ellis.whiteh...@gmail.com wrote:


 Hello David,

 Thanks for your reply.  Do you know whether lift *should* work with
 scala 2.8 when we pull it from the maven repositories?


 Lift currently only works with Scala 2.7.4.  You can use Eclipse and 2.7.5
 to edit Lift files, but Lift must be deployed against 2.7.4.

 We will have a branch of Lift (Jorge... you got this running yet) building
 against 2.8, but it will be experimental.

 I have experienced a fair number of suboptimalities with Lift and Eclipse
 in the last 3 weeks with the 2.7.5 stable plugin.  I have had success
 recently with NetBeans, IntelliJ, and emacs.


  If so, then
 I'll try deleting my ~/.m2 as Tim suggested.

 Thanks,
 Ellis


 On Jun 22, 8:14 pm, David Pollak feeder.of.the.be...@gmail.com
 wrote:
  Ellis,
  Miles will be back online in a few days, but I suspect that the answer
 is
  that the 2.8 plugin is the new generation and the 2.7.5 stuff is going
 to
  have bugs. :-(
 
  Sorry.
 
  David
 
 
 
  On Mon, Jun 22, 2009 at 11:08 AM, Ellis ellis.whiteh...@gmail.com
 wrote:
 
   Hello everyone,
 
   Does anyone have a setup for eclipse that works like it should?  By
   like it should, I mostly mean that the scala plugin doesn't crash
   regularly AND it works with lift/maven.  If so, which versions of
   which plugins are you using?
 
   The nightly build of the scala plugin seems to work better than
   2.7.4/2.7.5 in some ways, but I couldn't get it working with lift/
   maven due to signature differences between the scala libraries.
 
   Best regards,
   Ellis
 
  --
  Lift, the simply functional web frameworkhttp://liftweb.net
  Beginning Scalahttp://www.apress.com/book/view/1430219890
  Follow me:http://twitter.com/dpp
  Git some:http://github.com/dpp





 --
 Lift, the simply functional web framework http://liftweb.net
 Beginning Scala http://www.apress.com/book/view/1430219890

 Follow me: http://twitter.com/dpp
 Git some: http://github.com/dpp

 


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



[Lift] Re: scalajpa - while accessing two distincts databases, the second access is made with a connection to the first database

2009-06-17 Thread Jorge Ortiz
In Derek's defense, it's not how objects in classes work but how Lift
RequestVars work. Scala objects in classes aren't global singletons, just
per-class-instance singletons. But a Lift ReuqestVar object in a class is
pretty much a global singleton (unless you do some hacking like Derek did).

--j

On Tue, Jun 16, 2009 at 11:14 PM, Derek Chen-Becker
dchenbec...@gmail.comwrote:

 I agree that it's an issue. In my own defense, what I meant was not that I
 didn't think people would use more than one DB. I actually have several apps
 (not yet converted to Lift) that use 4 or more persistence units that
 represent various legacy databases. Rather, I failed to realize the problem
 that would arise from defining the EM factory as a singleton because when I
 wrote that code I didn't fully understand how member objects on classes
 worked. Other than that, I agree with your post :)
 Derek

 On Tue, Jun 16, 2009 at 5:38 PM, Meredith Gregory 
 lgreg.mered...@gmail.com wrote:

 Derek,

 soapbox
 You have just demonstrated a process that i have been talking about for
 the last 15 years. People have a blind spot when it comes to thinking
 compositionally. They think -- almost to a person -- about god's eye view
 solutions where there's only one of some key solution component. They don't
 think about solutions that are composed of ... (wait for it)... solutions!
 It takes some serious training to think compositionally. Compositional
 solutions, however, are the only realistic way to scale. When solutions are
 compositional, you can *de*compose. The db example is a case in point.
 One of the most natural ways to scale data access is sharding and
 partitioning -- which requires upfront machinery to support decomposition of
 the store.

 Lest you feel bad, note that some of the best scientific minds of all time
 have fallen prey to this blind spot. Newtonian physics as well as Einstein's
 update to Newton's proposal is a non-compositional solution. Quantum
 mechanics also exhibits compositional failures. This is why physics is
 failing to find proposals that link theories of gravitation (essentially
 large scale) to quantum mechanical theories of the other forces (essentially
 very small scale) -- the physical theories are non-compositional -- they
 don't scale!

 One of the real things functional programming has going for it is that the
 basic model of computation underlying the means of structuring and
 manipulating programs is compositional. That's why it is important to have a
 technology like Scala resting atop the incumbent execution model (JVM) being
 deployed on web-scale problems. Compositionality is the only way to tackle
 applications at global scale.
 /soapbox

 Thanks for getting the fix to this problem in so quickly.

 Best wishes,

 --greg


 On Tue, Jun 16, 2009 at 11:53 AM, Derek Chen-Becker 
 dchenbec...@gmail.com wrote:

 Using multiple EMs was not something I had considered when I wrote this.
 I think that I can modify the code to provide a __nameSalt def to
 differentiate instances. Let me work on it and I'll have something soon.

 Derek


 On 6/16/09, Jean-Luc jlcane...@gmail.com wrote:

 For your information, here is an extract of source code of RequestVarEM
 :

 Trait RequestVarEM extends ScalaEntityManager with ScalaEMFactory {
object emVar extends RequestVar[EntityManager](openEM()) { ... }
 }

 EntityManager is stored in the singleton emVar; so, all db access of
 Model objects are made using the singleton emVar.
 = trait RequestVarEM allow only one connection to a database within the
 same HttpRequest context.


 Jean-Luc

 2009/6/15 Jean-Luc jlcane...@gmail.com

  Hello,

 I have two databases, db1 (a.k.a. Motorbike) and db2 (a.k.a. Motorway)
 defined with RequestVarEM :
 - object ModelDb1 extends LocalEMF(db1) with RequestVarEM  //
 Motorbike database
 - object ModelDb2 extends LocalEMF(db2) with RequestVarEM  //
 Motorway database

 I thought one could access to any databases independently from any
 snippet as long as the correct Model object were used (ModelDb1 or 
 ModelDb2
 for exemple) ; but when I access both databases from the same page, the
 second database access issues a Named query not found exception.

 I have two snippets, one to display a list of motorbike, another to
 display a list of motorway :
 - page1 :
 ModelDb1.createNamedQuery[Motorbike](Motorbike.findAll).getResultList() 
 =
 ok
 - page2
 : ModelDb2.createNamedQuery[Motorway](Motorway.findAll).getResultList() 
 =
 ok
 - page3 : calling from page 3 motorbike  motorway snippets : Named
 query not found: Motorway.findAll
 - page4 : calling from page 4 motorway  motorbike snippets : Named
 query not found: Motorbike.findAll
 - page3  changing the query of *Motorway* snippet :
   - 
 ModelDb2.createNamedQuery[*Motorbike*](*Motorbike*.findAll).getResultList()
 = it's ok and I do NOT have an exception !

 I joined a sample application, ...

 any idea about this issue ?
 (bad use of LocalEMF in the application code ? issue 

[Lift] Re: Cheap Hosting

2009-06-15 Thread Jorge Ortiz
Another option is http://prgmr.com/xen/

You can get as much RAM as Slicehost for only $8/mo (but slightly less
storage and data transfer).

The support will be much more barebones, though.

--j

On Mon, Jun 15, 2009 at 2:01 PM, Mark Lynn m...@sabado.com wrote:


 I want to thank everyone that replied on this. Derek's suggestion of GAE is
 intriguing and I am at least going to check it out - I'm a little weary of
 that persistence situation with GAE since I don't have any experience with
 JDO or JPA. However, if GAE does not work out, I like the Mosso approach
 suggested by Tim below. This app has very minimal bandwidth requirements so
  I suspect Mosso will be cheaper than Slicehost. Thanks again!

 Mark Lynn


 On Jun 15, 2009, at 9:50 AM, Tim Nelson wrote:

 You might want to also look into Mosso's Cloud Servers. They use
 Slicehosts' technology (Slicehost was purchased by rackspace, which owns
 mosso), but don't package the bandwidth in the price. If you have small
 bandwidth needs, it will be a little cheaper.
 Another alternative is mor.ph. It is a PaaS that has JavaEE as a choice.
 You just upload your WAR and off you go. I haven't tried this with a Lift
 app yet, but it should work.

 On Mon, Jun 15, 2009 at 8:28 AM, Jeremy Day jeremy@gmail.com wrote:

 Mark,

 It is my understanding (and this could be incorrect, of course) that you
 can do whatever you want on a Slicehost Slice.  You can install whatever
 Java applications you like.  You have total control.

 Jeremy


 On Mon, Jun 15, 2009 at 8:02 AM, Mark Lynn m...@sabado.com wrote:


 Thanks. That is certainly very reasonable and VPS hosting is definitely a
 possibility. I guess what I am asking is whether there is shared hosting in
 the Java realm where you can also install Scala and LIft? I'm assuming the
 answer is not yet, but I thought I would ask.

  Mark Lynn


 On Jun 14, 2009, at 11:56 PM, David Pollak wrote:

 Mark,
 You should be able to host a moderately trafficked site (400 unique
 visitors an hour) with a $20 slicehost.com account.

 Thanks,

 David

 On Sun, Jun 14, 2009 at 4:40 PM, Mark Lynn m...@sabado.com wrote:



 I have a web app that I am doing free for a charitable organization
 that is sensitive to hosting costs. I would like to make it my first
 Lift app since it is pretty straight-forward - simple database and
 will probably just use Mapper. Most of my previous experience is with
 Rails projects or projects that were hosted internally so I don't have
 much experience with java hosting services. Does anyone have a
 recommendation for an inexpensive hosting option where I can use scala/
 lift? With Rails or PHP I can find stuff for as little as $5/mth.

 Mark Lynn









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















 


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



Re: [scala] Re: [Lift] Programming in Scala #5, Lift Book #8, Beginning Scala #9

2009-06-09 Thread Jorge Ortiz
In addition to the Lift Workshop, I also co-taught a ten-week (1.5hrs/wk)
course at Stanford on Scala. It was targeted at advanced undergrads and
graduate students. Most were programming language enthusiasts, so the course
focused more on the interesting parts of Scala from a programming language
perspective, rather than a more practical here's-how-you-get-stuff-done
course (like the Lift Workshop).

--j

On Tue, Jun 9, 2009 at 2:33 AM, David Pollak
feeder.of.the.be...@gmail.comwrote:

 Luc,
 Jorge, Kaliya and I did a LiftWorkshop in November.  We had 6 people at the
 workshop.  We tried to pack in Scala and Lift all into a day... it didn't
 work.

 Jorge and I have done some review and we figure there's 3 days of Scala
 training and 2-3 days of Lift training that would be a minimum for folks to
 be able to go home and build Lift apps.  The To Do example (see
 http://liftweb.net/docs/getting_started.html ) would be one of the days
 (we gave it about an hour during the workshop and that was not nearly
 enough.)

 Thanks,

 David

 On Tue, Jun 9, 2009 at 1:23 AM, Luc Duponcheel 
 luc.duponch...@gmail.comwrote:

 here are some thoughts:

  - agreeing upon the *what* is probably easier than agreeing upon the *
 how*
for example: which IDE to use (if any) during the labs [ Eclipse,
 Netbeans, ... ] .
My experience is that the description of how to do labs should be
 independent
of any tools (it does not make sense to explicitely state things like:
 in Netbeans
go to this submenu and select that choice and ... ).

  - I think we should go for 'extreme course development' in the sense that
changes can be incorporated quickly (any text based format that
can (in a moderated way) be edited by many people is good
(e.g. LaTeX, assuming the existence of templates))
[ maybe git would be a perfect candidate for doing version management ]
Another advantage of using text based development is that consistency
can be automated: for example, code excerpts in slides can be extracted
programmatically from the code proper so that all changes to that code
are automatically propagated [ and also propagated in the embedded
 slides
of student guides ]. I have some LateX templates (and Scala code) to
 automate all this.
[ I have to agree that there is much room for improvement of the
 look-and-feel
 (it has been some time since I played around with LaTeX, and I'm not a
 specialist
   of LaTeX's beamer package) ]

 - About the financial model: if it is joint work, then I do not think it
 makes
   much sense to ask companies like Sun (or Oracle) money for the *
 development*
   of the material. If they are willing to make the material part of their
 curriculum
   (which implies: visibility via their catalogs),
   then we can make money by *delivering* the material.
   Whether or not the material itself should be freely downoadable by
 anyone
   in the world is yet another matter. Again, maybe there should be some
   moderated group of people having access to the material.


 ...

 Luc
 On Tue, Jun 9, 2009 at 9:25 AM, Viktor Klang viktor.kl...@gmail.comwrote:



  On Tue, Jun 9, 2009 at 8:21 AM, Luc Duponcheel 
 luc.duponch...@gmail.com wrote:

 Hi all,

 I attended the talk on Scala and the talk on Lift.
 Both excellent talks!

 [ I did not attend the talk on Actors
 (I was cycling on the other side of the Golden Gate Bridge (Mt
 Tamalpais)) ]

 ...

 Those talks act as 'teasers' to make developers
 'eager to know more about Scala'.

 This is great!

 But, sometimes, I also have the impression that those talks
 'preach for those that are already converted'.

 The point I want to make is the following:

 when talking to developers about Scala,
 I am almost always confronted with the fact that they
 still think it has a 'steep learning curve'.
 I tell them that 'once you have climbed the mountain,
 you can enjoy the view over the landscape' (cfr Mt Tamalpais).

 So, I really think there is this need for *hands on training*.

 Maybe some of you folks should try to convince Sun (or Oracle) Education
 to invest in training courses. Not a simple task indeed, but, worth the
 effort
 (helps Scala becoming mainstream).

 ps: I agree that I'm partially saying this out of pure opportunism
 (I'm delivering Java courses for Sun Education, and, of course,
 I would be the first one to deliver Scala courses).


 Awesome idea.

 Would be great to establish some kind of curriculum with joint teaching
 material to be able to offer courses worldwide.




 Luc

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

  A big congratulations to the authors as well as the whole Scala
 community... Yet another proof point that 2009 is the year of Scala.  Rock
 On!

   On Mon, Jun 8, 2009 at 7:34 AM, TylerWeir tyler.w...@gmail.comwrote:


 http://www.theserverside.com/news/thread.tss?thread_id=54862

 Quote:
 Here are the top 10 selling books at the JavaOne 

[Lift] Re: Switch to Scala 2.7.5 for 1.1 ?

2009-06-03 Thread Jorge Ortiz
In general I thought the plan for 1.1 was to compile against 2.8.

If anything we might want a 1.0.1 against 2.7.5.

--j

On Wed, Jun 3, 2009 at 1:26 PM, Heiko Seeberger 
heiko.seeber...@googlemail.com wrote:

 Hi,
 I wonder if we should switch to Scala 2.7.5. I do not know whether the
 actor fixes are relevant as Lift has got its own actor library now. But for
 users of the Scala IDE for Eclipse (like me) it might be beneficial, because
 the Scala IDE ships with 2.7.5.

 Cheers
 Heiko
 --
 My blog: heikoseeberger.name
 Follow me: twitter.com/hseeberger
 OSGi on Scala: www.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 liftweb@googlegroups.com
To unsubscribe from this group, send email to 
liftweb+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/liftweb?hl=en
-~--~~~~--~~--~--~---



[Lift] Re: JTA

2009-05-29 Thread Jorge Ortiz
I, too, would like to see Transactions be monadic.

--j

On Fri, May 29, 2009 at 3:54 PM, Meredith Gregory
lgreg.mered...@gmail.comwrote:

 Jonas,

 i applaud the effort. i agree with DPP sentiments regarding annotations.
 That said, i feel pretty comfortable that transactions fit entirely in a
 monadic context. Since LINQ demonstrates that query fits into monadic
 context, and there's already at least one Scala implementation of 
 LINQhttp://github.com/szeiger/scala-query/tree/master,
 might i suggest that you come up with a monadic presentation first and then
 map the sugar to that. My guess is that the sugar will be informed by the
 monadic presentation.

 To be suggestive... think of a context with a Tx object, TxCtxt, as like an
 Option widget. Then you do stuff inside a transaction via

 for ( myTransactedWidget - TxCtxt if someCondition ) yield {
 someOperationsThatNeedToBeTransacted }

 If you implement flatMap, yada, on TxCtxt you can have fun with nested
 transaction semantics. The point is that this should just work with a
 LINQ-like presentation of query.

 Best wishes,

 --greg


 On Fri, May 29, 2009 at 6:54 AM, Jonas Bonér jbo...@gmail.com wrote:


 I'll go for closures. Much simpler and less intrusive into Lift.
 The current impl is based on Atomikos and Hibernate, I'll start with
 pushing that in and we can make it pluggable later.
 For example for Hibernate one need to add a line to the hibernate
 config to register the
 org.hibernate.transaction.TransactionManagerLookup class in order to
 make Hibernate aware of our TX manager.

 Should I fork the github repo and submit patches or how do you guys work?

 /Jonas


 2009/5/29 Derek Chen-Becker dchenbec...@gmail.com:
  I'd vote for closures. We use annotations for JPA because we have to,
 but
  IMHO closures provide a nicer semantic approach because they
 syntactically
  enclose the block where the action is occurring.
 
  Derek
 
  On Fri, May 29, 2009 at 7:44 AM, Jonas Bonér jbo...@gmail.com wrote:
 
  No perf difference. The annotations are turned into the same exact
  closures.
 
  2009/5/29 Timothy Perrett timo...@getintheloop.eu:
  
  
   Are there any performance implications considering closures vs
   annotations?
   Agreed that closures are more lift like however.
  
   Cheers, Tim
  
   On 29/05/2009 10:21, marius d. marius.dan...@gmail.com wrote:
  
  
   I think that would be really good. But I'd rather not use
 annotations.
   Personally I find closures approach a much better fit here.
  
   withTxRequired {
 ... // do transational stuff
  
   }
  
  
   Br's,
   Marius
  
   On May 29, 11:55 am, Jonas Bonér jbo...@gmail.com wrote:
   Hi guys.
  
   I have been talking with David Pollak the rest of the lift team
 about
   adding JTA to Lift. I have implemented that for a product written
 in
   Scala some time ago. Now some of that code is OSS
   at:http://github.com/jboner/skalman/tree
  
   We used using two different APIs.
   1. Annotations (would require Lift to support proxied objects, e.g.
   grab them from a factory):
  
   @TransactionAttribute(REQUIRED)
   def transactionalMethod = { ... }
  
   2. Call-by-name:
  
   withTxRequired {
 ... // do transational stuff
  
   }
  
   But I don't know what fits Lift and would like to know how you guys
   would like to have JTA integrated.
   At which level? Which APIs? Etc.
  
   --
   Jonas Bonér
  
   twitter: @jboner
   blog:http://jonasboner.com
   work:  http://crisp.se
   work:  http://scalablesolutions.se
   code:  http://github.com/jboner
   
  
  
  
  
   
  
 
 
 
  --
  Jonas Bonér
 
  twitter: @jboner
  blog:http://jonasboner.com
  work:   http://crisp.se
  work:   http://scalablesolutions.se
  code:   http://github.com/jboner
 
 
 
 
  
 



 --
 Jonas Bonér

 twitter: @jboner
 blog:http://jonasboner.com
 work:   http://crisp.se
 work:   http://scalablesolutions.se
 code:   http://github.com/jboner





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

 +1 206.650.3740

 http://biosimilarity.blogspot.com


 


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



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

2009-04-25 Thread Jorge Ortiz
I had nothing to do with it. David beat me to it.

--j

On Sat, Apr 25, 2009 at 11:34 AM, Timothy Perrett
timo...@getintheloop.euwrote:


 Sweet! Well done Jorge / David for getting this out so quickly with
 the announcement of 2.7.4
 


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



[Lift] Re: directives versus snippets

2009-04-10 Thread Jorge Ortiz
Huh?

lift: snippet, surround, embed, ignore, comet, children, a, form, loc, and
with-param are all built-in in liftTagProcessing. Yes, they're overrideable,
but imo it'd be nicer if they were Just A Snippet, like, say, lift:msgs.

lift:bind is just bad naming. it's not actually a directive, it's just what
lift:surround looks for to bind at. should probably be called surround:bind
or something with a different namespace.

--j

On Fri, Apr 10, 2009 at 1:26 PM, David Pollak feeder.of.the.be...@gmail.com
 wrote:

 Bob,
 They are actually the same thing.  Lift's processing directives are simply
 built-in snippets.  You can, if you dare, override their functionality. :-)

 Thanks,

 David

 On Fri, Apr 10, 2009 at 11:23 AM, bob rbpas...@gmail.com wrote:


 if I see lift:/, it could mean one of two things: a directive,
 e.g., lift:bind/ or lift:surround/ or shorthand for a snippet, eg
 lift:myClass represents lift:snippet type=MyClass

 i guess I would like to see these disambiguated a shorthand for
 snippets that doesn't overlap with the directive namespace.

 some possible solutions:

 1. lift:bind/ would be the directive and lift:.bind/ would be the
 snippet. please don't get hung up on my use of dot. it is only an
 example, and not an actual suggestion.

 2. lift:bind/ maps to a real class, not some internal code, much the
 way lift:msgs/ maps to net.liftweb.builtin.snippets.Msgs  (thanks
 Jorge)

 3. lift:bind is the directive, and liftsnippet:bind is the snippet

 comments?

 thanks, bob






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

 


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



[Lift] Google App Engine

2009-04-08 Thread Jorge Ortiz

Google App Engine just released support for Java/Scala. I just sent in
my laptop for repairs and won't get it back for a while.

Anyone want to try Lift on GAE and report back?

--j

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



[Lift] Re: Newbie Scala syntax question re: parameterized types with bounds

2009-04-03 Thread Jorge Ortiz
On Fri, Apr 3, 2009 at 12:53 PM, David Pollak feeder.of.the.be...@gmail.com
 wrote:



 On Wed, Apr 1, 2009 at 8:06 PM, Kris Nuttycombe kris.nuttyco...@gmail.com
  wrote:


 Something that occurred to me recently along these lines - perhaps
 someone can disabuse me of this notion. In Java, such recursive types
 are necessary because you don't have abstract types. To refer to the
 implementation type in the declaring class you have to use the
 self-type.

 But in Scala, what application would not be satisfied by:

 trait Mapper {
   type T : Mapper
 }

 class User extends Mapper {
   type T = User
 }

 Is it just that the restriction on T is not sufficiently narrow?


 No... becayse you can say:

 class User extends Mapper {
   type T = Address
 }

 I think this captures things, but I'm not 100% sure (and self-types weren't
 around when I did Mapper):

 trait Mapper[T : Mapper] {
   self: T =
 }


This can be expressed as:

  trait Mapper {
type T : this.type : Mapper
  }

  class User extends Mapper {
type T = User
  }

Actually, this might be sufficient:

  trait Mapper {
type T = this.type
  }

  class User extends Mapper

Actually, that's too specific, because then:

  object MetaUser extends User {
def create: T = new User // oops, MetaUser.T == MetaUser.type != User
  }

But I think the first suggestion still works:

  trait Mapper {
type T : this.type : Mapper
  }

  class User extends Mapper {
type T = User
  }

  object MetaUser extends User {
def create: T = new User
  }

W, types are fun...

It might be a good idea to user these for Mapper* stuff, but Mapped* stuff
would maybe get too verbose with type T = ... syntax versus [T] syntax.

--j



 Kris

 On Fri, Mar 27, 2009 at 5:26 PM, Alex Boisvert boisv...@intalio.com
 wrote:
  Or said another way,
 
  MappedTextarea[ T : Mapper[T] ]
 
  declares a type parameter T and fixes the upper bound of the
 MappedTextarea
  type parameter to Mapper[T], which means that the type passed to
  MappedTextArea must be a subtype of Mapper.
 
  I, too, found this notation confusing at first and wished I could write
  MappedTextarea[ : Mapper[T] ] directly but declaring the T before its
 use
  is necessary to disambiguate it from existing class names.
 
  alex
 
 
 
  On Fri, Mar 27, 2009 at 1:52 PM, Stefan Scott 
 stefanscottal...@gmail.com
  wrote:
 
  Hi -
 
  Sorry to be asking a Scala syntax question here in the Lift group, but
  I figured somebody here would know, since this Scala syntax occurs
  quite a bit in the Lift source code.
 
  When reading some of the Lift source I come across a particular Scala
  idiom involving parameterized types with bounds, whose semantics I'm
  unsure of.
 
  For example:
 
  class MappedTextarea[ T : Mapper[ T ] ] ( owner : T, maxLen: Int )
  extends
   MappedString[ T ]( owner, maxLen ) { ... }
 
  What I'm unsure about here is the part where it says:
 
  T : Mapper[ T ]
 
  At first, this made no sense to me - how could a type T be a subtype
  of type Mapper[ T ] ?
 
  Then I guessed that maybe the two occurrences of T are unrelated to
  each other - ie, class MappedTextarea is parameterized over a type T,
  which must be a subtype of a type Mapper[ T ] -- where the second T is
  actually in a separate scope so that it has nothing to do with the
  first T.
 
  Is that what this really means?
 
  And, if that's really the case, then I guess the other occurrences of
  T later in the text:
 
  owner : T
  MappedString[ T ]
 
  are also referring to the first occurrence of T -- the type T which is
  upper-bounded by type Mapper[ T ].
 
  Finally, does this mean that the above code could also have been
  written equivalently as follows:
 
  class MappedTextarea[ T : Mapper[ U ] ] ( owner : T, maxLen: Int )
  extends
   MappedString[ T ]( owner, maxLen ) { ... }
 
  using U instead of T for the type parameter that's in a separate
  scope?
 
  Thanks for any help.
 
  - Stefan Scott
 
 
 
 
 
 
 
 
  
 





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

 


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



[Lift] Re: Advice on Ramping Up

2009-04-03 Thread Jorge Ortiz
Aside: I think the preferred abbreviation for Programming in Scala is PinS,
not PiS.

Just fyi,

--j

On Fri, Apr 3, 2009 at 4:15 PM, Timothy Perrett timo...@getintheloop.euwrote:



 My advice, if your generally / vaugly familiar with Scala from reading PiS
 (that truly is a very unfortunate acronym!) just dive into making a lift
 app, then go from there.

 One of the best things about Lift is the community - if you have questions,
 chances are its either already in the group archive from one of our many
 debates, or in the lift book, or if not, just ask on the mailing list and
 someone will no doubt help you right quick!

 Good luck!

 Tim


 On 03/04/2009 23:01, Charles F. Munat c...@munat.com wrote:

 
  I'd suggest that you start working in Lift, then when you encounter
  something that doesn't make sense to you, refer to the PiS book
  (unfortunate acronym). It helps if you have the PDF version because you
  can search. The index is OK, but often insufficient.
 
  This is the approach I used to get started, though eventually I went
  back and read most of the book sequentially (I still have a couple of
  chapters to go). Take a look also at DPP's book and the online Lift
  book, both easily searchable.
 
  If you want to jump ahead in the book, I'd recommend the following:
 
  15: Case Classes and Pattern Matching
  16: Working with Lists
  23: For Expressions Revisited
 
  Lists, for expressions, case classes, and pattern matching are used *all
  over the place* in Lift. You can't be too familiar with these.
 
  Then maybe:
 
  19: Type Parameterization
  21: Implicit Conversions and Parameters
 
  You don't need to understand those thoroughly, but having some
  familiarity with them will help with debugging and understanding what
  the heck is going on.
 
  If you have time, you could also read the following to fill in a few
 gaps:
 
  22: Implementing Lists
  26: Working with XML
 
  And if you're going to use Comet, you should probably read:
 
  30: Actors and Concurrency
 
  But again, you can dive in and then reference these chapters as
 necessary.
 
  Chas.
 
  lmorroni wrote:
  Hi,
  I am a Java programmer that is interested in learning Lift.  I have
  just finished the first six chapters of Programming in Scala.  I
  wonder what people's opinions are on how much of this book I need to
  read before diving into Lift.  I attempted to dive into Lift without
  reading anything on Scala and that worked great until I wanted to
  start reviewing the Lift libraries :)
  Maybe there are some chapters in this book that I can skip?  I think
  the book is really well written and I have followed everything so
  far.  I just would rather get rolling on Lift sooner rather than
  later.
  Larry
 
 
 
  
 



 


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



[Lift] Re: Proposed URL Shortening widget

2009-04-02 Thread Jorge Ortiz
What about easily turning any lift app into a url shortener service?

Wouldn't be too hard...

Granted, some services (bit.ly) add statistics, visualization, conversation
tracking, etc. which aren't just url shortening.

--j

On Thu, Apr 2, 2009 at 12:13 PM, Tim Perrett timo...@getintheloop.euwrote:


 Guys,

 I've been contemplating doing this for a while and am now finding
 myself with a bunch of free time tomorrow and a need to write some
 code.

 So, I want to make a widget that shortens URL's in an extendable
 way... Im thinking of having something like:

 trait URLReductionProvider { ... }

 object TinyURL extends URLReductionProvider
 object IsGd extends URLReductionProvider
 object BitLy extends URLReductionProvider

 You get the general idea...

 So, im thinking of implementing the actual URL fetching stuff as a
 partial function so that users could do:

 def reductionResult = {
  case Full(result) = // result is the URL, insert into database etc
  case _ = // something went wrong
 }

 My question is however, if i make this actor based, could someone
 implement it so rather than writing there URL to database in a
 separate thread to the main one, would it be possible for them to say,
 use a JsCmd and return that to update the browser? Im guessing not
 unless it was a CometActor right.

 This then got me thinking, do you guys thing this is worth doing actor
 based, or is it just ok to make a blocking call to the provider?
 (tinyurl or is.gd etc)

 Cheers, Tim
 


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



[Lift] Re: The Lift 1.1 list

2009-04-01 Thread Jorge Ortiz
I propose we migrate to Joda Time for 1.1.

In particular, I propose that Record ditch Java Date/Time entirely in favor
of Joda Time. Since migrating from Mapper to Record will involve a port
anyway, what's one more breaking change among friends?

Lift's other uses of Date/Time should be deprecated in favor of Joda Time
alternatives.

Mapper should continue to support Date/Time.

--j

On Wed, Apr 1, 2009 at 9:11 AM, David Pollak
feeder.of.the.be...@gmail.comwrote:

 Folks,

 I think we've got our Lift 1.1 list.  If anyone has anything to add, please
 speak up now.

- Improved documentation: better VScalaDoc coverage as well as better
tutorial and cook-book documentation.
- Improved J2EE support including JTA and Portlets.
- Finish Record/Field code with backing store including JDBC, JPA and
Goat Rodeo (what's Goat Rodeo? http://goatrodeo.org)
- Improved client-side JavaScript support and better JavaScript
abstractions.
- Client/Server data synchronization (integrated with Record/Field)
- Improved support for REST.
- Improved performance including caching templates when running in
production mode.
- OSGi support.
- Improved testing framework and better testing support when running in
test mode.
- Implement Servlet 3.0 support.
- HTML 5 and Web Sockets support and integration with Kaazing's Web
Sockets server.  Also, sensing which browser is making the request and
performing optimizations based on that browser's characteristics
(specifically, Chrome and Firefox 3.1 support)

 We will have bug-fix releases of 1.0 along the way and we'll have a release
 off the 1.0 branch when Scala 2.8 is released.

 Feedback is welcome in the next 3 days.

 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
 Git some: http://github.com/dpp

 


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



[Lift] Re: The Lift 1.1 list

2009-04-01 Thread Jorge Ortiz
I also propose we start thinking seriously about 2.8.

In particular, 2.8 will probably add support for named and default
arguments. This places extra burdens on library and framework designers, as
method -argument- names will be just as much a part of a library/framework's
API as class, method, and field names. It also means that decisions about
the order of arguments, whether arguments have a default, and whether
methods are overloaded need to be made or revisited.

For our 1.0 branch, this means cleaning up argument names before releasing a
2.8 version. Order of arguments should not be changed, nor should we remove
any overloaded method versions.

For our 1.1 branch, I propose we do a holistic review of API decisions with
regards to arguments, argument names, argument order, defaults, and
overloading.

--j

On Wed, Apr 1, 2009 at 9:11 AM, David Pollak
feeder.of.the.be...@gmail.comwrote:

 Folks,

 I think we've got our Lift 1.1 list.  If anyone has anything to add, please
 speak up now.

- Improved documentation: better VScalaDoc coverage as well as better
tutorial and cook-book documentation.
- Improved J2EE support including JTA and Portlets.
- Finish Record/Field code with backing store including JDBC, JPA and
Goat Rodeo (what's Goat Rodeo? http://goatrodeo.org)
- Improved client-side JavaScript support and better JavaScript
abstractions.
- Client/Server data synchronization (integrated with Record/Field)
- Improved support for REST.
- Improved performance including caching templates when running in
production mode.
- OSGi support.
- Improved testing framework and better testing support when running in
test mode.
- Implement Servlet 3.0 support.
- HTML 5 and Web Sockets support and integration with Kaazing's Web
Sockets server.  Also, sensing which browser is making the request and
performing optimizations based on that browser's characteristics
(specifically, Chrome and Firefox 3.1 support)

 We will have bug-fix releases of 1.0 along the way and we'll have a release
 off the 1.0 branch when Scala 2.8 is released.

 Feedback is welcome in the next 3 days.

 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
 Git some: http://github.com/dpp

 


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



[Lift] Re: MappedDateTime - Do we have a Date? Or is it a timestamp?

2009-03-31 Thread Jorge Ortiz
I was on IRC trying to help Clemens with this. The name (MappedDateTime),
targetSQLType (java.sql.Types.TIMESTAMP), and type (extends
MappedField[java.util.Date, _]) of this class suggests millisecond precision
(java.sql.Timestamp and java.util.Date have millisecond precision). However,
methods jdbcFriendly and real_convertToJDBCFriendly use java.sql.Date, which
has only day precision.

If the intent is day precision, then calling the class DateTime is probably
misleading. If the intent is millisecond precision, then we have a bug.

rant

Which brings up the larger issue of the brokennes of the Java Date/Time API.
Java 7 will hopefully be getting a newer/better one, but for those of us
stuck on Java 5/6, Joda Time is much preferable to the native Date/Time API.
It more clearly represents foundational concepts like instants (March 31,
2009 at 12:15.000pm UTC), partials (March 3 or 7:15pm), intervals (the space
between two instants), durations (1000 milliseconds), periods (1 month), and
chronologies (calendar systems). It's also completely immutable (oh, you
didn't know java.util.Calendar isn't thread-safe? you're lucky to have never
had to track down that bug).

/rant

Sigh... it's probably too big of a breaking change to rip out Java Date/Time
from Mapper and Helpers and replace it with Joda Time, but one can dream...

--j

On Tue, Mar 31, 2009 at 11:58 AM, Clemens Oertel
clemens.oer...@gmail.comwrote:


 While trying to figure out why my MappedDateTime fields get stored in
 the DB with all the time info set to 0, I noticed the following:

 MappedDateTime (v. 1.0) claims to be a TimeStamp: def targetSQLType
 = Types.TIMESTAMP. However, it uses java.sql.Date for its JDBC-
 friendly converted version, not java.sql.TimeStamp. If I read the
 java.sql.Date documentation correctly, java.sql.Date does set all time
 information to 0, since the SQL DATE type only stores dates, by no
 times.

 Any comment whether this might have something to do with me losing my
 time would be appreciated.

 Best,
 Clemens

 


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



[Lift] Re: Decoupling Lifts Template System

2009-03-19 Thread Jorge Ortiz
I hadn't thought about localization. That makes things a bit trickier.

Part of my goal was to make methods that allow you to easily access template
functionality programmatically. For example:

  def lift_surround(template: Box[String], at: Box[String])(child: NodeSeq):
NodeSeq
  def lift_snippet(stype: String)(child: NodeSeq): NodeSeq
  def lift_embed(what: String): NodeSeq
  def lift_comet(ctype: String, name: String)(child: NodeSeq): NodeSeq

Another goal was to be able to use templates without the rest of Lift. I
really just wanted the XML munging (templates, snippets, etc). Didn't think
too much about localization, views, etc.

In a lot of ways all this stuff is either a NodeSeq or a NodeSeq = NodeSeq.
I feel like there's some nice abstraction that would make everything pretty
but somehow I'm missing it...

My lowest priority would be to make template systems pluggable (i.e., use
some other template system with Lift). I have no desire to use this
personally, but part of the work involved for the first two goals means
extricating Lift's templates from the core of Lift. Making the template
system pluggable might just fall out of that.

--j

On Thu, Mar 19, 2009 at 3:39 PM, TylerWeir tyler.w...@gmail.com wrote:


 I thought Jorge was talking about this.  Maybe he'll jump in.

 On Mar 19, 3:58 pm, David Pollak feeder.of.the.be...@gmail.com
 wrote:
  It would be very tough because the templating system is all about the
  current state which is all about S and LiftRules.
 
  On Mar 19, 2009 12:41 PM, Tim Perrett timo...@getintheloop.eu wrote:
 
  Guys,
 
  What would it take to decouple Lifts template system? Specifically, im
  interested in reusing a bunch of the localization and view
  componentry.
 
  I know that wa back there was talk of doing this. For instance,
  lets say that you wanted filesystem view storage, rather than views
  being held in the WAR... right now, you have to rebuild the wheel to
  keep the lift functionality (like selecting templates based on locale
  ISO code) as lift currently only looks for resources based on the
  context root.
 
  Anyway... what are people's thoughts? I appreciate this is a fairly
  big task, but anyone want to bang it out for 1.1?
 
  Cheers, Tim
 


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



[Lift] Re: Lift Web, why no download of a zipped archive on the website?

2009-03-19 Thread Jorge Ortiz
If you want the sources, GitHub makes them available here:

http://github.com/dpp/liftweb/downloads

If you want the binaries...

We'll, you'll want to use Maven anyway. Just get that, really.

--j

On Thu, Mar 19, 2009 at 1:34 PM, BerlinBrown berlin.br...@gmail.com wrote:


 http://liftweb.net/download.html

 Call me old fashion, but why can't there simply be a download on the
 download page?
 


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



[Lift] FieldType and ForeignType

2009-03-17 Thread Jorge Ortiz
Anyone know what these two types:

  type FieldType : KeyType
  type ForeignType : KeyedMapper[KeyType, Other]

in trait MappedForeignKey are doing?

They're never fully defined and never used, but somehow were causing compile
problems in someone's code.

If they're useless, can they be axed?

--j

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



[Lift] Re: FieldType and ForeignType

2009-03-17 Thread Jorge Ortiz
And if they're useful, can subclasses of MappedForeignKey define them more
exactly?

Errors looked like this:

[WARNING] C:\workspace\liftapp\src\main\scala\com\liftworkshop\model\ToDo.scala:
16: error: object creation impossible, since type ForeignType in trait MappedFor
eignKey with bounds : Nothing : net.liftweb.mapper.KeyedMapper[Long,my.liftapp
.model.User] is not defined
[WARNING]   object owner extends MappedLongForeignKey( this , User )
[WARNING]  ^


[WARNING] C:\workspace\liftapp\src\main\scala\com\liftworkshop\model\ToDo.scala:
16: error: object creation impossible, since type FieldType in trait MappedForei
gnKey with bounds : Nothing : Long is not defined
[WARNING]   object owner extends MappedLongForeignKey( this , User )
[WARNING]  ^


--j

On Tue, Mar 17, 2009 at 5:42 PM, Jorge Ortiz jorge.or...@gmail.com wrote:

 Anyone know what these two types:

   type FieldType : KeyType
   type ForeignType : KeyedMapper[KeyType, Other]

 in trait MappedForeignKey are doing?

 They're never fully defined and never used, but somehow were causing
 compile problems in someone's code.

 If they're useless, can they be axed?

 --j


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



[Lift] Re: FieldType and ForeignType

2009-03-17 Thread Jorge Ortiz
Argh. Good call. I don't know as I was debugging through IRC, but it was
probably 2.7.2 since he was using the todo example site from the Lift
workshop.

And I told him to upgrade to Lift 1.0. That's going to cause problems. Oh
well.

--j

On Tue, Mar 17, 2009 at 8:23 PM, David Pollak feeder.of.the.be...@gmail.com
 wrote:

 What version of Scala?


 On Tue, Mar 17, 2009 at 5:45 PM, Jorge Ortiz jorge.or...@gmail.comwrote:

 And if they're useful, can subclasses of MappedForeignKey define them more
 exactly?

 Errors looked like this:

 [WARNING] 
 C:\workspace\liftapp\src\main\scala\com\liftworkshop\model\ToDo.scala:

 16: error: object creation impossible, since type ForeignType in trait 
 MappedFor
 eignKey with bounds : Nothing : 
 net.liftweb.mapper.KeyedMapper[Long,my.liftapp
 .model.User] is not defined
 [WARNING]   object owner extends MappedLongForeignKey( this , User )


 [WARNING]  ^


 [WARNING] 
 C:\workspace\liftapp\src\main\scala\com\liftworkshop\model\ToDo.scala:
 16: error: object creation impossible, since type FieldType in trait 
 MappedForei

 gnKey with bounds : Nothing : Long is not defined
 [WARNING]   object owner extends MappedLongForeignKey( this , User )
 [WARNING]  ^


 --j


 On Tue, Mar 17, 2009 at 5:42 PM, Jorge Ortiz jorge.or...@gmail.comwrote:

 Anyone know what these two types:

   type FieldType : KeyType
   type ForeignType : KeyedMapper[KeyType, Other]

 in trait MappedForeignKey are doing?

 They're never fully defined and never used, but somehow were causing
 compile problems in someone's code.

 If they're useless, can they be axed?

 --j







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

 


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



[Lift] Re: Custom Boot Class

2009-03-16 Thread Jorge Ortiz
I get the same error, unfortunately.

--j

On Mon, Mar 16, 2009 at 4:48 AM, Sergey Andreev andser...@gmail.com wrote:

 Jorge,

 I am using a custom Boot class and it works just fine. I believe that if
 you create a Brat.scala and put your class there, it will solve the problem

 Regards,
 Sergey


 On Mon, Mar 16, 2009 at 1:31 PM, Jorge Ortiz jorge.or...@gmail.comwrote:

 Folks,

 I'm trying to specify a custom Boot class, as per Chapter 3 of the Lift
 Book. To my web.xml I've added:

   context-param
 param-namebootloader/param-name
 param-valuebootstrap.liftweb.Brat/param-value
   /context-param

 and in Boot.scala I've commented out the regular Boot class and added a
 Brat class with identical implementation, except it extends Bootable.

   class Brat extends Bootable { ... }

 Unfortunately, I'm getting a:

   ERROR - Failed to Boot
   java.lang.ClassNotFoundException: bootstrap.liftweb.Boot

 Attached is the zipped project.

 Thanks,

 --j




 


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



[Lift] Re: Custom Boot Class

2009-03-16 Thread Jorge Ortiz
Thanks Derek!

--j

On Mon, Mar 16, 2009 at 8:33 AM, Derek Chen-Becker dchenbec...@gmail.comwrote:

 Just confirmed. Changing you web.xml to:

 ?xml version=1.0 encoding=ISO-8859-1?

 !DOCTYPE web-app
 PUBLIC -//Sun Microsystems, Inc.//DTD Web Application 2.3//EN
 http://java.sun.com/dtd/web-app_2_3.dtd;

 web-app

 filter
   filter-nameLiftFilter/filter-name
   display-nameLift Filter/display-name
   descriptionThe Filter that intercepts lift calls/description
   filter-classnet.liftweb.http.LiftFilter/filter-class
   init-param
 param-namebootloader/param-name
 param-valuebootstrap.liftweb.Brat/param-value
   /init-param
 /filter


 filter-mapping
   filter-nameLiftFilter/filter-name
   url-pattern/*/url-pattern
 /filter-mapping

 /web-app

 Fixes it. I'll fix the book.

 Derek


 On Mon, Mar 16, 2009 at 9:19 AM, Derek Chen-Becker 
 dchenbec...@gmail.comwrote:

 I think we might have an error in the book. The example you give uses
 context-param, but I think it needs to be an init-param within the filter
 portion of the web.xml.

 Derek


 On Mon, Mar 16, 2009 at 9:04 AM, Viktor Klang viktor.kl...@gmail.comwrote:

 No, it was working when we switched to the filter. :/


 On Mon, Mar 16, 2009 at 2:58 PM, Derek Chen-Becker 
 dchenbec...@gmail.com wrote:

 I wonder if this is something that broke when we moved to a Filter...

 Derek


 On Mon, Mar 16, 2009 at 7:02 AM, Jorge Ortiz jorge.or...@gmail.comwrote:

 I get the same error, unfortunately.

 --j


 On Mon, Mar 16, 2009 at 4:48 AM, Sergey Andreev 
 andser...@gmail.comwrote:

 Jorge,

 I am using a custom Boot class and it works just fine. I believe that
 if you create a Brat.scala and put your class there, it will solve the
 problem

 Regards,
 Sergey


 On Mon, Mar 16, 2009 at 1:31 PM, Jorge Ortiz 
 jorge.or...@gmail.comwrote:

 Folks,

 I'm trying to specify a custom Boot class, as per Chapter 3 of the
 Lift Book. To my web.xml I've added:

   context-param
 param-namebootloader/param-name
 param-valuebootstrap.liftweb.Brat/param-value
   /context-param

 and in Boot.scala I've commented out the regular Boot class and added
 a Brat class with identical implementation, except it extends Bootable.

   class Brat extends Bootable { ... }

 Unfortunately, I'm getting a:

   ERROR - Failed to Boot
   java.lang.ClassNotFoundException: bootstrap.liftweb.Boot

 Attached is the zipped project.

 Thanks,

 --j














 --
 Viktor Klang
 Senior Systems Analyst






 


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



[Lift] Re: Why does HelloWorld index.html contain a snippet rather than a complete XHTML page?

2009-03-13 Thread Jorge Ortiz
Yes, if index.xhtml is a compliant XML (preferably XHTML) document, it will
just be served up as-is. The lift:... / tags define transformations that
are applied to your document before it is served up.

--j

On Fri, Mar 13, 2009 at 3:40 PM, Marc Boschma
marc+lift...@boschma.cxmarc%2blift...@boschma.cx
 wrote:


 Hi Mal,

 That aspect of the lift templating approach also warped my head for a
 while, having seen so many examples of the opposite approach (PHP,
 JSP, etc)...

 There is a certain part of me that still is unsettled about it, but I
 can see the advantages of it.

 Marc
 Ps. can the files such as index.html in the examples be full XML
 compliant documents?

 On 13/03/2009, at 3:30 PM, mal3 wrote:

 
  Why does HelloWorld index.html contain a snippet rather than a
  complete XHTML page?
 
  When I first saw the HelloWorld example I thought there must be a
  mistake,
  because the index.html file contains a snippet, while default.html
  contains
  what looked more like a complete XHTML page.
 
  Why doesn't lift initially reference a complete XHTML page and then
  pull in the snippet(s)?
 
  Is it to make it difficult/impossible for logic to creep into the
  view?
 
  Mal.
 
  


 


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



[Lift] Re: Record and JSON

2009-03-06 Thread Jorge Ortiz
Hey Folks,

I wrote a Json AST and parser/serializer for unrelated reasons yesterday.
This could be the basis of a Record -- Json tool.

--j

On Wed, Mar 4, 2009 at 9:11 AM, David Pollak
feeder.of.the.be...@gmail.comwrote:



 On Wed, Mar 4, 2009 at 9:08 AM, Marius marius.dan...@gmail.com wrote:


 Hi,

 I was thinking that it might be useful to be able to obtain a JSON
 representation of a Record and also from a JSON construct to create a
 Record.

 Record defines now:

 def suplementalJs(ob: Box[KeyObfuscator]): List[(String, JsExp)] = Nil

 but that's not very intuitive ... not to mention not implemented yet.

 Thoughts ?


 I've been needing bi-directional JSON support to allow for the creation of
 complex JSON data structures.

 So, my thought is I have a need, but not a solution. :-)




 Br's,
 Marius




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


 


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



[Lift] Re: ORM Framework

2009-02-22 Thread Jorge Ortiz
I've used Mapper on desktop apps that don't do http. You lose a lot of the
features but it's still usable and sometimes even convenient.

YMMV,

--j

On Sun, Feb 22, 2009 at 4:23 PM, David Pollak feeder.of.the.be...@gmail.com
 wrote:



 On Sun, Feb 22, 2009 at 3:45 PM, Paulo Cheque pauloche...@gmail.comwrote:


 Thanks by the fast answer David, and congratulations by the good work!

 I think this relationship is very strange (domain + http), is there
 any idea to change this in the future?


 Lift's Mapper stuff relies of classes in the HTTP framework for access
 control, form generation, etc.  It would significantly detract from the
 Mapper classes to remove this kind of functionality.  Plus, Lift's OR Mapper
 stuff is nice for simple projects (like ActiveRecord), it's not meant to
 replace the functionality of a JPA solution (caching, etc.)

 So, no, there's no plan to remove the dependency between mapper and webkit.




 Thanks in advance again
 []s
 Paulo



 On Sun, Feb 22, 2009 at 8:24 PM, David Pollak
 feeder.of.the.be...@gmail.com wrote:
  Paulo,
  Lift's Mapper depends on the HTTP framework.  I would suggest using JPA
 as a
  stand-alone alternative.
  Thanks,
  David
 
  On Sun, Feb 22, 2009 at 11:04 AM, Paulo Cheque pauloche...@gmail.com
  wrote:
 
  Like GORM in Grails, it is possible to use the ORM framework of Lift
  separately?? There is any tutorial or documentation avaiable?
 
  Thanks in advance
 
  []s
  Paulo
 
 
 
 
 
  --
  Lift, the simply functional web framework http://liftweb.net
  Beginning Scala http://www.apress.com/book/view/1430219890
  Follow me: http://twitter.com/dpp
  Git some: http://github.com/dpp
 
  
 





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

 


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



[Lift] Re: Weird Mapper type error

2009-02-19 Thread Jorge Ortiz
Committed the fix to lift-archetype-basic (to set a good example)

--j

On Thu, Feb 19, 2009 at 9:10 AM, David Pollak feeder.of.the.be...@gmail.com
 wrote:



 On Thu, Feb 19, 2009 at 6:49 AM, Derek Chen-Becker 
 dchenbec...@gmail.comwrote:

 Shouldn't it be

 override def fieldOrder: List[BaseOwnedMappedField[Transaction]] = txtime
 :: amount :: summary :: Nil

 I did try that and it gave the same error. In any case, List(...) works.


 This is because the :: (cons) operation does inference on each cons
 element, rather than the List as a whole.  At some point, it gets confused.
 Please use List().




 Derek


 On Thu, Feb 19, 2009 at 2:35 AM, Jorge Ortiz jorge.or...@gmail.comwrote:

 Yup, this is a type inference bug. If I'm not mistaken then

 override def fieldOrder: BaseOwnedMappedField[Transaction] = txtime
 :: amount :: summary :: Nil

 should also work.

 In any case, I'd probably just stick with the List(...) syntax.

 --j


 On Wed, Feb 18, 2009 at 10:23 PM, Derek Chen-Becker 
 dchenbec...@gmail.com wrote:

 0.11-SNAPSHOT, and I'm writing up some example code for the book. I have
 the following class/object:

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

   object account extends MappedLongForeignKey(this, Account) {
 override def dbIndexed_? = true
   }

   object txtime extends MappedDateTime(this)

   // The amount has up to 16 digits and 2 decimal places
   object amount extends MappedDecimal(this, MathContext.DECIMAL64, 2)

   // Holds a brief description of the transaction
   object summary extends MappedString(this, 100)

   object notes extends MappedTextarea(this, 1000) {
 override def textareaCols = 60
 override def textareaRows = 8
   }

   def tags = TransactionTag.findAll(By(TransactionTag.transaction,
 this.id))
 }

 object Transaction extends Transaction with
 LongKeyedMetaMapper[Transaction] {
   override def fieldOrder = txtime :: amount :: summary :: Nil
 }

 The compile error I get is:

 [WARNING]
 /home/software/pocketchangeapp/PocketChange/src/main/scala/com/pocketchangeapp/model/Transaction.scala:35:
 error: inferred type arguments [net.liftweb.mapper.MappedField[_ : _1 with
 java.util.Date : java.io.Serializable,
 com.pocketchangeapp.model.Transaction]] do not conform to method ::'s type
 parameter bounds [B : net.liftweb.mapper.MappedField[_ : String with
 BigDecimal : java.io.Serializable,
 com.pocketchangeapp.model.Transaction]{def jdbcFriendly(String):
 java.io.Serializable}]
 [WARNING]   override def fieldOrder = txtime :: amount :: summary :: Nil
 [WARNING]^
 [WARNING] one error found

 If I remove the summary element from the fieldOrder list then it
 compiles fine. Likewise, if I remove txtime and put summary and notes into
 the list it compiles fine. I'm trying to get my head around all of the
 nested type bounds in the error message but I'm not seeing anything obvious
 other than the weird String with BigDecimal bound. I tried using an
 explicit type for fieldOrder but that doesn't work either.

 I finally tried changing fieldOrder to:

 override def fieldOrder = List(txtime, amount, summary, notes)

 That compiles fine. Have I found a type inferencing bug, or have I just
 done something incredibly stupid somewhere? Feel free to critique the 
 class,
 too.

 Thanks,

 Derek











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


 


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



[Lift] Re: Fwd: [jquery-dev] Re: Namespace failure

2009-02-16 Thread Jorge Ortiz
This might be a bit of a pain to deal with, but something like:

  tag class=lift-gc lift-gc-[uuid] /

Of course, you'd want to append to the 'class' attribute, not replace it
entirely.

--j

On Mon, Feb 16, 2009 at 1:49 PM, David Pollak feeder.of.the.be...@gmail.com
 wrote:

 what would the raw XHTML look like?
 Also, we can't rely on jQuery to scrape because we have to support other
 libraries (e.g., YUI) without jQuery.


 On Mon, Feb 16, 2009 at 1:45 PM, Viktor Klang viktor.kl...@gmail.comwrote:

 How about adding a class-attribute called gc to everything that's
 supposedly collectible?
 Then doing a scrape using jQuery(.gc) would be just as feasible.

 Would it solve the problem or can it be extended to solve it fully?


 On Mon, Feb 16, 2009 at 10:37 PM, David Pollak 
 feeder.of.the.be...@gmail.com wrote:



 On Mon, Feb 16, 2009 at 1:36 PM, Jorge Ortiz jorge.or...@gmail.comwrote:

 Can lift:gc be renamed lift_gc until the bug is addressed?


 lift_gc is not a valid attribute in XHTML as far as I know, so browsers
 would reject any element containing that attribute. :-(




 On Mon, Feb 16, 2009 at 9:20 AM, David Pollak 
 feeder.of.the.be...@gmail.com wrote:



 On Mon, Feb 16, 2009 at 9:04 AM, Tim Perrett he...@timperrett.comwrote:


 What's the impact overall?


 The impact is: use innerHTML directly rather than going through
 jQuery's HTML re-writing.


 Is this a result of upgrade to JQuery
 1.3.1?


 No.  This is a latent Firefox bug and has to do with how jQuery
 sanitizes HTML.  The problem existed in prior versions of jQuery, but is 
 now
 an issue because of the lift:gc stuff.




 Thanks, Tim

 On Feb 16, 4:51 pm, David Pollak feeder.of.the.be...@gmail.com
 wrote:
  Folks,
  It turns out that there are issues with jQuery's methods that
 insert/replace
  HTML and using XHTML on Firefox.  Sigh.
 
  We should be aware of this.  using $(...).html(stuff) will likely
 fail if
  any of the elements in stuff have namespaces.
 
  Sorry.
 
  David
 
  -- Forwarded message --
  From: John Resig jere...@gmail.com
  Date: Sun, Feb 15, 2009 at 8:31 PM
  Subject: [jquery-dev] Re: Namespace failure
  To: jquery-...@googlegroups.com
 
  Anko -
 
  You're welcome to file a bug on XHTML support - let me know when you
  do. I have it penciled in the Roadmap for jQuery 1.4 - but it's
 going
  to require a lot of work (basic things like innerHTML aren't
  guaranteed to work, for example) - not to mention that things like
  attributes and expandos are handled very differently.
 
  I took some very basic steps of converting our test suite to run
 under
  the proper mimetype and wasn't terribly pleased with the result
 (lots
  of failures). I'll definitely revisit it at some point, though.
 Right
  now the only component guaranteed I'm sure that passes is the
 selector
  engine. I'd like to have 100% passing in all components for 1.4.
 
  http://dev.jquery.com/browser/trunk/jquery/test/xhtml.php
 
  --John
 
  On Sun, Feb 15, 2009 at 9:24 PM, Anko Painting anko@gmail.com
 wrote:
 
   Is there a ticket associated with this bug? I'm dealing with the
 same
   issue myself.
 
   It's frustrating because i need to serve as application/xhtml+xml
 so
   that I can put svg on the page.
 
   On Feb 14, 12:52 am, John Resig jere...@gmail.com wrote:
   Correct - you have to do it with the mimetype - which forces it
 in to
   the XML mode where everything becomes 'fun'.
 
   --John
 
   On Fri, Feb 13, 2009 at 9:37 AM, David Zhou da...@nodnod.net
 wrote:
 
   http://media.nodnod.net/test.htmlworksfor me.  Is it because
 I'm not
serving the page as application/xhtml+xml?
 
-- dz
 
On Fri, Feb 13, 2009 at 9:31 AM, Dave Methvin 
 dave.meth...@gmail.com
  wrote:
 
Me too.
 
Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.9.0.6)
 Gecko/
2009011913 Firefox/3.0.6 (.NET CLR 3.5.30729)
 
  --
  Lift, the simply functional web frameworkhttp://liftweb.net
  Beginning Scalahttp://www.apress.com/book/view/1430219890
  Follow me:http://twitter.com/dpp
  Git some:http://github.com/dpp




 --
 Lift, the simply functional web framework http://liftweb.net
 Beginning Scala http://www.apress.com/book/view/1430219890

 Follow me: http://twitter.com/dpp
 Git some: http://github.com/dpp








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





 --
 Viktor Klang
 Senior Systems Analyst






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

 


--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
Lift group.
To post to this group, send email to liftweb@googlegroups.com
To unsubscribe from this group, send email to 
liftweb+unsubscr

[Lift] Re: IMPORTANT: Library Upgrades

2009-02-12 Thread Jorge Ortiz
You're right, I completely forgot about Blueprint and YUI. I'll get those
right away.

Although it seems like the latest version of Blueprint still has issues with
Opera, IE 6, and IE 5.5 (!!!). See:
http://wiki.github.com/joshuaclayton/blueprint-css/browser-compatibility-list

--j

On Thu, Feb 12, 2009 at 11:00 AM, Joachim A.
wallaby.po...@googlemail.comwrote:


 Jorge,
 thanks a lot for that (I especially like the JQuery 1.3.1 update).

 Is it possible to update to the latest blueprint css version? 0.8 was
 released
 2009-02-06. I noticed some type/font problem in Opera with the version
 shipped
 with Lift.

 Joachim

  I've upgraded the dependencies for all of the Lift components and sample
  projects. I used the latest backward-compatible version that was
 available
  on public Maven repositories. (See below for the complete list.) PLEASE
  CHECK YOUR APPS to make sure nothing breaks. You only have a couple of
  weeks to get bug reports in before our major 1.0 release.

 


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



[Lift] Re: IMPORTANT: Library Upgrades

2009-02-12 Thread Jorge Ortiz
Ok, two more upgrades. Do note that Blueprint changed it's directory layout.
If you're using the CSS.Blueprint / snippet you should be fine though.

Blueprint CSS
0.6 - 0.8

YUI
2.5.1 - 2.6.0

--j

On Thu, Feb 12, 2009 at 11:58 AM, Jorge Ortiz jorge.or...@gmail.com wrote:

 You're right, I completely forgot about Blueprint and YUI. I'll get those
 right away.

 Although it seems like the latest version of Blueprint still has issues
 with Opera, IE 6, and IE 5.5 (!!!). See:
 http://wiki.github.com/joshuaclayton/blueprint-css/browser-compatibility-list

 --j


 On Thu, Feb 12, 2009 at 11:00 AM, Joachim A. wallaby.po...@googlemail.com
  wrote:


 Jorge,
 thanks a lot for that (I especially like the JQuery 1.3.1 update).

 Is it possible to update to the latest blueprint css version? 0.8 was
 released
 2009-02-06. I noticed some type/font problem in Opera with the version
 shipped
 with Lift.

 Joachim

  I've upgraded the dependencies for all of the Lift components and sample
  projects. I used the latest backward-compatible version that was
 available
  on public Maven repositories. (See below for the complete list.) PLEASE
  CHECK YOUR APPS to make sure nothing breaks. You only have a couple of
  weeks to get bug reports in before our major 1.0 release.

 



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



[Lift] Re: Using Quaere in Scala

2009-02-05 Thread Jorge Ortiz
You may want to look at this
http://szeiger.de/blog/2008/12/21/a-type-safe-database-query-dsl-for-scala/

--j

On Thu, Feb 5, 2009 at 11:21 AM, Meredith Gregory
lgreg.mered...@gmail.comwrote:

 Scalads and lasses and Lifted,
 Does anyone have any experience with using Quaere under Scala? In
 particular, i'm wondering if anyone has already done implementations for
 flatMap, etc? This would seem a quick and relatively painless way to get
 type safety on top of a nearly LINQ implementation that lacks some type
 safety.

 Best wishes,

 --greg

 --
 L.G. Meredith
 Managing Partner
 Biosimilarity LLC
 806 55th St NE
 Seattle, WA 98105

 +1 206.650.3740

 http://biosimilarity.blogspot.com

 


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



[Lift] Fwd: [scala] Jane Street Summer Program

2009-02-02 Thread Jorge Ortiz
If you're a student, Jane Street Capital can give you money to work on
functional programming for a summer...

--j

-- Forwarded message --
From: James Iry james...@gmail.com
Date: Mon, Feb 2, 2009 at 9:36 AM
Subject: [scala] Jane Street Summer Program
To: Scala list sc...@listes.epfl.ch


This caught my eye and might be interesting to some Scalars out there.  This
year they aren't just focusing on OCaml.

=

The Jane Street Summer Project is aimed at encouraging growth in the
functional programming community by funding students over the summer to work
on open-source projects in various functional programming languages (with a
focus on our favorite language, OCaml). We do that by funding students and
faculty to work together over the summer to create software that makes it
easier for people who are using functional languages as an ends rather than
a means.

The JSSP is funded by Jane Street Capital http://janestreet.com/. We make
extensive use of OCaml at Jane Street http://ocaml.janestreet.com/, and
it's in our interest to see the FP community thrive. Plus, we think it will
be fun.

For more detailed information, check out the faq!
http://ocaml.janestreet.com/?q=node/57

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



[Lift] Re: JPA is killing me. Enumeration hell.

2009-01-22 Thread Jorge Ortiz
I don't really know much about JPA, but just a quick observation on the code
you posted:

Your code has line:
  abstract class EnumvType(val et: Enumeration with EnumTrait) extends
UserType {
whereas JPA Demo has line:
  abstract class EnumvType(val et: Enumeration with Enumv) extends UserType
{

I don't know what your EnumTrait is, or whether it might be causing the
problem, but it's worth noting.

One thing I can do is release a version of 0.10 that compiles against Scala
2.7.2 and rolls back the minor changes made to Lift to compile against
2.7.2. But I don't know how David et al feel about this.

--j

On Thu, Jan 22, 2009 at 3:16 PM, Charles F. Munat c...@munat.com wrote:


 I have an entity thus:

 @Entity
 @Table{val name = cocktails}
 class Cocktail extends BaseEntity {
   @Id
   @GeneratedValue{val strategy = GenerationType.AUTO}
   var id : Long = _

   var name : String = 

   var description : String = 

   var ingredients : String = 

   @Column{val name = file_name}
   var fileName : String = 

   @Column{val name = is_archived}
   var isArchived : Boolean = false

   @Type{val `type` = com.xxx.model.CocktailGroupType}
   @Column{val name=cocktail_group}
   var cocktailGroup: CocktailGroup.Value = CocktailGroup.Originals
 }



 Which uses this enumeration:

 object CocktailGroup extends Enumeration with Enumv {
   val Originals = Value(Originals)
   val Contemporaries = Value(Contemporaries)
   val Classics = Value(Classics)
   val Others = Value(Others)
 }

 class CocktailGroupType extends EnumvType(CocktailGroup) {}



 Which is queried thus in orm.xml:

 named-query name=findCocktailsByGroup
   query![CDATA[from Cocktail c
 where c.isArchived = false
 and c.cocktailGroup = :cocktailGroup
 order by c.name]]/query
 /named-query



 And called from CocktailOps.scala:

 120: val cocktails = Model.createNamedQuery[Cocktail](
findCocktailsByGroup,
cocktailGroup - Originals).findAll



 Using Enumv:

 trait Enumv  {

   this: Enumeration =

   private var nameDescriptionMap =
 scala.collection.mutable.Map[String, String]()

   def Value(name: String, desc: String) : Value = {
 nameDescriptionMap += (name - desc)
 new Val(name)
   }

   def getDescriptionOrName(ev: this.Value) = {
 try {
   nameDescriptionMap(+ev)
 } catch {
   case e: NoSuchElementException = ev.toString
 }
   }

   def getNameDescriptionList =  this.elements.toList.map(
 v = (v.toString, getDescriptionOrName(v) ) ).toList
 }



 And EnumvType:

 abstract class EnumvType(val et: Enumeration with EnumTrait)
   extends UserType {

   val SQL_TYPES = Array({Types.VARCHAR})

   override def sqlTypes() = SQL_TYPES

   override def returnedClass = classOf[et.Value]

   override def equals(x: Object, y: Object): Boolean = {
 return x == y
   }

   override def hashCode(x: Object) = x.hashCode

   override def nullSafeGet(resultSet: ResultSet,
names: Array[String],
owner: Object): Object = {
 val value = resultSet.getString(names(0))
 if (resultSet.wasNull()) return null
 else {
   return et.valueOf(value)
 }
   }

   override def nullSafeSet(statement: PreparedStatement,
value: Object,
index: Int): Unit = {
 if (value == null) {
   statement.setNull(index, Types.VARCHAR)
 } else {
   val en = value.toString
   statement.setString(index, en)
 }
   }

   override def deepCopy(value: Object): Object = value

   override def isMutable() = false

   override def disassemble(value: Object) =
 value.asInstanceOf[Serializable]

   override def assemble(cached: Serializable, owner: Object):
 Serializable = cached

   override def replace(original: Object,
target: Object,
owner: Object) = original

 }


 Which gets me this error:

 Exception occured while processing /drinks/

 Message: javax.persistence.PersistenceException:
 org.hibernate.PropertyAccessException: could not set a field value by
 reflection setter of com.xxx.model.Cocktail.cocktailGroup

  
 org.hibernate.ejb.AbstractEntityManagerImpl.throwPersistenceException(AbstractEntityManagerImpl.java:630)
org.hibernate.ejb.QueryImpl.getResultList(QueryImpl.java:75)
com.xxx.model.ScalaQuery.getResultList(JPA.scala:82)
com.xxx.model.ScalaQuery.findAll(JPA.scala:77)
com.xxx.snippet.CocktailOps.originals(CocktailOps.scala:120)




 I have tried everything I can think of. This used to work before the
 recent switch to 2.7.3. Can anyone spot the problem?

 Thanks. Website down. Am really screwed here.

 Chas.

 


--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
Lift group.
To post to this group, send email to liftweb@googlegroups.com
To unsubscribe from this group, send email to 

[Lift] Re: JPA is killing me. Enumeration hell.

2009-01-22 Thread Jorge Ortiz
Ahh, I see what the problem might be. There was another change to EnumvType:

Replace this line:
  return et.valueOf(value)
With this line:
  return et.valueOf(value).getOrElse(null)

I'm sorry this is causing you so much trouble Chas. I made changes to
classes in JPADemo and didn't realize they were used as template code for
other projects.

Perhaps these classes should be rolled into a lift-jpa module so that
everyone can share the same code?

--j

On Thu, Jan 22, 2009 at 3:16 PM, Charles F. Munat c...@munat.com wrote:


 I have an entity thus:

 @Entity
 @Table{val name = cocktails}
 class Cocktail extends BaseEntity {
   @Id
   @GeneratedValue{val strategy = GenerationType.AUTO}
   var id : Long = _

   var name : String = 

   var description : String = 

   var ingredients : String = 

   @Column{val name = file_name}
   var fileName : String = 

   @Column{val name = is_archived}
   var isArchived : Boolean = false

   @Type{val `type` = com.xxx.model.CocktailGroupType}
   @Column{val name=cocktail_group}
   var cocktailGroup: CocktailGroup.Value = CocktailGroup.Originals
 }



 Which uses this enumeration:

 object CocktailGroup extends Enumeration with Enumv {
   val Originals = Value(Originals)
   val Contemporaries = Value(Contemporaries)
   val Classics = Value(Classics)
   val Others = Value(Others)
 }

 class CocktailGroupType extends EnumvType(CocktailGroup) {}



 Which is queried thus in orm.xml:

 named-query name=findCocktailsByGroup
   query![CDATA[from Cocktail c
 where c.isArchived = false
 and c.cocktailGroup = :cocktailGroup
 order by c.name]]/query
 /named-query



 And called from CocktailOps.scala:

 120: val cocktails = Model.createNamedQuery[Cocktail](
findCocktailsByGroup,
cocktailGroup - Originals).findAll



 Using Enumv:

 trait Enumv  {

   this: Enumeration =

   private var nameDescriptionMap =
 scala.collection.mutable.Map[String, String]()

   def Value(name: String, desc: String) : Value = {
 nameDescriptionMap += (name - desc)
 new Val(name)
   }

   def getDescriptionOrName(ev: this.Value) = {
 try {
   nameDescriptionMap(+ev)
 } catch {
   case e: NoSuchElementException = ev.toString
 }
   }

   def getNameDescriptionList =  this.elements.toList.map(
 v = (v.toString, getDescriptionOrName(v) ) ).toList
 }



 And EnumvType:

 abstract class EnumvType(val et: Enumeration with EnumTrait)
   extends UserType {

   val SQL_TYPES = Array({Types.VARCHAR})

   override def sqlTypes() = SQL_TYPES

   override def returnedClass = classOf[et.Value]

   override def equals(x: Object, y: Object): Boolean = {
 return x == y
   }

   override def hashCode(x: Object) = x.hashCode

   override def nullSafeGet(resultSet: ResultSet,
names: Array[String],
owner: Object): Object = {
 val value = resultSet.getString(names(0))
 if (resultSet.wasNull()) return null
 else {
   return et.valueOf(value)
 }
   }

   override def nullSafeSet(statement: PreparedStatement,
value: Object,
index: Int): Unit = {
 if (value == null) {
   statement.setNull(index, Types.VARCHAR)
 } else {
   val en = value.toString
   statement.setString(index, en)
 }
   }

   override def deepCopy(value: Object): Object = value

   override def isMutable() = false

   override def disassemble(value: Object) =
 value.asInstanceOf[Serializable]

   override def assemble(cached: Serializable, owner: Object):
 Serializable = cached

   override def replace(original: Object,
target: Object,
owner: Object) = original

 }


 Which gets me this error:

 Exception occured while processing /drinks/

 Message: javax.persistence.PersistenceException:
 org.hibernate.PropertyAccessException: could not set a field value by
 reflection setter of com.xxx.model.Cocktail.cocktailGroup

  
 org.hibernate.ejb.AbstractEntityManagerImpl.throwPersistenceException(AbstractEntityManagerImpl.java:630)
org.hibernate.ejb.QueryImpl.getResultList(QueryImpl.java:75)
com.xxx.model.ScalaQuery.getResultList(JPA.scala:82)
com.xxx.model.ScalaQuery.findAll(JPA.scala:77)
com.xxx.snippet.CocktailOps.originals(CocktailOps.scala:120)




 I have tried everything I can think of. This used to work before the
 recent switch to 2.7.3. Can anyone spot the problem?

 Thanks. Website down. Am really screwed here.

 Chas.

 


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



[Lift] Re: Writing tests for actors

2009-01-19 Thread Jorge Ortiz
Hey Tim,

Testing concurrent code is an Open Problem. That said, keeping pairs of
(Message, Response) where you send an actor a Message and get a Response is
not a bad idea.

However, I see two problems with this approach. Fist, with many uses of
actors, when you send a message you don't expect a response. Second, it's
not clear whether you're not really testing the concurrency of the actors.
Actors can dead/livelock just like threads can, and often these bad states
are only observed when particular actions happen at particular times and the
scheduler just happens to cycle through actors in just the wrong order to
make everything lock up. Just like with threads, there no real good way to
-guarantee- that you've avoided these problems other than looking at your
design and going Hmmm

Since there are no guarantees, the best we can do is to stress test and
check if things break. The best approach I can think of is to test your
actors by hitting them with messages that mimic real world conditions. For
this it's best to use more actors, to simulate many things happening to your
system at the same time. You can test for correctness guarantees (after this
sequence of actions, this should be the state of the world) and for
performance guarantees (total throughput, average response time, etc).

HTH,

--j

On Fri, Jan 16, 2009 at 8:16 PM, timshawn tim.sh...@gmail.com wrote:


 Hello Lifters,

 I'm pretty new at programming with actors, and right now I am starting
 to write an app on lift for a web-based game, which uses cometactor
 and actors in general.
 I was wondering if anyone can give me advice on how to write tests for
 actors, especially testing multiple actors that interact with each
 other.
 I was thinking maybe keeping a Map where the keys are the case classes
 for messages, and the values are the valid responses/thunks that can
 contain assertions, iterating through and sending them to the actors
 under test.

 Does this sound reasonable? can you think of another way of doing it?
 How have you done it in your apps?

 Thanks!
 Tim
 


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



[Lift] Re: Can or Box or something else

2009-01-07 Thread Jorge Ortiz
You're talking about algebraic data types.

The rest of us are discussing classes and inheritance.

When someone says that a Dog is an Animal, they clearly don't mean is
isomorphic to.

--j

On Tue, Jan 6, 2009 at 6:46 PM, Tony Morris tonymor...@gmail.com wrote:


 Jorge Ortiz wrote:
  For most people, is does not always and exclusively mean
  bi-implication. You are free to think this way, if you choose,
  but please don't impose your Language Police on us.
 
  --j

 For most people, is means is isomorphic to when talking about data
 types. Furthermore, you are free to invent your own definition, but it
 is loaded with nothing more than cognitive bias. If Can is Option -
 under a (failed) definition, then Can is also List by precisely the
 same flawed method.

 Somehow, I'm not sure it is I who is missing the point.

 I had no intention of this. I'm finished. I hope Oliver has understood.


 --
 Tony Morris
 http://tmorris.net/

 S, K and I ought to be enough for anybody.






 


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



[Lift] Re: Can or Box or something else

2009-01-07 Thread Jorge Ortiz
And, by the way, squares and triangles are isomorphic (
http://en.wikipedia.org/wiki/Topological_isomorphism).

--j

On Tue, Jan 6, 2009 at 6:44 PM, Tony Morris tonymor...@gmail.com wrote:


 related to a combination of Option and Either
 I'm not sure how I am missing that point since that is exactly the
 code I provided earlier. There is no point, except to assist Oliver in
 looking passed these fancy language tricks.

 In a pragmatic and therefore, not very useful way, yes Can is like
 Option. But now that I have subverted what it means for Can to be
 like anything I'm going to propose that Can is List - it is either
 empty or has a value (right?). Let's all chime in now with our
 preferred cognitive biases now that we have lost meaning into the
 impractical infection called pragmatism.

 A square is like a triangle, but with one extra side. No wait, a
 square is a combination of four triangles. Oh actually, a square is
 like a triangle, except it is not in any way at all.

 Don't fall for it Oliver - it's a misintegration.

 --
 Tony Morris
 http://tmorris.net/

 S, K and I ought to be enough for anybody.


 Miles Sabin wrote:
  On Tue, Jan 6, 2009 at 11:23 PM, Tony Morris tonymor...@gmail.com
  wrote:
  No this is a mistake. Can is not an Option. Indeed it is (almost)
   impossible to write Can using Option (if you are familiar with
  Peano Arithmetic you will understand the need to qualify with
  almost).
 
  While you're right in a (very) narrowly technical sense you're
  missing the point that Lift's Can has functionality that is very
  closely related to a combination of Option and Either in a
  touchy-feely pragmatic getting-useful-things-actually-done sort of
  sense.
 
  To prove the point, here,
 
  http://www.milessabin.com/misc/Chain.scala
 
  is something I put together a while ago which can be used in a very
   similar way to Can (at least, I expect that's the case ... I
  haven't worked with Lift so I can't be sure) but which only exposes
  Option and Either in it's public interface. It's also sufficiently
  Monad like to get along nicely with for comprehensions.
 
  Given the likelihood of confusion between Can and Option
  (irrespective the algebraic niceties) I wish Lift had gone for
  something more like that than a rename to Box.
 
  Cheers,
 
 
  Miles
 




 


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



[Lift] Re: Can or Box or something else

2009-01-06 Thread Jorge Ortiz
It depends on what the meaning of is is.

If Option were not sealed, Can could be implemented as an Option... by
adding Failure and Empty as subclasses of None. In this (OO) sense, a Can is
an option.

In the algebraic sense, then you're probably right that a Can is not an
Option.

--j

On Tue, Jan 6, 2009 at 5:23 PM, Tony Morris tonymor...@gmail.com wrote:


 No this is a mistake. Can is not an Option. Indeed it is (almost)
 impossible to write Can using Option (if you are familiar with Peano
 Arithmetic you will understand the need to qualify with almost). There
 is an arrow from forall A. Can[A] to Option[A] but not from forall A.
 Option[A] to Can[A] (easily) - try it for yourself. To suggest that
 Can is an Option (or an Option with more features or an Either) is
 a mistake of misintegration (Peikoff DIM Hypothesis). Indeed the Can
 algebra has nothing to do with Option (except for the aforementioned
 function). There is no isomorphism between Can and Option - they are
 not the same, not even close.

 Here is a bit of code for fun. Note the bijective function using
 Either alone:

 sealed trait T[+A] {
 val e: Either[(String, T[Throwable], List[(String, Throwable)],
 Either[A, Unit]]

 // bijection to e
 val c: Can[A] = e match {
 case Left(m, e, c) = Failure(m, e,
 // Can makes the mistake of using a data constructor as a type.
 // Unfortunately Scala permits this.
 c map toFailure)
 case Right(e) = e match {
 case Left(a) = Full(a)
 case Right(_) = Empty
 }
 }
 }

 object T {
 // construct with Either or Can
 }

 --
 Tony Morris
 http://tmorris.net/

 S, K and I ought to be enough for anybody.


 David Pollak wrote:
  It's an Option.
 
  It contains a value or it doesn't. In the case that it does not
  contain a value, it may contain out of band information. This is
  not any different from None which contains information. It
  contains the information that it lacks information.
 
  Sure, you can write Option[T] as Either[T, Nothing], but the value
  of only having on type is lost.
 
  On Tue, Jan 6, 2009 at 2:59 PM, Tony Morris tonymor...@gmail.com
  mailto:tonymor...@gmail.com wrote:
 
 
  Right, that's what Oliver said and I was reinforcing it with
  deductive reasoning. It is also not Option. It is something else
  altogether. Nevertheless, an isomorphism can easily be written with
  Either alone (ignoring bottoms). So in some loose sense it is an
  Either.
 
  -- Tony Morris http://tmorris.net/
 
  S, K and I ought to be enough for anybody.
 
 
  David Pollak wrote:
  Tony,
 
  Can (now Box) is not an Either.
 
  David
 
  On Tue, Jan 6, 2009 at 2:37 PM, Tony Morris
  tonymor...@gmail.com mailto:tonymor...@gmail.com
  mailto:tonymor...@gmail.com mailto:tonymor...@gmail.com
  wrote:
 
 
  Can is not an Option and to call it so in any way is an error of
  misintegration. Indeed it would be an error to replace Option
  with
  Can - they are completely different algebras. Either is kinded *
  - * - * so cannot possible be isomorphic and cannot possibly
  have
  map, flatMap etc (though it can have a bifunctor map being
  covariant in both type arguments). However, Either.LeftProjection
  and Either.RightProjection are kinded * - * and are both
  covariant
  functors and monads, hence map, flatMap etc. are available. e.g.
  for(x - either.left) ... is valid, try it.
 
  Of mild interest, it is possible to construct an isomorphism
  to Can
  using both Either and Option. Indeed, it is possible to construct
  an isomorphism to Option using Either e.g. forall A. Option[A] ≡
  Either [Unit, A] so it is possible using Either alone. I'll
  leave both as reader exercises.
 
 
  On Dec 21 2008, 5:15 am, Oliver Lambert ola...@gmail.com
  mailto:ola...@gmail.com
  mailto:ola...@gmail.com mailto:ola...@gmail.com wrote:
  Ok so Can is not either an Either or an Option, its a Can. I
  kind of
  wondered when I first used Can, and it was described as an
  enhanced
  Option, why it wasn't called something like Option+ with
  None, Some
  and Failure.
 
  On 21/12/2008, at 5:47 AM, David Pollak wrote:
 
  Can has map, flatMap, filter etc. So it can be used in a for
  comphrension. I don't believe Either has those methods.
  Further,
  Can has a bunch of helpers to turn Empty into Failure
 
  On Dec 20, 2008 10:33 AM, Oliver Lambert ola...@gmail.com
  mailto:ola...@gmail.com
  mailto:ola...@gmail.com mailto:ola...@gmail.com wrote:
 
  Is Can a little less like Option and more like scala.Either,
  where
  the left side is used to indicate failure? On 21/12/2008, at
  1:43 AM, David Pollak wrote:  Folks,  
  Over the
  year that Lift has had Can[T...
 
 
 
 
 
  -- Lift, the simply functional web framework http://liftweb.net
  Collaborative Task Management http://much4.us Follow me:
  http://twitter.com/dpp Git some: http://github.com/dpp
 
 
 
 
 
 
 
 
 
 
  -- Lift, the simply functional web framework http://liftweb.net
  Collaborative Task Management http://much4.us Follow me:
  http://twitter.com/dpp Git some: 

[Lift] Re: Can or Box or something else

2009-01-06 Thread Jorge Ortiz
For most people, is does not always and exclusively mean bi-implication.
You are free to think this way, if you choose, but please don't impose your
Language Police on us.

--j

On Tue, Jan 6, 2009 at 5:49 PM, Tony Morris tonymor...@gmail.com wrote:


 When talking about data types is means is congruent to or is
 isomorphic to. You are not free to use is arbitrarily, since if you
 are then Can is anything I want it to be.
 Since equivalence can be broken into an implication both ways e.g. A
 - B and B - A then it is quite easy to test if Can is an Option.

 def f[A](o: Option[A]): Can[A] // this should be total and bijective
 def g[A](c: Can[A]): Option[A] // this should be total and bijective

 The use of = in function signatures means logical implication. Does
 Can imply Option? Yes (you can complete the g function). Does Option
 imply Can? No (you cannot complete the f function). Therefore, Can is
 not an Option. It was not even close (lack of totality in this test is
 catastrophic).

 If you want to try to save this notion of Well Can is a something,
 then I have already pointed out a suggestion. Try to think of others,
 but do not say that Can is an Option - it is not, not even close. Poor
 Oliver was all confuzzled when he popped this one to me the other day.

 --
 Tony Morris
 http://tmorris.net/

 S, K and I ought to be enough for anybody.


 Jorge Ortiz wrote:
  It depends on what the meaning of is is.
 
  If Option were not sealed, Can could be implemented as an
  Option... by adding Failure and Empty as subclasses of None. In
  this (OO) sense, a Can is an option.
 
  In the algebraic sense, then you're probably right that a Can is
  not an Option.
 
  --j
 
  On Tue, Jan 6, 2009 at 5:23 PM, Tony Morris tonymor...@gmail.com
  mailto:tonymor...@gmail.com wrote:
 
 
  No this is a mistake. Can is not an Option. Indeed it is (almost)
  impossible to write Can using Option (if you are familiar with
  Peano Arithmetic you will understand the need to qualify with
  almost). There is an arrow from forall A. Can[A] to Option[A] but
  not from forall A. Option[A] to Can[A] (easily) - try it for
  yourself. To suggest that Can is an Option (or an Option with more
  features or an Either) is a mistake of misintegration (Peikoff
  DIM Hypothesis). Indeed the Can algebra has nothing to do with
  Option (except for the aforementioned function). There is no
  isomorphism between Can and Option - they are not the same, not
  even close.
 
  Here is a bit of code for fun. Note the bijective function using
  Either alone:
 
  sealed trait T[+A] { val e: Either[(String, T[Throwable],
  List[(String, Throwable)], Either[A, Unit]]
 
  // bijection to e val c: Can[A] = e match { case Left(m, e, c) =
  Failure(m, e, // Can makes the mistake of using a data constructor
  as a type. // Unfortunately Scala permits this. c map toFailure)
  case Right(e) = e match { case Left(a) = Full(a) case Right(_) =
  Empty } } }
 
  object T { // construct with Either or Can }
 
  -- Tony Morris http://tmorris.net/
 
  S, K and I ought to be enough for anybody.
 
 
  David Pollak wrote:
  It's an Option.
 
  It contains a value or it doesn't. In the case that it does not
  contain a value, it may contain out of band information. This is
  not any different from None which contains information. It
  contains the information that it lacks information.
 
  Sure, you can write Option[T] as Either[T, Nothing], but the
  value of only having on type is lost.
 
  On Tue, Jan 6, 2009 at 2:59 PM, Tony Morris
  tonymor...@gmail.com mailto:tonymor...@gmail.com
  mailto:tonymor...@gmail.com mailto:tonymor...@gmail.com
  wrote:
 
 
  Right, that's what Oliver said and I was reinforcing it with
  deductive reasoning. It is also not Option. It is something else
  altogether. Nevertheless, an isomorphism can easily be written
  with
  Either alone (ignoring bottoms). So in some loose sense it is an
   Either.
 
  -- Tony Morris http://tmorris.net/
 
  S, K and I ought to be enough for anybody.
 
 
  David Pollak wrote:
  Tony,
 
  Can (now Box) is not an Either.
 
  David
 
  On Tue, Jan 6, 2009 at 2:37 PM, Tony Morris
  tonymor...@gmail.com mailto:tonymor...@gmail.com
  mailto:tonymor...@gmail.com mailto:tonymor...@gmail.com
  mailto:tonymor...@gmail.com mailto:tonymor...@gmail.com
  mailto:tonymor...@gmail.com mailto:tonymor...@gmail.com
  wrote:
 
 
  Can is not an Option and to call it so in any way is an error
  of misintegration. Indeed it would be an error to replace
  Option
  with
  Can - they are completely different algebras. Either is kinded
  * - * - * so cannot possible be isomorphic and cannot
  possibly
  have
  map, flatMap etc (though it can have a bifunctor map being
  covariant in both type arguments). However,
  Either.LeftProjection and Either.RightProjection are kinded *
  - * and are both
  covariant
  functors and monads, hence map, flatMap etc. are available.
  e.g. for(x - either.left) ... is valid, try it.
 
  Of mild

[Lift] Re: query about current status of MySQL support

2009-01-04 Thread Jorge Ortiz
I would highly recommend Aqua Data Studio

--j

On Sun, Jan 4, 2009 at 11:47 PM, Matt Harrington mbh.li...@gmail.comwrote:


 On Sun, Jan 4, 2009 at 8:14 PM, O'Rorke Paul p...@ororke.com wrote:

  An advantage of MySQL on the Mac is that there is a free, reasonably
  nice GUI database tool (CocoaMySQL).
  I could use Derby if I had a similar (preferably free) user
  interface.  There is one in NetBeans but I don't think there is one in
  eclipse.

 I think David already answered your question about MySQL, but to
 interface with Derby you just need any database utility which speaks
 JDBC.  There are several to choose from, both standalone varieties and
 Eclipse plugins such as this one:


 http://www.eclipseplugincentral.com/Web_Links-index-req-viewlink-cid-379.html

 I haven't tried that one myself though.

 I'm lead to believe that this app is popular:

 http://www.minq.se/products/dbvis/

 I personally just use the clients in NetBeans or IntelliJ IDEA.

 Matt

 


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



[Lift] Re: *** Minor breaking change *** - Lift HTTP authentication

2008-12-29 Thread Jorge Ortiz
Why Box[List[Role]] instead of just List[Role]?

Is there a semantic difference between Empty and Full(Nil)?

--j

On Mon, Dec 29, 2008 at 7:33 AM, Marius marius.dan...@gmail.com wrote:


 Hi,

 If you use so far the HTTP authentication support in Lift, you code
 would likely break. So far we could assign a single role to user by
 using userRoleRequestVar. This has been changed from:

 object userRole extends RequestVar[Box[Role]](Empty)

 to

 object userRoles extends RequestVar[Box[List[Role]]](Empty)

 In your authentication function you can say:

 userRoles(Full(AuthRole(useradmin, siteadmin))) or
 userRoles(Full(AuthRole(useradmin)))


 Br's,
 Marius
 


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



[Lift] Re: Can or Box or something else

2008-12-28 Thread Jorge Ortiz
Promise has a specific technical meaning in the context of concurrency.
See: http://en.wikipedia.org/wiki/Futures_and_promises

--j

On Sun, Dec 28, 2008 at 2:46 PM, stephen goldbaum 
stephen.goldb...@gmail.com wrote:


 One last suggestion...  Promise with Fulfilled, Empty, and Broken (my
 other suggestion of Blond, Brunette and Redhead didn't seem to make
 it...).

 


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



[Lift] Re: Fwd: [scala-announce] Scala 2.7.3 RC1

2008-12-23 Thread Jorge Ortiz
It takes a day or so for hudson to pick up new Scala releases (I think
DavidB had a bad experience with a -final release that wasn't really final),
but as soon scala-tools.org picks it up I'm on it.

--j

On Tue, Dec 23, 2008 at 11:11 AM, David Pollak 
feeder.of.the.be...@gmail.com wrote:

 Jorge,

 You on the 2.7.3 branch of Lift?

 Ideally, we can have 2.7.3 be the 0.10 release on Jan 2.

 Thanks,

 David


 -- Forwarded message --
 From: Antonio Cunei scala...@cunei.com
 Date: Tue, Dec 23, 2008 at 5:43 AM
 Subject: [scala-announce] Scala 2.7.3 RC1
 To: sc...@listes.epfl.ch, scala-annou...@listes.epfl.ch


 Just in time for Christmas, here is the first release candidate of our
 new Scala distribution: Scala 2.7.3 RC1. This new version is mainly
 intended as a maintenance release: it fixes a number of bugs and
 improves on various aspects of the existing code. There are no new
 features, however; they are being added instead to a new development
 branch, currently in its early stages, that will become the next major
 Scala release sometime next year. If no particular problems are found
 with this first release candidate, a final Scala 2.7.3 release should
 follow in a few weeks.

 You can download Scala 2.7.3.RC1, as usual, from our Download Page:
 http://www.scala-lang.org/downloads. An updated Scala plugin for
 Eclipse is also available (see http://www.scala-lang.org/node/94).

  WHAT IS NEW? -

 There are no new features, as this is essentially a maintenance release;
 however, many bug fixes and other improvements are available in this
 version, including:

  * fixes for bugs #1460, #1467, #1461, #1464, #1454,
#1382, #1374, #1402, #1379, #1375, #1241, #1263,
#1235, #547, #1404, #1390, #1329, #1329, #1367,
#1323, #1306, #1294, #1249, #508, #1206, #1267,
#1289, #1271, #998, #1232, #1167, #1315, #820,
#1083, #1257, #1264, #1358, #1514, #1541
  * fixed IntMap and LongMap.getOrElse
  * several optimisation fixes (dead-code elimination)
  * scaladoc fixes
  * deepToString fixes
  * fixed Queue.enqueue
  * ScalaSwing fixes and improvements
  * optimisation to Range.foreach (#1297)
  * fixed EOF problem with RegexParsers.phrase
  * fixed a problem with files vs. URLs on Windows.
  * fixed problem with partest-created compilers not finding
scala package.
  * fix for testing.Show on .NET
  * fixes for Windows platform
  * fixed bug where fsc sometimes fails to start
  * fix memory leak in handling GC of actors
  * remove race condition when linking/unlinking actors
  * thread pool in actor runtime now uses Thread.getState()
instead of timestamps on JVM 1.5, yielding substantial
performance improvements
  * improve actor scheduling on JVM 1.4
  * fixes to BigDecimal
  * improvements to JVM 1.4 support




 --
 Lift, the simply functional web framework http://liftweb.net
 Collaborative Task Management http://much4.us
 Follow me: http://twitter.com/dpp
 Git some: http://github.com/dpp

 


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



[Lift] Re: todo_steps feedback

2008-12-23 Thread Jorge Ortiz
 Not that I am aware of, but then I am in Australia and these days almost
 anything could be mucking about with my internet connectivity, but I
 digress...


Bit of a sore point, eh? At least in Australia they tell you about the
mucking. In the US that's all state secrets or somesuch. It's so secret
that not even the legislature or the judiciary can know about it, but I
digress...

--j

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



[Lift] Github pages

2008-12-18 Thread Jorge Ortiz
http://github.com/blog/272-github-pages

--j

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



[Lift] Re: behind the scenes with Maven?

2008-12-16 Thread Jorge Ortiz
Yup, you've about got it right.

As I understand it, Hudson uses Maven to fetch the latest code from Github,
compile, test, and deploy it. (By 'deploy' I mean: put jars, scaladocs, and
archetypes on scala-tools.org)

When commits are made to Github, it takes about an hour for changes to
appear on scala-tools.org

mvn -U forces an update. mvn (without -U) will also periodically check for
updates anyway. mvn -o forces offline (no updates) mode.

--j

On Tue, Dec 16, 2008 at 9:24 PM, Matt Harrington mbh.li...@gmail.comwrote:


 A few times over the past week, I've had something of a ghost in the
 machine with Maven.  I haven't spent the time to track things down and
 have just blown away my repository and things resolve themselves.
 However, the next time Maven acts up I want to really figure things
 out.  It'd help if I knew more about what happens behind the scenes
 with 0.10-SNAPSHOT.  Here's a guess:

 1.)  Committers upload to github.org
 2.)  A machine (named hudson maybe?) builds 0.10-SNAPSHOT from the
 github source (how often?)
 3.)  The compiled artifacts such as lift-mapper are transfered to
 scala-tools.org
 4.)  Scaladocs are built from step 3 by scala-tools.org
 5.)  The lift archetypes get updated

 Let's say that breaking changes are made in step 1.  That will only
 affect me if I run mvn -U, right?

 ---Matt

 


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



[Lift] Re: Fwd: [scala-user] Is there a memory leak in 2.7.2 Actors?

2008-12-12 Thread jorge . ortiz

Can do

On 12/12/08, David Pollak feeder.of.the.be...@gmail.com wrote:
 Folks,

 Who has time to do testing, etc. with 2.7.3?

 Thanks,

 David

 -- Forwarded message --
 From: Philipp Haller philipp.hal...@epfl.ch
 Date: Fri, Dec 12, 2008 at 6:42 AM
 Subject: Re: [scala-user] Is there a memory leak in 2.7.2 Actors?
 To: David Pollak feeder.of.the.be...@gmail.com
 Cc: scala-user scala-u...@listes.epfl.ch


 Hi again,

 FYI, I committed a fix in r16750 (2.7.x branch) and r16751 (trunk). It
 looks like we are probably releasing 2.7.3 including this fix some time
 next week (or shortly after).

 Cheers,
 Philipp


 philipp.hal...@epfl.ch wrote:
 Hi,

 I found the memory leak. A fix should be ready shortly.

 Cheers,
 Philipp


 Quoting David Pollak feeder.of.the.be...@gmail.com:

 Folks,

 I've been noticing that Lift apps run out of memory after a certain
 period of time.  This is a relatively new thing.  I think I've
 traced the problem back to a memory leak in the Actors library.  The
  enclosed program terminates with an out of memory error.

 Am I failing to release the Actors in some way or is there a memory leak?

 Thanks,

 David

 import scala.actors._
 import Actor._

 object ActorWatcher extends Actor {
   def act = loop {
 react {
   case Exit(actor: Actor, why: Throwable) =
 failureFuncs.foreach(f = f(actor, why))
   case x = println(x)
 }
   }

   private def startAgain(a: Actor, ignore: Throwable) {a.start}

   private def logActorFailure(actor: Actor, why: Throwable) {
 println(The ActorWatcher restarted +actor+ because +why)
   }

   /**
* If there's something to do in addition to starting the actor
 up, pre-pend the
* actor to this List
*/
   var failureFuncs: List[(Actor, Throwable) = Unit] = logActorFailure _
 ::
   startAgain _ :: Nil

   this.start
   this.trapExit = true
 }

 case object Start
 case object EndMe

 class A extends Actor {
 def act = loop {
 react {
 case Start =
 link(ActorWatcher)
 case EndMe =
 unlink(ActorWatcher)
 exit()
 }
 }
 }

 object Sloth {
 def z(in: Long) = if (in / 1024L == 0L) in
 else if (in / (1024L * 1024L) == 0L) (in / 1024L).toString + K
 else (in / (1024L * 1024L)).toString + M
 def main(args: Array[String]) {
 val rt = Runtime.getRuntime()
 for (o - 1 to 100) {
 println(Outer +o)
 //var a: List[Actor] = Nil
  for (i - 1 to 1) {
 val t = new A
 //a = t :: a
 t.start
 t ! Start
 t ! EndMe
 }
 println(Done creating)
 // for (act - a) act ! EndMe
 ActorGC.gc()
 rt.gc()
 println(Free +z(rt.freeMemory())+ total +z(rt.totalMemory()))
 }
 }
 }


 --
 Lift, the simply functional web framework http://liftweb.net
 Collaborative Task Management http://much4.us
 Follow me: http://twitter.com/dpp
 Git some: http://github.com/dpp







 --
 Lift, the simply functional web framework http://liftweb.net
 Collaborative Task Management http://much4.us
 Follow me: http://twitter.com/dpp
 Git some: http://github.com/dpp

 


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



[Lift] Re: maven problem - can't make ToDo example work - or even get off the ground.

2008-12-10 Thread Jorge Ortiz
You need to cd into the project directory

  cd todo

--j

On Wed, Dec 10, 2008 at 5:30 PM, mike beckerle [EMAIL PROTECTED] wrote:


 Lifters,

 I tried to follow David Pollack's ToDo example to start trying out
 lift.

 It dies on me before we even get started. I am running maven 2.0.9 on
 Ubuntu.

 Any help resolving this greatly appreciated.

 The first big mvn command succeeds:

  mvn archetype:create -U \
  -DarchetypeGroupId=net.liftweb \
 -DarchetypeArtifactId=lift-archetype-basic \
 -DarchetypeVersion=0.10-SNAPSHOT \
 -DremoteRepositories=http://scala-tools.org/repo-snapshots \
 -DgroupId=com.liftworkshop -DartifactId=todo

 The next step fails:

 mvn jetty:run

 [INFO] Scanning for projects...
 [INFO] Searching repository for plugin with prefix: 'jetty'.
 [INFO]
 
 [ERROR] BUILD ERROR
 [INFO]
 
 [INFO] The plugin 'org.apache.maven.plugins:maven-jetty-plugin' does
 not exist or no valid version could be found
 [INFO]
 
 [INFO] For more information, run Maven with the -e switch
 [INFO]
 
 [INFO] Total time:  1 second
 [INFO] Finished at: Tue Dec 09 18:54:24 EST 2008
 [INFO] Final Memory: 1M/4M
 [INFO]
 

 


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



[Lift] Re: Debugging CometActors?

2008-12-10 Thread Jorge Ortiz
Yeah, something like that :)

In the absence of props files, where does Log.error go? It's not showing up
in the console...

And even then, something is kinda funky. After my actor dies, ctrl-c won't
fully kill Jetty. I have to kill -9 it from another Terminal to make it
fully die.

--j

On Wed, Dec 10, 2008 at 9:40 PM, David Pollak [EMAIL PROTECTED]
 wrote:

 You mean like:

 object ActorWatcher extends Actor {
   def act = loop {
 react {
   case Exit(actor: Actor, why: Throwable) =
 failureFuncs.foreach(f = tryo(f(actor, why)))
   case _ =
 }
   }

   private def startAgain(a: Actor, ignore: Throwable) {a.start}

   private def logActorFailure(actor: Actor, why: Throwable) {
 Log.error(The ActorWatcher restarted +actor+ because +why, why)
   }

   /**
* If there's something to do in addition to starting the actor up,
 pre-pend the
* actor to this List
*/
   var failureFuncs: List[(Actor, Throwable) = Unit] = logActorFailure _ ::
   startAgain _ :: Nil

   this.start
   this.trapExit = true
 }


 Which CometActors link themselves to on startup?

 On Wed, Dec 10, 2008 at 7:32 PM, Jorge Ortiz [EMAIL PROTECTED]wrote:

 Is there a good way to debug CometActors? Right now if a CometActor throws
 an exception, it gets swallowed silently, kills the actor, and Lift hangs
 waiting for a response from the now-dead actor until the timeout kicks in.

 If there aren't any debug mechanisms, are there any objections to me
 committing some code that will catch exceptions thrown by the actor and
 logging them for debugging purposes?

 --j





 --
 Lift, the simply functional web framework http://liftweb.net
 Collaborative Task Management http://much4.us
 Follow me: http://twitter.com/dpp
 Git some: http://github.com/dpp

 


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



[Lift] Re: LiftRules consolidation

2008-12-09 Thread Jorge Ortiz
Seems like prime opportunity for an abstraction...

Why not make them (*gasp*) mutable data structures with prepend/append
methods?

--j

On Tue, Dec 9, 2008 at 1:35 PM, Marius [EMAIL PROTECTED] wrote:


 Hi.

 Unfortunatelly only some vars that are essentially Lists of something
 are private and prepend/append functions are exposed.

 I proposed to do this for ALL List variables.

 Br's,
 Marius
 


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



[Lift] Re: LiftRules consolidation

2008-12-09 Thread Jorge Ortiz
Hm... I can think of situations where such mutations are useful after
Boot (app/prependSnippet comes to mind). Maybe they can be made immutable
(.toList) as necessary?

--j

On Tue, Dec 9, 2008 at 2:01 PM, David Pollak
[EMAIL PROTECTED]wrote:

 And we should freeze the lists after Boot is finished.  The permutation
 methods should throw exceptions post-boot

 On Dec 9, 2008 11:39 AM, Jorge Ortiz [EMAIL PROTECTED] wrote:

 Seems like prime opportunity for an abstraction...

 Why not make them (*gasp*) mutable data structures with prepend/append
 methods?

 --j

 On Tue, Dec 9, 2008 at 1:35 PM, Marius [EMAIL PROTECTED] wrote: 
   Hi.   Unfortunatel...


 


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



[Lift] Re: LiftRules consolidation

2008-12-09 Thread Jorge Ortiz
I would use a ListBuffer as the underlying representation. I would call the
methods append and prepend (LiftRules.snippet.append,
LiftRules.dispatch.append, etc.). I would also make them immutable
as-needed. ListBuffer caches toList so that it's very efficient if you don't
append/prepend in between calls to toList.

On Tue, Dec 9, 2008 at 2:20 PM, Marius [EMAIL PROTECTED] wrote:


 I'm not sure if this is the case ... if we want context dependent
 Snippets then probably using loc snippets is the right place

 How about something like:

 abstract class RulesSeq[T] {
  var rules : List[T] = Nil

  private def safe_?(f : = Any) {
doneBoot match {
  case false = f
  case _ = throw new IllegalStateException(Can not modify after
 boot.);
}
  }

  def prependRule(r: T) {
safe_? {
  rules = r :: rules
}
  }

  def appendRule(r: T) {
safe_? {
  rules = rules ::: List(r)
}
  }
 }

 Br's,
 marius

 On Dec 9, 10:12 pm, Jorge Ortiz [EMAIL PROTECTED] wrote:
  Hm... I can think of situations where such mutations are useful after
  Boot (app/prependSnippet comes to mind). Maybe they can be made immutable
  (.toList) as necessary?
 
  --j
 
  On Tue, Dec 9, 2008 at 2:01 PM, David Pollak
  [EMAIL PROTECTED]wrote:
 
   And we should freeze the lists after Boot is finished.  The permutation
   methods should throw exceptions post-boot
 
   On Dec 9, 2008 11:39 AM, Jorge Ortiz [EMAIL PROTECTED] wrote:
 
   Seems like prime opportunity for an abstraction...
 
   Why not make them (*gasp*) mutable data structures with prepend/append
   methods?
 
   --j
 
   On Tue, Dec 9, 2008 at 1:35 PM, Marius [EMAIL PROTECTED]
 wrote: 
 Hi.   Unfortunatel...
 


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



[Lift] Re: How does lift wrap the templates

2008-12-06 Thread Jorge Ortiz
Try:

  case badger :: Nil = Left(() = demo)

An Either[A, B] means it can be either a Left[A] or a Right[B].

--j

On Sat, Dec 6, 2008 at 12:35 PM, Tim Perrett [EMAIL PROTECTED] wrote:


 Sorry, the code should have been:

 object ExampleLoader {
  def template: LiftRules.ViewDispatchPF = {
 case badger :: Nil = () = demo
  }

  def demo: Can[NodeSeq] = Full(html/html)

 }


 [INFO]  found   : () = net.liftweb.util.Can[scala.xml.NodeSeq]
 [INFO]  required: Either[() = net.liftweb.util.Can
 [scala.xml.NodeSeq],net.liftweb.http.LiftView]
 [INFO] case badger :: Nil = () = demo
 [INFO]^



 Cheers, Tim
 


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



[Lift] Re: Record small paradigm shift

2008-12-02 Thread Jorge Ortiz
  class Foo

  // type is singleton type Bar.type
  object Bar extends Foo {
def exc = (new Exception).printStackTrace
  }

  // type is structural type Foo{def exc: Unit}
  val Baz = new Foo {
def exc = (new Exception).printStackTrace
  }

  // compare:
  Bar.exc
  Baz.exc

Singleton types get their own .class file. Structural types use reflection.

--j

On Tue, Dec 2, 2008 at 12:33 PM, Alex Boisvert [EMAIL PROTECTED] wrote:

 On Tue, Dec 2, 2008 at 10:24 AM, Jorge Ortiz [EMAIL PROTECTED]wrote:

 If you add (non-overriden) fields to a val, they'll always be invoked via
 reflection, which takes a performance hit. Objects, on the other hand,
 define their own class so reflection isn't necessary.


 Can you give an example?  I can't picture this from your description.

 alex


 


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



[Lift] Re: Record small paradigm shift

2008-12-02 Thread Jorge Ortiz
I agree. Fields should be perfectly functional by just overriding members.
But it should be mentioned in docs, etc as Lift best practices to not add
methods or fields inside of Fields.

--j

On Tue, Dec 2, 2008 at 1:01 PM, Marius [EMAIL PROTECTED] wrote:


 Quite right ... still I don't quite see why someone would use a Field
 as structural type (.. or as anonymous instance) and define new -
 overridden functions and invoke them later. Field should only override
 functions  to adapt the behavior for the needed situation.

 Nevertheless it is a very good observation !

 Br's,
 Marius

 On Dec 2, 8:51 pm, Jorge Ortiz [EMAIL PROTECTED] wrote:
class Foo
 
// type is singleton type Bar.type
object Bar extends Foo {
  def exc = (new Exception).printStackTrace
}
 
// type is structural type Foo{def exc: Unit}
val Baz = new Foo {
  def exc = (new Exception).printStackTrace
}
 
// compare:
Bar.exc
Baz.exc
 
  Singleton types get their own .class file. Structural types use
 reflection.
 
  --j
 
  On Tue, Dec 2, 2008 at 12:33 PM, Alex Boisvert [EMAIL PROTECTED]
 wrote:
   On Tue, Dec 2, 2008 at 10:24 AM, Jorge Ortiz [EMAIL PROTECTED]
 wrote:
 
   If you add (non-overriden) fields to a val, they'll always be invoked
 via
   reflection, which takes a performance hit. Objects, on the other hand,
   define their own class so reflection isn't necessary.
 
   Can you give an example?  I can't picture this from your description.
 
   alex
 


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



[Lift] Re: Compile problems with lift

2008-12-01 Thread Jorge Ortiz
It might be the type checker getting confused.

Try:

  val models: List[MetaMapper] = List(User, Game, GameUser, Hull, Ship,
StarSystem)

You can also call schemify with:

  Schemifier.schemify(true, Log.infoF _, models :_*)

Instead of the foreach stuff

--j

On Mon, Dec 1, 2008 at 3:44 PM, Juha L [EMAIL PROTECTED] wrote:


 I'm not sure whether it is just me, but I seem to be stumbling on the
 Scala compiler exceptions whatever I do. First there was one when
 creating specs that I mailed earlier, and now I get compile problems
 when I changed Boot-class.

 I have changed Boot-class as follows. Idea is to allow different
 database based on runlevel and also cleaning up the tables when doing
 tests. I have tried to change models to List[KeyedMapper[Any, Any]]
 but then I just get different set of exceptions. If I expand models by
 hand to schemify and cleanTables, it works just fine. Should I just
 send report to scala lang -list or am I doing something wrong?

 class Boot {
  def database = (org.apache.derby.jdbc.EmbeddedDriver,
 jdbc:derby:liftdb_+Props.mode.toString.toLowerCase+;create=true)

  def dbVendor = new ConnectionManager {
def newConnection(name: ConnectionIdentifier): Can[Connection] = {
  try {
val (driver, databaseString) = database
Class.forName(driver)
Full(DriverManager.getConnection(databaseString))
  } catch {
case e : Exception = e.printStackTrace; Empty
  }
}
def releaseConnection(conn: Connection) {conn.close}
  }

  val models = List(User, Game, GameUser, Hull, Ship, StarSystem)

  def schemify {
models foreach {
  m = Schemifier.schemify(true, Log.infoF _, m)
}
  }

  def cleanTables {
models foreach {
  m = m.bulkDelete_!!()
}
  }

  def boot {
Log.info(Running boot at runmode + Props.mode)
if (!DB.jndiJdbcConnAvailable_?) DB.defineConnectionManager
 (DefaultConnectionIdentifier, dbVendor)

Props.mode match {
  case Props.RunModes.Development =
schemify
  case Props.RunModes.Test =
schemify
cleanTables
  case _ =
}
 ...


 I get this kind of stack trace:

 [WARNING] Exception in thread main java.lang.OutOfMemoryError: Java
 heap space
 [WARNING]   at scala.tools.nsc.util.HashSet.growTable
 (HashSet.scala:58)
 [WARNING]   at scala.tools.nsc.util.HashSet.addEntry(HashSet.scala:
 41)
 [WARNING]   at scala.tools.nsc.symtab.Types$class.unique
 (Types.scala:2221)
 [WARNING]   at scala.tools.nsc.symtab.Types$class.mkThisType
 (Types.scala:1910)
 [WARNING]   at scala.tools.nsc.symtab.SymbolTable.mkThisType
 (SymbolTable.scala:12)
 [WARNING]   at scala.tools.nsc.symtab.Symbols$ClassSymbol.thisType
 (Symbols.scala:1540)
 [WARNING]   at scala.tools.nsc.symtab.Types$class.copyRefinedType
 (Types.scala:1986)
 [WARNING]   at scala.tools.nsc.symtab.SymbolTable.copyRefinedType
 (SymbolTable.scala:12)
 [WARNING]   at scala.tools.nsc.symtab.Types$TypeMap.mapOver
 (Types.scala:2324)
 [WARNING]   at scala.tools.nsc.symtab.Types$AsSeenFromMap.apply
 (Types.scala:2708)
 [WARNING]   at scala.tools.nsc.symtab.Types$AsSeenFromMap.apply
 (Types.scala:2575)
 [WARNING]   at scala.tools.nsc.symtab.Types$TypeMap.mapOver
 (Types.scala:2343)
 [WARNING]   at scala.tools.nsc.symtab.Types$AsSeenFromMap.apply
 (Types.scala:2708)
 [WARNING]   at scala.tools.nsc.symtab.Types$Type.asSeenFrom
 (Types.scala:399)
 [WARNING]   at scala.tools.nsc.symtab.Types$Type.memberType
 (Types.scala:429)
 [WARNING]   at scala.tools.nsc.symtab.Types$Type.findMember
 (Types.scala:696)
 [WARNING]   at scala.tools.nsc.symtab.Types$Type.nonPrivateMember
 (Types.scala:378)
 [WARNING]   at scala.tools.nsc.symtab.Types$$anonfun$29.apply
 (Types.scala:3984)
 [WARNING]   at scala.tools.nsc.symtab.Types$$anonfun$29.apply
 (Types.scala:3983)
 [WARNING]   at scala.List.map(List.scala:805)
 [WARNING]   at scala.tools.nsc.symtab.Types$class.lubsym$1
 (Types.scala:3983)
 [WARNING]   at scala.tools.nsc.symtab.Types$$anonfun$31.apply
 (Types.scala:4015)
 [WARNING]   at scala.tools.nsc.symtab.Types$$anonfun$31.apply
 (Types.scala:4010)
 [WARNING]   at scala.List.foreach(List.scala:834)
 [WARNING]   at scala.tools.nsc.symtab.Types$class.lub0$1
 (Types.scala:4010)
 [WARNING]   at scala.tools.nsc.symtab.Types$class.lub(Types.scala:
 4034)
 [WARNING]   at scala.tools.nsc.symtab.SymbolTable.lub
 (SymbolTable.scala:12)
 [WARNING]   at scala.tools.nsc.symtab.Types$$anonfun$41.apply
 (Types.scala:4180)
 [WARNING]   at scala.tools.nsc.symtab.Types$$anonfun$41.apply
 (Types.scala:4171)
 [WARNING]   at scala.List$.map2(List.scala:326)
 [WARNING]   at scala.tools.nsc.symtab.Types
 $class.mergePrefixAndArgs(Types.scala:4170)
 [WARNING]   at
 scala.tools.nsc.symtab.SymbolTable.mergePrefixAndArgs
 (SymbolTable.scala:12)

 


--~--~-~--~~~---~--~~
You received this message 

[Lift] Re: Upgrading to Manifest[C] from Class[C]

2008-11-28 Thread Jorge Ortiz
Oops... forgot I was working on a branch.

Pushed now.

--j

On Thu, Nov 27, 2008 at 11:38 PM, Marius [EMAIL PROTECTED] wrote:


 Nice ! ... is this committed anywhere?

 On Nov 28, 4:57 am, Jorge Ortiz [EMAIL PROTECTED] wrote:
  Folks,
 
  First, I've deprecated the containsClass method in ClassHelpers. It was
 only
  being used once in the entire Lift codebase, and it was basically
 equivalent
  to a very short call to List.exists. If you're using containsClass and
 have
  some objection to using List.exists instead, let me know and I'll
  undeprecate it, but otherwise I see no good reason to keep it around.
 
  Second, I've updated some of the stuff in net.liftweb.util to take
 advantage
  of Scala's new Manifests, which provide a cleaner interface. The older
  methods using Class[C] should still be there and work as they did before.
 
  For example, Cans have an isA method that takes a Class and returns a
 Full
  can if the contents of the Can can be cast to that class, or Empty
  otherwise. To illustrate:
 
abstract class Base
case object Derived extends Base
case object Incompatible extends Base
 
Ful(Derived).isA(classOf[Base]) // returns a Full[Base]
Full(Derived).isA(classOf[Incompatible]) // returns an Empty
Empty.isA(classOf[Base])  // returns Empty
 
  The new method is called asA, and has a sligtly different (cleaner)
  interface:
 
Full(Derived).asA[Base] // returns a Full[Base]
Full(Derived).asA[Incompatible] // returns an Empty
Empty.asA[Base] // returns an Empty
 
  Likewise, the findClass methods in ClassHelpers take a Class[C] to which
 the
  found class must conform. There are now new findType methods which don't
  require the Class[C], just a type annotation. So instead of:
 
findClass(name, where, classOf[CometActor])
 
  You can now do:
 
findType[CometActor](name, where)
 
  There were some methods private to Lift that I migrated as well, but
 those
  shouldn't affect your apps.
 
  Thanks,
 
  --j
 


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



[Lift] Upgrading to Manifest[C] from Class[C]

2008-11-27 Thread Jorge Ortiz
Folks,

First, I've deprecated the containsClass method in ClassHelpers. It was only
being used once in the entire Lift codebase, and it was basically equivalent
to a very short call to List.exists. If you're using containsClass and have
some objection to using List.exists instead, let me know and I'll
undeprecate it, but otherwise I see no good reason to keep it around.

Second, I've updated some of the stuff in net.liftweb.util to take advantage
of Scala's new Manifests, which provide a cleaner interface. The older
methods using Class[C] should still be there and work as they did before.

For example, Cans have an isA method that takes a Class and returns a Full
can if the contents of the Can can be cast to that class, or Empty
otherwise. To illustrate:

  abstract class Base
  case object Derived extends Base
  case object Incompatible extends Base

  Ful(Derived).isA(classOf[Base]) // returns a Full[Base]
  Full(Derived).isA(classOf[Incompatible]) // returns an Empty
  Empty.isA(classOf[Base])  // returns Empty

The new method is called asA, and has a sligtly different (cleaner)
interface:

  Full(Derived).asA[Base] // returns a Full[Base]
  Full(Derived).asA[Incompatible] // returns an Empty
  Empty.asA[Base] // returns an Empty

Likewise, the findClass methods in ClassHelpers take a Class[C] to which the
found class must conform. There are now new findType methods which don't
require the Class[C], just a type annotation. So instead of:

  findClass(name, where, classOf[CometActor])

You can now do:

  findType[CometActor](name, where)

There were some methods private to Lift that I migrated as well, but those
shouldn't affect your apps.

Thanks,

--j

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



[Lift] Testing for well-formed XML

2008-11-26 Thread Jorge Ortiz
Folks,

One of the concerns raised at the Lift Workshop on Saturday was that
ill-formed XML files in your templates will fail at run time instead of
compile time, often with cryptic errors.

To correct for this, I've added a simple test to lift-archetype-basic and
lift-archetype-blank that will test all *.html and *.xml files in your
src/main/webapp directory (and its subdirectories) to make sure they can all
be loaded by Scala's XML parser. If they can't be loaded the test will fail
and notify you which files couldn't be loaded and why.

These tests run during Maven's 'test' phase. This phase is required before
the 'package', 'install', or 'deploy' phases can run. Unfortunately, the
'jetty:run' phase only requires 'test-compile', not 'test'. If you want the
test to run before starting Jetty, you'll have to specify it manually: 'mvn
test jetty:run' (or 'mvn install jetty:run', etc).

The test is available on any new projects created with Lift's archetypes. To
add the test to your own project, the code is included below. It's a simple
JUnit test. If you used a previous version of the archetypes to start your
project, you can throw it into AppTest.scala

Enjoy,

--j


  /**
   * Tests to make sure the project's XML files are well-formed.
   *
   * Finds every *.html and *.xml file in src/main/webapp (and its
   * subdirectories) and tests to make sure they are well-formed.
   */
  def testXml() = {
var failed: List[java.io.File] = Nil

def wellFormed(file: java.io.File) {
  if (file.isDirectory)
for (f - file.listFiles) wellFormed(f)

  if (file.isFile  (file.getName.endsWith(.html) ||
file.getName.endsWith(.xml))) {
try {
  scala.xml.XML.loadFile(file)
} catch {
  case e: org.xml.sax.SAXParseException = failed = file :: failed
}
  }
}

wellFormed(new java.io.File(src/main/webapp))

val numFails = failed.size
if (numFails  0) {
  val fileStr = if (numFails == 1) file else files
  val msg = Malformed XML in  + numFails +   + fileStr + :  +
failed.mkString(, )
  println(msg)
  fail(msg)
}
  }

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



[Lift] Re: Testing for well-formed XML

2008-11-26 Thread Jorge Ortiz
Oops, it just test *.htm and *.xhtml files as well. Updated code below.

--j

  /**
   * Tests to make sure the project's XML files are well-formed.
   *
   * Finds every *.html and *.xml file in src/main/webapp (and its
   * subdirectories) and tests to make sure they are well-formed.
   */
  def testXml() = {
var failed: List[java.io.File] = Nil

def handled(file: String) =
  file.endsWith(.html) || file.endsWith(.xml) ||
  file.endsWith(.htm)  || file.endsWith(.xhtml)

def wellFormed(file: java.io.File) {
  if (file.isDirectory)
for (f - file.listFiles) wellFormed(f)

  if (file.isFile  handled(file.getName)) {
try {
  scala.xml.XML.loadFile(file)
} catch {
  case e: org.xml.sax.SAXParseException = failed = file :: failed
}
  }
}

wellFormed(new java.io.File(src/main/webapp))

val numFails = failed.size
if (numFails  0) {
  val fileStr = if (numFails == 1) file else files
  val msg = Malformed XML in  + numFails +   + fileStr + :  +
failed.mkString(, )
  println(msg)
  fail(msg)
}
  }


On Wed, Nov 26, 2008 at 4:58 PM, Jorge Ortiz [EMAIL PROTECTED] wrote:

 Folks,

 One of the concerns raised at the Lift Workshop on Saturday was that
 ill-formed XML files in your templates will fail at run time instead of
 compile time, often with cryptic errors.

 To correct for this, I've added a simple test to lift-archetype-basic and
 lift-archetype-blank that will test all *.html and *.xml files in your
 src/main/webapp directory (and its subdirectories) to make sure they can all
 be loaded by Scala's XML parser. If they can't be loaded the test will fail
 and notify you which files couldn't be loaded and why.

 These tests run during Maven's 'test' phase. This phase is required before
 the 'package', 'install', or 'deploy' phases can run. Unfortunately, the
 'jetty:run' phase only requires 'test-compile', not 'test'. If you want the
 test to run before starting Jetty, you'll have to specify it manually: 'mvn
 test jetty:run' (or 'mvn install jetty:run', etc).

 The test is available on any new projects created with Lift's archetypes.
 To add the test to your own project, the code is included below. It's a
 simple JUnit test. If you used a previous version of the archetypes to start
 your project, you can throw it into AppTest.scala

 Enjoy,

 --j


   /**
* Tests to make sure the project's XML files are well-formed.
*
* Finds every *.html and *.xml file in src/main/webapp (and its
* subdirectories) and tests to make sure they are well-formed.
*/
   def testXml() = {
 var failed: List[java.io.File] = Nil

 def wellFormed(file: java.io.File) {
   if (file.isDirectory)
 for (f - file.listFiles) wellFormed(f)

   if (file.isFile  (file.getName.endsWith(.html) ||
 file.getName.endsWith(.xml))) {
 try {
   scala.xml.XML.loadFile(file)
 } catch {
   case e: org.xml.sax.SAXParseException = failed = file :: failed
 }
   }
 }

 wellFormed(new java.io.File(src/main/webapp))

 val numFails = failed.size
 if (numFails  0) {
   val fileStr = if (numFails == 1) file else files
   val msg = Malformed XML in  + numFails +   + fileStr + :  +
 failed.mkString(, )
   println(msg)
   fail(msg)
 }
   }



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



[Lift] Re: JsCmd

2008-11-25 Thread Jorge Ortiz
You're almost there. The second parameter to ajaxCheckbox is a function that
gets called on the server when the checkbox changes:

  SHtml.ajaxCheckbox(thing.isActive, (toggled: Boolean) =
{thing.setActive(toggled); Noop})

The Noop is needed because ajaxCheckbox expects a Boolean = JsCmd function.
(I can't find a good reason for it needing a JsCmd though... Shouldn't it
just be Boolean = Any or better yet Boolean = Unit?) Howver, you can
replace thing.setActive(toggled) with whatever code you want to run when
the checkbox is toggled. Here, toggled contains the state of the checkbox.

Likewise ajaxSelect:

  val daysOfWeek = List(Monday, Tuesday, Wednesday, Thursday,
Friday,
Saturday, Sunday).map(x = (x, x))
  SHtml.ajaxSelect(daysOfWeek, Full(Monday), (opt: String) =
{thing.setDayOfWeek(opt); Noop})

The second parameter is the default value. The opt in the third parameter
will correspond to the selected day.

--j

On Tue, Nov 25, 2008 at 4:11 AM, Charles F. Munat [EMAIL PROTECTED] wrote:


 I want to update an attribute on a model object in the database via AJAX
 when a checkbox is clicked on a page. I presume that ajaxCheckbox is for
 this purpose.

 Can anyone quickly give me an example of how it works?

 If I have an attribute called isActive, how would I create an
 ajaxCheckbox that would call a method on the server when the checkbox is
 clicked to set isActive to true or false, depending on the state of the
 checkbox after the click?

 bind(mine, xhtml,
   isActive - SHtml.ajaxCheckbox(thing.isActive, ???)

 What about selecting the day of the week from an ajaxSelect and updating
 dayOfWeek. Or, finally, updating a text field on blur and setting the
 user_name.

 Examples would really help.

 I am pretty desperate to have this done today, and several hours of
 playing with various combinations has left me befuddled. Doesn't help
 that it's 4 AM.

 Any and all help very greatly appreciated.

 Thanks,
 Chas.

 


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



[Lift] Re: JsCmd

2008-11-25 Thread Jorge Ortiz
And David beat me to it... Oh well :)

On Tue, Nov 25, 2008 at 5:04 AM, Jorge Ortiz [EMAIL PROTECTED] wrote:

 You're almost there. The second parameter to ajaxCheckbox is a function
 that gets called on the server when the checkbox changes:

   SHtml.ajaxCheckbox(thing.isActive, (toggled: Boolean) =
 {thing.setActive(toggled); Noop})

 The Noop is needed because ajaxCheckbox expects a Boolean = JsCmd
 function. (I can't find a good reason for it needing a JsCmd though...
 Shouldn't it just be Boolean = Any or better yet Boolean = Unit?) Howver,
 you can replace thing.setActive(toggled) with whatever code you want to
 run when the checkbox is toggled. Here, toggled contains the state of the
 checkbox.

 Likewise ajaxSelect:

   val daysOfWeek = List(Monday, Tuesday, Wednesday, Thursday,
 Friday,
 Saturday, Sunday).map(x = (x, x))
   SHtml.ajaxSelect(daysOfWeek, Full(Monday), (opt: String) =
 {thing.setDayOfWeek(opt); Noop})

 The second parameter is the default value. The opt in the third parameter
 will correspond to the selected day.

 --j


 On Tue, Nov 25, 2008 at 4:11 AM, Charles F. Munat [EMAIL PROTECTED] wrote:


 I want to update an attribute on a model object in the database via AJAX
 when a checkbox is clicked on a page. I presume that ajaxCheckbox is for
 this purpose.

 Can anyone quickly give me an example of how it works?

 If I have an attribute called isActive, how would I create an
 ajaxCheckbox that would call a method on the server when the checkbox is
 clicked to set isActive to true or false, depending on the state of the
 checkbox after the click?

 bind(mine, xhtml,
   isActive - SHtml.ajaxCheckbox(thing.isActive, ???)

 What about selecting the day of the week from an ajaxSelect and updating
 dayOfWeek. Or, finally, updating a text field on blur and setting the
 user_name.

 Examples would really help.

 I am pretty desperate to have this done today, and several hours of
 playing with various combinations has left me befuddled. Doesn't help
 that it's 4 AM.

 Any and all help very greatly appreciated.

 Thanks,
 Chas.

 



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



[Lift] Re: Error on compile with 2.7.2

2008-11-18 Thread Jorge Ortiz
Anytime the compiler throws an exception it's a bug and should be filed.

On Tue, Nov 18, 2008 at 3:23 PM, Charles F. Munat [EMAIL PROTECTED] wrote:


 One would think so, and maybe it is, but the problem was actually caused
 by two errors in my code: a missing ) and then later an extra ) which
 turned what should have been a compile time error into a runtime error.

 That said, do you think there is a problem with the compiler?

 Chas.

 Jorge Ortiz wrote:
  That's a bug in the Scala compiler.
 
  Try to comment out code and reduce the bug to it's minimal form to file
  a bug report: http://lampsvn.epfl.ch/trac/scala/
 
  --j
 
  On Tue, Nov 18, 2008 at 2:44 PM, Charles F. Munat [EMAIL PROTECTED]
  mailto:[EMAIL PROTECTED] wrote:
 
 
  I changed the Scala version to 2.7.2, blew away .m2, did an mvn
 clean,
  and I now get the error below when I try to compile. I note that none
 of
  the files concerned are in my app, so I presume this is a Lift
 thing...
 
  Any ideas? I'll keep messing with it.
 
  [INFO] [compiler:compile]
  [INFO] Nothing to compile - all classes are up to date
  [INFO] [scala:compile {execution: default}]
  [INFO] suggestion: remove the scalaVersion from pom.xml
  [INFO] Compiling 28 source files to
  /private/var/www/mine/mine-app/target/classes
  [WARNING] Exception in thread main
  java.lang.ArrayIndexOutOfBoundsException: 30
  [WARNING]   at
  scala.tools.nsc.ast.TreeGen.mkTuple(TreeGen.scala:227)
  [WARNING]   at
  scala.tools.nsc.typechecker.Infer$class.actualArgs(Infer.scala:62)
  [WARNING]   at
  scala.tools.nsc.Global$analyzer$.actualArgs(Global.scala:284)
  [WARNING]   at
 
 scala.tools.nsc.typechecker.Typers$Typer.doTypedApply(Typers.scala:1733)
  [WARNING]   at
 
 scala.tools.nsc.typechecker.Typers$Typer$$anonfun$tryTypedApply$1$1.apply(Typers.scala:2566)
  [WARNING]   at
 
 scala.tools.nsc.typechecker.Typers$Typer$$anonfun$tryTypedApply$1$1.apply(Typers.scala:2566)
  [WARNING]   at
  scala.tools.nsc.typechecker.Typers$Typer.silent(Typers.scala:588)
  [WARNING]   at
 
 scala.tools.nsc.typechecker.Typers$Typer.tryTypedApply$1(Typers.scala:2566)
  [WARNING]   at
 
 scala.tools.nsc.typechecker.Typers$Typer.typedApply$1(Typers.scala:2617)
  [WARNING]   at
  scala.tools.nsc.typechecker.Typers$Typer.typed1(Typers.scala:3219)
  [WARNING]   at
  scala.tools.nsc.typechecker.Typers$Typer.typed(Typers.scala:3323)
  [WARNING]   at
  scala.tools.nsc.typechecker.Typers$Typer.typedArg(Typers.scala:1621)
  [WARNING]   at
 
 scala.tools.nsc.typechecker.Typers$Typer.typedArgToPoly$1(Typers.scala:1789)
  [WARNING]   at
 
 scala.tools.nsc.typechecker.Typers$Typer$$anonfun$27.apply(Typers.scala:1798)
  [WARNING]   at
 
 scala.tools.nsc.typechecker.Typers$Typer$$anonfun$27.apply(Typers.scala:1798)
  [WARNING]   at scala.List$.map2(List.scala:326)
  [WARNING]   at
 
 scala.tools.nsc.typechecker.Typers$Typer.doTypedApply(Typers.scala:1798)
  [WARNING]   at
 
 scala.tools.nsc.typechecker.Typers$Typer.typedApply$1(Typers.scala:2619)
  [WARNING]   at
  scala.tools.nsc.typechecker.Typers$Typer.typed1(Typers.scala:3219)
  [WARNING]   at
  scala.tools.nsc.typechecker.Typers$Typer.typed(Typers.scala:3323)
  [WARNING]   at
  scala.tools.nsc.typechecker.Typers$Typer.typedArg(Typers.scala:1621)
  [WARNING]   at
 
 scala.tools.nsc.typechecker.Typers$Typer$$anonfun$typedArgs$1.apply(Typers.scala:1624)
  [WARNING]   at
 
 scala.tools.nsc.typechecker.Typers$Typer$$anonfun$typedArgs$1.apply(Typers.scala:1624)
  [WARNING]   at scala.List$.loop$1(List.scala:293)
  [WARNING]   at scala.List$.mapConserve(List.scala:310)
  [WARNING]   at scala.List$.loop$1(List.scala:297)
  [WARNING]   at scala.List$.mapConserve(List.scala:310)
  [WARNING]   at scala.List$.loop$1(List.scala:297)
  [WARNING]   at scala.List$.mapConserve(List.scala:310)
  [WARNING]   at scala.List$.loop$1(List.scala:297)
  [WARNING]   at scala.List$.mapConserve(List.scala:310)
  [WARNING]   at scala.List$.loop$1(List.scala:297)
  [WARNING]   at scala.List$.mapConserve(List.scala:310)
  [WARNING]   at scala.List$.loop$1(List.scala:297)
  [WARNING]   at scala.List$.mapConserve(List.scala:310)
  [WARNING]   at scala.List$.loop$1(List.scala:297)
  [WARNING]   at scala.List$.mapConserve(List.scala:310)
  [WARNING]   at scala.List$.loop$1(List.scala:297)
  [WARNING]   at scala.List$.mapConserve(List.scala:310)
  [WARNING]   at scala.List$.loop$1(List.scala:297)
  [WARNING]   at scala.List$.mapConserve(List.scala:310)
  [WARNING]   at scala.List$.loop$1(List.scala:297)
  [WARNING]   at scala.List$.mapConserve(List.scala:310

[Lift] [ANN] Lift nightlies upgraded to Scala 2.7.2

2008-11-17 Thread Jorge Ortiz
I've just upgraded Lift's trunk to work with the newest release of Scala
(2.7.2), Specs (1.4.0), and Scalacheck (1.5). These changes are available in
the source code immediately, and should be reflected in the binaries posted
to http://scala-tools.org/repo-snapshots/ in about an hour or so. Use Lift
0.10-SNAPSHOT for compatibility with Scala 2.7.2.

There should be no breaking changes to source code that uses Lift. As always
with new Scala releases, binary incompatibilities will exist. You should
clean out any binaries compiled with Scala 2.7.1 and recompile with Scala
2.7.2. For existing Lift projects using 0.10-SNAPSHOT, this means updating
the relevant line in your pom.xml file to
read scala.version2.7.2/scala.version, then running 'mvn clean install'.

Lift projects that use Specs or Scalacheck may be subject to breaking
changes, as those APIs have changed.

This upgrade should greatly improve Lift's compatibility with the Scala
plugins for Eclipse, NetBeans, and IntelliJ IDEA.

Please report any issues to the Lift mailing list (liftweb@googlegroups.com
).

Thanks,

--j

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



[Lift] Re: SHtml form inputs and attributes/labels

2008-11-17 Thread Jorge Ortiz
Try:

SHtml.text(user.name, user.name = _) %
  (size, 24) %
  (maxlength, 48) %
  (id, user_name) %
  (title, Enter your name)

That should work.

--j

On Mon, Nov 17, 2008 at 12:21 PM, Charles F. Munat [EMAIL PROTECTED] wrote:


 I spend a lot of time writing % new UnprefixedAttribute(...) to add
 attributes to SHtml form elements (input, textarea, select, etc.).

 It would be nice if the relevant SHtml methods would permit optional
 extra parameters in the form of tuples where contents are name-value
 pairs that get translated to attributes. I don't think this would be a
 breaking change.

 In other words, instead of:

 SHtml.text(user.name, user.name = _) %
   new UnprefixedAttribute(size, 24,
 new UnprefixedAttribute(maxlength, 48,
   new UnprefixedAttribute(id, user_name,
 new UnprefixedAttribute(title, Enter your name, Null)
   )
 )
   )

 I could do:

 SHtml.text(user.name, user.name = _,
   (size, 24),
   (maxlength, 48),
   (id, user_name),
   (title, Enter your name)
 )

 Which is a hell of a lot cleaner and faster, and I don't have to import
 UnprefixedAttribute and remember the % and the new keywords.

 Or is this already possible and I'm missing it?

 I have an online survey with 43 questions on 5 pages involving more than
 150 database fields. The snippet is already over 700 lines and growing.
 It's just unmanageable.

 Another thing: the label element is a very important part of
 accessibility to persons with disabilities, but it needs a for
 attribute that references the id attribute of the input element (or
 textarea, etc.). The current SHtml output (unlike Rails) does not
 generate an id attribute, so they have to be added by hand. Has anyone
 given any thought to automatically-generated id elements on form fields?
 Better yet, some way to integrate labels?

 Ideally, I would do something like this:

 survey:name label=Your name/

 Or this:

 survey:nameYour name/survey:name

 and bind would allow me to generate this:

 label for=id123Your name
 input type=text id=id123 value= name=F1226951216428645000_I0G/
 /label

 What do others think? Is this already possible?

 Chas.

 


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



[Lift] Re: Recommended tools ?

2008-11-15 Thread Jorge Ortiz
To search the wiki, I suggest using using the site:liftweb.net keyword in
google. That will search all pages within liftweb.net
We should probably change the wiki search to do that automatically. The
built-in MediaWiki search is pathetic anyway.

--j

On Sat, Nov 15, 2008 at 8:53 AM, Oscar Picasso [EMAIL PROTECTED]wrote:

 Hi,

 Which tools would you recommend to work for a lift project, and more
 generally with scala?
 The requirement being that the project also uses maven.

 I have tried the Eclipse plugin a number of times and I found it too
 unstable.

 The last Intellij IDEA plugin is decent, I was considering switching to
 IDEA. Howver I ran lately in some issues. The more important being that if I
 define implicits somewhere their containing folder keep loading... forever.

 I could use emacs but I would like some pretty formatting, code completion
 and error checking.

 On a scala list post I read David P. explaining that there are a number of
 decent tools to work with lift. Which ones?

 BTW: the lift wiki search does not work. It always returns a *No such
 special page*.

 Oscar

 


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



[Lift] Re: Concatenating lists of nodes

2008-11-13 Thread Jorge Ortiz
A NodeSeq is really just a Seq[Node]. And a List[Node] is also a Seq[Node].
Hence a List[Node] is a NodeSeq.
scala import scala.xml.NodeSeq
import scala.xml.NodeSeq
scala val n: NodeSeq = List(spanA/span, spanB/span, spanC/span)
n: scala.xml.NodeSeq = spanA/spanspanB/spanspanC/span

--j

On Thu, Nov 13, 2008 at 10:14 AM, Charles F. Munat [EMAIL PROTECTED] wrote:


 If I have a list thus:

 List(spanA/span,spanB/span,spanC/span)


 How can a get a NodeSeq thus from this:

 spanA/spanspanB/spanspanC/span


 I'm sure this is drop-dead simple, but it's still not obvious to me...

 Thanks,

 Chas.

 


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



[Lift] Olio

2008-11-13 Thread Jorge Ortiz
There's a new Apache Incubator project called Olio:

Olio is a is a web2.0 toolkit to help evaluate the suitability,
functionality and performance of web technologies. Olio defines an example
web2.0 application ( an events site somewhat like yahoo.com/upcoming) and
provides three initial implementations : PHP, Java EE and RubyOnRails (ROR).
The toolkit also defines ways to drive load against the application in order
to measure performance.

We encourage alternate implementations of the application by either
completely re-writing the application using a different language (say
python), higher-level frameworks (such as CakePHP http://cakephp.org/)

Anyone interested in taking a stab at a Lift implementation of this?

--j

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



[Lift] Re: Latest NetBeans plugin and NB 6.5 RC2 is wicked great

2008-11-07 Thread Jorge Ortiz
Lift on 2.7.2 works just fine as of RC3.

I unfortunately haven't been keeping up with the flurry of RCs. What RC is
the Eclipse plugin currently released against? I can update the branch of
Lift tracking 2.7.2 to that RC.

But whenever 2.7.2 is released (any day now *crosses fingers*) Lift will
upgrade as soon as possible.

--j

On Fri, Nov 7, 2008 at 11:21 AM, Miles Sabin [EMAIL PROTECTED] wrote:


 On Fri, Nov 7, 2008 at 6:31 PM, Tim Perrett [EMAIL PROTECTED] wrote:
  Out of interest - what's going on with the eclipse support these days?
  Is netbeans superior for scala? Or should I just stick to command line
  and textmate?

 I'm subscribed to this list, so if there are Lift specific problems I
 should see them fairly promptly.

 My understanding is that Lift on 2.7.2 is still a work in progress, so
 seeing as the Eclipse plugin requires 2.7.2 it might be early days for
 that combination.

 As ever I'm keen to make the Lift and Eclipse experience as pain free
 as possible, but as ever I need help from the Lift community. Please
 try Lift with 2.7.2 and Eclipse and get your feedback to me (tho'
 obviously generic 2.7.2 non-Eclipse issues should go to the EPFL Trac
 as usual).

 Cheers,


 Miles

 --
 Miles Sabin
 tel:+44 (0)1273 720 779
 mobile: +44 (0)7813 944 528
 skype:  milessabin

 


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



[Lift] Re: PayPal Example Application

2008-11-07 Thread Jorge Ortiz
I've renamed the PayPalIPN trait to PaypalIPN.

Macs have unfortunate issues with case sensitive file names. The generated
.class files for the PayPalIPN trait were clashing with the PaypalIPN
singleton.

I've also renamed the PayPalPDT trait to PaypalPDT for consistency.

--j

On Fri, Nov 7, 2008 at 9:51 AM, Dano [EMAIL PROTECTED] wrote:


 I have been working with David Pollak on example code which exercises
 the Lift paypal library.  This exercise is a prelude to using the
 paypal library within buyafeature.com to allow customers to pay for
 playing private Buy A Feature games.

 The code for this example can be downloaded from
 http://tunaforcats.com/paypal-example.tar.

 The main touchpoints in the paypal library are the PayPalPDT and
 PayPalIPN objects.

 The PayPalPDT object supports the Payment Data Transfer transaction
 processing.  This process is illustrated by the diagram available at

 https://www.paypal.com/en_US/i/IntegrationCenter/scr/scr_ppPDTDiagram_513x282.gif
 and further described at
 https://www.paypal.com/IntegrationCenter/ic_pdt.html
 (you will need to sign up for a developer account to see this and
 other paypal URLs – go to developer.paypal.com to get a developer
 account - it's free).  Step 4  in the diagram triggers a call to
 pdtResponse function.  This is where you can receive all of the
 details about the transaction your user completed using PayPal.

 The PayPalIPN object supports Instant Payment Notification
 processing.  This process is illustrated by the diagram at

 https://www.paypal.com/en_US/i/IntegrationCenter/scr/scr_ppIPNDiagram_555x310.gif
 and further described at
 https://www.paypal.com/IntegrationCenter/ic_ipn.html.
 This allows for asynchronous notification of the payment separate from
 the PDT flow above.  Step 4 in the diagram triggers a call to the
 PayPalIPN actions function.

 Going to the paypal example code, in Boot.scala you will see objects
 created for both PDT and IPN processing.  BAFOPayPalPDT utilizes the
 PayPalPDT trait to redirect the user to a particular page in the
 sample application.  BAFOPayIPN utilizes the PayPalIPN trait to
 capture the paypal transaction information and persist it in the
 database.

 The classes I am using to persist to the paypal transaction to the
 database are borrowed from Fowler's Account pattern.  Basically there
 is an AccountTransaction which represents the paypal transaction.  The
 Account class in this example is being used to represent an inventory
 of 'game credits' which are available to the user in advance of
 playing a game.  The credit (or debit) from an account is represented
 by the AccountEntry class.  All of these classes are housed within
 model directory within the paypal example.

 The paypal example is driven by logging into the application and going
 to the 'Account Admin' page.  This page allows you to manage a set of
 accounts (create, view, edit, delete).  Once you create an account,
 you 'buy' credits by selecting the 'view' link associated with an
 existing account.  This will bring you a page which shows a familiar
 looking 'Buy Now' button.  This is the button which triggers the
 paypal flow described above.  It will debit from the paypal buyer
 account you specify and credit to the merchant account you have
 previously setup.  Also, for this to work, you will need to be logged
 into your developer paypal account (details below).

 After going thru the paypal process, you should end up at the account
 admin page where you can look to see if the account was credited.  You
 can also go to developer.paypal.com to see if your buyer account was
 debited and your merchant account was credited.

 Running the Example

 In order to bring up your lift app, do the following:

 0) Extract file files from the paypal-example tarball to a location to
 your liking.  The top-level directory should be called paypal-example.

 1) Create developer paypal account – Go to developer.paypal.com and
 hit the Sign Up Now button

 2) Create merchant and buyer accounts - Go to Test Accounts and
 create the merchant/buyer accounts using the Preconfigured link.

 3) Stay logged into your developer account – this is required for the
 paypal integration to work with your lift app.

 4) Setup your properties file – in the src/main/resources directory
 there is a file called default.props.  Copy this file to
 username.props where username is the OS user you are logged in as
 when you run the lift app.   You will need to follow the instructions
 in the top comment section, fill in the paypal.authToken and specify
 the paypal.ipnHost property with your host and path (i.e.
 http://hostname.com:port).

 5) Build and run – go to the paypal-example directory and run mvn
 jetty:run

 Thanks to David for helping me to get this to work.  Please let us
 know if you have questions or suggestions.  There is probably a lot
 more that could be done with the example to improve it or make it
 easier to understand.


 Dan

 



[Lift] Re: MIME Types?

2008-10-22 Thread Jorge Ortiz
Yeah, that's a really bad backwards incompatibility, but fortunately the fix
is fairly easy:

  SHtml.submit(Submit, println(here))

I'd encourage you to stay on SNAPSHOT. The APIs might suffer a little
instability (that are always announced to the mailing list) but there are
several in-production sites on SNAPSHOT, so the code itself is pretty rock
solid.

--j

On Wed, Oct 22, 2008 at 12:16 AM, tacobandit [EMAIL PROTECTED] wrote:


 David,

 I appreciate the response. It was very helpful. Your suspicions were
 right, and this is not an issue for me in the current SNAPSHOT.

 However, given the instability of the SNAPSHOT I'm not sure this does
 me much good. I can't figure out any workarounds to apparent bugs
 which I would are show stoppers. For example, both
 SHtml.Submit(Submit, () = println(here))  and
 SHtml.Submit(Submit, x = println(here)) silently don't do
 anything. Which is fine, I mean I don't expect the snapshot to be
 stable. But what might I do? Would 0.8 work for me? Or should I
 *shudder* use a less scala friendly framework until Lift is ready?

 Eric

 


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



[Lift] Re: MIME Types?

2008-10-22 Thread Jorge Ortiz
On Wed, Oct 22, 2008 at 1:28 AM, tacobandit [EMAIL PROTECTED] wrote:


 Jorge,

 Awesome thanks. I guess that should have been obvious to me looking at
 the docs if I knew Scala better? The method signature was = Any..
 which i took to mean a Function0 which I tried to do as () = xyz.
 But obviously I read it wrong...


This, unfortunately, is a tricky one for even experienced users of Scala.
Anything you could throw at it conforms to = Any. What = T means is,
give me a T, but I promise not to evaluate it until I need it. In this
case, give me an Any, but I promise not to evaluate it until I need it.
This makes it safe to pass in a println and know that it won't get
evaluated until it's needed.

On the flipside, you can also pass in an expression that makes a Function0.
In this case, evaluating the expression means -making- the Function0, not
-executing- it, which is the bug you were seeing.

I don't mind sticking with the latest and greatest, especially if it's
 proven stable. But one thing that seems missing from my hunting is a
 thorough example site, that I can pretty much refer to for all the
 basics.. Is the code for demo.liftweb.net available? Or something
 similar? That's updated in tandem with the framework? I think that
 could keep me from spinning my wheels on some of these things like the
 Submit trick..


Yes, there certainly is. Check out liftweb/sites in the git repository.
There are several sample Lift sites, including demo.liftweb.net (which is
liftweb/sites/example I believe).

Happy Lifting!

--j

On Oct 22, 12:36 am, Jorge Ortiz [EMAIL PROTECTED] wrote:
  Yeah, that's a really bad backwards incompatibility, but fortunately the
 fix
  is fairly easy:
 
SHtml.submit(Submit, println(here))
 
  I'd encourage you to stay on SNAPSHOT. The APIs might suffer a little
  instability (that are always announced to the mailing list) but there are
  several in-production sites on SNAPSHOT, so the code itself is pretty
 rock
  solid.
 
  --j
 
  On Wed, Oct 22, 2008 at 12:16 AM, tacobandit [EMAIL PROTECTED]
 wrote:
 
   David,
 
   I appreciate the response. It was very helpful. Your suspicions were
   right, and this is not an issue for me in the current SNAPSHOT.
 
   However, given the instability of the SNAPSHOT I'm not sure this does
   me much good. I can't figure out any workarounds to apparent bugs
   which I would are show stoppers. For example, both
   SHtml.Submit(Submit, () = println(here))  and
   SHtml.Submit(Submit, x = println(here)) silently don't do
   anything. Which is fine, I mean I don't expect the snapshot to be
   stable. But what might I do? Would 0.8 work for me? Or should I
   *shudder* use a less scala friendly framework until Lift is ready?
 
   Eric

 


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



[Lift] Re: Lifecycle of a Lift Snippet Class

2008-10-22 Thread Jorge Ortiz
To add to Derek's explanation, if you want to keep some server-side state
that gets updated with AJAX calls, take a look at some of the stuff in
liftweb/sites/example. You can use a SessionVar (as in Count.scala) or a
StatefulSnippet (as in CountGame.scala or ArcChallenge.scala).

--j

On Wed, Oct 22, 2008 at 1:27 PM, didi [EMAIL PROTECTED] wrote:


 Hello,

 im Playing around with Lift Snippets and die Ajax Examples provided in
 the Demo.
 I've learned from the FAQ the a Snippet default lives for a request
 time.

 Now i have following Ajax example:

 class HelloFormAjax {
  def sample = {
var cnt = 0

span
{
  a(() = {cnt = cnt + 1; SetHtml(cnt_id, Text( cnt.toString))},
  spanClick me to increase the count
 (currently span id='cnt_id'0/span)/span)
}/span
  }
 }

 Here is what i observed using Java Remote Debugger connecting my
 Eclipse to Jetty:

 The cnt = 0 expression is executed once a request (Reload of the
 Browser Page).

 Now I wonder where the cnt var lives during the Ajax calls.

 Thanks
 Christian

 


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



[Lift] Re: Lift Scala 2.7.2-rc3

2008-10-21 Thread Jorge Ortiz
Sasha,

I've been sitting on a bunch of unpushed commits to the RC3 branch. Due to a
bug in GitHub, the lift twitter stream gets awfully spammed every time I do
a push. I've been meaning to push in the middle of the night when some
twitter spam hopefully won't be as annoying, but keep forgetting.

I'll set a reminder and push the changes around midnight PST tonight.

RC1 and RC2 should work fine though.

--j

On Tue, Oct 21, 2008 at 2:49 PM, Sasha Kazachonak [EMAIL PROTECTED]wrote:

 Hi lifters!

 Seems like scala-2.7.2.RC3 lift source branch isn't compatible with scala
 2.7.2.RC3. When I changed scala.version to 2.7.2-rc3 in 
 pom.xmlhttp://github.com/dpp/liftweb/tree/scala-2.7.2.RC3/pom.xmland 
 changed line 42 of CometActor like said
 therehttp://groups.google.com/group/liftweb/browse_thread/thread/f235c4c38c54e756/06a024f6c05b6f69I
  was able to build it.
 


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



[Lift] Re: addDispatchBefore case matching 4 times per request

2008-10-19 Thread Jorge Ortiz
It's a Scala gotcha, unfortunately.

Anything you put in the matching part of a pattern matching expression
should be side-effect free. (Side effects are things like printing to
screen, writing to files, changing a database, changing global state, etc.)
Because of the way the compiler optimizes pattern matching expressions, it
can't guarantee that they'll only be run once.

Your second approach is the right one. Put all side-effecting expressions in
the body of the pattern match.

--j

On Sun, Oct 19, 2008 at 2:31 AM, Tim Perrett [EMAIL PROTECTED] wrote:


 Thats strange. changing the code to:

LiftRules.addDispatchBefore {
  case r @ RequestState(paypal:: ipn :: Nil, , PostRequest)
 = () = {
PaypalIPN(r)
Full(XmlResponse(complete /))
  }
}

 and then it only gets called once. Very strange - why does it do that?

 Cheers

 Tim
 


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



[Lift] Re: JPA questions (was Re: SnippetFailure)

2008-10-15 Thread Jorge Ortiz
Derek,

With the upcoming release of 2.7.2, you can update all this classOf[T] stuff
to use scala.reflect.Manifest[T], which handles all that stuff for you
almost automagically.

I've been meaning to blog about this, but haven't found the time. The short
example is:

  def find[A](id: Any)(implicit m: scala.reflect.Manifest[A]) =
em.find[A](m.erasure, id).asInstanceOf[A]

Which can be invoked as:

  val user = find[User](userId)

The compiler will fill in the implicit Manifest parameter for you. Manifest
represents a Scala type. You can test two Manifests for subtype and
supertype relationships. You can also call erasure on a Manifest to get
the Java Class corresponding to the runtime erasure of that type.

Manifests are undocumented and experimental, so proceed with caution.
Eventually they'll be the backbone of a native Scala reflection API (yay!)

--j

On Tue, Oct 14, 2008 at 6:13 PM, Derek Chen-Becker [EMAIL PROTECTED]wrote:

 You can just do Model.find(classOf[User], userId) and the type on the
 method will be inferred. Any time you see a Class[A] parameter, it wants the
 result of a classOf[...].

 Derek

 On Tue, Oct 14, 2008 at 5:52 PM, Charles F. Munat [EMAIL PROTECTED] wrote:


 A question from the JPADemo...

 How does one use this:

 def find[A](clazz: Class[A], id: Any) =
   em.find[A](clazz, id).asInstanceOf[A]

 If I have a User model and I want to use find on the EntityManager, what
 goes where the *** is below:

 val user = Model.find[User]( ***, userId)

 Thanks,

 Chas.



 


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



[Lift] Re: A stupid question

2008-10-15 Thread Jorge Ortiz
Also check out CanSpec.scala to get an idea of how Cans can be used.

--j

On Wed, Oct 15, 2008 at 9:33 AM, David Pollak [EMAIL PROTECTED] wrote:

  Charles,

 A Can is a container... it can contain a thing or be empty.

 You can transform the contents of a Can from one thing to another using
 map().  map() on Can, Option, List is exactly the same as map() on Array in
 Ruby:
 irb(main):004:0 [1,2,3].map{|v| v.to_s +  Cats}
 = [1 Cats, 2 Cats, 3 Cats]

 This is just like in Scala:
 scala List(1,2,3).map(v = v.toString +  Cats)
 res0: List[java.lang.String] = List(1 Cats, 2 Cats, 3 Cats)

 In Ruby, when you access the first element of an Array that has no
 elements, you get 'nil' back.  In Scala, you get an exception.  This allows
 you to tell the difference between [nil][0] and [][0] which are the same in
 Ruby.

 The most syntactically pleasing way of extracting things from List, Can,
 Option in Scala is the for comprehension:

 scala for (a - Some(3);
  |b - Some(4)) yield a * b
 res1: Option[Int] = Some(12)


 Does that help?

 Thanks,

 David




 Charles F. Munat wrote:

 Thanks. I have read everything I could find on this but I think I'm just
 a bit dense about it. Probably, it's just unfamiliarity with the syntax
 of Scala as a whole and functional programming in general (or maybe I'm
 just stupid). Hopefully, at some point the light bulb will come on and
 this will seem easy. I'll read the blog post.

 Chas.

 David Pollak wrote:


  Please also 
 see:http://blog.lostlake.org/index.php?/archives/50-The-Scala-Option-class-and-how-lift-uses-it.html

 Can[T] is just like Option[T]

 Marius wrote:


  to get stuff out of a can you can do:

 1. Pattern matching

 having c a Can[String]

 c match {
   case Full(value) = //do something with the value
   case _ =
 }

 2. call open_!(if you're sure your can is not empty) or openOr

 Br's,
 Marius

 On Oct 15, 3:22 am, Charles F. Munat [EMAIL PROTECTED] [EMAIL 
 PROTECTED] wrote:



  I must be very dense, but these cans are kicking my butt (kicking my
 can?). No matter what I do, I seem to end up with everything back in the
 can! I just... want... to get... the goodies... OUT!

 An example:

 How do I extract the URI of the current page from S.request?

 I am currently doing something immensely stupid and wrong like this:

 S.request.toList.head.location.toList.head.createDefaultLink.toList.head.text

 I *know* this is way wrong, but I'm not clever enough, apparently, to
 figure out the puzzle, despite reading through the Can code repeatedly.
 I figure the above works only because what I'm looking for is there,
 which sort of defeats the purpose of the cans...

 Can anyone help? This is driving me insane.

 Chas.





 


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



[Lift] Re: Welcome Derek to the Lift committers

2008-10-06 Thread Jorge Ortiz
Awesome!

On Mon, Oct 6, 2008 at 10:12 AM, David Pollak [EMAIL PROTECTED]
 wrote:

 Folks,

 Derek Chen-Becker has just joined the Lift committers.  One might ask What
 took so long?  Derek's been an awesome contributor to the Lift community
 for more than a year and it's good to see that he's going to be contributing
 the the Lift codebase.

 Woo Hoo and Welcome.

 Thanks,

 David

 --
 Lift, the simply functional web framework http://liftweb.net
 Collaborative Task Management http://much4.us
 Follow me: http://twitter.com/dpp
 Git some: http://github.com/dpp

 


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



[Lift] Re: Simple Build Tool

2008-10-05 Thread Jorge Ortiz
I don't see a downside to providing an alternative build system to people
who are very Maven-averse (as long as I don't have to maintain it!, heh)

But yeah, replacing Maven at this point seems unwise, unless there are very
compelling reasons.

--j

On Sun, Oct 5, 2008 at 12:15 PM, David Pollak [EMAIL PROTECTED]
 wrote:



 On Sun, Oct 5, 2008 at 10:59 AM, Tim Perrett [EMAIL PROTECTED] wrote:


 Guys,

 Check this out:

 http://code.google.com/p/simple-build-tool/

 It appeared a couple of days ago - im wondering if its something we
 could customize to make starting lift projects easier? Its all written
 in scala so should be easily extendable.


 I am very reluctant to introduce an additional build system to Lift.  If
 this tool is built on top of the Maven infrastructure but uses Scala files
 to define build rules rather than using XML, I'm interested in learning
 more.  If it's yet another build tool... well...




 I need to take a better look, but thought id float the idea

 Cheers

 Tim






 --
 Lift, the simply functional web framework http://liftweb.net
 Collaborative Task Management http://much4.us
 Follow me: http://twitter.com/dpp
 Git some: http://github.com/dpp

 


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



[Lift] Re: Dates from database

2008-10-04 Thread Jorge Ortiz
A MappedDateTime wraps a java.util.Date, just like a MappedInt wraps an Int.

There is an implicit conversion that automatically turns MappedDateTime into
a Date, or you can invoke it directly by using the is method.

--j

On Sat, Oct 4, 2008 at 1:47 PM, Charles F. Munat [EMAIL PROTECTED] wrote:


 If I have a MappedDateTime column in the database, how do I format the
 date and/or time when it comes back from the database? There don't seem
 to be any examples of this in the example sites.

 I have a dateFormatter, but it takes an instance of java.util.Date, I
 think. How do I convert the date/time as output by the mapper into
 something I can format? Did I miss this in the code somewhere?

 Thanks.

 Chas.

 


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



[Lift] Re: Please Welcome Al Thompson to the Lift committers

2008-10-02 Thread Jorge Ortiz
Awesome! Welcome, Al.

--j

On Thu, Oct 2, 2008 at 5:14 PM, David Pollak
[EMAIL PROTECTED]wrote:

 Folks,

 I've know Al Thompson for longer than any of the other Lift committers.
 Cast you mind back to '97... I was doing crazy things with browser-based,
 multi-user spreadsheets.  Al was my technical liaison at Sun.  Now I'm doing
 Lift.  Al is joining the Scala and Lift communities.  He's offered to help
 out with the RDBMS drivers.

 So, welcome Al and I'm looking forward to cool things from you.

 Thanks,

 David

 --
 Lift, the simply functional web framework http://liftweb.net
 Collaborative Task Management http://much4.us
 Follow me: http://twitter.com/dpp
 Git some: http://github.com/dpp

 


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



[Lift] Re: [ANN] Compiling Lift with Scala 2.7.2.RC2 and Eclipse Plugin

2008-09-25 Thread Jorge Ortiz
Can you try the 1.5 branch of Git?

(Is anyone else getting this problem?)

--j

On Thu, Sep 25, 2008 at 2:40 PM, DavidV [EMAIL PROTECTED] wrote:


 I'm using the latest version - 1.6.0.2 for windows.  I got it from
 this website:
 http://code.google.com/p/msysgit/downloads/list

 I figured it was OK since all the versions are listed as Beta...

 


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



[Lift] [ANN] Compiling Lift with Scala 2.7.2.RC2 and Eclipse Plugin

2008-09-24 Thread Jorge Ortiz
DISCLAIMER Nothing is this e-mail is meant to imply that any future public
version of Lift will compile with Scala 2.7.2. At the moment, all future
public versions of Lift will compile with Scala 2.7.1 until DavidP says
otherwise. /DISCLAIMER

Here are the instructions for compiling Lift under Scala 2.7.2.RC2 and
(optionally) working with the RC2 release of the Eclipse plugin.

You will need to compile Lift from source.

These instructions were tested with:
  java -version
java version 1.5.0_13
Java(TM) 2 Runtime Environment, Standard Edition (build
1.5.0_13-b05-237)
Java HotSpot(TM) Client VM (build 1.5.0_13-119, mixed mode, sharing)

  mvn -version
Maven version: 2.0.8
Java version: 1.5.0_13
OS name: mac os x version: 10.5.4 arch: i386 Family: unix

  git --version
git version 1.5.5

  (optional)
  Eclipse SDK Classic
Version: 3.4.0
Build id: I20080617-2000

  Eclipse Scala Plugin
2.7.2.RC2

#1 Acquire Lift source
(If you already have Lift's Git repository, skip to step 2)
Execute:
  git clone git://github.com/dpp/liftweb.git

#2 Make sure your Lift source is up-to-date
Execute:
  cd liftweb
  git checkout master
  git pull

#3 Check out Lift's Scala 2.7.2.RC2 branch
  git checkout --track -b scala-2.7.2.RC2 origin/scala-2.7.2.RC2

#4 Install Lift without tests
  mvn clean install -Dmaven.test.skip=true
(Tests must be skipped because Scala Specs is not yet compatible with
2.7.2.RC2)

You should know have a lift-webkit-0.10-SNAPSHOT.jar in your local Maven
repository.
Any Maven projects depending on Lift 0.10-SNAPSHOT in Maven will compile
with the 2.7.2.RC2 version.
This means you need to update the scala.version in the pom.xml file of those
Maven projects to 2.7.2-rc2

If you want to go back to using the 2.7.1 version of Lift 0.10-SNAPSHOT,
there are two ways you could do that:
  1) Delete Lift 0.10-SNAPSHOT from your local Maven repository. The next
time you need Lift 0.10-SNAPSHOT, Maven will download it from the public
scala-tools.org repository. THE PUBLIC VERSION OF LIFT 0.10-SNAPSHOT WILL
CONTINUE TO COMPILE WITH SCALA 2.7.1
  2) Alternatively, execute:
git checkout master
mvn clean install

OPTIONAL
Instructions for using Eclipse with the 2.7.2.RC2 version of Lift

#5 Download and install Eclipse Classic version = 3.4 from
http://www.eclipse.org/downloads/

#6 Install Scala Eclipse Plugin version 2.7.2.RC2 with instructions from
http://www.scala-lang.org/node/94

#7 Set your Eclipse M2_REPO environment variable to the directory of your
local Maven repository
  Eclipse -- Preferences -- Java -- Build Path -- Classpath Variables
-- New
Name: M2_REPO
Path: Location of your local Maven repository (usually ~/.m2/repository)

#8 Prepare your Lift project for Eclipse
In the directory for the Lift project you want to import into Eclipse
(whether a project that depends on Lift 0.10-SNAPSHOT or Lift 0.10-SNAPSHOT
itself), execute:
  mvn eclipse:eclipse

#9 Import project into Eclipse
  File -- Import -- General -- Existing Projects Into Workspace
Then select the root directory of the project you wish to import
(WARNING: If you're importing the Lift project itself, be careful. Lift is
made up of many sub-projects. Import them one at a time. If you try to
import them all at the same time, Eclipse may crash.)
/OPTIONAL

Enjoy,

--j

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



[Lift] Re: Lift Wiki search issues

2008-09-21 Thread Jorge Ortiz

You can use Google to get better search results, just add
site:liftweb.net to your query (without the quotes) to restrict the
search to the wiki.

For example, a query for site:liftweb.net many-to-many yields the following:

http://www.google.com/search?q=site%3Aliftweb.net+many-to-many

Maybe we can make this the default search in the wiki, instead of the
crappy built-in one?

--j

On Sun, Sep 21, 2008 at 1:44 AM, Charles F. Munat [EMAIL PROTECTED] wrote:

 There are some things that are impossible to find on the wiki because
 the words are too common and are apparently on the stop-words list.
 Example: the following page discusses many-to-many relationships (and
 includes those words on the page):

 http://liftweb.net/index.php/HowTo_setup_composite_keys

 (Thanks, Martin.)

 But a search for many-to-many yields no results. This has happened to me
 many times with different search phrases. I *know* something's there,
 but I can't find it.

 Is there a way to alter the stop-words list? Maybe we can optimize it
 for the types of searches likely to occur on the Lift wiki.

 Chas.

 


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



[Lift] Re: Source file encoding ...

2008-09-21 Thread Jorge Ortiz
But does it still test what the test is intended to test?

--j

On Sun, Sep 21, 2008 at 11:20 AM, David Pollak
[EMAIL PROTECTED] wrote:
 If we do the \u encoding thing, the test will still be valid.

 On Sun, Sep 21, 2008 at 11:18 AM, Marius [EMAIL PROTECTED] wrote:

 I think it is reasonable to comment out this test until a better
 solution can be found. ... or perhaps we can just save this file as
 UTF-8 and not ASCII.. and yet this willl most likely be overwritten as
 someone would change this file in an editor that automatically saves
 source code as ASCII ... so kind of risky.

 Br's,
 Marius

 On Sep 21, 8:52 pm, Jorge Ortiz [EMAIL PROTECTED] wrote:
  well, heh, so the relevant test is:
 
  encode a string replacing non-ASCII characters by their unicode
  value in {
niña.encJs must_== 'ni\\u00f1a'
  }
 
  --j
 
  On Sun, Sep 21, 2008 at 3:46 AM, Marius [EMAIL PROTECTED] wrote:
 
   What if we use \u notation? ... it should work. (but I don;t know
   the hex code of this char)
 
   Br's,
   Marius
 
   On Sep 21, 12:21 pm, Jorge Ortiz [EMAIL PROTECTED] wrote:
   2.7.2 is throwing an exception on this and failing to compile lift's
   tests.
 
   I dug around and it seems that the character that's getting barfed is
   the n-with-tilde (ñ) at line 164 of StringHelpersSpec.scala
 
   Anyone know how to address this issue?
 
   --j
 
   On Sat, Sep 13, 2008 at 6:39 AM, David Pollak [EMAIL PROTECTED]
   wrote:
 
Yeah... I get that.  I figured it was part of Eric's tests.
 
Marius wrote:
Is anyone seeing this?
 
IO error while decoding
/media/WORK/marius/workspace/lift/liftweb-
framework/src/test/scala/net/liftweb/util/StringHelpersSpec.scala
with
UTF-8
Please try specifying another one using the -encoding option
 
Br's,
Marius




 --
 Lift, the simply functional web framework http://liftweb.net
 Collaborative Task Management http://much4.us
 Follow me: http://twitter.com/dpp
 Git some: http://github.com/dpp

 


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



[Lift] Re: JPA and enumerations

2008-09-20 Thread Jorge Ortiz

On Sat, Sep 20, 2008 at 9:14 AM, Oliver Lambert [EMAIL PROTECTED] wrote:

 I need this too so I might have a go at implementing it. Does lift persist
 enumerations (cant see a mapper it)

There's a MappedEnum class in MappedInt.scala

--j

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



[Lift] Re: Deprecations / compilation failure on 0.10-SNAPSHOT

2008-09-17 Thread Jorge Ortiz

Kris,

There were no changes to the 'bind' function. What changed was the way
in which BindParams (which bind takes as arguments) are generated.

The deprecated code for generating BindParams (using --) is on lines
123-156 of BindHelpers.scala

The new code for generating BindParams (using -) is on lines 158-203
of BindHelpers.scala

In both cases you'll need to import Helpers._ or BindHelpers._ to get
the relevant implicits

What error messages do you see when using -?

--j

On Wed, Sep 17, 2008 at 2:53 PM, Kris Nuttycombe
[EMAIL PROTECTED] wrote:

 Hi, all,

 I noticed this in the BindHelpers code:

 #   /**
 #* This class creates a BindParam from an input value
 #*
 #* @deprecated use - instead
 #*/
 #   @deprecated
 #   class BindParamAssoc(val name: String) {
 # def --(value: String): BindParam = TheBindParam(name, Text(value))
 # def --(value: NodeSeq): BindParam = TheBindParam(name, value)
 # def --(value: Symbol): BindParam = TheBindParam(name, Text(value.name))
 # def --(value: Any): BindParam = TheBindParam(name, Text(if
 (value == null) null else value.toString))
 # def --(func: NodeSeq = NodeSeq): BindParam = FuncBindParam(name, func)
 # def --(value: Can[NodeSeq]): BindParam = TheBindParam(name,
 value.openOr(Text(Empty)))
 #   }

 and so dutifully modified my code to use -, but I'm having trouble
 finding a version of bind() that this works with. I assumed that it
 would be in BindHelpers, but didn't find a bind() that was appropriate
 (at least, Helpers.bind(...) didn't work when called.)

 I'm using the usual signature of bind(prefix, xhtml, foo - ...,
 bar - ...).

 This brings up a related question; I decided to create some implicit
 defs that would wrap my model objects appropriately such that I could
 just call myModelObject.bind(xhtml) within whatever snippet I am
 concerned with. The base class of my standard wrapper looks like this:

 abstract class EntityBinder[+A](val a : A) {
  def bind(xhtml : NodeSeq) : NodeSeq
 }

 and an implementation might look like:

 import net.liftweb.util.Helpers._
 import scala.xml._

 class FooBinder(foo : Foo) extends EntityBinder[Foo](foo) {
  def bind(xhtml : NodeSeq) : NodeSeq = {
bind(foo, xhtml, baz - NodeSeq.Empty)
  }
 }

 My class hierarchy has three or four levels, each of which binds some
 set of tags to the results of a call to super.bind(xhtml).

 For some reason, the Scala compiler can't figure out that the bind() I
 want to call in the implementation is Helpers.bind - it gives me this:

 [WARNING] 
 /home/knuttycombe/work/gcsi/gcsi-admin/src/main/scala/com/gaiam/gcsi/view/EntityBinder.scala:114:
 error: wrong number of arguments for method bind:
 (scala.xml.NodeSeq)scala.xml.NodeSeq
 [WARNING] bind(t, super.bind(xhtml),
 [WARNING] ^

 Any idea why it's not using the imported bind function?

 If I'm barking completely up the wrong tree with my approach here,
 that information would also be useful! Thanks,

 Kris

 


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



[Lift] Re: bind() and lift:embed

2008-09-11 Thread Jorge Ortiz

There's some parallels between Lift's templates and lazy evaluation.
In the examples below, the code inside the snippets is lazy, it
doesn't get evaluated until it is needed.

Maybe what we need is a way to programmatically force evaluation of
some template-code? Then if a snippet has an embed passed into it, it
can choose to force that embed to evaluate before doing further
processing on it.

--j

On Thu, Sep 11, 2008 at 2:49 PM, David Pollak [EMAIL PROTECTED] wrote:
 Kris,

 I don't think I understand your question.

 Lift does do things differently than Rails as it evaluates outside in rather
 than inside out.  Thus:

 lift:MySnippet

 thisSome random text/this
 thatlift:comet type=CometComponent//that

 /lift:MySnippet

 If MySnippet chooses this or that... a CometComponent will only be
 invoked if MySnippet returns XHTML containing lift:comet
 type=CometComponent/

 If you are trying to embed a lift:embed .../ in the body of a snippet...
 e.g.:

 lift:MySnippet
   lift:embed .../
 /lift:MySnippet

 The snippet will get lift:embed .../ passed in as the NodeSeq rather than
 the expanded XHTML contained in the template.

 Thanks,

 David



 Kris Nuttycombe wrote:

 It appears that if I use lift:embed .../ to embed a template,
 bindings that I have declared that would be interpreted properly in
 the embedding template are not propagated to the embedee. Is this by
 design? How can I facilitate this sort of template reuse?

 I had hoped that lift:embed might be somehow analogous to Rails's
 render :partial where state is propagated downward into the embedded
 template, but this doesn't appear to be the case.

 Thanks,

 Kris




 


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



[Lift] Re: bind() and lift:embed

2008-09-11 Thread Jorge Ortiz

Also nice would be ways to programmatically access template features,
e.g. embed(template) or snippet(Class:method), etc

--j

On Thu, Sep 11, 2008 at 2:55 PM, Jorge Ortiz [EMAIL PROTECTED] wrote:
 There's some parallels between Lift's templates and lazy evaluation.
 In the examples below, the code inside the snippets is lazy, it
 doesn't get evaluated until it is needed.

 Maybe what we need is a way to programmatically force evaluation of
 some template-code? Then if a snippet has an embed passed into it, it
 can choose to force that embed to evaluate before doing further
 processing on it.

 --j

 On Thu, Sep 11, 2008 at 2:49 PM, David Pollak [EMAIL PROTECTED] wrote:
 Kris,

 I don't think I understand your question.

 Lift does do things differently than Rails as it evaluates outside in rather
 than inside out.  Thus:

 lift:MySnippet

 thisSome random text/this
 thatlift:comet type=CometComponent//that

 /lift:MySnippet

 If MySnippet chooses this or that... a CometComponent will only be
 invoked if MySnippet returns XHTML containing lift:comet
 type=CometComponent/

 If you are trying to embed a lift:embed .../ in the body of a snippet...
 e.g.:

 lift:MySnippet
   lift:embed .../
 /lift:MySnippet

 The snippet will get lift:embed .../ passed in as the NodeSeq rather than
 the expanded XHTML contained in the template.

 Thanks,

 David



 Kris Nuttycombe wrote:

 It appears that if I use lift:embed .../ to embed a template,
 bindings that I have declared that would be interpreted properly in
 the embedding template are not propagated to the embedee. Is this by
 design? How can I facilitate this sort of template reuse?

 I had hoped that lift:embed might be somehow analogous to Rails's
 render :partial where state is propagated downward into the embedded
 template, but this doesn't appear to be the case.

 Thanks,

 Kris




 



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



[Lift] Re: Template questions

2008-09-10 Thread Jorge Ortiz

Group won't work, as it too needs a Seq[Node], an Iterable[Node] just won't do.

Kris, this problem is certainly annoying and stems from the type
differences between Java collections and Scala collections. You need
your items argument to either be a proper Scala collection (Seq or
any of it's subclasses (List, Array, etc)) or you can wrap your Java
collections with the wrappers in scala.collections.jcl (the
Conversions object has some convenient implicit conversions). These
wrappers all extend Scala's Seq, which is what you want.

--j

On Wed, Sep 10, 2008 at 2:51 PM, Marius [EMAIL PROTECTED] wrote:

 Kris,

 Having a template like (slightly changed from your example so the
 values to be dynamic):

lift:Hello.orderList
order:id/
order:items
item:name/
item:cost/
/order:items
/lift:Hello.orderList


 and the Scala code:

  case class OrderItem(name:String, cost:String)

  def orderList(xhtml: Group): NodeSeq = {

val orderList = OrderItem(first, 9.99$) :: OrderItem(second,
 19.99$) :: Nil

val content = (xhtml \\ items).first.descendant

println(Content  + content)

bind(order, xhtml,
 id - Text(My order Id),
 items - Group(orderList flatMap (elem = bind(item,
 content, name - Text(elem.name), cost - Text(elem.cost
)

  }
 should work just fine (at least for me it does).

  regarding your compile error the flatMap call returns an
 Iterable[scala.xml.Node] which does not conform with NodeSeq return
 Type. To fix this you can probably wrap everything into a Group like:

 private def bindItems(xhtml : NodeSeq,
 items :java.util.Collection[Item]) : NodeSeq = {
Group(items.flatMap(item =
  bind(item, xhtml,
   name -- Text(item.getName
  }

 ... just out of curiosity is there a reason why you;re using
 java,util.collection and not Scala List, Seq etc?


 Br's,
 Marius

 On Sep 11, 12:16 am, Kris Nuttycombe [EMAIL PROTECTED]
 wrote:
 Man, I really wish I understood the Scala type system better.

   def list(xhtml : NodeSeq) : NodeSeq = {
 val orders = EM.createQuery[Order](FROM Order).getResultList
 orders.flatMap(order =
   bind(order, xhtml,
id -- Text(order.getId.toString),
uuid -- Text(order.getUuid.toString),
items -- bindItems((xhtml \\ items).first.child,
 order.getItems))
 )
   }

   private def bindItems(xhtml : NodeSeq, items :
 java.util.Collection[Item]) : NodeSeq = {
 items.flatMap(item =
   bind(item, xhtml,
name -- Text(item.getName)))
   }

 [WARNING] 
 /home/knuttycombe/work/gcsi/gcsi-admin/src/main/scala/com/gaiam/gcsi/snippet/Orders.scala:33:
 error: type mismatch;
 [WARNING]  found   : Iterable[scala.xml.Node]
 [WARNING]  required: scala.xml.NodeSeq
 [WARNING] items.flatMap(item =
 [WARNING]  ^
 [WARNING] one error found

 That's the only error, too; the list function compiles just fine.
 I've tried making that items.flatMap[NodeSeq], adding an explicit cast
 .asInstanceOf[NodeSeq] to the results of the binding, and split
 bindItems out into a separate function just to try to make things look
 as much the same as possible. WTF?

 Kris

 On Wed, Sep 10, 2008 at 2:28 PM, Derek Chen-Becker

 [EMAIL PROTECTED] wrote:
  Sorry, forgot about that. You might be able to use Scala's XML processing 
  to
  just get at the children:

  bind (item, (xhtml \\ items).first.child, ...)

  Kind of ugly. I still can't find the example that David posted but it 
  seemed
  a lot cleaner.

  Derek

  On Wed, Sep 10, 2008 at 12:39 PM, Kris Nuttycombe
  [EMAIL PROTECTED] wrote:

  Hrm. I think that I need to do something extra there to extract and
  bind against just the order:items element to avoid re-binding over
  the entire contents of the snippet.

  Marius, can you expand at all on using snippet attributes for case
  (1)? I've googled around and looked at all of the template docs I can
  find and am not really following how to take that approach.

  Thanks,

  Kris

  On Wed, Sep 10, 2008 at 12:08 PM, Derek Chen-Becker
  [EMAIL PROTECTED] wrote:
   I think the bind would look something like this (assuming that xhtml is
   the
   input NodeSeq):

   bind(order, xhtml, id -- Text(your_id_here),
items -- your_items.flatMap{ item =
   bind(item,
   xhtml, name -- Text(item.name), cost -- Text(item.cost)) })

   I seem to remember David giving an example of a nested bind but I can't
   find
   it.

   Derek

   On Wed, Sep 10, 2008 at 11:37 AM, Marius [EMAIL PROTECTED]
   wrote:

   Hi,

   1. You can use snippet attributes.
   2. You can leave the divs in the template page and attach only
   certain attributes from the snippet. Note that Scala XML API is
   immutable but that was never an inconvenience for me :) ... you could
   pattern match them easily.

   Br's,
   Marius

   On Sep 10, 8:05 pm, Kris Nuttycombe [EMAIL PROTECTED]
  

[Lift] Re: Missing Scala class?

2008-09-08 Thread Jorge Ortiz

What version of Lift and what version of Scala are you using?

(The version of Scala that you use must match the version of Scala
that was used to compile your version of Lift.)

--j

On Mon, Sep 8, 2008 at 10:37 AM, Kris Nuttycombe
[EMAIL PROTECTED] wrote:

 Hi, all,

 I'm not sure whether this is a Lift issue or a Scala issue, but in
 running the Glassfish verifier over my Lift war I saw a couple of
 suspect failures:

 Failed to find following classes:
 [
  scala.Stream$cons
 ]

 referenced in the following call stack :

  at scala.Stream$cons$
  at scala.Stream$$anonfun$apply$1
  at scala.Stream$
  at scala.Stream$class
  at scala.RandomAccessSeq$$anon$6
  at scala.RandomAccessSeq$class
  at scala.RandomAccessSeq$Projection$$anon$7
  at scala.RandomAccessSeq$Projection$class
  at scala.Array$Projection$$anon$2
  at scala.Array$Projection$class
  at scala.Array$
  at scala.runtime.BoxedObjectArray
  at scala.runtime.StringAdd
  at scala.Predef
  at scala.Predef$$anon$2
  at scala.Predef$
  at scala.Iterator$$anon$3
  at scala.Iterator$
  at scala.Iterator$$anon$15
  at scala.Iterator$class
  at scala.BufferedIterator$Advanced$$anon$3
  at scala.BufferedIterator$Advanced$class
  at scala.BufferedIterator$Default
  at scala.Iterator$PredicatedIterator
  at scala.Iterator$TakeWhileIterator
  at scala.Iterator
  at scala.collection.mutable.Buffer
  at scala.Iterable
  at scala.Collection
  at scala.RandomAccessSeq$Projection$MapProjection
  at scala.RandomAccessSeq$Projection
  at scala.RandomAccessSeq
  at scala.collection.mutable.ResizableArray
  at scala.collection.mutable.ArrayBuffer
  at scala.collection.mutable.Script
  at scala.collection.mutable.Buffer$class
  at scala.collection.mutable.ListBuffer
  at scala.List$$anonfun$flatten$1
  at scala.List
  at scala.Stream
  at scala.runtime.BoxedArray
  at scala.StringBuilder
  at scala.Tuple2
  at scala.Iterable$class
  at scala.Seq$Projection$ComputeSize
  at scala.Seq$Projection
  at scala.Seq$Projection$class
  at scala.Seq$
  at scala.Either$RightProjection
  at scala.Either
  at scala.Left
  at scala.Option
  at scala.Seq
  at scala.runtime.BoxedDoubleArray
  at scala.runtime.ScalaRunTime$
  at net.liftweb.http.ParsePath
  at net.liftweb.http.LiftFilter

 Any ideas?

 Thanks,

 Kris

 


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