Java: tuples (pairs, triplets)








public class Pair<X, Y> { 
  public final X x; 
  public final Y y; 
  public Pair(X x, Y y) { 
    this.x = x; 
    this.y = y; 
  } 
}

//    Unit<A> 
//    Pair<A,B> 
//    Triplet<A,B,C> 
//    Quartet<A,B,C,D> 
//    Quintet<A,B,C,D,E> 
//    Sextet<A,B,C,D,E,F> 
//    Septet<A,B,C,D,E,F,G> 
//    Octet<A,B,C,D,E,F,G,H> 
//    Ennead<A,B,C,D,E,F,G,H,I> 
//    Decade<A,B,C,D,E,F,G,H,I,J>  

see also




Java: create a new file also its parent directories as required








File file = new File("/tmp/a/b/c/1.txt");
file.getParentFile().mkdirs();
file.createNewFile();



Show apt-get (dpkg) history








/var/log/apt/history.log is the log file for apt-get install/remove: for example I want to find the command that I installed okular package:
cat /var/log/apt/history.log | grep Install | grep okular
This is useful if you want to find all the packages that were included automatically when you install a particular package. So that you can remove them all.

If the package was installed using dpkg command, you can find the log in /var/log/dpkg.log
cat /var/log/dpkg.log | grep adobereader