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"?> | |
<persistence xmlns="http://java.sun.com/xml/ns/persistence" version="2.0"> | |
<persistence-unit name="PU" transaction-type="RESOURCE_LOCAL"> | |
<provider>org.hibernate.ejb.HibernatePersistence</provider> | |
<properties> | |
<property name="hibernate.connection.driver_class" value="com.mysql.jdbc.Driver" /> | |
<property name="hibernate.connection.user" value="root" /> |
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
buildscript { | |
repositories { | |
mavenCentral() | |
} | |
pluginVersions = [ | |
androidannotations: '0.3.0' | |
] |
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 Test<T extends Test.Foobar> { | |
public T foobar() { | |
return new Foobar(); // compilation error | |
} | |
public class Foobar { | |
} | |
} |
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.dondusang.task; | |
import android.os.AsyncTask; | |
import android.util.Log; | |
import com.google.gson.Gson; | |
import com.supinfo.dondusang.helper.UrlHelper; | |
import com.supinfo.dondusang.model.gift.Center; | |
import com.supinfo.dondusang.model.gift.CenterMapUrl; | |
import com.supinfo.dondusang.model.gift.CenterResult; | |
import org.apache.commons.io.IOUtils; |
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
/** | |
* @author Lukasz Piliszczuk <lukasz.pili AT gmail.com> | |
*/ | |
public class Main { | |
public static void main(String... args) { | |
Character character1 = new Character(); | |
character1.hp = 100; |
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
/** | |
* @author Lukasz Piliszczuk <lukasz.pili AT gmail.com> | |
*/ | |
public class ExceptionTraining { | |
public static void main(String[] args) { | |
int choice = 10; | |
try { | |
choice = Integer.valueOf("sdf"); |
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 StringImmuabilityTraining { | |
public static void main(String[] args) { | |
// String are immuable | |
String foo = "John"; | |
String foo2 = foo; | |
foo += "Toto"; | |
System.out.println(foo); // "JohnToto" | |
System.out.println(foo2); // "John" |
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 PolymorphismDemo { | |
public static void main(String[] args) { | |
ClassA a = new ClassA(); | |
ClassB b = new ClassB(); | |
a.foo(); | |
b.foo(); // Ok car B hérite de la méthode foo() de A |
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.siu.android.dondusang.activity; | |
import android.app.Activity; | |
import android.os.Bundle; | |
import android.support.v4.app.Fragment; | |
import android.support.v4.app.FragmentActivity; | |
import android.support.v4.app.FragmentTransaction; | |
import com.actionbarsherlock.app.ActionBar; | |
import com.actionbarsherlock.app.SherlockActivity; | |
import com.actionbarsherlock.app.SherlockFragmentActivity; |
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
// XHTML : | |
<h:body> | |
<h:selectOneItem value="#{myController.myObject}" | |
converter="#{myObjectConverter}"> | |
<f:selectItems value="#{myController.mySelectItems}"/> | |
</h:selectOneItem> | |
</h:body> | |