|
|
Up |
|
|
  |
Author: CGeek WannabeCGeek Wannabe
Date: Aug 29, 2008 03:38
Anyone who is still seeing all the Protocols spam in this ng
I've found that if you can killfile or Score by the
X-Complaints-To: attribute, you can use this:
X-Complaints-To: abuse@ te.net.ua
It's pretty expensive, but it works. At least in slrn it does.
YMMV
|
| |
|
| |
4 Comments |
|
  |
Author: Roedy GreenRoedy Green
Date: Aug 29, 2008 02:28
On Thu, 28 Aug 2008 10:39:36 -0700 (PDT), "Tom A."
yahoo.com> wrote, quoted or indirectly quoted
someone who said :
>So, after I build the file, I was wondering how to get the offset to
>the "Offsets" area. I couldn't find any sort of "size" function that
>will return the size in bytes of "Names".
|
| |
|
| |
no comments
|
|
  |
Author: Boris StummBoris Stumm
Date: Aug 29, 2008 00:16
Mark Space wrote:
> Tom A. wrote:
>> 2nd question
>> If I have an array of say boolean, barray, would I be able to
>> initialize it using the new for syntax with:
>> for(boolean b : barray ) b=false;
>
> I think new arrays of primitives are initialized to 0/null/false just
> like instance fields in new classes, but I didn't double check that.
That is right.
> However I think b just represents the value of your array elements, not
> a reference to them, so no dice on the loop. Use indexes and access the
> elements as normal for an array.
If you do not want to fill it with 0/null/false, you can use
java.util.Arrays.fill()
|
| |
|
no comments
|
|
  |
Author: wizard of ozwizard of oz
Date: Aug 28, 2008 22:11
I'm trying to write a data class using generics. This class is a Sparse
Matrix meaning that it can have many dimensions but not many entries (e.g. a
100 by 100 matrix, but there might only be 10 entries in the matrix).
I intend to use LinkedLists or Trees to manage the row and column keys and
probably a hash Map to manage the cells - but that's not important right
now.
My first step is that in my add method, I need to ensure that my row and
column keys are in my list. I would like to use one common routine for this.
The problem is I can't figure out the right generics syntax.
Here is what I started with:
public class SparseMatrix {
private TreeSet rowHeaders = new TreeSet ();
private TreeSet colHeaders = new TreeSet ();
public void add (R rowKey, C colKey, E element) {
ensureExists (rowHeaders, rowKey);
ensureExists (colHeaders, colKey);
}
|
| Show full article (2.07Kb) |
|
4 Comments |
|
  |
Author: Tom A.Tom A.
Date: Aug 27, 2008 07:00
I am trying to set up a random access file RanFile.
(sorry, I don't have my code with me)
I have confirmed or created the directory, I have confirmed or created
the file in a File object, and then I create the random file
try { RanFile = new RandomAccessFile(File, "rw" ); }
catch ( < exceptions> ),
{ < put out informative error, and exit program > }
Then I use RanFile
RanFile.seek(0L);
and the compiler complains that RanFile may not be initialized. Now I
know that if it wasn't, then the program would have ended by this
point. How do I convince the compiler of that?
Thanks.
Tom A.
|
| |
|
7 Comments |
|
  |
Author: QQQQ
Date: Aug 27, 2008 00:27
Hi All
I read a book which mentioned Java new keyword vialiate "Open-close"
and "DIP" OO principle.
I don't understand it, anybody having deep knowledge explain to me?
Thanks a lot.
Steven
|
| |
|
4 Comments |
|
  |
Author: marlow.andrewmarlow.andrew
Date: Aug 27, 2008 00:04
I have just discovered that when a java program starts one of more
threads and then the main thread comes to the end of function main,
the program will wait for the other threads to complete unless the
threads are daemon threads. This comes as quite a suprise to me. Does
this mean there is an implicit join?
Regards,
Andrew Marlow
|
| |
|
4 Comments |
|
  |
Author: maxneslermaxnesler
Date: Aug 26, 2008 19:14
I have been doing some practice exams and came across this funny
'. . .' in the signatuer of a method:
int doIt(int... i) {
return 4;
}
any hint on what this means? i have an idea that it means you can
pass as many ints as you wish? Ruby uses a similar syntax.
|
| |
|
7 Comments |
|
  |
Author: maxneslermaxnesler
Date: Aug 26, 2008 19:12
I have been doing some practice exams and came across this funny
'. . .' in the signatuer of a method:
int doIt(int... i) {
return 4; }
|
| |
|
4 Comments |
|
  |
|
|
  |
Author: ykonykon
Date: Aug 26, 2008 16:22
Hello java ppl,
For some hours now I am experimenting with MappedByteBuffer, and I
have the following issue:
Firstly I write 10 integers, followed by a String encoded in UTF-8.
Next when I try to read it back, but the String is garbage formated.
Here is the (messy)code:
public class MemoryMappingRW {
MappedByteBuffer mbb;
public MemoryMappingRW(String fileName) throws
java.io.FileNotFoundException, java.io.IOException {
File myFile = new File(fileName);
if (myFile.exists()) {
myFile.delete();
}
mbb = new RandomAccessFile(myFile, "rw").getChannel().map(
FileChannel.MapMode.READ_WRITE, 0, 0x8FFFFFF);
}
public static void main(String[] args) throws Exception {
|
| Show full article (1.77Kb) |
|
no comments
|
|
|
|
|
|
|