Differences between revisions 54 and 55
Revision 54 as of 2020-09-02 11:57:08
Size: 5924
Editor: davidsch
Comment:
Revision 55 as of 2020-09-02 14:13:55
Size: 0
Editor: davidsch
Comment: articles now under /Programming
Deletions are marked like this. Additions are marked like this.
Line 1: Line 1:
#rev 2020-09-02 davidsch

= Programming =
<<TableOfContents(2)>>

== Programming language literature ==

On the [[https://github.com/EbookFoundation/free-programming-books/blob/master/free-programming-books.md|free Ebook foundation website]], you will find an overview of a bunch of '''programming e-books''' (PDF/ HTML) '''free of charge''' for almost any language in the areas of

 * '''Regular programming''' (e.g. C, C++, C#, Java, Go, MATLAB, PHP, Rust, Scala, ...)
 * '''Scripting''' (e.g. JavaScript, make, Perl, Python, R, Ruby, Unix/ Windows Shells, SQL, ...)
 * '''Document rendering''' (e.g. HTML, CSS, LaTeX, ...)
 * '''Multiprocessing/ parallel computing APIs''' (e.g. OpenMP, ...)
 * '''Programming related tools''' (e.g. Git, Subversion, Mercurial, Jenkins, ...)

== OpenGL ==
=== Compiling OpenGL/ NVidia CUDA-based applications on Debian Linux ===
The Debian platform managed by ISG.EE uses the following directory layout for the OpenGL libraries and headers:

Libraries:

{{{
The /usr/lib/x86_64-linux-gnu/libGL*.so OpenGL libraries are symbolic links to the hardware-specific libraries. There is a mechanism in the starup process of each client workstation which detects the accurate OpenGL library based on the information about the graphics card and the kernel driver. The CUDA runtime libraries are found in the same directory.
}}}

Header Files:

{{{
The OpenGL headers are found under /usr/include/GL. For NVidia programming, a CUDA toolkit that should work with
the installed NVidia graphics card is installed (CUDA headers in /usr/include).
}}}

Compiling sources and linking against the NVidia libraries:
{{{
No special CFLAGS/ CXXFLAGS and LDFLAGS must be set. The required headers and libraries are all found under the
standard system paths. If you use an own OpenGL/ CUDA toolkit, e.g. installed in your home, make sure it is
compatible with the graphics driver/ hardware installed on the system. Then set CFLAGS (standard C programming,
e.g. compiling with gcc) and/ or CXXFLAGS (C++ programming, e.g. compiling with g++) and LDFLAGS as follows:

Assume you have installed the toolkit under /home/$USER/toolkit, then set the mentioned environment
variables in your Debian shell (bash, tcsh, ...) as follows, before you start compiling/ linking:

export CFLAGS="-I/home/$USER/toolkit/include"
export CXXFLAGS="$CFLAGS"
export LDFLAGS="-L/home/$USER/toolkit/lib -Wl,-rpath,/home/$USER/toolkit/lib"

$USER must of course be replaced with your ETH (login-) username.
}}}


== Perl ==
 * Please use the default perl (/usr/bin/perl) that is installed on all Debian Linux computers.
 * If you use older perl interpreters from other directories, you should switch to the default perl interpreter.
 * A bunch of most-often used perl modules is installed with the default perl interpreter.

== Network Programming ==
 * If you are completely new to socket programming, have a look at [[https://www.binarytides.com/socket-programming-c-linux-tutorial/|this]] tutorial. It explains socket programming step-by-step with code examples that a easily be compiled and run on your computer.

 * If you run in a situation where your TCP/ IP socket code compiles and runs, but from time to time a connection is lost for no obvious reasons or there are too many open sockets, then one good idea is to check the [[https://en.wikipedia.org/wiki/File:Tcp_state_diagram.png|TCP state diagram]] first, and review your code afterwards.

== Linux desktop GUI programming ==
 * The "X Window System" (X11) is window system, which was first developed at MIT in 1984, then it was enhanced by various non-profit organzations like XFree86 and X.Org over the years. On the Debian clients managed by ISG.EE, "X.Org" (X server) is the current reference software implementation based the original X11 server. Most programmers nowadays no longer directly write software that is interacting with the X server server directly (for those who are still interested in that, read: [[http://www.rahul.net/kenton/xsites.framed.html|X11 Programming]]).
 * For contemporary and fast Linux GUI programming, one usually uses a high-level C/C++ programming toolkit library like [[https://www.qt.io/|QT]] or [[https://www.gtk.org/|GTK]]. For programming languages that come with their own UI toolkits (like Java), one even doesn't have to care about the platform - those languages follow the paradigm "write once, run everywhere". However, in practice you will notice small differences between the platforms, even when the paradigm mentioned should apply.

== Linux debugging ==
 * Unfortunately, it is difficult to write bug-free programs. A good debugger is very helpful tracking down errors. On the Debian clients managed by ISG.EE we recommend to use the Data Display Debugger (DDD). DDD supports a variety of programming languages: Ada, C, C++, Chill, Fortran, Java, Modula, Pascal, Perl, Python.

 * For a current list, consult the DDD manual (man ddd).

== Database programming ==
 * To learn about databases and data/ entity-relationship modeling (ERM), one of the books to recommend for beginners is "Fundamentals of Database Systems" (published by Pearson Inc.). Note this book is not free, but it is used in many computer science around the world.
 * If you want to exercise practical database design and programming, you (D-ITET employees and students) can obtain an account on the ISG.EE MariaDB (MySQL-compatible open source software fork) database server. Write an e-mail to support@ee.ethz.ch to make a database request. The database server is acessible (only from within ETH-networks) on TCP port 3306 with any MariaDB/ MySQL compatible client.
 * Besides installing a database command line client, you may also use the [[https://mysql.ee.ethz.ch/|phpMyAdmin]] webinterface for to access the ISG.EE hosted MariaDB/ MySQL databases.


[[CategoryLXSW]]