198 Matching Annotations
  1. Dec 2019
  2. Oct 2019
  3. 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

    Tags

    Annotators

    URL

  4. May 2019
  5. 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

  6. Mar 2019
  7. 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).

  8. 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

  9. 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

  10. 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>

  11. 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

  12. 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.

  13. 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/

  14. 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!

  15. Jul 2017
  16. 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?

  17. 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.

  18. Mar 2017
  19. Jun 2016
  20. May 2016
    1. Java Programming Language was developed by James Gosling, Chris Warth, Patrick Naughton, Mike Sheridan and Ed Frank at Sun Microsystems, Inc in the year 1991. At first Java Programming Language was named as Oak, later that it was renamed to Java in the year 1995. Java Programming is a platform independent language. The Internet (World Wide Web) made Java programming more valuable. Since, Internet is connected to different types of systems which having different CPU's & environments, it must have the programs to run on any OS, CPU and Platform. Since, Java programming obtain platform independence and can able to run on any platform like Unix, Intel, Mac etc., it was widely used. Java language also protects two other major issues of Internet, they are security & portability.

      Java Programming Language was developed by James Gosling, Chris Warth, Patrick Naughton, Mike Sheridan and Ed Frank at Sun Microsystems, Inc in the year 1991. At first Java Programming Language was named as Oak, later that it was renamed to Java in the year 1995.

      Java Programming is a platform independent language. The Internet (World Wide Web) made Java programming more valuable. Since, Internet is connected to different types of systems which having different CPU's & environments, it must have the programs to run on any OS, CPU and Platform. Since, Java programming obtain platform independence and can able to run on any platform like Unix, Intel, Mac etc., it was widely used. Java language also protects two other major issues of Internet, they are security & portability.

  21. Dec 2015
    1. blade is a web framework for rapid development of Java applications,you can be used to develop API, Web and back-end services and other applications, a RESTful framework, it provides a simple and convenient way of development, the whole operation of the micro kernel MVC bus guide frame, initial goal is to simplify the web development, and of course the author will upgrade in the future and integrate more compact components based on blade.

      MVC backend java micro framework for API

    1. Compose complex, data-driven visualizations from reusable charts and components with d3.

      wykresy i grafy w javascript

    1. booking.jsMake a beautiful embeddable booking widget in minutes.

      Great google calendar conector in java script

  22. Sep 2015
    1. MyInterfaceImpl

      I believe that a better name would be StandardOutputMyInterface. The name of the implementation should describe the character of the implementation, which in this case is output to the standard output stream. I consider simply appending Impl to the interface name a (common) bad habit.

  23. Jul 2015
  24. Feb 2015
    1. 2.3.2. Mapping native queries You can also map a native query (ie a plain SQL query). To achieve that, you need to describe the SQL resultset structure using @SqlResultSetMapping (or @SqlResultSetMappings if you plan to define several resulset mappings). Like @NamedQuery, a @SqlResultSetMapping can be defined at class level or in a JPA XML file. However its scope is global to the application.

      JPA SQL native query den join ile birden fazla nesne elde etme

    1. @SqlResultSetMappings( { @SqlResultSetMapping(name = "ProfessorWithAddress", entities = { @EntityResult(entityClass = Professor.class), @EntityResult(entityClass = Address.class) }) })

      jpa birden fazla tabloyu direk sınıf ile eşleme join table mapping

    1. Use @FieldResult in the SqlResultSetMapping, to link each entity property to its column alias

      birden fazla tablonun birleşimini sınıflara eşleştirirken oluşan hatanın giderilmesi

  25. Jan 2015