1013 byte By
vipinzee at 2007-9-30 11:02:12
We generaly use a singleton class when we want only a single instance of that class to exist.Why cant we use a class with all static methods and all static member variables for the same purpose.what is the difference between the following two classes.public class ClassStatic{private static ...
Like a fool, I sold my first year statistics textbook and have regretted it ever since. Help a guy out?It goes like this: I have two random variables, X and Y, for which I know the cumulative distribution functions. I have a third random variable Z, which is just X + Y. Is there a formula ...
Hi,i need to create a multidimensional structure let's say with n dimensions.I only know what n is and the size of each individual dimension at runtime.I cannot use an array because it's not dynamic, so curently i am using a Vector of Vector's.If i know the number of dimensions it's easy to ...
Hello all..I want to make a Counting sort that sort an array[1],...,a[n] of integers, which each in the range 0 to m, inclusive.The algorithm may look like this://....start of algorithmInput Parameter: a, mOuput Parameter: aCounting_sort(a,m) {//set c[k] = the number of occurence of value k in ...
I have a FORM which can have multiple instances of a single field. Each of those fields can have a different value.Now when I submit the form, I will get those attribute values as an array.For eg if I have a field say Owner which is present multiple times on my Form, when I submit FORM then I ...
1228 byte By
valjok at 2007-9-30 11:19:59
Some Server have multiple TCP clients and the goal is to fix output bandwidth on per client basis (each client has its own limit). The implementation will be done using FilterOutputStream. I'm itnerested in the algorithm. Currently, I mark the connection establishment time. After each write ...
I have data that's coming from a network connection in the format as followsreceiver_email=someone%40hotmail.com&receiver_id=I9OWF2HNCR2XH&business=paypal%40yourdomain.com&item_name=Item1I wrote a simple algorithm to parse the data based on the = and & characters. My question ...
hi,I'm writing a program that read data from database to create a Tree. The database table:DATAPREDATAPOSTDATA145267312489If the DATA has a PREDATA, it will be inserted into the left node otherwise null and POSTDATA will be inserted into right node. For example if I pass in 3 the Tree should ...
605 byte By
tazze at 2007-9-30 11:31:21
Hi,Im trying to analyse soundfiles. In every soundfile there are sounds from one real instrument. I want now to separate these sounds. I did count the sum of segments running over the soundfile and comparing them with a threshold but that is not getting exact segmentations and only works if the ...
643 byte By
enlowe at 2007-9-30 11:32:51
I'm working on a chromatic tuner. I use FFT to get the frequencies from the sound samples and then find the freq with the most power. The tuner works well for the most part. My problem is this: Some of the notes are being read as an octave above the correct pitch. It seems to be the same notes ...
145 byte By
must41 at 2007-9-30 11:35:10
How can I detect a collision between two rectangles? I'm now doing it with a few points but there has to be an algorythm for that!
Hi, I am trying to write an algorithm that reads in an image file and extracts every single pixels, checks whether it is black or white and stores 0 (black) or 1(white) ina 2-D array. So what steps should I take to read those pixels?Cheers,Dinaz Sheriff
198 byte By
xaviesh1 at 2007-9-30 11:43:22
Does anybody know of an existing URI/URN parser that can parse not onlythe scheme but also all the parameters. For examplemailto:abc@def.com?subject=subj1&body=body1
388 byte By
tazze at 2007-9-30 11:45:54
Hi,I want to make a waveform drawing panel. If i use a zoomed out look of the wave it doesn't seems to be the correct output like audio editors use. If the wave is zoomed out , for example, i paint every eighth point from the samples a line to the next eighth point.How do audio editor paint ...
322 byte By
fenril06 at 2007-9-30 12:11:56
Hi!I've tried unsuccesfully to find an algorithm of OCR /OMR over the web...I would like something not very complicated cause I just have to scan 4 boxes (a,b,c and d) to verify which one has been marked with a cross.A typicall form actually...If anyone has an idea or a link thank you! ...
1044 byte By
jim.cp at 2007-9-30 12:32:05
I was reading the Collections FAQ:"... Why don't you provide for "observable" collections that send out Events when they're modified? Primarily, resource constraints. If we're going to commit to such an API, it has to be something that works for everyone, that we can live with for the long ...
I have a problem with reordering an array when one of it's values is changed.I can state the problem as follows :Suppose there is an array of size three(3), consisting of elements 0, 1 and 2 at the respective indices. Now if the value at any one of the indices is changed, like 0 is changed to ...
818 byte By
PRASHPSG at 2007-9-30 12:37:45
Hello all,I am currently carrying out a project that involves using some genetic algorithms to solve optimal reduction Problems in a graphical term rewriting system. I want the algorithm to find the optimal positions for rewriting or reduction in this caseI need to represent chromosones in tree ...
I would like to implement those functions myself. The speed is all that matter, the accuracy does not matter. Trig functions are especially slow in java and are the most important to improve
224 byte By
kbr1412 at 2007-9-30 12:48:47
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
186 byte By
Tjoa at 2007-9-30 12:54:29
Hi, I currently doing a project which needs the API for data compression in J2ME environment. Does anyone here have or knows about this API. Thank You.
I want to write numbers in fixed format. I mean, using only 8 characters as it happens on the display of a calculator. What's the best way to format that numeric string? Thank you.
Hi,I'm mechanical engineer and I like programming too.Do you know about finite elements models used for structural analysis in mechanical engineering?I would like to know what architecture you would chose for the input files of this kinds of applications. On the meantime people use NASTRAN ...
I want to search through the arraylist by name and then print out the information at the index that it is found.Both the getname and print method are declared. Can someone tell me why this algorithm doesn't work. The compiler isn't giving me any errours. I am using a constructor and storing ...
2537 byte By
chops316 at 2007-9-30 13:03:24
I am trying to implement Eisenbergs and Mcguires algorithm for the mutex problem using the following codeimport java.io.*;public class EandM2 extends AbstractTestThread{ public static final int IDLE = 0; public static final int WAITING = 1; public static final int ACTIVE = 2; public static ...
Folks,In an enterprise system, the rules are variable in a year and they may change. The rules and data are somehow dynamic. The dynamic data exists in a RDBMS but about the rules, I want to put them in a Rule Base Engine. If they are hard coded, the system is not flexible again the changes. ...
1244 byte By
Hasooni at 2007-9-30 13:05:42
Im making a Java game that is played by a person's brainwaves, rather than any keyboard of mouse input.To convert analogue brainwaves into digital numbers than can be used as game inputs, I have to use FFT - since im interested to know the amplitudes of the alpha(8-12Hz), beta(16-20Hz) and ...
So I've been looking around for a good algorithm to compute a very precise value for e. All the algorithms I've found all use a derivative of the old summation from 1->n of 1/n!. And this is accurate, however I need to calculate e out to several thousand decimal places and you simply ...
I dont know if this is the correct forum, but it's the best I can find.I need to download a webpage, but it's on a php-using server... I do have an account on that server, so I basicly need an algorithm to submit my user info to the webpage, so I can acces them...any suggestions?tnx ...
175 byte By
Tjoa at 2007-9-30 13:20:08
How do we check if there are multiple files to unzip ?Is there a the method in the java.util.zip that allow us to check for multiple files ?
What is the complexity of this problem?It's my old problem, it was presented on this board a while ago.You have a ball. The ball is in a 3D space. It's moving on some trajectory that is unknown. There are a lot of other balls. You know starting positions of balls, expected destinations and ...
318 byte By
jboeing at 2007-9-30 13:24:33
Does anyone know if anyone has made available a package for multi-objective genetic algorithms (such as NSGA-2 or SPEA-2)? I found source in C, but here at work, we need it in Java. I had no luck with Google, and if nothing shows up, I can start porting from C (at least it's well-written ...
1565 byte By
kill1234 at 2007-9-30 13:26:01
Could anyone help me to implement a fastest fibonacci with recursive , and use the BigIntegers for avoid the integer overflow problem, the methods like "static public BigInteger fastestFibonacci(int n);the Fibonacci is defined as follows;fibonacci(0)=0;fibonacci(1)=1for all ...
Has anybody written a Genetic Alorithm in Java or any other language...if so I would appreciate if he/she can send me a concrete example.... manju_RN@rediffmail.com
2453 byte By
asjf at 2007-9-30 13:27:26
hi, I would like to find the shortest string possible given a rewrite relation (a Map in the code below) and a string.The map has a special property that anything mapped to cannot appear in the input string (this is hacked in to the implementation below by surrounding the r.h.s with !s)a simple ...
Hi everyone,I like to use winamp all the time and it has a jump feature that can jump to a song if you type a few letters that are contained in it. So i'm trying to apply that idea to a directory i have on my computer that has too many books to look through to find anything. My first thoughts ...
238 byte By
anilntm at 2007-9-30 13:31:38
hiI had to convert a value in hexadecimal to its corresponding ascii value.How can it be done ?( eg:313233(hexa) will be 123(ascii) ) Pls help me with a sample code.thankxAnil
427 byte By
santan_1 at 2007-9-30 13:32:04
I have an application to code that is about loading a Container in an optimized way, I do not know how to start the algorithm, I looked at the Genetic Algorithm but it is only about optimizing the exeistig situation,but how can I load lots of different shaped objects into a Container that has ...
I am trying to put an array into a file and read the array from the file. I am using FileOutputStreamObjects and FileInputStreamObjcets. I have serializable implemented and here is the code. The code compiles but and the Save method seems to be working because i checked it with MS-DOS so I ...
Question:Do you know a function that fits these requirements1) Its chaotic (other then knowing the function a value cannot be used to predict the next value of in the sequence)2) Its guarenteed to be 1 to 1.Range is whole numbers 0 to 32^2-1. Domain is whole numbers 0 to 32^2-1. Each number in ...
1464 byte By
kill1234 at 2007-9-30 13:36:12
Hello; The following is the code for recursive fibonacci , but i got a problem with run my code, when run my code with "java Fib 20", it come up the result in 1 second, but when I run my code with "java Fib 50" or up to 50,I wait for 10 mins, i could not see any things, I am runing in linux ...
533 byte By
chungkp at 2007-9-30 13:37:00
What is the most efficient way of converting from 1D array into a 2D array? I know the easiest way is to do something like:k = 0for( int i = 0; i < array2D.length; i ++ )for( int j = 0; j < array2D.length; j++ ) { array2D[j] = array1D[k];}But this is rather inefficient for handling a ...
186 byte By
santan_1 at 2007-9-30 13:39:04
IS there anybody knows about the bin packing algorithms, I searched the web but there is not any usefulsource for me! can you tell me a book name or a resource name.
Hi,I am a novice to Java (and not that experienced with programming.) I am looking for a library of basic reusable components. Most of the stuff I want is fairly simple, but for the college assignment I am working on, I would get a better grade for reusing robust external components rather than ...
does anyone have code for the negamax algorithm in order to build a game tree for a draughts playing program. Any help would be much appreciated
133 byte By
lolidus at 2007-9-30 13:46:07
Write a program in C++ or Java that will take as input two Web pages URLs and find a path of links from one to another.
1767 byte By
kill1234 at 2007-9-30 13:47:24
Hello; I am implementting for insertion sort, but when I run my code, it report the following error, If my array side > 100000. Could anyone help me, Thanks. Exception in thread "main" java.lang.OutOfMemoryError [code]import java.util.*;public class InsertionSort{ public static Random ...
4250 byte By
kill1234 at 2007-9-30 13:49:48
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 ...
Hi I'm creating a few map algorithms. A nasty map generation. Any Ideas and recommendations? I have a few rather effective algorithms, I prefer non fractal ones, that are able to create maps at sizes 1000x1000. They are not stat of art however. Because on the Internet is a pretty low amount of ...
Hello,I am wondering how to convert user input string such as "hello world" to a BigInteger using the constructor public BigInteger(string val);How does this work exactly? I do