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/sh | |
find /Users/porcelli/Documents/dev/osl -name \*.java -type f | \ | |
(while read file; do | |
iconv -f MacRoman -t UTF-8 $file > tmp.txt; | |
mv tmp.txt $file | |
done) |
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 java.security.InvalidParameterException; | |
import java.util.LinkedHashMap; | |
import java.util.Map; | |
import java.util.Map.Entry; | |
import java.util.TreeMap; | |
public class RestParser { | |
final char[] content; | |
final Map<Integer, String> positionedVariables = new TreeMap<Integer, String>(); |
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
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> | |
<modelVersion>4.0.0</modelVersion> | |
<groupId>mysql-parser</groupId> | |
<artifactId>mysql-parser</artifactId> | |
<version>0.1</version> | |
<packaging>jar</packaging> | |
<name>MySQL Parser</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
public static void main(String... args) { | |
StopWatch sw = new StopWatch(); | |
sw.start(); | |
BigInteger a = new BigInteger("0"); | |
BigInteger b = new BigInteger("1"); | |
for (int i = 0; i < 1e6; i++) { | |
final BigInteger c = b; | |
b = a.add(b); | |
a = c; |
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 static void main(String... args) throws MuleException { | |
Mule myMule = Mule.newInstance(new MyModule()); | |
myMule.start(); //start mule | |
} | |
public static class MyModule extends AbstractModule { // config module | |
@Override | |
protected void configure() { | |
flow("SimpleFilePollAndMove") //defines a named flow |
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 static void main(String... args) throws MuleException { | |
Mule myMule = Mule.newInstance(new AbstractModule() { //creates a new mule instance using an anonymous inner AbstractModule based class | |
@Override | |
protected void configure() { | |
flow("multipleFileMove") | |
.from("file:///opt/my_app/out") // source folder | |
.transformTo(byte[].class) //transform file to byte[] | |
.broadcast() //broadcast the payload to | |
.send("file:///opt/other_app/in") //destiny folder | |
.send("file:///opt/crm/in") //destiny folder |
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 static void main(String... args) throws MuleException { | |
Mule mule = Mule.newInstance(new AbstractModule() { | |
@Override | |
protected void configure() { | |
flow("SendEmail") | |
.send("smtp://smtp.mycompany.com:25?address=#[header:address]"); | |
} | |
}); | |
mule.start(); // start mule |
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 GenerateSignatures { | |
public static void main(String... args) { | |
Parameter[] values = new Parameter[]{new Parameter("A", "int"), new Parameter("B", "String"), new Parameter("C", "long")}; | |
Parameter[][] result = multiply(values); | |
for (int i = 0; i < result.length; i++) { | |
for (int k = 0; k < result[i].length; k++) { | |
System.out.print(result[i][k].toString() + " "); |
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
DBObject myBuilderContact = BasicDBObjectBuilder.start() | |
.add("username", "porcelli") | |
.add("first name", "alexandre") | |
.add("last name", "porcelli") | |
.push("address") | |
.add("st. name", "r. josé ramon urtiza") | |
.add("number", "181") | |
.add("complement", "ap. 191B") | |
.add("city", "são paulo") | |
.add("country", "brasil") |
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
admin=admin,manager,user,webdesigner,functionalanalyst | |
krisv=admin,manager,user | |
john=admin,manager,user,PM | |
mary=admin,manager,user,HR | |
sales-rep=admin,manager,user,sales |
OlderNewer