I'm trying to solve some ill-conditioned simultaneous linear equations for a graphics application. Gaussian elimination using total pivoting on doubles isn't accurate enough. Does anyone know any better techniques?
78 byte By
DOMO at 2007-9-27 18:31:19
I don't find this forum in the forum listing!Did you forget it?
I'm looking for an algorithm doing text searches in filesI need it to support AND OR + - keywords (for example "ejb AND peristence")Does anyone knows where I cand find this kind of algorithm with the full source ?Of course I can adapt C,C++ to Java.In fact my target language is Serverside ...
262 byte By
nleaver at 2007-9-27 18:45:18
Hello,Please could somebody help me to convert a long millisecond value into int's for hours, minutes and seconds?Thankyou in advance.p.s. So far I have done long seconds = millis / 1000; :-)
357 byte By
ctmoore at 2007-9-27 18:47:23
Anyone have any links to code that does this quickly?More specifically, I'm looking to calculate the hexadecimal digits quickly. So either do that or calculate base 10 and convert them fast.[I don't need the Bailey-Borwein-Plouffe Algorithm as I don't want individual digits, I want the ...
374 byte By
ctmoore at 2007-9-27 18:53:08
:chopping off the integer part of a Double/Float:double d = 'some double';d -= (int)d; //is this the best way?example-3.19283 --> -0.19283 0.9999-->0.999911.00192 -->0.00192:dividing out and rounding:double ak = 'some double';double r = 'some double';r -= (int)(r / ak) * ...
1032 byte By
Tbergman at 2007-9-27 19:16:36
Greetings all...I'm not any good at java...yet.However I was wondering if anyone can help me write a javascript calculator that will solve an equation for my father-in-laws website.He wants to allow visitors to calculate a flow rate of gallons per minute (GPM) by entering 4 variables. Now I ...
Hi i would like to create a HashTable that adds rectangles to an underlying arrayList, using the x,y,width,height of the rectangle to choose the index of the rectangle in the list.The reason for this is to speed up the retreival of the rectangle when searching with its dimensions.How do you use ...
822 byte By
johnR at 2007-9-27 19:45:07
I want to be able to uniquely identify a file by it's contents so I read the file and use java.utils.zip.CRC32 to compute the checksum value. I store the checksum value and compare any new file to the saved checksums to prevent the same file from being processed more than once. What is the ...
Have two arrays: ttt and ppp. I have to have a method to compare them.public int compareTo(object ob)both of the arrays are int type and both have super long numbers in them.Thanks
1586 byte By
abhijaan at 2007-9-27 20:00:21
Hi all!I wish to compare two result set's from different sources, the later data being populated from the previous one. Both the result sets will have some data which i wish to compare (extra data in both result set is present). Now in the later datasource changes can be made and records can ...
Here's a reasonably interesting requirement for an algorithm - well I think so anyway.Given any arbitrary range of numbers that represent plottable points along a graph axis, display suitable labelled grid divisions along the axis with "human meaningful" amounts on the labels. The graph axis ...
9673 byte By
stormk82 at 2007-9-27 20:14:26
hi this is an assignment that i have to do and i've written somecode below. but i have to find the maximum and average of therunning time by repeating 5 times. please help me! design an application program that performs benchmarking tests for ranking the sorting methods heapSort, mergeSort, ...
i have a number of problems-- but will start with this one first:1) first. imagine there is 2-d surface that is 15 kilometers x 15 kilometers. there are "points" ( reception test points for anyone familiar with cellular communicadtion ) placed every 100 meters on this 2-d surface. So a 15 x 15 ...
463 byte By
stotz at 2007-9-27 20:52:16
Hello,I am new in this Forum.I d'ont speak very good english....I Have a big question, I'm begin with Java programming and i'm intersted with AI Algorythm programming but i don't know how i must commence with.Some one can help me ?I search for good documentation about AI or Source Code (or ...
849 byte By
mgthura at 2007-9-27 20:57:48
hi everyone, I have one program, and that has to write with the OOP and also related with Maths's ideas. Would anyone help me to solve this? Here is the Program, and I gave the structure format below.Class VLDI(very large decimal integer)models positive infinite precision integer.VLDI i1 = new ...
in class Random ,the method nextInt:public int nextInt(int n) {if (n<=0) throw new IllegalArgumentException("n must be positive");if ((n & -n) == n) // i.e., n is a power of 2return (int)((n * (long)next(31)) >> 31);int bits, val;do {bits = next(31);val = bits % n;} while(bits - ...
I am investigating ways to perform the following (currently array based) problem efficiently.Here is the problem:1. There are two same-sized arrays (some other data structure may work as well) which store 0s and 1s at each index location.E.g.,int finalArray[ ] = new int[ 2601 ];int changeArray[ ...
Any ideas on how to parse an HTML page? I'm trying to do it with a StreamTokenizer but with little success. I don't think this class was made to do this sort of thing, Oridnarilly anyway. Is there a better choice? StringTokenizer? Here's what I have so far: URLConnection uc = ...
I have such a problem: there are text with JSP-like special tags in it:<%! <some declaration> %><some text goes here><%= <some expression> %><another text goes here><% <some code> %><%! <declaration again> %><all the remaining ...
Right now I am writing a maze program just for practice to take the Sun Programmer certification test. I am going to use DFS algorithm first, but I was wondering if there was a way to do DFS without using recursion. I am probably going to use recursion, because that seems more intuitive to me, ...
This is a cross post from a thread in the Java Programming Forum. If you haven't read this there, read it here and please reply if you have a minute.> I'm conducting a personal study about some stuff, just> out of curiousity.> > Who writes code like this:> >public void ...
hello!if you have an array that the first part contains negative numbers. what is the fastest way to count how many negative numbers in it?Meir!
Ok I have this DFS algorithm that I wrote for a maze (a 2-D array of what Cells, Cells extend Point, and that is what they basically are).Here is my code. You won't be able to run it, because of all the other missing classes.package Grid;import java.util.*;import java.awt.*;import ...
Ok, if you've read my other posts, you know I am having some DFS alrogithm problems. I would like to go over my algorithm in pseudocode and see if I am screwing anything up. If you want to see the whole code, it is in my previous post. ...
404 byte By
sabinap at 2007-9-27 22:27:47
Hi, how can I get the n-permutation of a given array of numbers? By n-permutation I mean e.g. for an array like 1|2|3|4 there are the 3-permutations 1|2, 1|3, 1|4, 2|3 and so on. I tried to find a method, but I was not successful. Now I would like to write it on my own, but I have no idea about ...
707 byte By
valjok at 2007-9-27 22:31:13
Hello, it very often when I have to write code like this:class Any { void build(param);} a.build(i); process(a); a.build(i2); process(a)Is the following programming style better?class Any { Any build(param) { ...; return this; }}... process(a.build(i)); ...
9 byte By
Ranter at 2007-9-27 22:31:42
Hi
i was wondering wheather there is a difference between a crc value and a HashCode. the definition of both seems the same."if 2 objects are equal the hashcode/must be equal, if the objects differ the crc/hashcode *should* be different to improve performance."i have another question: how can i ...
how do i generate an UUID in java?
709 byte By
DOMO at 2007-9-27 22:49:45
The situation:Imagine you're invited to a gameshow. There are three doors lets say A, B and C.Behind two doors is nothing. You only win, if you choose the one with the car.Now the showmaster asks you to choose one door. You choose one.The showmaster says he helps you and opens one door. The ...
I have a requirement to do some manipulation of relatively simple polygons. In particular I have two requirements:1. Determine the area of the polygon2. Create a new polygon from the intersection of two existing polygons that includes the area of the first minus the area of the second.I've had ...
290 byte By
dantams at 2007-9-27 22:54:08
I am looking for an algorithm which will calculate the decceleration of a spinning wheel, as in a slot machine. A rough algorithm would be fine, accuracy is not that important. If you have an acceleration algorithm, please share, I might be able to reverse it.TIADaniel
373 byte By
Mouni at 2007-9-27 23:02:33
How to stop an Animation when i start it tpo create a digital Signal for example: for (i=0; i<t.length; i++) {....// random Gaussian Numbert =((random.nextGaussian())) ;for (e=0 ; e>< 10000 ;e++){g.fillRect(i*10,0*ma齭tab,10,10);g.fillRect(i*10,-ma齭tab,10,10);}.......}...} ...
i'm a student in a hong kong institution. And i'm using java to write a mutiple player card game as my final year project.My supervisor suggest me to think about using a object base or a database to store the game rules: i.e. the algorithm to store the rules.However it is really odd to me, ...
767 byte By
miztasa at 2007-9-27 23:35:51
I need to write a class called Scrabble which has a constructor:public Scrabble(String s1)and contains a method: public boolean scrabble(String s2)and any other methods and variables I need. Assume that s1 and s2 are made of the 26 lower case ascii characters a....z. If the following code is ...
Hi All I am making a chat server using socket connection.I need to save a chat (in textArea ) on the server end.Can any one suggest me with some good and innovative way to do so?Thanks in advance Vipin
hello ...HELP !!!Having a slight problem implementing the A*Search in Java. We have it calculating the straight line distance from nodes to goal using .cost, however we need to get individual path distances between the nodes, preferably without hardcoding. We were thinking of using the addEdge ...
I'm wondering about the best way to pad a block cypher at the end of data.The problem is I'm reading from a buffer into a block cipher that takes 8 byte chunks. I won't know how much data there is until I get to the end, and I'm writing to a buffer so I cand prepend a count when I get ...
hi,i want to create a method to print to the screen an array of any dimension.i think it must be recursive, so this is the code i have at the moment:import java.lang.reflect.Array;public class Tst2 { //This is the recursive method public static void print_array(int[][][] array, int[] coord){if ...
Hi,I've an assignment at hand which I would like you to have a look at to see.Basically it's using Dijkstra's Algorithm and futher information could be obtain here... http://www.cse.unsw.edu.au/~cs2011/lect/ShortestPath.pdfAs for information of the assignment, pls refer ...
I don't understand what this question is asking.A) Develop a java program to output html text of home page of any URL, to console and also to an ASCII text file named urlhtmlinfo.txtUse URL class of java.net.* class library and any other standard java libraries.The url input as a command line ...
Hi,I've just noticed a topic from someone else with the same problem.. and yes it was homework. But I've done it for myself and could just do with any suggestions on how to speed it up.The problem was to take 2 strings s1 and s2 and check whether s2 can be made by rearranging some of the ...
Im new to the world of programming and need help with pseudocode, if anyone could give me a little help id be really grateful.I need to write this in pseudocode but am stuck on how to explain it in pseudocode.Car exits car park but first puts ticket with date and time printed on into a ticket ...
hi...I want to process road in one map. to be easy in that map there is only a road on it. let say i need to know/calculate a distance between to point on the road, how can i do this. The calculation between this to point must including not only one path, but also using any different path. I ...
398 byte By
bregotya at 2007-9-28 0:46:49
Hi, I need some small help regarding writing an algorithm. I want to find out maximum array values for given random array.sample data:Input :A[5] = { 3,2,7,4,1}//here i'm giving random values in an arrayoutput : 1,2,3,4,7// here i need output like ascending orderif anybody knows ,please help ...
Will memory be allocated when i do assignments of array of objects.For instance,class A { boolean [] bits;A (int num){bits = new boolean[num];}}class main{A [] obj;main (){obj = new A [4];for (int i=0; i<4; i++){obj = new A (10);}}breed (){A temp = obj[0];//** Is memory where obj[0] is ...
i'm really stuck i need to write a parrell soultion to the prefix sum problem. i'm new 2 java and v.confused any help anybody can give would be major major help
Is there a easy way of multiplying and adding binary numbers i JAVA? Especially big binarynumbers.
HiI need to find out the actual code that makes some of the methods in the API work. Anyone know a site where i can find this?Chris