background preloader

Java

Facebook Twitter

Gc jdk dev

BigDecimal VS Flottant (float, double) - Veille technologique et technique par l'agence de développement web iMDEO. De Jérôme Meillant dans Technique 24 Sep 2012 Java nous trompe lorsqu’il s’agit d’afficher la valeur d’un double ou d’un float. double d1 = 0.1; System.out.println(« d1 => » + d1); float f1 = 0.1f; System.out.println(« f1 => » + f1);d1 => 0.1 f1 => 0.1 La console affiche 0.1 alors qu’en représentation flottante la valeur 0.1 ne peut pas être représentée de manière exacte.

BigDecimal VS Flottant (float, double) - Veille technologique et technique par l'agence de développement web iMDEO

Best (and Worst) Java Exception Handling Practices. Handling Exceptions in Java is one of the fundamental things a developer should be experienced in - handling them is as important as the rest of the code, and should never be overlooked or underestimated.

Best (and Worst) Java Exception Handling Practices

In this blog, I'll try my best to make a guide to help newer developers understand how to handle their exceptions according to industry standards, and also how not to handle them. I'm assuming you're already familiar with what exceptions are, and what exception handling is as well as basic rules like the handle-or-declare rule. That being said, I won't cover any of that information and jump straight to practices, aimed at newer developers who mainly have experience with textbook examples.

Index of /~forax/ens/java-avance/cours/pdf. Index of /~forax/ens/java-avance/cours/pdf Name Last modified Size Description Parent Directory -

Index of /~forax/ens/java-avance/cours/pdf

How One Little Method In java.io.File Cost Us 2 Weeks – Code Like The Wind. Last year, we helped Global Bank upgrade from JBPM v5 to 6.

How One Little Method In java.io.File Cost Us 2 Weeks – Code Like The Wind

And since BPM6 was basically a redesign, there were numerous hurdles to migrate inflight processes from v5. But we worked tirelessly with the Global Bank team to resolve each one. We couldn’t wait to put it into production. It would be a big win for Global Bank and Red Hat. Unfortunately, we had to delay until the next release: R21. Double Brace Initialization. One of the JavaIdioms.

Double Brace Initialization

JavaLanguage doesn't have a convenient literal syntax for collections (lists, maps, sets, etc.). This makes creating constant collections or passing collections to functions quite laborious. Every time you have to Declare a variable for a temporary collection Create a new empty collection and store a reference to it in the variable Put things into the collection Pass the collection to the method E.g. To pass a set to a method: Set<String> validCodes = new HashSet<String>(); validCodes.add("XZ13s"); validCodes.add("AB21/X"); validCodes.add("YYLEX"); validCodes.add("AR2D"); removeProductsWithCodeIn(validCodes);

Car Detection For Autonomous Vehicles With Deep Learning. This is a cross-post from the original, written by Klevis Ramo.

Car Detection For Autonomous Vehicles With Deep Learning

In this post, we are going to build a real-time video object detection application in Java for car detection, a key component in autonomous driving systems. In a previous post, we were able to build an image classifier (cats vs. dogs); now, now we are going to detect the object (i.e. cars, pedestrians) and additionally mark them with bounding boxes (rectangles). Feel free to download code or run the application with your own videos (short live example).

Object Detection Nature. Uninitialized Behavior in Java (and Thoughts for Other Programming Languages) The How and the Why of Default Values Experienced programmers have had it beaten over their heads to always initialize their variables, which is very useful for those who have used C or an equivalent systems-level language.

Uninitialized Behavior in Java (and Thoughts for Other Programming Languages)

In designing a compiler, one must be aware of the performance trade-off that a default value may present: if there are n uninitialized local variables, setting them all to a default value requires at least n instructions to actually store in memory. For system languages like C, this decision is easy — it’s far better to require the user to explicitly set the memory to what they want, rather than possibly storing a useless value. In Java, local variables are stored in what is called a stack frame, which for simplicity sake we will say looks roughly like this: To create this stack frame, you must request a sufficient amount of memory from the Operating System, and then begin filling in the data that you know — the return address, the current frame pointer, etc. Reference - What's the difference between SoftReference and WeakReference in Java?

Java Development in 2018. Simplifier l’écriture de vos classes avec Lombok. Aujourd’hui je vais vous présenter une librairie qui va vous faire gagner pas mal de temps dans vos projets.

Simplifier l’écriture de vos classes avec Lombok

Vous savez le moment où vous définissez vos classes métiers (beans) avec les getters/setters, la définition des méthodes hashCode(), equals() et toString(), le moment où vous multipliez par 10 le code source de vos beans. Ce moment long, fastidieux et répétitif est terminé. Soulagez vos sources et votre IDE et adoptez Lombok ! Le projet Lombok est une librairie qui va vous permettre d’annoter vos classes afin de faire tout cela à la compilation très simplement et sans superflus dans vos sources (et même bien plus encore). Créer une classe métier simple Actuellement lorsque vous créez votre bean métier, vous utilisez surement votre IDE préféré afin de générer les getters/setters, ainsi que la redéfinition des méthodes de la classe Object . Voici un exemple de ce que vous faites actuellement : Avec Lombok , pour le même résultat, il suffit d’écrire : Les autres cas utiles.

Java Generics: extends, super and wildcards explained. Today we continue our mini-series on Java Generics.

Java Generics: extends, super and wildcards explained

In previous posts we have investigated Java type parameters are used as type placeholders. A List<X> is a container for X objects, and X can be instantiated with any class: you can have List<Object>, List<String>, and List<Number>. Introducing bounds: extends. Understanding sun.misc.Unsafe.

Collections

Tests. Strings. MultiThread. Data. JDK version specific. APM. Java EE. AOP. Tooling. Dates. Spring. Mapper. Garbage Collection.