Skip to main content

Posts

Showing posts from October, 2012

Java run with external jar

1. When classpath is used, jar command is ignored . So use "classpath" with class file and "cp" with jar file 2. NEVER FORGET TO PUT : even you use only 1 external jar. In some cases you will get compilation error if you don't put : java  -classpath  /media/Data/eclipseWorkspace/myExternalJar/commons-math-1.2.jar :   com.cbrc.motifmap.CombinationOfTF java  -cp /media/Data/eclipseWorkspace/myExternalJar/commons-math-1.2.jar:    -jar myJar.jar

java comparator sorted linked hash map treemap

////////////  inner class /////////////////     class ValueComparator implements Comparator {         LinkedHashMap  base;         public ValueComparator(LinkedHashMap hMap) {             this.base = hMap;         }         public int compare(Object a, Object b) {             Myclass obj1 = (Myclass) base.get(a);             Myclass obj2 = (Myclass) base.get(b);             if( obj1.getRankDistance() > obj2.getRankDistance()    ) {                 return -1;             }  else {                 return 1;             }         }     }     class Myclass     {         double rankDistance;         DMFmotif  motif;         public Myclass( double rankDistance, DMFmotif motif) {             super();             this.rankDistance = rankDistance;             this.motif = motif;         }         public double getRankDistance() {             return rankDistance;         }         public void setRankDistance(double rankDistance) {             this.rankDistance = rankDistance;         }

LATEX basic command

Float 3 float Table, Figure, Picture Caption can be given only to figure tabular   is just an array. Not float \begin{table} \begin{center} \begin{tabular} { |r | r | r | c | } \hline \multicolumn{4}{c}{this is header of table} \\ \hline 1 & 2 & 3 & 4 \\ \hline \multicolumn{4}{c}{this is text} \\ \hline \bf 4 & \it 5 & 6 & val \\ \hline \hline \end{tabular} \caption{mycaption} \label{lbl:mylabel1} \end{center} \end{table} Math environment running text  $  write here $  centered & new line \[  ]\  \[ \left( \begin{array}{cc} a & b \end{array} \right) \] \[  2^{2^{\cdot{^2}}}  \] Bibtex ..... at end of document write \bibliography{mybib.bib} to cite \cite{label1} \cite{lab1} \bibliography{1} \bibliographystyle{plain} % alpha / unsrt / siam / ieeetr \end{document}

LATEX beamer tutorial

% This text is proprietary. % It's a part of presentation made by myself. % It may not used commercial. % The noncommercial use such as private and study is free % Dec 2007 % Author: Sascha Frank % University Freiburg % www.informatik.uni-freiburg.de/~frank/ % % \documentclass{beamer} \setbeamertemplate{navigation symbols}{} \usetheme{Warsaw} \beamersetuncovermixins{\opaqueness<1>{25}}{\opaqueness<2 -="-">{15}} \begin{document} \title{Beamer Class Warsaw} \author{Sascha Frank} \date{\today} \begin{frame} \titlepage \end{frame} \begin{frame}\frametitle{Table of contents}\tableofcontents \end{frame} \section{Section no.1} \begin{frame}\frametitle{Title} Each frame should have a title. \end{frame} \subsection{Subsection no.1.1  } \begin{frame} Without title somethink is missing. \end{frame} \section{Section no. 2} \subsection{Lists I} \begin{frame}\frametitle{unnumbered lists} \begin{itemize} \item Introduction to  \LaTeX \item Course 2 \item Termpapers and pres