Image to Base64

282 byte By emereditha at 2007-9-30 2:20:37
Using the JAI I am able to convert .tif images to jpg without issue. Now that I have the jpg, I need to convert it to Base64 to transport via XML. Is there a standard way of doing this? I'll look at Open Source, and packages if necessary, but would prefer not.Thanks.

help me with linkedlist please!!

1128 byte By apcssa at 2007-9-30 2:25:38
public void insert(int id, int inv){ Object value = new Item (id, inv);DoublyListNode temp = new DoublyListNode(null, value, null); if (size == 0) addLast(value); else {DoublyListNode p = first; while ((p != null) && (((Item)p.getValue()).compareTo(value)) > 0) {p = p.getNext(); }if ...

comparing trees

1217 byte By tabz123 at 2007-9-30 2:27:05
Hello everyone. Im a bit of a algorithms newbie- forgive me if this a basic question. Im trying to compare 2 many branching trees to check if they are the same. Im checking the data item in each tree to the other one, and the length of the branch if it is the same. The method returns true if ...

the shuttle puzzle problem..

1491 byte By o37355345 at 2007-9-30 2:27:10
Hi guys;for those raedy to rise challenges i present this problem... Any ideas to solve it are welcomed..some code would be a generous action from your part... SHUTTLE PUZZLE The SHUTTLE PUZZLE of size 3 consists of 3 white marbles, 3 black marbles, and a strip of wood with 7 holes. The marbles ...

Algorithm For Handling Multi-Row Conditions in ResultSets

1392 byte By mjacobsca at 2007-9-30 2:35:29
I have objects that are composed of multiple rows in my database. In order to determine whether on object meets criteria, I allow my users to specify formulas during their search, such that they might say "give me all objects where condition one is X and condition two is Y, OR condition one is ...

Simple LZW Compression Algorithm

3303 byte By blimblob at 2007-9-30 2:40:03
I have to write a very simple LZW algorithm based on the following psuedocode as part of my final year thesis.1. word=" ";2. while not end_of_filex=read_next_character;if word + x is in the dictionary word = word + xelse output the dictionary index for word; add word + x to the dictionary;word ...

desperate looking tree algorithm

468 byte By scifo at 2007-9-30 2:40:49
Hi,I am looking for an algoritm that traverse a Jtree and display all the possible combinations of treenodesfe.root-A-1 -1_1 -1_2-2-B-3-4a want to create an output like thisABA,BA,1A,2A,1,2B,3B,4B,3,4A,B,3A,B,4A,B,3,4........but i cannot figure out how to do thisgreetings ...

Generate unique hascode based on two integeres

667 byte By ash_mod2 at 2007-9-30 2:48:22
Dears,The problem of generating unique hashcode for an object instance has been quested a lot, I need help in an object that depend on 2 integers as I try to represent a finite state machine so I need an initial state and transition to give me the future state, thats how I thought about it.My ...

v42bis java library?

215 byte By marktjm@yahoo.com at 2007-9-30 2:50:10
Anyone know if a v42bis data compression library has been developed in Java, either free or for purchase?Please email me directly at marktjm (at) yahoo (dot) com.Thanks,Mark

Calculating IP Ranges

1253 byte By novo_caine at 2007-9-30 2:55:05
Hi i'm currently struggling on a problem!i'm writing a program that will create a range of IP Addresses given a start and finish address.So far i'm using a nested 'For Statement' shown below!if( (A > 127) && (A < 192) ){ServerDialog.append("\nClass B Network");for(i=C; ...

Basic Java Code Refactoring

727 byte By s3nghly at 2007-9-30 2:56:48
Hi there, im looking for a way to refactor Java code, i've developed a syntax highlighter using ostermiller, and it basically reads in a java file, colors it, puts it into a document, and then that document goes into a JTextArea.But if the whole of the java code is one one line, eg. public ...

shunting

253 byte By Techno1 at 2007-9-30 2:57:28
hi there, i am new to this and really need simple easy to understand help please.what is the shunting algorithm and how does it work? please explain to me in a nice and easy to understand words. i would appreciate this.Thanks

how merge?

568 byte By doctorbie at 2007-9-30 2:57:43
hallo everyone!here is a function i have to implement .public static Skyline merge(Skyline skyline1, Skyline skyline2){} Skyline is an class that contains two constructors;1) a constructor with three parameters (left,right,height)2) a constructor with one parameters (int[] coords)the question ...

