Recent update: 2008-5-9
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 ...
Unexpected NaN from arithmetic operation with doubleI抦 not sure if this is the right place to post this message but I hope someone can help. I'm puzzled by a very strange computational error. Java is multiplying two doubles (a[2]*b[2] or 0.0 * 0.0) and is getting NaN. I've attached the code ...
i want write a algorithm to implements the normal distribution formula. i worked hard but without success. does the jave liberary includes one? or please some write one for me. thank you!
Hi,Can anyone help to create an algorithm for arranging a graph as http://www.spss.com/research/wilkinson/Applets/graphlayout.html the "Network" layout on this page.Thanks a lot.
I need to do a project for time table generation. I need the algorithm for doing the same. Kindly send it...
I need to take an ArrayList of characters and print combinations of them. The length of the combinations should be from 1 character long to x (an input number) characters long. The characters in the ArrayList can be used more than once. What algorithm can I use?example:x = 5ArrayList contains ...
6457 byte By
h3nrya at 2007-9-24
Hi, I have written a short program in Java that takes as input a text file containing an arbitrary number of mathematical sets (presumably with the property that none of the sets can be formed by union of any of the other sets, although thats not really important) and finds all possible ...
Hey well i have to make a project for my grade 11 computer science class and i wanted to do something hard. i was thinking of a game called tank wars. Here is an example of the game i want to recreate: http://www.addictinggames.com/tankwars.html. I just need to know any ideas any of u might ...
I`m looking the algorithm reRooting a binary tree:reArange the pointers of the roots (and leafs) and create a new Tree from a chosen root ( =one of the subTrees of the original root).(A Tnode holds data, and pointers to the left and right Tnodes.
Hello there,can anyone take a look at this very short piece of code and tell me why my JButtons are refusing to show up!/** * Validate.java * * * Created: Mon Apr 24 13:02:50 2006 * * @author <a href="mailto:Samuel@EL-DIABLO"></a> * @version */import java.text.*;import ...
495 byte By
MAKa at 2007-9-24
Hi everyone,I need help on deleting an already existing quota entry in MS Windows XP. I used java to run the commands available in FSUTIL QUOTA in CMD and I was able to create and modify quota...The problem is that I cannot delete an already existing quota entry using java... I used a vbscript ...
Hello,Im trying to write another method called primeProduct that takes as input a positive integer n > 1and returns the product of the primes from 2 to n.So far i have only got the program to see if the number is prime or not.Is it easier to write primeProduct in an array? And is the ...
I came across this link and thought it would be useful to my fellow programmers: http://en.wikipedia.org/wiki/List_of_algorithms
If I have 3 positions and 3 numbers I know there are 6 possible soultions (of having a diff number in each)If I have 4 positions and 4 numbers I know there are 12 possible soultions (of having a diff number in each)I know the function to find the number of diff positions in n! where n is the ...
i face a problem where i wan compare the contain of the string, let saystring a = "java is cool";string b = "well java is cool";the tokens for a =3 n b=4,i wan compare the whole line using tokenizer, where the b have the similar string on a. the result will be,token 2 3 4 from b is simalar with ...
轻俞倾 卺磉?Hello for all I want to make Balanced Merge Sort algorithm in my project ,but i face many problems as,I can't make this algorithmand , i don't know ,how i can to establish files to write and read from it ..Example about this algorithm for members who don't know about BMSsuppose that ...
Hi im trying to get the program below to work, the method "naive" is redundant but works, its just there to show you what im trying to do. isSpam should be passed a message, and it then needs to use the patterns located in spamPatterns (just a text file read in and separated into separate lines ...
Hi,I see some product that use "java code statistics analysis" in order to my JR programmer made program as SR programmer or as AP.I think that is better for my apps this tools.I think that this tool could make "robots" and could make that SR programmer to cash more money. I like see a Open ...
Hi, i found some source code online for a holdem poker odds calculator.i had a look at the code, and tried to copy and compile it. It compiles, but doesn't give the answer i was expecting! bascially it's for a java appletts which you can see here: http://www.jbridge.net/jimmy/holdem_sim.htmAs ...
651 byte By
Zoliqa at 2007-9-23
Hi!!!I have a serious problem with a program i've made.More exactly i have a problem with just a part of the code because i can't stop a thread.This thread is executing a cpu intensive code(i mean the cpu is at 100% when runs this part of code), and i don't know how to stop it.It can be ...
140 byte By
gomaa at 2007-9-23
if we Solve this recurrence relations. may assume that T(1) = 1 then we find O(2^n/2) or n^2 just tell me T(2m)= 2T(2m-1) + 2m
Hello all,I have been trying to find an efficient way to convert some strings into Bitsets in Java. Unfortunately I'm having trouble mapping the string character values to the Bitsets. Currently I read in all of the Strings which reside in a text file in the format:a b c fc da detc. I then ...
Hie dear frenz,Im a beginner here, I would like your help on how to to string manipulations. I have done aprogram that reads a text lines from a file and write it out to another text file. But, at the same time, I need to display the text file line by line and store it in the string, and ...
I have a following problem: -Given a class with member fields (typical value object) I would like to generate as many objects of this class as many combinations created by the set of setters as well as futher combinations resulting from the different set of values it can take. This class will ...
Hi, I need to find difference between two files.This is an example:oldfile.txt:This is the old file.I need some help with this task!.newfile.txt:This is the new file.I need help with this task please!.Differences:* old -> new* need -> need* "some" was deleted* please was addedNotice that ...
Hi all,im developing a shortest path searching techniques by using Djikstra's algorithm. My search space is very huge and it is about 100,000 nodes or we can call it Vertex. I store all the nodes and weight of edges in MySql as follows:From|To|PathCostA B2B A2A D9DA 9BC 7CB 7BE 5EB 5CD 5DC ...
HiI have the design challenge of creating an unified login. I have already though about several solutions but I'm not happy with any of them. I'm trying to find a loosely coupled solution.I have, in my application container: -> webapp 1 -> webapp 2 -> webapp 3Each with it's own ...
Hello,I am trying to use JgraphT. it sure simplifies things BUT, I think there might be a problem in setting weight on an edge of undirected graph.here are few code lines that stuck:ListenableUndirectedGraph g = new ListenableUndirectedGraph ( );g.addVertex( "v1" );g.addVertex( "v2" ...
can any one tell how i can call e.getPoint from another method in the same class that i defined in it mouse listner.means.that i have button event and mouse event and i want to get the point from the mouse event and use it in the button event.
Hi,I'd like to get/replace the methods implementation of a java file. Like this:public class A { public void myMethod(String s) { XXXX }}getMethod("public void myMethod(String)") > returns "public void myMethod(String s) { XXXX }"replaceMethod("public void myMethod(String)", "public void ...
I am trying to parse a Newick formatted tree, which looks like this:(((One:0.2,Two:0.3):0.3,(Three:0.5,Four:0.3):0.2):0.3,Five:0.7):0.0;( http://evolution.genetics.washington.edu/phylip/newick_doc.html tells more about the format)The string above represents a tree:+-+ One+--+| +--+ Two+--+| | ...
I have a database includes list of book names and price.when key in a book name, system will return its selling price. however, if user keyed in name wrongly, for exmaple. "risl management" instead of real name "risk management", my system won't know how to handle this type of problem. another ...
[nobr]The following code is for the benefit of the Java community to improve the performance of the removeAll and retainAll methods when removing elements from an array.The following is the link to the RFE: http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=5028425The following code is provided ...
Hi all, I am trying to create a FilteredRandomizer. I have a range of values (e.g) [MIN , MAX]. I want to reduce the probability of some specific numbers, for example I have range from 1 to 4, if I am generating them 1000 times each number could be generate 250 times. I want number 3 to be ...
Hi guys;i have a .txt file that contains data that i want to pick for some manipulation...the structure of one record in the file is as follows:in a line it has : ID, fname, Lname, section ...in the second : the first 15 days of the month :01,02,....15in the third: the coresponding hours worked ...
I am trying to come up with a way to do machine authentication in a generic way. Basically, what I was thinking that I will create a simple java class, with my public key embedded.When user will run the program, it will use the local machine's MAC address, encrypt it,and write the information ...
Hi!I would like to write a server-side program which generates guaranteed ordered numbers (incremental, no hole and duplication) in a networking environment with clustered servers (Used by many clients and Lotus Notes). How should I start doing this? Where can I found great documentation for ...
Hello;I am implementing a stack base on array, and the array size will auto increse by double the array size, if the array size is full, But I got a problem that I do not know how to increse the array size. Could anyone help, please.Thanks. import java.lang.*;import java.util.*; class Stack ...
hihow can ı re write a file without loosing before ı wroteı mean thatin program ı wrote something in a filelater ı want to add something in file again
Hello,I am writing a basic Image processing system, which reads an grayscale image, stores the pixels in an 2 dimensional array, then writes the array back to an bufferedimage for writing to file . I felt the bufferedimage was too slow to processing.I discovered, when coping the bufferedimage ...
4232 byte By
asjfa at 2007-9-21
hi, for the zip algorithm in java.util.zip doessize(zip(A) + zip(B))==approxsize(zip(A+B))?I've run the code below on a few directories of a couple of thousand files and the results seem to more or less say yes. This seems surprising because I'd expected zip(A+B) to be able to compress more ...
283 byte By
j3boXa at 2007-9-21
Hi all~It may be stupid to ask but I am totally new to this java programming...i will be thankful if any kind soul can help me out on this :How do i implement new algorithms in java, using MergeSort and SelectSort as examples?thank you very much!!!
Hi.I'm studying computing at university, and my dissertation requires me to work with sound. Amongst other things, I need to find the frequency of some sound data coming into the computer via a microphone.I understand that I need to use a fast fourier transform on this data. I have chosen to ...
Can anybody tell me how does repaint work.
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, ...
Hi !I have a matrix 11x11 and I need a 2D Guassian Fitting algorithm !Does anyone know where i could find one ?ThanksFelix
What is algorithm for sinus?so if I would like to count sin 3= Math.sin would lead just to native method so no learning from source files.
public class Hungarian {Hungarian ( int[][] matrix ){//input a n by n matrix}private void initial(){//some initial process}public int getMin(){//main ideainitial();rowSubtract();columnSubtract();while( minCover() < this.size ){modify();}return findSolution();}public int getMax(){//main ...
I need help to define the best approach to avoid connection jam.I am writing some classes that read xml file, save to local disk, parse its contents, send receiving notification & insert the contents in oracle database. The xml file is sent over a network and I have a listener (servlet). ...
Hi, the quadtree data stucture seems so simple, and fits alot of problems, but coding it properly is a problem.The purpose of the tree is to find which objects are with in a visible area.So each node has dimensions x,y,width, height. And child a,b,c,d. Plus a object list.The main method to ...