Micho Lee

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

Recent posts by Micho Lee

So I'm guessing I just have to manually copy any multi-dimentional arrays that are passed if I don't want any references to the original?

For now that's what I did but I wish there were some shortcut.

BTW thanks for the reply.
18 years ago
I know that when an array is passed to a class or method the value of its reference is sent. Hence when I pass an array to a new class/object I created and that object performs operations on that array, the values are changed in the original array. How do I pass an array so that the object creates a local copy and the original isn't altered by the new object/class/method?

ex.

private int naPoo[][] = null;

foo(int[][] p_naPoo)
{
naPoo = p_naPoo;
naPoo[1][1] = 69;
}

main()
{
int naPooOrig[][] = new int[2][2];
naPooOrig[1][1] = 77;
foo objFoo = new foo(naPooOrig);
System.out.println(naPooOrig[1][1]);
}

this will give output of 69. I don't want this. I want to pass the array but not have it altered by the receiving object or method.

I tried using:

naPoo = (int[][]) p_naPoo.clone();

but that doesn't work... same result. Any help would be much appreciated.
18 years ago
I'm writing a java application that runs in the background in a Windows XP environment. I need a way for the application to detect when certain keys have been pressed on the keyboard even when it is not in focus. Kind of like a key logger would do, I need it to detect any keys that might be pressed. Does anyone know how to implement such a "global" key listener so that a key press can be captured at any/all times within Windows?

Help (esp exaple code) would be much appreciated. Thanks in advance!
19 years ago
I'm writing a java application that runs in the background in a Windows XP environment. I need a way for the application to detect when certain keys have been pressed on the keyboard even when it is not in focus. Kind of like a key logger would do, I need it to detect any keys that might be pressed. Does anyone know how to implement such a "global" key listener so that a key press can be captured at any/all times within Windows?

Help (esp exaple code) would be much appreciated. Thanks in advance!
19 years ago
Thanks for the advice! I'd rather re-instantiate too.. to avoid bugs... but if performance becomes and issue I guess I should look into reusing the object.
20 years ago
Hi, I was wondering how efficient the java garbage collector was at cleaning up unlinked objects. If I have an object I reuse over and over again but just reinstantiate it with each round of the program's execution instead of resetting particular variables back to their initial value, does it make a large performance difference?
In other words, as a simple example:
1.
for (int nCounter = 0; nCounter < 10; nCounter++)
{
myObject1 = new myObject();
}
2.
for (int nCounter = 0; nCounter < 10; nCounter++)
{
myObject1.init()
}
Would 1. be a lot worse than 2.? The init() function would just rest all the variables to their initial values.
20 years ago
This makes perfect sense. I was thinking that I would have to do something like this but didn't know what tools to use. Thanks for the detailed explanation. If I run across problems trying to implement something that you mentioned, I will humbly take your offer for additional help.
Best Regards.
20 years ago
Is there a way to compare images or image objects in java to see if two images are identical?

Thanks a bunch!
20 years ago
Is there a way to compare images or image objects in java to see if two images are identical?

Thanks a bunch!
20 years ago
Thanks for the speedy reply Jon.
"Before going into a lengthy explanation, please verify that I understand your question. It sounds like you want to determine whether or not an image has been "stamped" with your logo and, if so, find the x,y coordinate of the logo. Is that correct?"
Yes, that is what I asked on the first part of the question.
"Before going into a lengthy explanation, please verify that I understand your question. It sounds like you want to determine whether or not an image has been "stamped" with your logo and, if so, find the x,y coordinate of the logo."
Again, Yes.
Is that correct? Can we assume that the logo is the same size on each image (even though the images may vary in size)?
Yes, the logo images are all exactly the same as the original.
Also, I'm assuming that you want to first read the image into a Java Image object rather than looking at the raw image data. Is this correct?
Yes, dealing with an Image object would be easier, but I'm not familiar with it. Can you please provide some insight?

Once again, I appreciate the help very much.
20 years ago
Hello:
I was hoping someone could give me some insight into finding exact image matches. I know image comparison is complex if you�re trying to find similar images, but the comparison I�m trying to do is locating an image that is exactly the same as the one I have in hand.
I have a bunch of images of differing sizes into which I inserted a logo. The logos are all exactly the same so I want to search each image, locate the x, y coordinates of the logo on that image and remove/replace the logo. I�m sure it involves comparing pixels or something, but I�m not sure how to do this. Can someone point me to an effective and quick way to locate a matching image within a picture?
Also, I know the approximate area the logo appears in all the pictures (bottom right) so is there a way to use this information to speed up the process so it doesn�t have to search the whole table.
On a related topic, there is a serial number I inserted into each of my images. Is there a way to extract these letters and numbers from a pixel/graphic representation into string/int data? I�m sure if I don�t know the exact font used I just have to make samples of each character (0-9, A-z) and use the comparison type method I asked about above. But how about if you have/know the font used? Otherwise is there a good way to go about converting alphanumeric image data? I�m sure those hidden speed guns/cameras use this type of technology to capture the license plate numbers of speeding cars these days.

Any help would be greatly appreciated. Thanks in advance!
20 years ago
Hello:
I was wondering if someone could give me some direction in leaning how to access and control other windows using a separate program. For instance, I want to be able to detect when a window taskbar button blinks (saying something happened), open that window, then capture (alt-printscreen) and print a picture of that window into a file. Can someone give me some sample code or direct me to documents that would help me do this? I�m working with Java, so java related help would be most appreciated.
Thanks a bunch in advance!
20 years ago
Hello:
I was wondering if someone could give me some direction in leaning how to access and control other windows using a separate program. For instance, I want to be able to detect when a window taskbar button blinks (saying something happened), open that window, then capture (alt-printscreen) and print a picture of that window into a file. Can someone give me some sample code or direct me to documents that would help me do this? I�m working with Java, so java related help would be most appreciated.
Thanks a bunch in advance!
20 years ago
Hello:
I was wondering if someone could give me some direction in leaning how to access and control other windows using a separate program. For instance, I want to be able to detect when a window taskbar button blinks (saying something happened), open that window, then capture (alt-printscreen) and print a picture of that window into a file. Can someone give me some sample code or direct me to documents that would help me do this? I�m working with Java, so java related help would be most appreciated.
Thanks a bunch in advance!
20 years ago