This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
macro dowhile (cond, body) | |
syntax ("do", body, "while", "(", cond, ")") | |
{ | |
def loop = Nemerle.Macros.Symbol (Util.tmpname ("do_while")) | |
<[ | |
(($("_N_break" : global) : { | |
def $(loop : name) () : void { | |
($("_N_continue" : global) : { $body }) : void; | |
when ($cond) | |
$(loop : name) (); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
struct ProfileInfo | |
{ | |
1: required string uid; | |
2: optional string firstName; | |
3: optional string middleName; | |
4: optional string lastName; | |
5: optional string email; | |
6: optional string phone; | |
7: optional string addrPostal; | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def listUsers(r: Request): RequestResult = listForm.bind(request){ | |
success(form) => Ok (ToJson( | |
users.filter(_.name contains form.q).page(form.offset,form.limit) | |
) ) | |
failure(f,message, ex) => Error(403, message) | |
} | |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package x | |
import akka.actor._ | |
import scala.concurrent._ | |
import scala.concurrent.duration._ | |
import ExecutionContext.Implicits.global | |
object X | |
{ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
case class Person(firstName:String, lastName:String) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public class Person | |
{ | |
private String firstName; | |
private String lastName; | |
String getFirstName() { return firstName; } | |
void setFirstName(String firstName) { this.firstName = firstName; } | |
String getLastName() { return lastName; } | |
void setLastName(String lastName) { this.lastName = lastName; } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public class Person extends DTOBase | |
{ | |
public String firstName; | |
public String lastName; | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
list.sort((x,y)-> { | |
int cmp = x.lastName.compareTo(y.lastName); | |
return cmp!=0 ? cmp : x.firstName.compareTo(y.firstName) | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
list.sort((x,y) => { | |
val cmp = x.lastName.compareTo(y.lastName) | |
if (cmp!=0) cmp else x.firstName.compareTo(y.lastName) | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var (maxFirstLen, maxSecondLen) = (0,0) | |
list.foreach{ | |
x => maxFirstLen = max(maxFirstLen, x.firstName.length) | |
maxSecondLen = max(maxSecondLen, x.secondName.lenght) | |
} |