Conrad McLaughlin

Greenhorn
+ Follow
since Jan 31, 2006
Merit badge: grant badges
For More
Cows and Likes
Cows
Total received
In last 30 days
0
Forums and Threads

Recent posts by Conrad McLaughlin

Thanks for the help.

The problem is now fixed by:
Float IDF;
IDF = (float) Math.log(N/M);
IDF = (float) Math.log(IDF);
18 years ago
I have narrowed it down and the problem occurs when calculated Inverse Document Frequency. Here is the part which is causing problems:



(Docs is an integer)
(M almost never has final value of 0.)

Next, calculation:



Example:
N=3, M=2
Log (3/2)
= Log(1.5)
= 0.1760912589 (on calculator)

BUT SYSTEM OUTPUT.
IDF = 0.0.


Is it something to do with Math.log?
18 years ago
222: incompatible types
found : double
required: java.lang.Float
VL = Math.sqrt(VL); //Square root


Can't you square root a number if it is a float?
(VL is declared as a float.)
18 years ago
In my program there is a calculation if done by calculator comes out to be 0.1465747 for example.

In the code this value is stored as a DOUBLE.

How come this number now changes to 0.0?

I have noticed other numbers like 0.812344 stay the same?

Any help?

What is float? Will that store 0.0002231 for example?
18 years ago
Really basic. I'm trying to create a splash screen for my program.
What is the best way?

How do I have a Jframe with has a jpg image?

At the moment I have a button with an imageicon as this is the only way I know how to show an image. But it does not look good.

18 years ago
Is there anyway I can make this JFrame always on top? I want to be on top of any other windows that appear later in the program.

18 years ago
Bit of a weird question, i am a java novice so I hope its not silly.

Can you save a tree map externally from a java file?

The reason being that is that I have a java program that adds words from text files to a tree map. The text files never change, and a lot of time is spent reading the text files into the tree map every time you re-run the program.

So it was wondering if there was a way of 'saving' the treemap to an external file and the 'loading' the tree map at the start of the program to save time of reading the text files again on each load.


hmmm...(do I make sense?)



Ps. What exactly is saved in the class files which are produced when i compile java programs?
18 years ago
I solved the problem:


Thanks for the help.
18 years ago
Thanks. I'm trying to work with it now.

but i keep getting:


Any tips on how to actually write the code to save filenames in string array?
18 years ago
Is it possible to an arraylist (string) of the names of files within a directory? eg. textfiles

i'm guessing you would need a while loop. but how to use fileinputreader?
18 years ago
How Do I add a vertical scroll bar to a JTextArea?

At the moment text is appended to the text area and when there is too much text the text area increases for some reason.
18 years ago
I'm new to java. not sure if this should be in beginners section.

How do you handle events for a list? If I have for example two items in a list and I want a system output for the item I have selected how do I do that?

This is part of the code that compiles and I see the list in Jframe:





How do I write code so it says "Message 1 selected" or "Message 2"?
Do I use Action events? How?
18 years ago
I'm new to java. not sure if this should be in beginners section.

How do you handle events for a list? If I have for example two items in a list and I want a system output for the item I have selected how do I do that?

This is part of the code that compiles and I see the list in Jframe:



How do I write code so it says "Message 1 selected" or "Message 2"?
Do I use Action events? How?
18 years ago
Any one know any wysiwyg swing builders so that I can draw menus and stuff for my program. preferably freeware.

I need to add GUI for my code.

I'm looking for recommended products to download or buy (within limit).

At the moment I use text pad and eclipse to write java. I did download a visual editor for eclipse but I had no idea how to install to plug in so many if anyone could help on that as well?

Is net beans a visual swing designer?
18 years ago
Are you asking how to convert an object to an integer? To do so you have to convert the object to string first. Look at my example where the object is called fn, string is fn2 and integer is fn3.

18 years ago