background preloader

Prog

Facebook Twitter

Lesson: Generics (Updated) (The Java™ Tutorials > Learning the Java Language) In any nontrivial software project, bugs are simply a fact of life. Careful planning, programming, and testing can help reduce their pervasiveness, but somehow, somewhere, they'll always find a way to creep into your code. This becomes especially apparent as new features are introduced and your code base grows in size and complexity.

Fortunately, some bugs are easier to detect than others. Compile-time bugs, for example, can be detected early on; you can use the compiler's error messages to figure out what the problem is and fix it, right then and there. Runtime bugs, however, can be much more problematic; they don't always surface immediately, and when they do, it may be at a point in the program that is far removed from the actual cause of the problem. Generics add stability to your code by making more of your bugs detectable at compile time.

Memory Analysis for Android Applications. [This post is by Patrick Dubroy, an Android engineer who writes about programming, usability, and interaction on his personal blog. — Tim Bray] The Dalvik runtime may be garbage-collected, but that doesn't mean you can ignore memory management. You should be especially mindful of memory usage on mobile devices, where memory is more constrained. In this article, we're going to take a look at some of the memory profiling tools in the Android SDK that can help you trim your application's memory usage. Some memory usage problems are obvious. For example, if your app leaks memory every time the user touches the screen, it will probably trigger an OutOfMemoryError eventually and crash your app. Other problems are more subtle, and may just degrade the performance of both your app (as garbage collections are more frequent and take longer) and the entire system.

Tools of the trade A heap dump is a snapshot of an application's heap, which is stored in a binary format called HPROF. Conclusion. Gc in android. Android Tutorial Java-Garbage Collector(Part-3) Coursera. GC Android. Java SE 6 HotSpot[tm] Virtual Machine Garbage Collection Tuning. Note: For Java SE 8, see Java Platform, Standard Edition HotSpot Virtual Machine Garbage Collection Tuning Guide. The Java™ Platform, Standard Edition (Java SE™) is used for a wide variety of applications, from small applets on desktops to web services on large servers. In support of this diverse range of deployments, the Java HotSpot™ virtual machine implementation (Java HotSpot™ VM) provides multiple garbage collectors, each designed to satisfy different requirements. This is an important part of meeting the demands of both large and small applications. However, users, developers and administrators that need high performance are burdened with the extra step of selecting the garbage collector that best meets their needs.

This better choice of the garbage collector is generally an improvement, but is by no means always the best choice for every application. When does the choice of a garbage collector matter? A feature referred to here as ergonomics was introduced in J2SE 5.0. Eden . . . Java - Why is it a bad practice to call System.gc. Tuning Garbage Collection with the 5.0 Java[tm] Virtual Machine. Introduction The Java TM 2 Platform Standard Edition (J2SE TM platform) is used for a wide variety of applications from small applets on desktops to web services on large servers. In the J2SE platform version 1.4.2 there were four garbage collectors from which to choose but without an explicit choice by the user the serial garbage collector was always chosen. In version 5.0 the choice of the collector is based on the class of the machine on which the application is started.

This “smarter choice” of the garbage collector is generally better but is not always the best. When does the choice of a garbage collector matter to the user? Amdahl observed that most workloads cannot be perfectly parallelized; some portion is always sequential and does not benefit from parallelism. The graph below models an ideal system that is perfectly scalable with the exception of garbage collection. The serial collector will be adequate for the majority of applications. Ergonomics for an application. Generations. How Garbage Collection works in Java.

Virtualisation

Scripts. Crontab. Unix systems start up the cron daemon in multi-user mode. Hence, so does Linux. The cron daemon will execute programs at predestined times. The daemon wakes up every minute and runs the commands as necessary. Files in which the time and interval to run commands are specified, as well as the commands themselves, are called crontab files. All cron implementations support user crontabs: each system-user has his/her own cron command file. These individual configuration files are stored in a standard directory: /var/spool/cron/crontabs or /var/cron/tabs/. They bare the name of the appropriate user-account from the /etc/passwd file. By default, either only the superuser or every user will have the right to create and maintain a crontab file (which of the two depends on the local configuration)

. $ crontab -e to edit your personal entry. Alternately, you can use a file in your HOME directory (or another location where you have write-access) and edit this file. Crontab <the-file-name> crontab -r. Adobe Flex 3 Component Life Cycle. Pratique d'ActionScript 3. Pratique d'ActionScript 3 s'adresse à tous les flasheurs. Cet ouvrage dresse un panorama de l'utilisation d'ActionScript 3 et de ses nouveautés, ainsi que du nouveau lecteur Flash 9. L'auteur explique au travers de nombreux exemples et cas concrets comment traiter désormais les objets, le texte, le son et la vidéo, le chargement et l'envoi de données externes (variables, XML, etc.), les sockets, etc. Certains sujets avancés et peu abordés comme les classes bas niveau ou encore Flash Remoting sont également traités. Enfin, l'auteur livre une application complète qui reprend les différents points évoqués.

Article lu 5644 fois. A propos de l'auteur▲ Thibault IMBERT est aujourd'hui ingénieur système chez Adobe France. Il a commencé en tant que développeur Flash pour différentes agences, avant de rejoindre Regart.net comme formateur et responsable pédagogique pour toutes les formations conçernant la plate-forme Flash. Remerciements▲ Préface▲ Object Definitions. Introduction One of the features of Nagios' object configuration format is that you can create object definitions that inherit properties from other object definitions.

An explanation of how object inheritence works can be found here. I strongly suggest that you familiarize yourself with object inheritence once you read over the documentation presented below, as it will make the job of creating and maintaining object definitions much easier than it otherwise would be. Also, read up on the object tricks that offer shortcuts for otherwise tedious configuration tasks. When creating and/or editing configuration files, keep the following in mind: Lines that start with a '#' character are taken to be comments and are not processed Directive names are case-sensitive Characters that appear after a semicolon (;) in configuration lines are treated as comments and are not processed Retention Notes Sample Configuration Files File Inclusions, Cascading Configs, and the 'include_file' Directive.

Maven. Java.

Divers

Java Tutorials. Java Dev.