C, Java and related
C basics
- C - Wikipedia created in the 1970s by Dennis Ritchie
- C++- also referred to as cpp, created in the 1980s by Stroustrup
- C # - C sharp - designed by Anders Hejlsberg from Microsoft in 2000
GNU software
- GNU software packages - GLib, glibc, gcc, make, automake, ...
- GNU's libc - Glibc - GNU's C standard library
- GNU's libc - Glibc - Wikipedia - GNU's C standard library
- GNU Project's implementation of the C standard library. It is a wrapper around the system calls of the Linux kernel for application use. Despite its name, it now also directly supports C++ (and, indirectly, other programming languages). It was started in the 1980s by the Free Software Foundation (FSF) for the GNU operating system.
- GNU's GLib
- GNU's GLib - Wikipedia -
- a bundle of three (formerly five) low-level system libraries written in C, developed mainly by GNOME
- GLib's code was separated from GTK, so it can be used by software other than GNOME and has been developed in parallel ever since
- forms the basis for projects such as GTK and GNOME, provides data structure handling for C, portability wrappers, and interfaces for such runtime functionality as an event loop, threads, dynamic loading, and an object system
Other basic software
- Valgrind - dynamic analysis - Valgrind is a GPL'd system for debugging and profiling Linux programs. With Valgrind's tool suite you can automatically detect many memory management and threading bugs, avoiding hours of frustrating bug-hunting, making your programs more stable. You can also perform detailed profiling to help speed up your programs.
Java basics
Created in 1991 by James Gosling, Mike Sheridan, and Patrick Naughton. Its history is described at Wikipedia, from JDK version 1.0 in 1996 to Java SE 18 in 2022.
See local files:
Oracle
OpenJDK
OpenJDK (Open Java Development Kit) is a free and open-source implementation of the Java Platform, Standard Edition (Java SE). OpenJDK is the official reference implementation of Java SE since version 7.
Standardisation
Sun - legacy
Java documentation
Oracle doc
Packages include java. ... and javax. ... The javax are 'extensions'. Javax is the package name for Java platform library extensions; goodies that are notionally outside the core functionality but are still part of the core Java platform library.
General 'Knowledge Sources' on Java
Building a Java project
Apache Ant - Another Neat Tool
- Apache Ant - Wikipedia
- a replacement for the Make build tool of Unix
- focus on Java
- uses XML to describe the code build process and its dependencies
- many open source Java developers include build.xml files with their distribution
- Apache Ant homepage
Apache Maven - 'accumulator'
Maven uses a repository to build software while Nexus (Sonatype) provides a repository.
- Apache Maven - Wikipedia
- addresses how software is built and its dependencies
- unlike Ant, Maven relies on a convention on how to define projects and on the list of work-flows that are generally supported in all projects
- primarily Java but support for a.o. C#, Ruby, Scala
- an XML file describes the software project being built, its dependencies on other external modules and components, the build order, directories, and required plug-ins
-
- includes pre-defined targets for performing e.g. compilation and packaging
- dynamically downloads Java libraries and Maven plug-ins from one or more repositories such as the Maven 2 Central Repository, and stores them in a local cache
- projects:
- are configured using a Project Object Model (POM), which is stored in a pom.xml-file
- use a default directory structure, including a project home directory where pom.xml resides
- plugins:
- handle building, testing, source control management, running a web server, generating Eclipse project files, ...
- are introduced and configured in a -section of a pom.xml file
- uses a default lifecycle (configurable) which consists of steps (validate, generate-, ..., compile, test, package, deploy)
- command 'mvn package' compiles all the Java files, run any tests, and package the deliverable code and resources into target/my-app-1.0.jar (assuming the artifactId is my-app and the version is 1.0.)
- search engines (e.g. The Central Repository Search Engine) can be used to find out coordinates for different open-source libraries and frameworks
- Apache Maven homepage
Sonatype/Nexus
Jenkins
- Jenkins - Wikipedia
- helps automate the parts of software development related to building, testing, and deploying, facilitating continuous integration and continuous delivery
- server-based, runs in servlet containers such as Apache Tomcat
- supports version control tools, including AccuRev, CVS, Subversion, Git, Mercurial, Perforce, ClearCase and RTC
- can execute Apache Ant, Apache Maven and sbt based projects as well as arbitrary shell scripts and Windows batch commands
- Jenkins homepage
Gradle
IDE/javac/jre
Java Frameworks
Refer also to Web and Application servers
Spring
- Spring framework - wikipedia
- Spring framework
- Application framework and inversion of control container (IoC) for the Java platform. Has become popular as an addition to, or even replacement for the Enterprise JavaBeans (EJB) model.
- In traditional programming, the custom code that expresses the purpose of the program calls into reusable libraries to take care of generic tasks
- In IoC, custom-written portions of a computer program receive the flow of control from a generic framework
- The IoC container provides a means to configure/manage Java objects using reflection. The container is responsible for managing object lifecycles. Objects created by the container are also called managed objects or beans. The container can be configured by loading XML (Extensible Markup Language) files or detecting specific Java annotations on configuration classes. These data sources contain the bean definitions that provide the information required to create the beans.
- Acegi - Java security for Spring
- Acegi samples at Code.google
Other
Security
XML processing
Approach 1 SAX/DOM
Steps:
- Write a program that creates a SAX parser and then uses that parser to parse the XML document. The SAX parser starts at the beginning of the document. When it encounters something significant (in SAX terms, an "event") such as the start of an XML tag, or the text inside of a tag, it makes that data available to the calling application.
- Create a content handler that defines the methods to be notified by the parser when it encounters an event. These methods, known as callback methods, take the appropriate action on the data they receive.
Parsing
- Xerces Wikipedia: libraries for XML, implementing standard APIs for XML parsing, including DOM, SAX and SAX2
- Xerces - Apache
Transforming
JAXP - Parsing and Transforming
- JAXP-XSLT included in JRE
- JAXP is a set of interfaces covering XML parsing, XSLT transformation, and XML schema validation
- As per Stackoverflow, it's not very effective nor popular
Approach 2 JAXB
JAXB allows Java developers to access and process XML data without having to know XML or XML processing. For example, there's no need to create or use a SAX parser or write callback methods.
After unmarshalling, your program can access and display the data in the XML document simply by accessing the data in the Java content objects and then displaying it.
Steps:
- Bind the schema for the XML document. This means generating a set of Java classes that represents the schema.
- All JAXB implementations provide a tool called a binding compiler to bind a schema (the way the binding compiler is invoked can be implementation-specific)
- For example, the JAXB Reference Implementation provides a binding compiler that you can invoke through scripts.
- Unmarshal the document into Java content objects. The Java content objects represent the content and organization of the XML document, and are directly available to your program.
- Unmarshalling an XML document means creating a tree of content objects that represents the content and organization of the document. The content tree is not a DOM-based tree.
- Alternative: accessing Data without Unmarshalling: JAXB also allows you to access XML data without having to unmarshal it. One of the classes generated from a schema, ObjectFactory, contains methods to generate objects for each of the schema-derived interfaces and classes. For example, the package generated for the books.xsd schema includes an ObjectFactory class that has methods such as createCollection to create a Collection object, and createBookType to create a BookType object. You can use these methods to create a tree of content objects without doing any unmarshalling. All your program needs is access to the ObjectFactory class that's in the package for the pertinent schema. Then you can use the appropriate methods in the ObjectFactory class to create the objects you need. After you create the objects, you need to provide their content. To do that, you use the set methods in the objects.
Mobile Edition
Useful stuff
Specific Java topics
Java logging
- Apache LOG4J
- Logback intended as a successor to log4j
- SLF4J - Simple Logging Facade for Java - allowing you to postpone the decision to bind to a specific logger
Java and BioInformatics
Java and Google
Java improved: Groovy - Grails
Java and Flex
Java, JNDI and LDAP
Java and XaDES
Other
Alternative providers