Home >

java

Advertisement
  • Z algorithm for string matching [on hold]May 10

    Working on Z algorithm and post the link and code I am referring to, I tested the code works, but I think there are cases when Z algorithm is sub-optimal, for example, I think it is possible there is another l2, where value z[i-l2] is larger than z[i

  • radix sort for advice [on hold]May 10

    I am learning Radix sort and learning by experiment and various forms of implementations, I post one of the code I am looking at, My question is, what is the value of globalPtr? Especially lost by statement next[bucketTail[value]] = globalPtr, why we

  • Array-based deque in JavaMay 9

    Are the conditions which I have included for insertion and deletion from front and rear sufficient and necessary? Have I missed some condition check? Or have I included some redundant condition? import java.io.*; class Dequeue { int arr[]; int lim; i

  • Cancelling a job in ExecutorServiceMay 9

    I wrote code which demonstrates how to cancel a job in Executor: ExecutorService executor = Executors.newFixedThreadPool(4); Future<Void> future = executor.submit(new Callable<Void>() { @Override public Void call() { // // do some long running

  • Android unit converterMay 9

    I am developing an unit converter application for android, the application is working correctly but my problem is with the optimization, is there a way to optimize somehow the code. I have different categories - speed, weight, length and so on, and f

  • Java two arrays of audio, or one array? how to determine the most effectiveMay 9

    Okay so I have some code, I want to play some audio of two byte arrays, I was wondering whether it would be better to play them as two separate arrays both calling the method or to put them into one array and play it from there. Note: The starting fr

  • Tile collision detectionApril 24

    Right. So I was making this simple game. The player is two tiles wide, and four tiles high. My current code is really buggy (it was better before my rewrite) Here it is: float newx = position.x + velocity.x; float newy = position.y + velocity.y; int

  • What is the concept of variable-free programming?April 20

    What does it mean by concept of variable-free programming? I have to write a program which adhere to concept of variable free programming for my class assignment. But I have no idea about the concept of variable-free programming. here is the instruct

  • Stack having push, pop and return min in o(1)April 7

    Here is my approach, class MinStack { Stack<Node> s1 = new Stack<>(); public void push(int x) { if(s1.isEmpty()) { s1.push(new Node(x,x)); } else { s1.push(new Node(x,Math.min(s1.peek().min, x))); } } public void pop() { s1.pop(); } public int

  • Java loops in Map Reduce MapperApril 7

    New to Java and can't get this loops and arraylist working correctly. Working on identifying co-occurences of Actors in a shakespeare play. The map and reduce should produce (Paul, Mary) 25. Indicating they were together 25 times. Below is the map fu

  • Integer tree sort in JavaApril 7

    I have this algorithm for sorting integer arrays. Basically, it's a balanced tree sort which creates a tree node for each distinct integer, and in each tree node it maintains a counter counting how many times the integer key appeared so for in the ar

  • How to create a boolean method that allows users to type in yes/y or no/n instead of true and false in java [on hold]April 7

    public boolean getYesOrNoAnswer(String yesNoPrompt) is all I got. Also it should be a method that can be called latter on in the code

  • Adaptive counting sort for integer arrays in Java - follow-upApril 6

    I have refactored this. Once again, the running time can be anything between \$\Omega(n)\$ and \$\mathcal{O}(n^2)\$, yet it adapts to "smoothness" of the input array. AdaptiveCountingSort.java: package net.coderodde.util.sorting; /** * This clas

  • Convert objective-c method EVP_DecryptInit_ex to java for encryptionApril 3

    How to convert blow objective-c method to java? I am trying to Convert objective-c method to java for encryptions, the encryption method in objective-c is EVP_CIPHER_CTX, and I wonder what related java method? +(int)seafileDecrypt:(char ​*)data_out o

  • The Exception Stops the program in the arrayApril 2

    This is the Exception class public class IllegalValuesException extends Exception { public IllegalValuesException(String message) { super(message); } public IllegalValuesException() { super("Illegal Values"); } } This is Tringle class public cla

  • How to check how many constants are in enumeration?April 1

    I have a enum: public enum Platform { Xbox360, XboxOne, Playstation3, Playstation4, PC } I want to iterate and print all constants from it. How can I get size ? Or for this purpose I shouldn't use enumeration but let say arrays? --------------Solutio

  • Can't access native library of tesseractApril 1

    Although I have placed the dll in the resource path It keeps telling this error java.lang.UnsatisfiedLinkError: Unable to load library 'libtesseract304': Native library (win32-x86-64/libtesseract304.dll) not found in resource path ([file:/C:/Users/Us

  • How to run .jar fileMarch 27

    I am currently running Windows 10 and am trying to open several installer .jar files for a game. In order to open the, I downloaded Java as that seems to be the most straight-forward way to do so. However, I am unable to actually "open" Java, I

  • Why should parentheses be used in an if statement?March 21

    My document says: This is incorrect: if b == 1 This is correct: if (b ==1) It says that the parentheses forces the expression inside to be evaluated first. Why does this matter? --------------Solutions------------- It is a syntactic requirement. The

  • Java REST WS with DBMarch 12

    I want to get the feedback this code about the best practice I should follow and if I am using the connection pooling properly. I have classes as follows: DAOConnectionFactory- to fetch pooled connections from the Datasource WatcherService- the REST

Copyright (C) 2017 ceus-now.com, All Rights Reserved. webmaster#ceus-now.com 14 q. 0.355 s.