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
int h1 = "0-42L".hashCode(); | |
int h2 = "0-43-".hashCode(); | |
System.out.println("h1 = " + h1); | |
System.out.println("h2 = " + h2); | |
/* | |
results : | |
h1 = 45721201 | |
h2 = 45721201 | |
*/ |
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
sudo update-alternatives --verbose --install /usr/bin/java java /opt/j2sdk1.4.2_18/bin/java 500 --slave /usr/share/man/man1/java.1 java.1 /opt/j2sdk1.4.2_18/man/man1/java.1 `for prog in *; do echo --slave /usr/bin/$prog $prog /opt/j2sdk1.4.2_18/bin/$prog; done | grep -v "java " | xargs` |
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 MonObjet { | |
private int monAttributEntier = 3; | |
private String monAttributString = "attribut"; | |
public static void main(String[] args) { | |
System.out.println(new XStream().toXML(new MonObjet())); | |
} | |
} |
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
@Before public void setup() { | |
BarreVerteTime.setMockTime(true); | |
BarreVerteTime.getInstance().setMockDate("2010-01-10 10:00:00"); | |
} | |
@After public void teardown() { | |
BarreVerteTime.setMockTime(false); | |
} | |
@Test public void unPremierTest() { /* ... */ } | |
@Test public void unDeuxiemeTest() { /* ... */ } |
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
package fr.barreverte.time; | |
import java.util.Date; | |
import org.junit.rules.ExternalResource; | |
static import fr.barreverte.BarreVerteDateUtils.*; | |
public class BarreVerteTimeRule extends ExternalResource { | |
public final String dateDeMaintenant; | |
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 MonTest { | |
@Rule public BarreVerteTimeRule timeRule = | |
new BarreVerteTimeRule("2010-01-10 10:00:00"); | |
@Test public void premierTest { /*...*/ } | |
@Test public void deuxiemeTest { /*...*/ } | |
} |
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
Date maDateNonTestable = new Date(); // :-( à ne plus faire | |
Date maDateTestable = BarreVerteTime.now(); // :-) la nouvelle façon |
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
#!/bin/bash | |
projectName=$1 | |
if [[ $projectName == '' ]]; then | |
echo "usage: $0 nameOfTheProjectToCreate" | |
exit 1 | |
fi | |
mkdir $projectName | |
cd $projectName |
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
[color] | |
branch = auto | |
diff = auto | |
status = auto | |
interactive = auto | |
[user] | |
name = Jean-Philippe CARUANA | |
email = [email protected] | |
[alias] | |
last = cat-file commit HEAD |
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
[INFO] Scanning for projects... | |
[INFO] Searching repository for plugin with prefix: 'archetype'. | |
[INFO] artifact org.apache.maven.plugins:maven-archetype-plugin: checking for updates from central | |
Downloading: http://repo1.maven.org/maven2/org/apache/maven/plugins/maven-archetype-plugin/2.0/maven-archetype-plugin-2.0.pom | |
Downloading: http://repo1.maven.org/maven2/org/apache/maven/archetype/maven-archetype/2.0/maven-archetype-2.0.pom | |
Downloading: http://repo1.maven.org/maven2/org/apache/maven/plugins/maven-archetype-plugin/2.0/maven-archetype-plugin-2.0.jar | |
[INFO] ------------------------------------------------------------------------ | |
[INFO] Building Maven Default Project | |
[INFO] task-segment: [archetype:generate] (aggregator-style) | |
[INFO] ------------------------------------------------------------------------ |
OlderNewer