Grayscale images:

1139 byte By Stephen9500 at 2007-9-30 3:02:34
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 ...

Gauss Elimination

68 byte By erolkocaman at 2007-9-30 3:04:24
Where can I find Gauss Elimination algorithm in java ?

simple replace method

3941 byte By rkippen at 2007-9-30 3:13:36
I'm looking for the fastest replace method that does a simple substitution based on a left to right scan.Of the following, so far replace2 is the fastest:public class Replace { public static void main(String[] args) {StringBuffer sb = new StringBuffer(); long time = System.currentTimeMillis(); ...

Problem with Adler32 algorithm provided by the Java API

2074 byte By hemant-kumar.jha at 2007-9-30 3:14:46
Friends,I have come across a situation where the checksum provided by the Class Adler32 from the java.utils.zip package returns a value which does'nt match the checksum generated by C++ counterpart for the same string.Initially I thought it was the problem with the C++ implementation but after ...

evaluation

716 byte By Techno1 at 2007-9-30 3:18:19
Hi there. I have a coursework handed out - before you think anythin i am NOT asking for the answer - i would love to but things dont work out like that.:)I DO NEED YOUR HELP :)basicaly, i need to make a program that evaluates some input expression (maths nos. 1-9 +*-/() )and evaluate it using ...

Transforming an int to 4 bytes and back to an int

2115 byte By fedetxf at 2007-9-30 3:24:03
I had this code:static int byteToInt(byte x, byte y, byte z, byte w) {int xx = (int) x;int yy = (int) y << 8;int zz = (int) z << 16;int ww = (int) w << 24;return xx + yy + zz + ww;} static byte[] intToByte(int x) {int xMask = 0x000000ff;int yMask = 0x0000ff00;int zMask = ...

optimisation problem

275 byte By harras2 at 2007-9-30 3:25:37
I am trying to find the smallest number of iterations required to produce a value to a client defined precision. I have working code with a brute force solution, but need to optimise for when high precision required. What is best algorithm for this?haras

Ensure specified-precision numbers sum to X

1066 byte By zcox456 at 2007-9-30 3:26:32
Here's a (hopefully) interesting problem I though I'd submit to the Algorithms forum.Given a set of doubles (double[], Collection of Double objects, etc.), create a corresponding set of Strings such that: - each String is the text representation of one double - the Strings have a fixed but ...

newtonian square root help! im getting a zero!

1407 byte By bananasplits at 2007-9-30 3:29:08
Hi guys, this is my first post here, adn I'm taking first level Java. I just recently wrote this code and at first it had 2 errors which i was finally able to debug, and made a clean compile. But now when i run it, it always gives me a zero output. Hope you can enlighten me. I know this code ...

Searching Files in a Directory.... help! :)

685 byte By veryconfused at 2007-9-30 3:30:41
HiI am developing an application, which when loaded allows you to specify a directory, the app then searches that dir for jpgs, gifs, etc, and then displays them in a slideshow, that has a next button and previous button at the bottom. So far I have created a slideshow app that shows ...

finding the nearest neigbhor between set of points using bucket search

810 byte By its_phani at 2007-9-30 3:31:54
hello, Can any one help me to sort out the problem i having, I have a set of points which form one cloud(cluster) and another set of points(cloud), i want to find the shortest distance of each point in first cloud to all the points in second set(cloud)using dynamic search , for example . . ...

drawing a spiral

238 byte By nodevelop at 2007-9-30 3:39:33
hi,I am trying to write an applet that draw a simple spiral point by point ( g.drawLine (x,y,x,y);)I was thinking it was quite simple, but now I don't think so!please, can you help me? eml

