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 ConcurrentIndexerTest { | |
@Test | |
public void testUniqueIndexes() throws InterruptedException, ExecutionException { | |
//would not work for ConcurrentHashMap unless you're extreamly lucky | |
Map<String, Integer> index = Collections.synchronizedMap(new HashMap<>()); | |
populateIndexer(index); | |
Collection<Integer> indexes = index.values(); | |
Set<Integer> uniqueIndexes = new HashSet<>(indexes); |
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 | |
#brings you back home after sudo su | |
function get_owner { | |
pid=$1 | |
echo $(ps ouid -p $pid h | tr -d ' ') | |
} | |
pid=$$ | |
my_uid=$(get_owner $pid) |
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
syntax on | |
set nu | |
set title | |
set titleold="" | |
set titlestring=VIM:\ %F | |
" Allow saving of files as sudo when I forgot to start vim using sudo. | |
cmap w!! w !sudo tee > /dev/null % |
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
alias ..="cd ../" | |
alias ...="cd ../.." | |
alias ....="cd ../../.." | |
alias .....="cd ../../../.." | |
alias mvnT='mvn -T 4 -e package' | |
alias mvnNT='mvn -T 4 -DskipTests -e package' | |
alias mvnNTA='mvn -T 4 -Dmaven.test.skip=true -e package' | |
alias mvnTI='mvn -T 4 -e clean install' |
NewerOlder