215 Matching Annotations
  1. Mar 2021
  2. Feb 2021
  3. Sep 2020
    1. Tribuo is a machine learning library in Java that provides multi-class classification, regression, clustering, anomaly detection and multi-label classification.

      Tribuo - Java ML library from Oracle

  4. Aug 2020
    1. Java may have been designed as a completely object oriented language, but when Java SE 8 was released in 2014, it added Lambda expressions (aka closures), which added some functional programming elements. Not every problem is best served by OOP, and by adding Lambdas, Java became more flexible. 
  5. Jul 2020
    1. AngularJS & Thymeleaf: What, Why & How to Supercharge Your Next Java App Development Project

      Thymeleaf vs Angular Development - What to Choose in 2020?. Read the detailed blog about the app development of single page to Multi page app development.

    1. A shell script to automate the retrieval and installation of the Oracle (Sun) Java Runtime Environment
  6. Jun 2020
  7. May 2020
    1. Programming languages These will probably expose my ignorance pretty nicely.

      When to use different programming languages (advice from an Amazon employee):

      • Java - enterprise applications
      • C# - Microsoft's spin on Java (useful in the Microsoft's ecosystem)
      • Ruby - when speed is more important then legibility or debugging
      • Python - same as Ruby but also for ML/AI (don't forget to use type hinting to make life a little saner)
      • Go/Rust - fresh web service where latency and performance were more important than community/library support
      • Haskell/Erlang - for very elegant/mathematical functional approach without a lot of business logic
      • Clojure - in situation when you love Lisp (?)
      • Kotlin/Scala - languages compiling to JVM bytecode (preferable over Clojure). Kotlin works with Java and has great IntelliJ support
      • C - classes of applications (operating systems, language design, low-level programming and hardware)
      • C++ - robotics, video games and high frequency trading where the performance gains from no garbage collection make it preferable to Java
      • PHP/Hack - testing server changes without rebuilding. PHP is banned at Amazon due to security reasons, but its successor, Hack, runs a lot of Facebook and Slack's backends
  8. Apr 2020
    1. To help you get started quickly, we created a special Installer of Visual Studio Code for Java developers. Download Visual Studio Code Java Pack Installer Note: The installer is currently only available for Windows. For other OS, please install those components (JDK, VS Code and Java extensions) individually. We're working on the macOS version, please stay tuned. The package can be used as a clean install or an update for an existing development environment to add Java or Visual Studio Code. Once downloaded and opened, it automatically detects if you have the fundamental components in your local development environment, including the JDK, Visual Studio Code, and essential Java extensions.

      If you wish to use Java inside VSCode, try downloading the Installer of Visual Studio Code for Java developers

  9. Mar 2020
  10. Dec 2019
  11. Oct 2019
  12. Jul 2019
    1. Java program to calculate area of a circle
    2. Java program to add two numbers
    3. Java program to calculate area of rectangle
    4. System arraycopy() method in java
    5. Binary search in java
    6. Java convert binary to decimal
    7. Add two numbers without using arithmetic operators in java
    8. Bubble sort in java
    9. Calculate percentage in java
    10. Convert char array to string in java
    11. Continue statement in java
    12. How to create directory in java
    13. Java create new file
    14. How to get current date time in java
    15. Java convert date to string
    16. Java program to convert decimal number to binary
    17. Java convert decimal to hex
    18. Java convert decimal to octal
    19. Java program to delete specified integer from an array
    20. Java program to find IP address
    21. Java program to find even or odd
    22. Armstrong number in java
    23. Factorial program in java
    24. Java program to print Floyd’s triangle
    25. For loop in java
    26. Garbage collection in java
    27. Java convert hex to decimal
    28. If else in java
    29. Insertion sort java
    30. How to get file last modified date in java
    31. Java program to find if given year is leap year
    32. Linear search in java
    33. How to list all files in a directory in java
    34. Java program to multiply two matrices
    35. Java program to find transpose of a matrix
    36. Merge sort java
    37. Java convert octal to decimal
    38. Java program to check if a number is palindrome or not
    39. Java program to check whether string is palindrome
    40. Java program to display pascal triangle
    41. Java program to check whether number is prime or not
    42. Java program to print alphabets
    43. Java program to print multiplication table of any number
    44. Quicksort java
    45. Java program to delete vowels in a given string
    46. Random number generator in java
    47. How to rename file in java
    48. Java reverse string array
    49. Selection sort java
    50. Java program to find simple interest
    51. How to sort a string array in java
    52. Sparse matrix and its representations in java
    53. String toUpperCase() method in java
    54. Java compare two strings
    55. String concatenation in java
    56. String length() method in java
    57. Java remove character from string
    58. Reverse a string in java
    59. Java string trim() method
    60. Java String toCharArray() method
    61. Java program to swap two numbers
    62. Switch statement in java
    63. Java catch multiple exceptions and rethrow exception
    64. Java overview
    65. Major features of java
    66. Preface to java virtual machine and architecture
    67. Variables in java
    68. Classes and objects in java
    69. Polymorphism in java
    70. Constructor in java
    71. This keyword in java
    72. Access modifiers in java
    73. Inheritance in java
    74. Abstraction in java
    75. Nested classes in java
    76. Strings in java
    77. Methods in java
    78. While loop in java
    79. Static keyword in java
    80. Interface in java
    81. String literal in java
    82. Comments in java
    83. Arrays.sort() in java
    84. Java program to find sum & average of an array
    85. Create matrix with user input in java
    86. For-each loop in java
    87. Matrix addition and subtraction in java
    88. Fibonacci series in java
    89. Symmetric matrix program in java
    90. Treemap in java
    91. Arrays copyOfRange() in java
    92. Treeset in java
    93. HashSet in java
    94. ArrayList in java
    95. Sorting HashMap by values in java
    96. Arrays in java
    97. Java convert string to date
    98. Java program to convert integer value into binary
    99. Multidimensional array in java
    100. Matrix multiplication in java using function
    101. Java program to swap two numbers using function
    102. Java program to swap two numbers using bitwise operator
    103. Java program to find circumference of a circle
    104. Java program to calculate area of circle using method
    105. Java program to find perimeter of a rectangle
    106. Calculate area of rectangle using class in java
    107. Calculate area of rectangle using default constructor in java
    108. Calculate area of rectangle using parameterised constructor in java
    109. Calculate area of rectangle using constructor overloading in java
    110. Find minimum and maximum values in a java array
    111. Static method – java convert decimal to octal
    112. Recursion – java program to convert decimal to octal
    113. How to remove element from arraylist in java
    114. Java program to print odd and even numbers in an array
    115. Even odd program in java using ternary operator
    116. Java bitwise AND to check a given number is odd or even
    117. Java program to print armstrong number from 1 to 1000
    118. Java program to check armstrong number
    119. Java program find GCD and LCM of two numbers using euclid’s algorithm
    120. Java program to remove vowels from a string using switch case
    121. Java program to remove vowels from string using StringBuffer class
    122. Java program to display prime numbers from 1 to 100
    123. Java program to check if it is a sparse matrix
    124. Difference between “==” operator and equals method in java
    125. Java program to find largest in three numbers using ternary operator
    126. Java program to find the largest in three numbers using nested if
    127. Sort string array in case insensitive order and case sensitive order java
    128. Java program to sort names in an alphabetical order
    129. Java program to convert decimal to binary using toBinaryString and stack
    130. Java program to convert decimal number to binary & count number of 1s
    131. Java program to check whether string is palindrome using library methods
    132. Java program to check palindrome string using recursion
    133. Java program to add two numbers using method
    134. String constructors in java
    135. Do-while loop in java




  13. May 2019
  14. Apr 2019
    1. (def current "Get current process PID" (memoize (fn [] (-> (java.lang.management.ManagementFactory/getRuntimeMXBean) (.getName) (string/split #"@") (first)))))

      getting current proces id (PID) more importantly: java.lang.management.ManagementFactory/getRuntimeMXBean

    1. (defn- file? [f] (instance? java.io.File f)) (defn- find-files-in-dir [dir] (filter #(.isFile ^File %) (file-seq dir)))

      finding files nice declarative way file-seq of this dir

  15. Mar 2019
  16. Jan 2019
    1. after the terminal operation of the stream pipeline commences.

      Above is because of the nature of Streams in general: they are lazily executed (or put another way, execution is delayed until the latest convenient method call).

  17. Dec 2018
    1. Headers in a manifest Header Definition Name The name of the specification. Specification-Title The title of the specification. Specification-Version The version of the specification. Specification-Vendor The vendor of the specification. Implementation-Title The title of the implementation. Implementation-Version The build number of the implementation. Implementation-Vendor The vendor of the implementation.

      It would be nice to have a bit more background, why this stuff is called like this

    1. To load classes in JAR files within a JAR file into the class path, you must write custom code to load those classes. For example, if MyJar.jar contains another JAR file called MyUtils.jar, you cannot use the Class-Path header in MyJar.jar's manifest to load classes in MyUtils.jar into the class path.

      So, other jars have to be extracted.

    2. The Class-Path header points to classes or JAR files on the local network,

      Wait, WHAT? on the local network??? Why would it look on the local network?

    1. To modify the manifest, you must first prepare a text file containing the information you wish to add to the manifest. You then use the Jar tool's m option to add the information in your file to the manifest.

      You don't add a manifest, but you add a second file that contains additional fields

    2. Warning: The text file from which you are creating the manifest must end with a new line or carriage return. The last line will not be parsed properly if it does not end with a new line or carriage return.

      This is very stupid....

    1. As an example, suppose you wanted to put audio files and gif images used by the TicTacToe demo into a JAR file, and that you wanted all the files to be on the top level, with no directory hierarchy. You could accomplish that by issuing this command from the parent directory of the images and audio directories: jar cf ImageAudio.jar -C images . -C audio .

      Don't preserve relative paths

    1. Full disclosure: I’m a co-maintainer of clj-time and I’m pretty vocal about encouraging people not to use clj-time when starting a new project: use Java Time instead. Conversion from an existing, clj-time-heavy project is another matter tho’, unfortunately.

      sean cornfield co-mainainter of clj-time use Java.Time

  18. Nov 2018
    1. in general, clojure doesn't have java interop, it has jvm interop so in places where the java language doesn't map 1:1 to the jvm, clojure gives something that matches the raw jvm, not something that matches the java language

      jvm not java interop

  19. Oct 2018
    1. Perhaps part of the confusion - and you say this in a different way in your little memo - is that the C/C++ folks see OO as a liberation from a world that has nothing resembling a first-class functions, while Lisp folks see OO as a prison since it limits their use of functions/objects to the style of (9.). In that case, the only way OO can be defended is in the same manner as any other game or discipline -- by arguing that by giving something up (e.g. the freedom to throw eggs at your neighbor's house) you gain something that you want (assurance that your neighbor won't put you in jail).

      [9] "Sum-of-product-of-function pattern - objects are (in effect) restricted to be functions that take as first argument a distinguished method key argument that is drawn from a finite set of simple names."

    2. Sum-of-product-of-function pattern - objects are (in effect) restricted to be functions that take as first argument a distinguished method key argument that is drawn from a finite set of simple names.

      fwiu: the "finte set of simple names" are all the objects defined in the codebase e.g. in java there are no functions as such just methods attached to classes i.e. "their key argument"

    3. All you can do is send a message (AYCDISAM) = Actors model - there is no direct manipulation of objects, only communication with (or invocation of) them. The presence of fields in Java violates this.

      from what I understand in Java... there are some variables on classes (class instances) that are only acessible through methods and for those the "only send message" paradigm holds but there are also fields which are like attributes in python which you can change directly

    4. Parametric polymorphism - functions and data structures that parameterize over arbitrary values (e.g. list of anything). ML and Lisp both have this. Java doesn't quite because of its non-Object types.

      generics so you've got a "template" collection e.g. Collectoin<animal> and you parametrise it with the Animal type in this example how is that broken by "non-Object types" in java</animal>

  20. Mar 2018
    1. a mutator method is a method used to control changes to a variable. They are also widely known as setter methods

      For example, a method definition in Java would be:

      class MyClassDef {
          public void setProperty(String propertyVal) { .. }

      For above, setProperty(..) method is the mutator

  21. Jan 2018
    1. Default Value

      Please note that the values listed below are the default ones. An Option can represent a Boolean toggle flag (i.e. HeapDumpOnOutOfMemoryError, PrintConcurrentLocks). For such Options, '+' and '-' flags deal with Boolean toggling. In short:

      • '+' means Enable (or set to '1');
      • '-' means Disable (or set to '0').

      For example, in the table pertaining to Debugging Options, by default the -XX:-HeapDumpOnOutOfMemoryError is Disabled, because it has the - prepended to it. To actually Enable it, change that with +, yielding the variant -XX:+HeapDumpOnOutOfMemoryError.

  22. Nov 2017
    1. java convert string to date.

      Learn how to convert string to date in java with an example - http://www.flowerbrackets.com/java-convert-string-date/

    2. convert date to string java program

      Learn how to convert date to string in java with an example - http://www.flowerbrackets.com/convert-date-to-string-java-program/

    3. Date time java program

      Learn how to display date and time in java with an example - http://www.flowerbrackets.com/date-time-java-program/

    4. create file java program

      Learn how to create file in java with an example - http://www.flowerbrackets.com/create-file-java-program/

    5. create directory java program.

      Learn a classic example of create directory java program with an example - http://www.flowerbrackets.com/create-directory-java-program/

    6. continue java example

      Learn continue statement in java with an example - http://www.flowerbrackets.com/continue-java-example/

    7. char array to string java program.

      Learn how to convert char array to string in java with an example - http://www.flowerbrackets.com/char-array-to-string-java-program/

    8. java calculate percentage

      Learn how to calculate percentage in java with an example - http://www.flowerbrackets.com/java-calculate-percentage/

    9. bubble sort program in java

      Learn how bubble sort algorithm in java with an example - http://www.flowerbrackets.com/bubble-sort-program-in-java/

    10. how to convert a binary number to decimal in java.

      Learn How To Convert A Binary Number To Decimal In Java with an example - http://www.flowerbrackets.com/how-to-convert-a-binary-number-to-decimal-in-java/

    11. binary search program in java

      Learn binary search program in java with an explanation and example - http://www.flowerbrackets.com/binary-search-program-java/

    12. Java system arraycopy example

      Learn System.arraycopy method in java with an example - http://www.flowerbrackets.com/java-system-arraycopy-example/

    13. find area of rectangle java program

      Learn how to find area of rectangle in java with an example - http://www.flowerbrackets.com/find-area-of-rectangle-java-program/

    14. Java program to add two numbers

      Java program to add two numbers with an example - http://www.flowerbrackets.com/java-program-add-two-numbers/

  23. Sep 2017
    1. but the true technology of Java is not in the language, but the virtual machine itself. The JVM as it stands today, is a fast, abstract machine that you can plug any languages into, and is able to operate at speeds comparable to natively compiled binaries.

      This is something really neat to ponder at... Thank you for your insight!

  24. Jul 2017
  25. May 2017
    1. Optimum buffer size is related to a number of things: file system block size, CPU cache size and cache latency. Most file systems are configured to use block sizes of 4096 or 8192. In theory, if you configure your buffer size so you are reading a few bytes more than the disk block, the operations with the file system can be extremely inefficient (i.e. if you configured your buffer to read 4100 bytes at a time, each read would require 2 block reads by the file system). If the blocks are already in cache, then you wind up paying the price of RAM -> L3/L2 cache latency. If you are unlucky and the blocks are not in cache yet, the you pay the price of the disk->RAM latency as well. This is why you see most buffers sized as a power of 2, and generally larger than (or equal to) the disk block size. This means that one of your stream reads could result in multiple disk block reads - but those reads will always use a full block - no wasted reads. Now, this is offset quite a bit in a typical streaming scenario because the block that is read from disk is going to still be in memory when you hit the next read (we are doing sequential reads here, after all) - so you wind up paying the RAM -> L3/L2 cache latency price on the next read, but not the disk->RAM latency. In terms of order of magnitude, disk->RAM latency is so slow that it pretty much swamps any other latency you might be dealing with. So, I suspect that if you ran a test with different cache sizes (haven't done this myself), you will probably find a big impact of cache size up to the size of the file system block. Above that, I suspect that things would level out pretty quickly. There are a ton of conditions and exceptions here - the complexities of the system are actually quite staggering (just getting a handle on L3 -> L2 cache transfers is mind bogglingly complex, and it changes with every CPU type). This leads to the 'real world' answer: If your app is like 99% out there, set the cache size to 8192 and move on (even better, choose encapsulation over performance and use BufferedInputStream to hide the details). If you are in the 1% of apps that are highly dependent on disk throughput, craft your implementation so you can swap out different disk interaction strategies, and provide the knobs and dials to allow your users to test and optimize (or come up with some self optimizing system).

      What's the cache size to keep when reading from file to a buffer?

  26. Apr 2017
    1. array with component type int

      My only suggestion is that this should be changed to single-dimension array with component type int. As per the Encoding conventions defined by java.lang.Class#getName()'s contract.

      In other other words, the OP missed the fact that for every dimension of the array-object, an [ character is prepended to the enconding of the type contained in the array.

  27. Mar 2017