How do u get a decimal to work on java..like for a calculator? I have no idea how to do it because there's no way to do exponents in Java, apparently.
I just have a long string and i want to make a integer of fixed length from that string, i thought of using hashcode() method to get the integer, but the hashcode will not be unique, can one tell me how can i convert the string to UNIQUE FIXED LENGTH INTEGER.Thaning youM.
For an audio application. as simple and basic as possible.any good sites on this. Or do u have a good example I could look at.cheersJ
Please help me...i cant seem to get the decimal function to work on my calculator..that is all i need tpo make my calculator work : package calculators;/*** A simple Calculator*/public class SimpleCalculator {static final String OPERATORS = "+-*/=";public final static double ONE=1.0;public ...
I have to update a database table every Tues-Sat from 4AM-6AM.so i written a code for a threadthis is the body of the run() method of a worker class that extends the Thread class.Calendar calendar = Calendar.getInstance();int currentHour = calender.get(calendar.HOUR_OF_DAY);int day = ...
Hi All,I am trying to fit a b-spline to a set of 3d points. I have a couple ofquestions that I can't see the answer to at the moment.1. How, if at all, can I extend the curve beyond the range of the points I have. I want to fit a curve to my data points, then extrapolate to see where the curve ...
256 byte By
spidey_a at 2007-9-29 16:32:16
hi,i developed a program which represents a struts-tree with a hard-coded root elementanyway, are there any pre-defined algorithm for representing a-bit-more-complex-than-trees graphs using with jgraph?thxbye--spid
hi everybody ... this is my methodpublic Data matchByInd1(Data data, Vector vector, int i) {Data _data; Data notFound = new Data("notFound"); if (i < vector.size()) {_data = (Data) vector.elementAt(i);if (!_data.isVisited() && matchInd1(data, _data)) {_data.setVisited();return ...
hi everybody ... this is my methodpublic Data matchByInd1(Data data, Vector vector, int i) { Data _data; Data notFound = new Data("notFound"); if (i < vector.size()) {_data = (Data) vector.elementAt(i);if (!_data.isVisited() && matchInd1(data, _data)) {_data.setVisited();return ...
Hi All,I am looking to use a kalman filter to predict the motion of a throw ball. I was wondering if anybody knew of a java implementation of the broad outline of the equations involved in kalman filters, or any specific examples of a java app / set of classes that have a kalman filter.I am new ...
Hi All,I need ideas/code/suggestions from you all. I am working on a Formula Builder UI. In this a user can create their own expressions choosing some variable values also. This will contain IF, AND , OR and NOT also from expression creation. For example it may look like this IF my_variable ...
Best groupmember,I just got to an intersection within my project where I have to decide what language to use for the part of my project that handles computing.What is the efficiency difference between different language, anyone having experience!? I'm most interested in the difference between ...
942 byte By
rkippena at 2007-9-29 17:02:50
This is more of an algorithm question then a JMF question (maybe).Scenario: User connects to webpage and loads applet. Applet makes a connection to a servlet. Servlet starts webcam and sends image data (in the form of bytes) from a webcam to the applet. The applet displays the image ...
Does anyone know an efficient implementation of an algorith to calculate the Luhn check digit of a number? Or know of a library that provides this?Here's a definition:Luhn Formula:1) Double the value of alternate digits beginning with the first right-hand digit (i.e. low order).2) Add the ...
Hello ,I require to create a youden Graph class. An applet would do good also as i have to display this graph to my clients over the net .I was looking for a ready made class or a pseudo code fr the same .Can any one help me ?Thank
Hello all,Can you please help me out a little bit on bin packing problem?I have a jpanel and i want to divide its space in order to put rectangles but having in mind that i have to take advantage of all the empty space provided by the jpanelthnx,John
I need to access the content of a Vector object, defined in a class (which keeps the references of database connection) from different classes.I don't know how can I share the reference of Vector object defined in one class, into other classes.You can consider that I want to design a middle ...
I've got a requirement to generate filenames based on a general pattern that looks like: "something.nnn" where "nnn" is some number represented in a zero padded fixed field - so the 6th sequential filename would be "something.006".So in a directory with files: file.001, file.002, file.005The ...
One part of my program requares to sort an array of 8 objects. Unfortunatelly there is no way to know how many times the sorting will take place, it could range between 10 to 10,000,000 and more times.What would be the fastest way to perform the task?Will Arrays.sort() be faster or i should ...
Speaking of sorting ...You know the shell-sort algorithim for n objects for(shell_size = n/2; shell_size > 0; shell_size /= 2) {for(the_shell = 0; the_shell < shell_size; the_shell++) {// sort items[the_shell + shell_size * x] where //x = 0 to n/shell_size }}generally speaking, shell sort ...
Hello!I?ve got problems with a recursive stack.I?ve got a stack overflow error. Hereis my push method.public void push(Object o) {StackRekursiv stack = new StackRekursiv();stack.top = top;stack.rest = rest;if(top==null && rest==null){rest = stack.rest = new StackRekursiv();top = ...
Hi,I'm trying to write a directed graph class.My graph is stored in a hash map, with key being an Object that describes the node (eg A) and the value being a list of Ojects (linked list) describing its neighbours (eg if A->B and A->C, value would contain B and C)I need a method which ...
It is simple to uniquely encode a number to another number within a certain "MAX", eg 2^31. Given to primes MULT and PLUS we can do it like this:int encoded=(number*MULT+PLUS)%MAX;eg for MAX=8, MULT=253, PLUS=13:numberencoded0512273441566370All encoded numbers are unique.My question is: How do ...
Hi guys,i would like to know which method or algorithm does Google use to recognise the user input and then match it accordingly.Thank you
Is there a way to implement the Comparable interface for sorting intervals of numbers so that two intervals are considered equal if they overlap?Or, alternatively, is the last axiom for the compareTo method of the Comparable interface used/needed by the TreeMap/Set classes?Background: I have a ...
Hello,I am trying to find a good algorithm for finding the best route between two stations on a subway transport system such as the London Underground. I have managed to read up on an algorithm called the breadth first search which is adapted to do this taks by using extra parameters such as ...
391 byte By
rkippena at 2007-9-29 18:04:17
0010010111001001111110110111001111001101Suppose given the above, what is the correct search term to describe putting rectangular boxes around groups of 1's until all one's are boxed (such that no boxes overlap) using the minimum # of boxes possible.I tried searching for "minimum rectangle ...
Hello:I searching for some advance math library that let me evaluate a function whit various variables. I looking more than one, to then compare for performance?Please I some one help to find some clue, I will grateful.Best Regards.
1137 byte By
korbitza at 2007-9-29 18:13:15
i wonder if anyone can help me out here, i have to design a piece of software, i have already written the software in C and i need a Java equivalent to compare the efficiency of both languagesthe basic problem is this,i have to implement a 10,000 x 10,000 array/matrix that allows adding, ...
I need a 64 (or 96) bit message digest function that acts like MD5 or something similar, but instead of spitting out 128 bit digests, it puts out either 64 or 96 bit digests. The problem is thus, we are currently using a piece of a proprietary library to create our pretty-close-to-unique keys, ...
hy guys, i'm totally screwed up. i can't figure out how to load an array of objects from a file into a separate method? it's always saying can't recognize symbols, because i'm putting buffered writer in the method, cause otherwise i don't know where to put it in the code in order to load ...
1995 byte By
UlrikaJa at 2007-9-29 18:24:03
This challange has been presented as hard and so far unsolved. Prove or disprove that the while loop terminates for a given value of x, where x is initially > 1.int x = ...;while (x > 1) {if (x % 2 == 0) // x is even x = x / 2;else x = 3 * x + 1;}Do you recognize this as an unsolved ...
Hi I have got a typical problem of setting font size in decimals. How do I achieve this. Please provide me some help.
Im looking for an efficent search algorithm which searches a body of text (under 3,000 words) looking for keywords.What would be the best algorithm to employ.The body of text may be a XML document (in which case id like to be able to search the XML elements eg search for 'Alan Turing' in the ...
Hi everyone,I'm relatively new to java and have been having some trouble with a program I'm creating. I'm trying to read a list of words from a text file into a 2D array and then use them to form the basis of a simple translator program with a GUI. One recurring problem early on was keeping ...
Ok guys, I know you all hate being asked for outright answers so I hope this isnt the case, but i really need help.I've been designing a maze that loads up a properties file into a 2d array called coOrdinates. These coordinates relate to a bunch of static ints (Wall, Inner, Sprite, EndPos, ...
259 byte By
usImagea at 2007-9-29 18:47:05
Does anyone know how to implement the SPIHT (Set Partitioning in Hiearchical Trees) algorithm in Java? It's used in Wavelet Comprssion in Image Processing.I have to implement it, but haven't a clue where to start. Thank you,Pete.
10677 byte By
legacyea at 2007-9-29 18:59:49
[red]This message was edited by legacye at 2003-12-9 20:29:17[/red][hr]Hey...im having a little problem with this program.It normally takes in two files containing linked lists of data (normal) is the normal data and (test) is data which we know has errors in it.It gets the gaussian ...
Hi there,I'm having problems designing an algorithm which returns all possible Eulerian Cycles in an unweighted and undirected Graph.(An Eulerian Cycle is a path which visits each edge in the Graph once, ending at the same vertex where te cycle started)Here's the code for finding one Eulerian ...
I have a table that has bug(description,subject or something). i want to search it by keyword.for example, a user enters "compatibility with Internet Explorer". i want to find "compatibility" word and "Internet Explorer" from the table. then should i make a string arraylike String[] keywords = ...
Hello All, If an arbitrary undirected and connected graph has edges with negative value how would the Kruskal and Prim algorithms be impacted? Also how would it change the complexity order? TIA
Suppose I have n random variables that can take values from 1 to d. The sum of the n variables is m. How many possible assignments to the variables are there? And why?This is stumping me big-time. Combinatorics is not my forte.
I know this is an extremely hard topic and there is many really advance solutions to it, but I just don't seem to find what I'm looking for, so perhaps someone who like this kind of things can give me any suggestions.I want a structure for a cube or hypercube of data that has following ...
Hello All,In Disjktra's Algorithm when computing the shortest path from one vertex to other vertices if some edge (x,y) with weight k is deleted how would the shortest path from v be updated without running the algorithm again in its entirety?TIA
Hello All,If one of the edges with a weight is deleted then how is it possible to update Dijkstra's algorithm with the shortest path without running it in entirety?TIA
Hi,I am wondering whether it is possible generate a random sequence of non-repeating numbers without storing previously used numbers.This is because the number sequence i need is formed from all the numbers between 0 and 2^32 and storing already used numbers will lead to large memory usage.I do ...
Hi all,What I want to do is to rebuild a tree from data stored in a database. I need help to build the algorithm since after many hours I still can't figure out how to do it. First, the data in the database is stored a certain way witch I think in english would translate "with intervals". I am ...
Could anybody give me a method to calculate a gausian matrix / kernal of unknown width, height and standard deviation Please.public double[][] gauss(int w, int h, int sd)Could anybody give me a method to calculate a lapacian matrix / kernal of unknown width, height and standard deviation ...
I have found and modified some existing merge sort code found using google. My modification is that i have added a boolean array which indicates when merging which half the element was chosen from. I hope to reconstruct the original unsorted array using a given boolean array.originally i ...
Hello there! I'm developing a project for my first computer science thesis at the university of Bari, Italy. This project consists in a OpenGL graph visualization tool but I'm having trouble in implementing a correct layout algorithm.The problem is that I have been unable to find any ...