You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
@@ -2629,36 +2630,77 @@ \subsection{Branching the code}
2629
2630
\end{itemize}
2630
2631
\end{frame}
2631
2632
2632
-
% \begin{frame}[fragile]{Selecting version of RAxML according the CPU type} % TODO RAxML branching - CPU type
2633
-
% \begin{itemize}
2634
-
% \item
2635
-
% \end{itemize}
2636
-
% \begin{bashcode}
2637
-
% #
2638
-
% \end{bashcode}
2639
-
% \end{frame}
2633
+
\begin{frame}[fragile]{Selecting version of RAxML according the CPU type I}
2634
+
\begin{itemize}
2635
+
\item\href{https://github.com/stamatak/standard-RAxML}{RAxML} can take advantage of modern CPUs to highly speed up calculations, with or without parallelization -- every version has separated binary, user must select, see \href{https://github.com/stamatak/standard-RAxML/blob/master/README}{README}
2636
+
\item After compilation, the script can select e.g. on remote server
2637
+
\item RAxML binaries must be in \texttt{\$PATH}
2638
+
\item See \texttt{raxml\_if.sh} for whole script
2639
+
\end{itemize}
2640
+
\begin{bashcode}
2641
+
if grep -iq avx2 /proc/cpuinfo; then # Does the CPU support AVX2?
2642
+
RAXML='raxmlHPC-AVX2' # Select appropriate binary
2643
+
elif grep -iq avx /proc/cpuinfo; then # Does the CPU support AVX?
2644
+
RAXML='raxmlHPC-AVX' # Select appropriate binary
2645
+
elif grep -iq sse3 /proc/cpuinfo; then # Does the CPU support SSE3?
2646
+
RAXML='raxmlHPC-SSE3' # Select appropriate binary
2647
+
else # The very last option
2648
+
RAXML='raxmlHPC' # Slowest oldest CPU...
2649
+
fi # End of branching
2650
+
$RAXML -s $INPUT ... # All the parameters as usually...
2651
+
\end{bashcode}
2652
+
\end{frame}
2640
2653
2641
-
% \begin{frame}[fragile]{Multiple branching in one step} % TODO Multiple branching with case
2642
-
% \begin{itemize}
2643
-
% \item
2644
-
% \end{itemize}
2645
-
% \begin{bashcode}
2646
-
% #
2647
-
% \end{bashcode}
2648
-
% \end{frame}
2654
+
\begin{frame}[fragile]{Selecting version of RAxML according the CPU type II}{Multiple branching in one step}
2655
+
\begin{itemize}
2656
+
\item Same task as on previous slide, but instead of it-then branching it is using \texttt{case}
2657
+
\item See \texttt{raxml\_case.sh} for whole script
2658
+
\end{itemize}
2659
+
\begin{bashcode}
2660
+
# Determine which CPU is available and which binary use then
$RAXML -s $INPUT # All the parameters as usually...
2673
+
\end{bashcode}
2674
+
\end{frame}
2649
2675
2650
-
\subsection{Loops}% TODO More examples, break, ...
2676
+
\subsection{Loops}
2651
2677
2652
-
\begin{frame}[fragile]{For, while and until cycles}
2678
+
\begin{frame}[fragile]{For cycles}
2653
2679
\begin{bashcode}
2654
-
# One line for cycle for resizing of images
2655
-
for file in *.jpg; do convert $file -resize 100x100 thumbs-$file; done
2680
+
# Ways how to declare number of repetitions
2681
+
for I in `seq 1 10`; do echo $I; done # "seq" is outdated
2682
+
for I in 12345678910; do echo $I; done
2683
+
for I in {1..10}; do echo $I; done
2684
+
for (( I=1; I<=10; I++ )); do echo $I; done
2685
+
# One line for cycle for resizing of images (another option, as above)
2686
+
for JPGF in *.jpg; do convert $JPGF -resize 100x100 thumbs-$JPGF; done
2656
2687
# More commands in a block
2657
-
for file in `ls -1 *.jpg`; do
2658
-
echo "Processing file $file"
2659
-
convert $file -resize 100x100 thumbs-$file
2660
-
echo thumbs-$file created
2688
+
for JPGF in `ls -1 *.jpg`; do
2689
+
echo "Processing JPGF $JPGF"
2690
+
convert $JPGF -resize 100x100 thumbs-$JPGF
2691
+
echo "File thumbs-$file created"
2661
2692
done
2693
+
for ...; do # Start cyclus as you need
2694
+
command1 # command1 will be executed in any cas
2695
+
if (condition); then # Set some condition to skip command2
2696
+
continue; fi # Go to next iteration of the loop and skip command2
2697
+
command2
2698
+
done
2699
+
\end{bashcode}
2700
+
\end{frame}
2701
+
2702
+
\begin{frame}[fragile]{While and until cycles}
2703
+
\begin{bashcode}
2662
2704
# while cycle is evaluating expression and if it is equal to 0
2663
2705
# the cycle body is launched, repeatedly while the condition is met
2664
2706
while expression
@@ -2669,6 +2711,15 @@ \subsection{Loops} % TODO More examples, break, ...
2669
2711
until expression; do
2670
2712
commands
2671
2713
done
2714
+
while ...; do # Start cyclus as you need
2715
+
commands...
2716
+
if [condition]; then # If something happens
2717
+
break; fi # End up the cyclus and continue by following commands
2718
+
while read TEXTLINE; do # Run cyclus on text file
2719
+
commands...
2720
+
done < text_file_to_process.txt
2721
+
while :; do echo "Press CTRL+C to exit..."; done # Infinite loop
2722
+
for (( ; ; )) ; do echo "Press CTRL+C to exit..."; done # Infinite loop
2672
2723
\end{bashcode}
2673
2724
\end{frame}
2674
2725
@@ -2849,13 +2900,42 @@ \subsection{Java}
2849
2900
\end{bashcode}
2850
2901
\end{frame}
2851
2902
2852
-
%\subsection{Windows applications} % TODO Wine
2903
+
\subsection{Windows applications}
2853
2904
2854
-
% \begin{frame}{Launching of Windows and DOS applications in Linux}
2855
-
% \begin{itemize}
2856
-
% \item
2857
-
% \end{itemize}
2858
-
% \end{frame}
2905
+
\begin{frame}[allowframebreaks]{Windows applications on Linux}
2906
+
\begin{itemize}
2907
+
\item Applications written for one operating system do not work on the other systems\ldots
2908
+
\begin{itemize}
2909
+
\item They must be written in portable language like Java or script like Perl, Python or BASH
2910
+
\item Otherwise we need an emulator -- not everything works
2911
+
\end{itemize}
2912
+
\item Windows 10 has \href{https://blogs.windows.com/buildingapps/2016/07/22/fun-with-the-windows-subsystem-for-linux/}{possibility to run Linux applications}, other option (for more Windows versions) is \href{https://www.cygwin.com/}{Cygwin} (application must be specially compiled to support Cygwin)
2913
+
\item To run Windows applications on Linux use \href{https://www.winehq.org/}{Wine}
2914
+
\begin{itemize}
2915
+
\item Search for packages named \texttt{wine} and install it
2916
+
\item Sometimes, extra functionality is in extra packages -- check \texttt{wine-*}
2917
+
\end{itemize}
2918
+
\item To run DOS application on Linux use \href{http://www.dosbox.com/}{dosbox} (package \texttt{dosbox})
2919
+
\item As soon as Wine is installed, just click to Windows \texttt{*.exe} file\ldots
2920
+
\item Windows applications are installed into \texttt{$\sim$/.wine/} where Windows directory structure is created, launchers use to be placed to standard application menu into \textbf{Wine} section
2921
+
\item Use \texttt{winecfg} to change settings (e.g. version of Windows -- can be different for each application, custom DLL library,~\ldots)
2922
+
\item\texttt{winefile} starts Windows file browser, \texttt{notepad} Notepad, \texttt{winemine} Mines
2923
+
\item To install some extra parts required by some applications use \texttt{winetricks}
2924
+
\begin{itemize}
2925
+
\item Usage use to differ according to distribution and GUI
2926
+
\item Browsing and selecting items to install can be bit messy\ldots
2927
+
\item It can be hard to check application requirements -- if it fails, check if it is listed at \url{https://appdb.winehq.org/} and/or run it from command line like \texttt{wine application.exe} and inspect errors in output
2928
+
\end{itemize}
2929
+
\item Before installing Windows application under Wine, check if there is some native Linux application to fit your needs\ldots
2930
+
\begin{itemize}
2931
+
\item Plenty of applications are available for more operating systems
2932
+
\item Linux distributions use to have external contributor's sites to provide more packages
2933
+
\item For many Windows-only applications there are fully comparable alternatives
2934
+
\end{itemize}
2935
+
\item Some applications do not work under Wine (from various reasons), some complex packages are \href{https://www.codeweavers.com/}{supported commercially} (I have no experience with it)
2936
+
\item Wine is well compatible with rest of the Linux hosting system, it is considerable to install Windows in e.g. WirtualBox (or another virtualization platform), if needed
% \item \href{https://github.com/}{GitHub} is currently probably the most popular platform to host development of open-source projects
3188
-
% \item \href{https://git-scm.com/}{Git} is version controlling system -- it traces changes among all versions -- absolutely crucial for any software development
3189
-
% \end{itemize}
3190
-
% \begin{bashcode}
3191
-
% #
3192
-
% \end{bashcode}
3193
-
% \end{frame}
3265
+
\begin{frame}[fragile]{Git and GitHub}
3266
+
\begin{itemize}
3267
+
\item\href{https://git-scm.com/}{Git} is \href{https://en.wikipedia.org/wiki/Version_control}{version controlling} system -- it traces changes among all versions -- absolutely crucial for any software development
3268
+
\item\href{https://github.com/}{GitHub} is currently probably the most popular platform to host development of open-source projects, see \href{https://help.github.com/}{documentation}
3269
+
\item Older (nowadays not so common) version controlling systems is Subversion (SVN), there are many more
3270
+
\item Probably the best textbook for Git is \href{https://git-scm.com/book/en/v2}{Chacon's Pro Git}
3271
+
\begin{itemize}
3272
+
\item Dostupná i~\href{https://git-scm.com/book/cs/v2}{česky} (včetně \href{https://knihy.nic.cz/}{prvního vydání})
3273
+
\end{itemize}
3274
+
\item Changes and their history is stored in repository (local or network, shared or private) -- it is possible to view any historical state and differences between any versions
3275
+
\item It is possible to trace who and when did what
3276
+
\item Branching and merging of branches helps with making of big changes
3277
+
\end{itemize}
3278
+
\end{frame}
3279
+
3280
+
\begin{frame}[fragile]{Git principles}
3281
+
\begin{multicols}{2}
3282
+
\begin{itemize}
3283
+
\item Three main areas
3284
+
\begin{enumerate}
3285
+
\item Working directory
3286
+
\item Staging (changes awaiting to be pushed to the repository)
3287
+
\item Git repository (remote/local)
3288
+
\end{enumerate}
3289
+
\item Everyone has whole repository and history -- very robust
3290
+
\item Flexible branches
3291
+
\begin{itemize}
3292
+
\item Very convenient
3293
+
\item Keeping work structured
3294
+
\item Separation of tasks
3295
+
\item Keeping more versions of the project in parallel
0 commit comments