extracting frequency using fft

899 byte By qotsa at 2007-9-30 3:39:57
I've read other topics on this subject but they dont quite answer my question.I'm working on a project to create a guitar tuner for a pc. The idea is to take input of a note through the mic and indicate whether it should be tuned up or down. I pluck a guitar string into the mic and read the ...

Is there an easy way to select Items randomly from a data structure?

526 byte By ChrisJY at 2007-9-30 3:46:09
Put simply, I want to implement a "bag" data structure. So, when i select an item I don't know which one i'm going to get. I want to be able to select all the items once (so no replacing of items i.e. selecting the same item twice in one session).I can think of ways to implement it using ...

Radix Exchange

2277 byte By wyrzy at 2007-9-30 3:49:01
I've been looking for a way to implement the Radix Exchange Sort in a Java app to sort a simple array. I'm having a little trouble understanding the code behind the algorithm. I know that the Radix Exchange Sort is set up like the QuickSort, but I was wondering if anyone can tell me how to ...

Tokenizing

520 byte By MarkFairchild at 2007-9-30 3:49:21
Does anyone have a good insight into how to make a regex-based tokenizer? I have a set of regular expressions that describe each of the possible tokens, and I'd like to tokenize a string using them.Obviously, I could just scan through the string, repeatedly trying each regex until one matched. ...

Slowing an algorithm down

545 byte By Ricky_s at 2007-9-30 3:50:36
Hi!This is my first post!For my dissertation, i am animating algorithms in Java (sorting, geometric etc) and I need to animate the algorithms step by step, and was wondering how it is possible to 'slow the algorithm down' so that it can actually be seen on my canvas!? I have also began ...

application registration algorithm

931 byte By oldmicah at 2007-9-30 3:51:00
I'm writing a small shareware app that I would ideally like people to register. This is the classic, if they send in the registration code 'xxxxxx', then I can send the unlock code 'YYYYY' situation.Three criteria:1) I would like the registrtaion code xxxxx to be unique. I am toying with ...

Finding word index from sorted Array of String

1813 byte By TimirKumarPatel at 2007-9-30 3:59:18
Hi there,I having Sorted Array of Words withabout 1,00,000 Words.In present i am using Binary Search Method to Find Word. but it is giving stranger Resutls some time.Is there any faster Algorithem to Find Specicif Word index from Sorted List.Rem: At a Part of Application i am displaying Results ...

vectorial image

242 byte By Hidwulf at 2007-9-30 4:03:46
Hello ... i just want to create or convert a png (or jpeg) image to a vectorial image. Or to create directly a vectorial image from a database in mysql where the data is stored, because it's a graphic.Please help me ....

decrementing loop efficiency

640 byte By yosarian1 at 2007-9-30 4:04:19
I've met a loop implementation what was strange for me at the first time, because its against my natural logic.A., for (int i = a.size(); i-- > 0;) I was told it should be more effective, because there is just one function call at the initialization and nothing in the test part.I wonder if ...

multiple Loop co-ordination problem

2044 byte By Sylviasue at 2007-9-30 4:05:41
Hi GuysI am trying to create and algorithm which allows me to retrieve a list of Customers from my Database in lots of 5 (as in my Code below specified as formatNo). Currently the Code below will display the list of Customer in lots of 5 and the page number showing 1| 2| 3| 4| 5| 6| 7| 8| etc. ...

Looking for an algorithm

564 byte By frankhovin at 2007-9-30 4:07:04
I'm trying to make an algorithm that writes the following: 10 21 32 43 53 64 75 86 9610711812913914 1015 1116 1217 1218 1319 1420 15 The numer to the left is just a counter. The number to the right is a variable that counts upwardsbased on the counter.Anyone got any nifty ideas? And, before ...

Equation Parsing

461 byte By itim100 at 2007-9-30 4:09:22
I need to parse an equation as a String to a Boolean; say i need a method parseEQ():parseEQ( "2x+3z == 16*y" )would return true or false, and the variables are doubles that i have defined.How could i go about doing this? I realize it is difficult, and i looked for examples, but what i find is ...

