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
import java.util.List; | |
import java.util.ArrayList; | |
public class Foo { | |
public <T> List<T> getGenerics() { | |
return new ArrayList<T>(); | |
} | |
public <T> T getFoo() { |
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
cd /opt/oracle | |
export ORACLE_HOME=/u01/app/oracle/product/10.2.0/db_1 | |
export ORACLE_BASE=/u01/app/oracle | |
echo "if [ -f ~/.bashrc ]; then" >> .bash_profile | |
echo " . ~/.bashrc" >> .bash_profile | |
echo "fi" >> .bash_profile | |
echo "PATH=$PATH:$HOME/bin" >> .bash_profile | |
echo "export PATH" >> .bash_profile | |
echo "unset USERNAME" >> .bash_profile | |
echo "umask 022" >> .bash_profile |
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
apply plugin: 'java' | |
apply plugin: 'idea' | |
version = '0.1-SNAPSHOT' | |
repositories { | |
mavenCentral() | |
} | |
dependencies { |
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
<?xml version="1.0" encoding="UTF-8"?> | |
<module type="JAVA_MODULE" version="4"> | |
<component name="NewModuleRootManager" inherit-compiler-output="true"> | |
<exclude-output/> | |
<content url="file://$MODULE_DIR$/"> | |
<sourceFolder url="file://$MODULE_DIR$/src" isTestSource="false"/> | |
<excludeFolder url="file://$MODULE_DIR$/.gradle"/> | |
<excludeFolder url="file://$MODULE_DIR$/build"/> | |
</content> | |
<orderEntry type="inheritedJdk"/> |
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 static void save(User user, @Required String afterSubmit) throws Exception { | |
EnhancedValidator validator = validator(); | |
// ici je valide une entité au niveau des infos requises, et automatiquement tout est géré dans le validator | |
// les erreurs sont ajoutées les scopes nécessaires (request, flash) suivant la requete pour ensuite faire une | |
// simple redirection et quand même avoir les erreurs qui sont gérées avec les helpers de play (helper field, etc). | |
// le seul problème c'est qu'il faut spécifier l'attribut de l'objet en dur (String). | |
// je me suis amusé avec les classes du core qui permettent de récupérer le nom des variables locales |
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 service; | |
import models.user.User; | |
import play.db.jpa.Model; | |
import java.util.ArrayList; | |
import java.util.List; | |
/** | |
* @author Lukasz Piliszczuk <lukasz.piliszczuk AT zenika.com> |
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 Sorter { | |
public static void main(String[] args) { | |
int[] arrayToSort = new int[10]; | |
Random random = new Random(); | |
for (int i = 0; i < arrayToSort.length; i++) { | |
arrayToSort[i] = random.nextInt(99) + 1; |
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 com.supinfo.gameoflife; | |
public class AliveCell implements Cell { | |
private int age = 0; | |
public AliveCell() { | |
} |
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 com.supinfo.supcommerce.servlet; | |
import java.io.IOException; | |
import javax.servlet.ServletException; | |
import javax.servlet.http.HttpServlet; | |
import javax.servlet.http.HttpServletRequest; | |
import javax.servlet.http.HttpServletResponse; | |
import com.supinfo.sun.supcommerce.bo.SupProduct; |
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 com.supinfo.supcommerce.filter; | |
import java.io.IOException; | |
import javax.servlet.Filter; | |
import javax.servlet.FilterChain; | |
import javax.servlet.FilterConfig; | |
import javax.servlet.ServletException; | |
import javax.servlet.ServletRequest; | |
import javax.servlet.ServletResponse; |
OlderNewer