This file contains 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
// 1, 2, 3 is easy | |
List<Integer> counting = Arrays.asList(1, 2, 3); | |
// mathematical variable | |
Double x; | |
// measuring performance | |
TimeUnit precision = TimeUnit.NANOSECONDS; | |
// 5:01 developers | |
Set<Day> working = new HashSet<Day>(Arrays.asList(MON, TUE, WED, THU, FRI)); | |
// content tags | |
List<String> labels; |
This file contains 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
<dependency> | |
<groupId>javax.validation</groupId> | |
<artifactId>validation-api</artifactId> | |
<version>1.0.0.GA</version> | |
<scope>compile</scope> | |
</dependency> | |
<dependency> | |
<groupId>org.hibernate</groupId> | |
<artifactId>hibernate-validator</artifactId> | |
<version>4.1.0.Final</version> |
This file contains 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
import javax.validation.constraints.Max; | |
import javax.validation.constraints.NotNull; | |
import javax.validation.constraints.Past; | |
import javax.validation.constraints.Pattern; | |
import javax.validation.constraints.Size; | |
@Config @NotNull @Size(min=1, max=5) | |
List<Person> persons; | |
@Config @NotNull @Size(min=8, max=25) |
This file contains 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
BeanId deployerRoleId = BeanId.create("deployer", Role.class.getName()); | |
Bean deployer = Bean.create(deployerRoleId); | |
BeanId assemblerRoleId = BeanId.create("assembler", Role.class.getName()); | |
Bean assembler = Bean.create(assemblerRoleId); | |
BeanId adminRoleId = BeanId.create("administrator", Role.class.getName()); | |
Bean adminRole = Bean.create(adminRoleId); | |
adminRole.addReference("roles", deployerRoleId); | |
adminRole.addReference("roles", assemblerRoleId); |
This file contains 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
@Config(desc = "An individual (or application program) identity") | |
public class User { | |
@Id(desc = "username") | |
private String username; | |
@Config(desc = "password") | |
private String password; | |
@Config(desc = "Roles assigned to this user") | |
private Set<Role> roles = new HashSet<Role>(); |
This file contains 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
@Config(desc = "A binary tree") | |
@BinaryTreeConstraint | |
public class BinaryTree { | |
@Id(desc = "id of current node") | |
private String id; | |
@Config(desc = "value of current node") | |
@NotNull @Min(1) | |
private Integer value; |
This file contains 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
urxvt*perl-ext-common: default,matcher,clipboard |
This file contains 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 Item { | |
private String id; | |
private String name; | |
public Item(String id, String name) { | |
this.id = id; | |
this.id = name; | |
} | |
public String getId() { return id;} | |
public String getName() { return name; } |
This file contains 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
Predicate<Item> heavyItemPolicy = new Predicate<Item>() { | |
@Override | |
public boolean apply(Item item) { | |
if(item.getWeight() > 1000){ | |
return true; | |
} | |
return false; | |
} | |
}; | |
Collection<Item> heavyItems = Collections2.filter(order, heavyItemPolicy); |
This file contains 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
#! /usr/bin/perl | |
sub on_sel_grab { | |
my $query=quotemeta $_[0]->selection; | |
$query=~ s/\n/\\n/g; | |
$query=~ s/\r/\\r/g; | |
system( "echo " . $query . " | xsel -i -b -p" ); | |
} |