Thread pools on the JVM should usually be divided into the following three categories:
- CPU-bound
- Blocking IO
- Non-blocking IO polling
Each of these categories has a different optimal configuration and usage pattern.
| # RUN AT YOUR OWN RISK, UNDERSTAND THE COMMANDS AND DO NOT RUN BLINDLY | |
| This will find all the duplicate photos in a `raw_photos` directory. | |
| create md5sum of all files (after `brew install coreutils`): | |
| find raw_photos -type f -exec gmd5sum "{}" + > files.md5 | |
| then sort that and you can find the files where the md5sum (the first field) is repeated for spot-checking and comparison |

| @Grab(group='org.apache.sshd', module='sshd-core', version='0.13.0') | |
| import org.apache.sshd.SshServer | |
| import org.apache.sshd.server.PasswordAuthenticator | |
| import org.apache.sshd.server.command.ScpCommandFactory | |
| import org.apache.sshd.server.keyprovider.SimpleGeneratorHostKeyProvider | |
| import org.apache.sshd.server.session.ServerSession | |
| import org.apache.sshd.server.sftp.SftpSubsystem | |
| import org.apache.sshd.server.shell.ProcessShellFactory |
For iPhone app developers. Emphasis on getting the fastest app store approval. Everything stated as suggestion made into an imperative. When "violating" these imperatives, you can check for yourself what the caveats are. Generally speaking, deviating will more likely cause your app to be hung up in approval.
You can read this entire document in about 20 minutes. This is faster than reading and understanding the entire Human Interface Guidelines.
| @Grab( 'com.netflix.rxjava:rxjava-groovy:0.15.1' ) | |
| import groovy.transform.* | |
| import rx.* | |
| @CompileStatic | |
| class RPSRX { | |
| enum Result { | |
| WIN, LOSE, DRAW | |
| } | |
| export JAVA7_HOME=`/usr/libexec/java_home -v 1.7*` | |
| export JAVA8_HOME=`/usr/libexec/java_home -v 1.8*` | |
| function jdk7 { | |
| export JAVA_HOME=$JAVA7_HOME | |
| set_path | |
| echo "Using Java 7 $JAVA_HOME" | |
| } | |
| function jdk8 { |
| /* | |
| * HQL would look something like this: | |
| * | |
| * from Person p join fetch p.addresses address | |
| * where exists ( | |
| * from Address addr left join addr.state st | |
| * where addr.personId = p.id | |
| * and st.abbreviation = :abbreviation | |
| * ) | |
| */ |