Influence This!

The People Behind People Search

0 notes

Generic Bash Java Executor

Simple script to compile and execute a Java application with any number of parameters

  • e.g. ./BashJavaExecutor.sh MyApp.java
  • e.g. ./BashJavaExecutor.sh MyApp.java “arg1” “arg2” 33
JAVA=$JAVA_HOME/bin/java
JAVAC=$JAVA_HOME/bin/javac
JAVA_HEAP_MAX=-Xmx1024m
CLASSPATH=${CLASSPATH}

args=("$@")

#Remove old class files (suppress warning for DNE)
rm ${args[0]}*.class 2> /dev/null

echo "Compiling Script ${args[0]}"
$JAVAC -classpath "$CLASSPATH" ${args[0]}.java

numOfArgs=${#args[@]}
arr=()
for (( c=1; c <= $numOfArgs; c++))
do
   let pos=$c-1
   arr[$pos]=${args[$c]}
done

$JAVA $JAVA_HEAP_MAX -classpath "$CLASSPATH" ${args[0]} ${arr[@]}

0 notes

Finding the right NoSQL DB for the job - The path to a non-RDBMS solution at Traackr

We recently gave this talk at the local Boston MongoDB Meetup group. It’s a walkthrough of Traackr’s experience in choosing a NoSQL solution and how we ended up up switching from HBase to MongoDB. This deck goes through some in depth technical aspects, like schema design and our use of secondary indexes. BTW, the attendance at the meetup was great. We love the Mongo community in general and are looking forward to continuing to work with them and 10gen.

0 notes

Proper Application Logging

Very good tips to do proper logging (via @mumbojumbo).

My favorite is the last one “easy to read”. This is why logs are so hard to do properly, they should be easy to read even looking at the logs 1 month, 3 months or 1 year after you wrote the code. Writing logs becomes like writing a book or a short story. It has to make sense; tell the story even without knowing (or remembering) the code that’s behind. Which is why I find myself “proof reading” logs sometimes: running my application multiple times and just looking at the logs to make sure they make sense.