flying-saucer - XML/XHTML and CSS 2.1 renderer in pure Java Welcome to Flying Saucer Flying Saucer takes XML or XHTML and applies CSS 2.1-compliant stylesheets to it, in order to render to PDF (via iText), images, and on-screen using Swing or SWT. The library implements (basically) the entirety of CSS 2.1 and aims to be fully compliant with the W3C specification; it includes a small handful of CSS 3 features. The source code is hosted on GitHub, here: Great! Check out our User's Guide (also available as downloadable pdf), our mailing list archives on Mark Mail and our FAQ. There are also some older articles which may have slightly out-of-date information Generating PDFs for Fun and Profit with Flying Saucer and iText, by Josh Marinacci from June 2007. Supported Features in CSS 2.1 Flying Saucer supports all of CSS 2.1 with a few exceptions. Features: 100% Java XML+CSS layout engine with native PDF, Swing, image rendering. Where is the Code? Get the source here. Mailing List Archives Special Thanks to...
Java Performance Tuning, Profiling, and Memory Management | Java Java application performance is an abstract word until you face its real implications. It may vary depending on your interpretation of the word 'performance'. This article is meant to give the developer a perspective of the various aspects of the JVM internals, the controls and switches that can be altered to optimal effects that suit your application. There is no single size that can fits all. You may be facing one of the issues listed below: The dreaded java.lang.OutOfMemory ErrorYour application is literally crawling. Before we take the plunge into solving the issues, we first need to understand some of the theory behind the issues. Theory What does the JVM do? Executes CodeManages Memory This includes allocating memory from the OS, managing Java allocation including heap compaction, and removal of garbaged objects Besides the above, the JVM also does stuff like managing monitors. Very Basic Java Theory The sequence of the garbage collection process is as follows: 1. JVM flavors JVM Heap:
The Java™ Tutorials The Java Tutorials are practical guides for programmers who want to use the Java programming language to create applications. They include hundreds of complete, working examples, and dozens of lessons. Groups of related lessons are organized into "trails". The Java Tutorials primarily describe features in Java SE 8. What's New The Java Tutorials are continuously updated to keep up with changes to the Java Platform and to incorporate feedback from our readers. Lambda expressions enable you to treat functionality as a method argument, or code as data. Apart from fixing typos and errors, this update includes also includes the following: The Security trail has been restructured; find security information about applets and Java Web Start applications in the Java Applets lesson. Trails Covering the Basics These trails are available in book form as The Java Tutorial, Fifth Edition. Creating Graphical User Interfaces Specialized Trails and Lessons
XPath Expression Syntax Introduction This document is an informal guide to the syntax of XPath expressions, which are used in SAXON both within XSLT stylesheets, and in the Java API. For formal specifications, see the XSLT and XPath standards, except where differences are noted here. We can classify expressions according to the data type of their result: string, number, boolean, node-set, and document-fragment. These categories are examined in the following sections. SAXON expressions may be used either in an XSL stylesheet, or as a parameter to various Java interfaces. Constants String literals are written as "London" or 'Paris'. Numeric constants follow the Java rules for decimal literals: for example, 12 or 3.05; a negative number can be written as (say) -93.7, though technically the minus sign is not part of the literal. There are no boolean constants as such: instead use the function calls true() and false(). Variable References It is an error to refer to a variable that has not been declared.
String (Java Platform SE 6) java.lang.Object java.lang.String All Implemented Interfaces: Serializable, CharSequence, Comparable<String> public final class Stringextends Objectimplements Serializable, Comparable<String>, CharSequence The String class represents character strings. Strings are constant; their values cannot be changed after they are created. String str = "abc"; is equivalent to: char data[] = {'a', 'b', 'c'}; String str = new String(data); Here are some more examples of how strings can be used: System.out.println("abc"); String cde = "cde"; System.out.println("abc" + cde); String c = "abc".substring(2,3); String d = cde.substring(1, 2); The class String includes methods for examining individual characters of the sequence, for comparing strings, for searching strings, for extracting substrings, and for creating a copy of a string with all characters translated to uppercase or to lowercase. Since: See Also: Object.toString(), StringBuffer, StringBuilder, Charset, Serialized Form Collator.compare(String, String)
Java : mise en forme d'une interface (1) : FlowLayout - JDN Développeurs dans les forums de JDN Développeurs Nous débutons ici une série d'articles sur la mise en forme (ou "en page") d'une interface à l'aide des gestionnaires de Java. Cela peut sembler futile en ces jours où la moindre application Java est conçue au sein d'un environnement de développement, et où les interfaces sont composées par suite de glisser-déposer des éléments idoines en leurs emplacements désirés, mais tout comme il faut d'abord apprendre le HTML avec le bloc-note avant de se permettre de passer par un outil comme Dreamweaver, il est de bon temps de connaître les gestionnaires avant de passer à, par exemple, JBuilder. Ces gestionnaires d'interface s'assurent que les éléments intègrés à l'application ne se superposent pas. Nous inaugurons cette série avec le gestionnaire , le gestionnaire par défaut des fenêtres . En voici un exemple (non-fonctionnel) plutôt qu'un long discours : import javax.swing import java.awt public class FlowerPower public static void main(String[] args)
OpenJDK: Download and install Debian, Ubuntu, etc. On the command line, type: $ sudo apt-get install openjdk-7-jre The openjdk-7-jre package contains just the Java Runtime Environment. Fedora, Oracle Linux, Red Hat Enterprise Linux, etc. $ su -c "yum install java-1.7.0-openjdk" The java-1.7.0-openjdk package contains just the Java Runtime Environment. $ sudo apt-get install openjdk-6-jre The openjdk-6-jre package contains just the Java Runtime Environment. $ su -c "yum install java-1.6.0-openjdk" The java-1.6.0-openjdk package contains just the Java Runtime Environment. BSD Port For a list of pointers to packages of the BSD Port for DragonFly BSD, FreeBSD, Mac OS X, NetBSD and OpenBSD, please see the BSD porting Project's wiki page.
Bare Bones Guide to HTML Version 4.0 Formatted -- February 1999 The latest version of this document is available at where you will also find the text version, translations, and background materials. The Bare Bones Guide to HTML lists all the tags that current browsers are likely to recognize. I have included all the elements in the official HTML 4.0 recommendation with common attributes, as well as Netscape and Microsoft extensions. The Guide is designed to be as concise as possible, and therefore it doesn't go into any detail about how to use the various tags. Table of Contents Using Swing Components: Examples (The Java™ Tutorials > Creating a GUI with JFC/Swing > Using Swing Components) The table that follows lists every example in the Using Swing Components lesson, with links to required files and to where each example is discussed. The first column of the table has links to JNLP files that let you run the examples using Java™ Web Start. NOTE: Release 7.0 is required to run all applets and Java Web Start examples. Most examples will run on an earlier release but you must compile and run them locally. To run an example using Java Web Start, click the [Launch] link in the first column of the table. The first time you run an example, there will be a delay while Java Web Start downloads the JAR file containing the class files for this lesson's examples. Compiling and Running the Examples Locally The second column in the table below has links to zip files for each demo that you can open and run in the NetBeans IDE. If you download an individual example, take care to have all the necessary files in the proper hierarchy when you compile and run it. Here is a typical setup:
C++ Reference [C++ Reference] Pattern (Java Platform SE 6) java.lang.Object java.util.regex.Pattern All Implemented Interfaces: Serializable public final class Patternextends Objectimplements Serializable A compiled representation of a regular expression. A regular expression, specified as a string, must first be compiled into an instance of this class. A typical invocation sequence is thus Pattern p = Pattern.compile("a*b"); Matcher m = p.matcher("aaaaab"); boolean b = m.matches(); A matches method is defined by this class as a convenience for when a regular expression is used just once. boolean b = Pattern.matches("a*b", "aaaaab"); is equivalent to the three statements above, though for repeated matches it is less efficient since it does not allow the compiled pattern to be reused. Instances of this class are immutable and are safe for use by multiple concurrent threads. Summary of regular-expression constructs Backslashes, escapes, and quoting Character Classes The precedence of character-class operators is as follows, from highest to lowest: Since: flags
OpenGL Video games outsource real-time rendering calculations to the GPU over OpenGL. The rendered results are not sent back, and are instead stored in a framebuffer whose content is sent to the display controller. Silicon Graphics Inc. (SGI) started developing OpenGL in 1991 and released it in January 1992;[6] applications use it extensively in the fields of CAD, virtual reality, scientific visualization, information visualization, flight simulation, and video games. OpenGL is managed by the non-profit technology consortium Khronos Group. Design[edit] An illustration of the graphics pipeline process The OpenGL specification describes an abstract API for drawing 2D and 3D graphics. In addition to being language-independent, OpenGL is also platform-independent. Development[edit] OpenGL is an evolving API. In addition to the features required by the core API, GPU vendors may provide additional functionality in the form of extensions. Documentation[edit] The Red Book A tutorial and reference book.
Boids Pseudocode This is an explanation of the boids algorithm explained with the use of pseudocode. It is mostly the standard algorithm as described by Reynolds [1], with a few of my own tweaks thrown in. It should be enough to get you started with programming your own boids simulation and making up your own extra routines. If you have any queries regarding this or have difficulty understanding any parts of the explanation, please contact me. Overview The boids program has the following structure: initialise_positions() LOOP draw_boids() move_all_boids_to_new_positions() END LOOP The initialise_positions() procedure puts all the boids at a starting position. The draw_boids() procedure simply draws one 'frame' of the animation, with all the boids in their current positions. The procedure I have called move_all_boids_to_new_positions() contains the actual boids algorithm. We'll now look at each of these three rules in turn. The Boids Rules The 'centre of mass' is simply the average position of all the boids.