Wrap Text

3840 byte By cybotx at 2007-9-30 4:14:16
[nobr]Anyone think this is a good way to accomplish this task? Anyone see improvements or better way to do this? /*** Wrap text at a certain line length. Default line break character is HTML <BR>** @param string The String* @param lineLength The position to create a line break** @return ...

ID3v2: Programmers' habits when describing bit-operations

1244 byte By Wan-Hi at 2007-9-30 4:17:44
Hi.I'm trying to implement a class that can read ID3v2 tags from MP3 files. The id3.org site seems to be the only source on the net where you can get information about the organisaton of ID3 tags.Unfortunately I haven't worked with bit operations before and get quite confused about the fact ...

attraction algorithm

6496 byte By rkippen at 2007-9-30 4:18:09
I want one point to be attracted to a second point such that the one point moves in a visually smooth way to the second point. The second point may change in location. The point only has to move along a horizontal line. Here is the code so far, but the termination condition doesn't work when ...

nearlyEquals(String, String) method

702 byte By AndyJoel at 2007-9-30 4:19:35
I am wanting to compare two strings to see if they are NEARLY equal, i.e. a user has given some input, and I want to compare it against a known String, and see if they are the same, but to allow for bad spelling. The result would be a score, say out of 100, something like:nearlyEquals("Some ...

iterative printInOrder of a Tree

1242 byte By joiaknla at 2007-9-30 4:25:22
hii, i'm doing a program that's supposed to printOut a tree using iterative inOrder and with a self created Stack.so i created a ListStackclass ListStack{private java.util.LinkedList list;public ListStack(){list = new java.util.LinkedList();}public boolean isEmpty(){return ...

Merging histograms

338 byte By clemort at 2007-9-30 4:26:58
Hi,I have two histograms. Sometime first one has points above second one, and sometimes below second one.My need is to merge the histograms together so as to get the encapsulating histogram.Does anyone knows an algorithm or a library so as to merge the two histograms ?Any idea is welcomed ...

convex hull

223 byte By aviadmo at 2007-9-30 4:28:27
i'm loking for an O(nlgn) algorithm for finding the convex hull of a set of circles with different radiithe algorithm i found is O(nh) when h is the number of output circles on the convex bounds

Iterative and Recursive algorithms

799 byte By keen2learn at 2007-9-30 4:37:20
I am fairly new to Java and am currently looking into Data structures, algorithms etc...I have designed a very basic ADT (Abstract Data Type) class called Loan which contains the following private instance variables 'loanNo, copyNo, membershipNo, dateDueBack, totalFines'.Basically I am trying ...

Cayley Tables

828 byte By mathuoa at 2007-9-30 4:40:03
Hi, The analysis of the following problem is "a bit difficult", speaking in terms of theory. What I am searching for is not a theoretical result, but a way to compute the solution. A cayley table is a table with the property that no row or collumn has the same element twice.e.g. 1 22 1is a ...

need help please

414 byte By anny_ward at 2007-9-30 4:42:22
I'm using 2D an array to represent the graph in first process I?m getting the minimum value but I have problem in 2ned process I?m getting again same value which I got it in first loop.I?m using Boolean Known [ ] array to check if it passed to node or not if (!known[k] && d[k]<m) { ...

ZIP FILES

92 byte By IT_STUDENT_HELP at 2007-9-30 4:44:27
i'm interested in knowing how to zip and unzip files in java....can you help

Fuzzy Checksum

1005 byte By kentkent at 2007-9-30 4:51:12
Hi-yaI want to detect when a web page has changed. To the best of my knowledge the last modified query on a web server is not req'd and also when implemented not accurate as to the real content. This problem addresses the problem of dynamic web pages that are served up and the names are ...

Brute Force Matching Algorithm Java Code

185 byte By EoinGriffin at 2007-9-30 4:56:32
Hi,Does anyone know code for the Brute Force Matching Alg in Java? I've worked out Knuth Morris Pratt and Boyer Moore but cant get around Brute Force.Thanks