15,560,073 members
Home / Discussions / Java

# Java

 Re: help with 2d cellular automata in JavaSwing Richard MacCutchan19-Nov-21 22:55 Richard MacCutchan 19-Nov-21 22:55
 Sending BufferedImage thought a socket Valentinor8-Oct-21 3:10 Valentinor 8-Oct-21 3:10
 Re: Sending BufferedImage thought a socket jschell24-Oct-21 7:53 jschell 24-Oct-21 7:53
 Re: Sending BufferedImage thought a socket Valentinor24-Oct-21 22:40 Valentinor 24-Oct-21 22:40
 Re: Sending BufferedImage thought a socket jschell23-Dec-21 6:29 jschell 23-Dec-21 6:29
 Re: Sending BufferedImage thought a socket Gerry Schmitz25-Oct-21 9:35 Gerry Schmitz 25-Oct-21 9:35
 Re: Sending BufferedImage thought a socket Joop Eggen 202125-Nov-21 7:15 Joop Eggen 2021 25-Nov-21 7:15
 Java Programming Challenge Purvesh Ptdr24-Sep-21 19:22 Purvesh Ptdr 24-Sep-21 19:22
 For given numbers N and K, write a function to find 'significant number'. Let's look at an example to understand the steps to find 'significant number'. Given N = 46333 and K = 3, 1. Check if N is 'reversible' or not. ['Reversible' denotes a number sequence that reads the same backward as forward, e.g., 12321] If Yes, return 1. If No, go to step 2. 2. Convert digits of N to elements of array A. e.g. For N = 46333 Convert to array A = [4, 6, 3, 3, 3] 3. Replace each element of array A with its 'modified value'. Modified value of A[ i ] = A[ i ] * 5; Modified value of 4 is = 4*5 = 20 Modified value for 6 is = 6*5 = 30 and so on. After replacing elements of array A with their 'modified values', array A will be [20, 30, 15, 15, 15] 4. For each element in the array generated in previous step, find the 'child primes' that are less than the array element. Then, generate the sum of these child primes. A child prime is a number in the form (2 * p) + 1 where p is prime. [Prime numbers are 2, 3, 5, 7, 11 ...] For A[0] = 20, for prime number 2, (2 * 2) + 1 = 5 < 20 for prime number 3, (2 * 3) + 1 = 7 < 20 for prime number 5, (2 * 5) + 1 = 11 < 20 for prime number 7, (2 * 7) + 1 = 15 < 20 for prime number 11, (2 * 11) + 1 = 23 > 20. Hence, will not consider 23. So, child primes less than 20 are [5 7 11 15]. Sum of child primes for array element A[0] is = 38 Similarly for A[1] = 30, child primes that are less than 30 are [5 7 11 15 23 27] Sum of child prime for array element A[1] is = 88 and so on. Array is now = [38 88 23 23 23] 5. Count pairs of the array generated in previous step whose sum is divisible by value K=3. Here pairs which are divisible by 3 are (38,88), (88,23), (88,23) and (88,23). Hence, return 4. This is the 'significant number' to be returned. Input 46333 3 where, First line represents value of N Second line represents value of K Expected Output 4
 Re: Java Programming Challenge Richard MacCutchan24-Sep-21 22:19 Richard MacCutchan 24-Sep-21 22:19
 java jshell beanshell eval string Majid Karimi28-Aug-21 0:45 Majid Karimi 28-Aug-21 0:45
 Re: java jshell beanshell eval string jschell5-Sep-21 9:55 jschell 5-Sep-21 9:55
 Default Casting a column to type using Hibernate ficevivu3-Aug-21 20:50 ficevivu 3-Aug-21 20:50
 How to make a scrolling background for a JPanel in java? Mr.Corona13-Jul-21 2:51 Mr.Corona 13-Jul-21 2:51
 Re: How to make a scrolling background for a JPanel in java? Richard MacCutchan13-Jul-21 3:37 Richard MacCutchan 13-Jul-21 3:37
 Re: How to make a scrolling background for a JPanel in java? Mr.Corona13-Jul-21 3:41 Mr.Corona 13-Jul-21 3:41
 Re: How to make a scrolling background for a JPanel in java? Richard MacCutchan13-Jul-21 3:46 Richard MacCutchan 13-Jul-21 3:46
 Re: How to make a scrolling background for a JPanel in java? Mr.Corona13-Jul-21 3:53 Mr.Corona 13-Jul-21 3:53
 Re: How to make a scrolling background for a JPanel in java? Richard MacCutchan13-Jul-21 4:04 Richard MacCutchan 13-Jul-21 4:04
 Re: How to make a scrolling background for a JPanel in java? Mr.Corona13-Jul-21 4:40 Mr.Corona 13-Jul-21 4:40
 Re: How to make a scrolling background for a JPanel in java? Richard MacCutchan13-Jul-21 6:02 Richard MacCutchan 13-Jul-21 6:02
 Re: How to make a scrolling background for a JPanel in java? Mr.Corona13-Jul-21 18:55 Mr.Corona 13-Jul-21 18:55
 How to read a certificate from USB Token and Print It on Eclipse Console?? Member 150264029-Jul-21 1:59 Member 15026402 9-Jul-21 1:59
 Knowing about jdk Ranjeet Singh from Unknown7-Jul-21 22:56 Ranjeet Singh from Unknown 7-Jul-21 22:56
 Re: Knowing about jdk Richard MacCutchan7-Jul-21 23:08 Richard MacCutchan 7-Jul-21 23:08
 Java Ranjeet Singh from Unknown7-Jul-21 22:54 Ranjeet Singh from Unknown 7-Jul-21 22:54
 Last Visit: 31-Dec-99 19:00     Last Update: 29-Jan-23 16:41 Refresh ᐊ Prev1...567891011121314 Next ᐅ