nevermind, i read around and figured it out. sorry to take up space, but i wanted an answer asap.
Type: Posts; User: Perd1t1on
nevermind, i read around and figured it out. sorry to take up space, but i wanted an answer asap.
I didn't know where to put this, but I have been having a tediousness problem with deleting multiple tabs. Is there someway to delete multiple tabs at once. For example, if you selected 10 lines of...
what do you mean by a four bit primitive? and do you have a pseudo example of your last sentence? And about the boolean, I've always read that it is simply 1 bit and so it's value is either 1 or 0....
Is it possible to create a new data type in java? My idea for how it could be done is to create an object that holds holds a boolean array of n size and translates the number you make only when...
K, well since you've settled the precision loss problem for float, I'm going to use long for sure now. The reason both x and y have to fit into it is so I can use the smallest data type possible. for...
The objective is kind of difficult to explain properly to someone who hasn't seen all of the code but that's not really important. I was originally seeing if it would be possible to use float instead...
I'm not sure what you mean by using a long instead but I redid the code using a long instead of a double. I know that double and long also both require 8bytes so I'm not sure if this is more...
And here is the undo portion of my code:
System.out.println("mag: "+mag+", and yx: "+yx+", and y: "+y+", and x: "+x);
String breaknum=Double.toString(yx);
short newy;
short...
the range is also a potential problem, it seems using double, I cannot exceed an x value beyond 99999, if I'm using my current method. But that's probably okay, because I can see other ways around...
Well I need the precision more so I'll have to use doubles for this. The y and x are not a million right now, I've been working with around 200x100 max just to weed out errors. But it can be expanded...
well I'm not super experienced, but the I have already seen the out of memory exception so far. I forget where, it may have been a mess up with a while loop. In terms of a rough estimation of the...
Well this program is going to be gigantic so I'm trying to use the smallest data types possible at every opportunity.
I don't want to use double if I don't have to because I want to save memory. Here is the code using double:
short mag;
int magx;
short y=154;
short...
byte[]array=new byte[10];
for(byte i=0;i<10;i++){
array[i]=(byte)((i*2)+(2*Math.random()));
System.out.println(array[i]);
}
boolean even=false;
byte next=0,range;...
haha, i can't believe I forgot about else if. thanks aussiemcgr
First of all, ta[0][0]=30. I didn't add a system out println to that one.
But you can tell there's an error even if you don't know what the code is about. I'll explain:
ta[0][3] should not = 30,...
Hello, I have no idea why this is happening, but the computer is assigning incorrect values in my loop:
byte ran;
for(short y=0;y<yt;y++){
for(short x=0;x<xt;x++){
//...
sorry i didn't think the code would be enough, but I figured it out.
Just to simplify, I'll leave out the details to my code:
public class Theclass{
private short a,b;
public Theclass(short a,short b){
}
thanks, after playing around with it I realized that a hashset can only add members and check if a member is inside the hashset. So it's limited but fast. I'm guessing you would convert it to an...
I've always been confused about hashtables/hashmaps. What are they?
I thought they may be like a 2 dimensional version of an arraylist which is like a 1 dimensional array. If not, what is it, or...
thank you Norm, it's fixed
Hello,
I'm trying to make my array as compact as possible. since a calculation will not go above 60, i used byte data type, but the compiler says 'possible loss of precision' and then doesn't run...
THANK YOU SIR!!!! I have no idea why this was so hard for me to find, but you pointed me in the right direction and I figured it out. I have been wandering around this site today a bit, and I have...
So would I make a method to replace my savePic method and use ImageIO.write instead of FileWriter? could you give some sample code regarding ImageIO.write?