Search:
Type: Posts; User: Filobel
Search:
Search took 0.04 seconds.
-
April 1st, 2011, 04:10 PM
Note that in your case, although the IDs ARE all unique, there is nothing that actually assures you it will always be that way. I don't know if this is an assignment or what, but depending on what...
-
April 1st, 2011, 02:22 PM
It really depends on what you are using that method for and when you consider two "person" to be the same. For instance, if you know for a fact that the ID will ALWAYS be unique to each person, then...
-
April 1st, 2011, 02:06 PM
First, doing:
Type String strChoice, strTryString, strTryInt, strTryDouble;
Is fine. They do need to be initialised before being used, but they don't NEED to be initialised the moment they are...
-
April 1st, 2011, 01:39 PM
Well, by cin, I didn't mean just writting
cin;
I ment putting something like:
cin >> a;
And by "at the end of your program", I ment right after the closing bracket of your "else".
So...
-
April 1st, 2011, 01:09 PM
This is pretty typical if you are using visual studio (I wish I knew why it didn't leave the console open). There are many tricks to stop this, but the one I typically use is to add a cin right...
-
April 1st, 2011, 12:06 PM
Ok, let me see if I get this straight. Lets say page 1 has n links on it, to page 1.1, 1.2... 1.n. (1.1 being the first link on the page). Then 1.1 has m links, 1.1.1, 1.1.2, ..., 1.1.m and so on....
-
April 1st, 2011, 10:52 AM
So, I'm fairly sure I have a deadlock, but I cannot for the life of me understand why. I'm using "lock" to make sure a thread doesn't try to access a collection while another one is modifying it. ...
-
March 23rd, 2011, 09:37 AM
Thank you for the tips, I'll keep those in mind while developing, tweaking the polling process.
-
March 22nd, 2011, 03:47 PM
Not sure if it's the best way to do it, but you could do something like
public class MyClass
{
TreeSet<Integer> two_numbers;
TreeSet<Integer> three_numbers;
MyClass(){
...
-
March 22nd, 2011, 03:08 PM
I hate polling as much as the next guy (possibly more), unfortunatly, I'm stuck with a library I didn't develop and for which I do not have the source code (nor would I have time to modify it). ...
-
March 10th, 2011, 10:41 AM
Well, I haven't changed anything to that part of the code and for some reason, it doesn't crash anymore. No idea what the problem was... hopefully it won't come back to bite me in the rear later on!...
-
March 10th, 2011, 09:42 AM
Actually, if the code got to that part, then you know for a fact that sizeof(long) != sizeof(jint). That was the whole point of the templating stuff. If sizeof(long) == sizeof(jint), this means...
-
March 9th, 2011, 05:20 PM
Ah! Sorry, I missread his question, he was talking about the body of the function, not the actual templating. Wow, I'm out of it today.
In that case, yeah, as I said before, the whole point of...
-
March 9th, 2011, 04:38 PM
The reason I said that is because, as I said, if I have the body of the template implementation for 4 byte long in a "regular" method and remove the template methods, the code works perfectly fine. ...
-
March 9th, 2011, 03:22 PM
Note before I start: This question contains JNI stuff, but the question is NOT actually about JNI and could most likely be answered by someone who knows nothing about JNI.
A little while ago I...
-
March 2nd, 2011, 09:54 AM
Sorry it took me so long to reply.
I wrote that code out of thin air directly on here, so it is quite likely that there are some mistakes. I just wrote the general idea, assuming you would be able...
-
February 24th, 2011, 05:01 PM
Let me see if I get this correctly. There are 500 tickets, two of which are winning tickets with different prizes. You want the user to be able to specify a number of tickets he wants to "buy" and...
-
February 24th, 2011, 04:36 PM
Perfect. So although I'm gonna use your bit of code to support 8 bytes long, I'll assume that more often then not, it'll be 4 bytes long and will use jints.
Thanks, I'll mark this as resolved...
-
February 24th, 2011, 09:54 AM
I heard you could use templates to do some stuff on compilation, but never actually used it. That's pretty cool, thanks!
Another follow up question. What's more typical? 4 bytes or 8 bytes for...
-
February 23rd, 2011, 09:16 PM
Follow up question revealing my newbiness in C++.
So, obviously, copying the values from the long array to the jlong array through a for loop adds an overhead and is unnecessary if the long is 8...
-
February 23rd, 2011, 05:31 PM
Bah, I was hoping there was a way to force to compiler to use one or the other, but didn't think there was. Oh well...
-
February 23rd, 2011, 02:17 PM
So, from what I understand, in C++ a long can be 4 bytes or 8 bytes. Not sure if it depends on the system or the compiler or whatever. Here's where I have a problem. I'm using JNI and I need to...
-
February 23rd, 2011, 12:52 PM
Ok, found how to fix it (sorry for the double post, but I felt the solution should probably be in a different post for the sake of clarity in case someone has the same problem). I'm not quite sure...
-
February 23rd, 2011, 12:03 PM
I just checked and I get junk in the constructor, so copying the values won't help.
-=edit=-
I really don't get it. I added this piece of code to the native side to see if the problem was in...
-
February 23rd, 2011, 09:41 AM
So you're saying in the constructor, you'd have something like:
for(int i = 0; i < 6; i++)
this.anArray[i] = anArray[i];
That could be a solution if I realise the data passed to the...
|
Click Here to Expand Forum to Full Width
|