Discussion:
... whiskey tango foxtrot.
(too old to reply)
Brandon Streiff
2005-10-02 21:08:54 UTC
Permalink
Pointer-arithmetic is fun!

... when you're writing C. Not Java pretending to be C.

It would be nice to have some javadoc comments for functions... I mean,
it'd be nice to know what, say, SlideAndDecrement should return. The
node's index? It's parent? The current US national debt mod 256?

Or what 'work down the tree' in updateRevAdaptive really means aside
from some sort of kinky action that would make an environmentalist cry.

Sigh.

And this whole represent-the-tree-as-an-array thing is... odd. I am very
very tempted to gut the whole thing and actually have a proper tree
structure, since manipulating array indices directly totally breaks the
object-oriented paradigm (omigod not that word) that Java is designed
for. (as opposed to, say, a Tree class backed by an array implementation)

-- brandon
Drake Dowsett
2005-10-02 21:13:41 UTC
Permalink
Post by Brandon Streiff
Pointer-arithmetic is fun!
... when you're writing C. Not Java pretending to be C.
It would be nice to have some javadoc comments for functions... I mean,
it'd be nice to know what, say, SlideAndDecrement should return. The
node's index? It's parent? The current US national debt mod 256?
Or what 'work down the tree' in updateRevAdaptive really means aside
from some sort of kinky action that would make an environmentalist cry.
Sigh.
And this whole represent-the-tree-as-an-array thing is... odd. I am very
very tempted to gut the whole thing and actually have a proper tree
structure, since manipulating array indices directly totally breaks the
object-oriented paradigm (omigod not that word) that Java is designed
for. (as opposed to, say, a Tree class backed by an array implementation)
-- brandon
Feeling your pain.

Drake
Luke Robison
2005-10-02 16:22:04 UTC
Permalink
I second that request.
Please Please comment your code, if you expect us to comment ours.
Could have really used More comments, and come to think of it,
Could have really used MORE Cowbell!!
I've got a fever, and the only cure is more COMMENTS!!!
Tarun
2005-10-02 21:18:58 UTC
Permalink
I second that request.

Please Please comment your code, if you expect us to comment ours.

Could have really used More comments, and come to think of it,
Could have really used MORE Cowbell!!
t3h j1mb0
2005-10-02 21:27:05 UTC
Permalink
You all might just be as lost as I am, but which array is the weighted
node .index() returning for?
Post by Brandon Streiff
Pointer-arithmetic is fun!
... when you're writing C. Not Java pretending to be C.
It would be nice to have some javadoc comments for functions... I mean,
it'd be nice to know what, say, SlideAndDecrement should return. The
node's index? It's parent? The current US national debt mod 256?
Or what 'work down the tree' in updateRevAdaptive really means aside
from some sort of kinky action that would make an environmentalist cry.
Sigh.
And this whole represent-the-tree-as-an-array thing is... odd. I am very
very tempted to gut the whole thing and actually have a proper tree
structure, since manipulating array indices directly totally breaks the
object-oriented paradigm (omigod not that word) that Java is designed
for. (as opposed to, say, a Tree class backed by an array implementation)
-- brandon
Luke Robison
2005-10-02 16:32:41 UTC
Permalink
Post by t3h j1mb0
You all might just be as lost as I am, but which array is the weighted
node .index() returning for?
lookupTable and parentTable. The index function just maps the
node_character into a positive integer. in C you would just do:

lookupTable[WeightedNode.node_charater];

this is what he was talking about when he mentioned signed chars.

(i think)
-luke
Somik Behera
2005-10-02 21:38:37 UTC
Permalink
Pre/Post conditions for the methods would have really saved me a lot fo
time in understanding the code. Given that everybody designs their code
differently, it would be helpful to comment the design consideration
including pre/post conditions for the methods.

-somik
Post by Brandon Streiff
Pointer-arithmetic is fun!
... when you're writing C. Not Java pretending to be C.
It would be nice to have some javadoc comments for functions... I mean,
it'd be nice to know what, say, SlideAndDecrement should return. The
node's index? It's parent? The current US national debt mod 256?
Or what 'work down the tree' in updateRevAdaptive really means aside
from some sort of kinky action that would make an environmentalist cry.
Sigh.
And this whole represent-the-tree-as-an-array thing is... odd. I am very
very tempted to gut the whole thing and actually have a proper tree
structure, since manipulating array indices directly totally breaks the
object-oriented paradigm (omigod not that word) that Java is designed
for. (as opposed to, say, a Tree class backed by an array implementation)
-- brandon
Trevor Fountain
2005-10-02 22:03:21 UTC
Permalink
int SlideAndDecrement (int index )
{
...
double national_debt = 0;
try {
URL debtclock = new URL("http://www.brillig.com/debt_clock/");
BufferedReader in = new BufferedReader(new
InputStreamReader(debtclock.openStream()));
String line;
while((line = in.readLine()) != null) {
if(line.indexOf("debtiv.gif")>0) {
int left = line.indexOf("$")+1;
int right = line.indexOf("><",left)-2;
String alt = line.substring(left,right);
alt = alt.replaceAll(" ","");
alt = alt.replaceAll(",","");
national_debt = Double.parseDouble(alt);
break;
}
}
in.close();
} catch(IOException x) {}
return national_debt % 256;
}
Post by Brandon Streiff
Pointer-arithmetic is fun!
... when you're writing C. Not Java pretending to be C.
It would be nice to have some javadoc comments for functions... I mean,
it'd be nice to know what, say, SlideAndDecrement should return. The
node's index? It's parent? The current US national debt mod 256?
Or what 'work down the tree' in updateRevAdaptive really means aside
from some sort of kinky action that would make an environmentalist cry.
Sigh.
And this whole represent-the-tree-as-an-array thing is... odd. I am very
very tempted to gut the whole thing and actually have a proper tree
structure, since manipulating array indices directly totally breaks the
object-oriented paradigm (omigod not that word) that Java is designed
for. (as opposed to, say, a Tree class backed by an array implementation)
-- brandon
Jamie Hargrove
2005-10-03 05:20:55 UTC
Permalink
User-Agent: OSXnews .10/b
Xref: number1.nntp.dca.giganews.com utexas.class.cs337:383

In my opinion, the only major comments the code was missing as handed to
us was a concise description of the actual usage of the 3 arrays... and
quite frankly, I'm going up the tree in updateRevAdaptive, as there
appears to be no good way to do the reverse. Descriptions of what exactly
each function would have been nice as well I guess.
Anyone else think that the update functions should really be passed the
symbol/byte rather than an index so that the zero node cases could be
handled in full there?
--Jamie
Post by Brandon Streiff
Pointer-arithmetic is fun!
.... when you're writing C. Not Java pretending to be C.
It would be nice to have some javadoc comments for functions... I mean,
it'd be nice to know what, say, SlideAndDecrement should return. The
node's index? It's parent? The current US national debt mod 256?
Or what 'work down the tree' in updateRevAdaptive really means aside
from some sort of kinky action that would make an environmentalist cry.
Sigh.
And this whole represent-the-tree-as-an-array thing is... odd. I am very
very tempted to gut the whole thing and actually have a proper tree
structure, since manipulating array indices directly totally breaks the
object-oriented paradigm (omigod not that word) that Java is designed
for. (as opposed to, say, a Tree class backed by an array implementation)
-- brandon
.
Nick Whelan
2005-10-03 05:14:07 UTC
Permalink
Yeah, I'm having absolutely no luck with the reverseAdaptive function. The
going down the tree has also gotten me confused.

-Nick
Post by Jamie Hargrove
In my opinion, the only major comments the code was missing as handed to
us was a concise description of the actual usage of the 3 arrays... and
quite frankly, I'm going up the tree in updateRevAdaptive, as there
appears to be no good way to do the reverse. Descriptions of what exactly
each function would have been nice as well I guess.
Anyone else think that the update functions should really be passed the
symbol/byte rather than an index so that the zero node cases could be
handled in full there?
--Jamie
Post by Brandon Streiff
Pointer-arithmetic is fun!
.... when you're writing C. Not Java pretending to be C.
It would be nice to have some javadoc comments for functions... I mean,
it'd be nice to know what, say, SlideAndDecrement should return. The
node's index? It's parent? The current US national debt mod 256?
Or what 'work down the tree' in updateRevAdaptive really means aside
from some sort of kinky action that would make an environmentalist cry.
Sigh.
And this whole represent-the-tree-as-an-array thing is... odd. I am very
very tempted to gut the whole thing and actually have a proper tree
structure, since manipulating array indices directly totally breaks the
object-oriented paradigm (omigod not that word) that Java is designed
for. (as opposed to, say, a Tree class backed by an array implementation)
-- brandon
.
Son Le
2005-10-03 00:53:41 UTC
Permalink
I dont think there is anyway to work down the tree in updateRevAdaptive.
That is said, I go up to.
Post by Jamie Hargrove
In my opinion, the only major comments the code was missing as handed to
us was a concise description of the actual usage of the 3 arrays... and
quite frankly, I'm going up the tree in updateRevAdaptive, as there
appears to be no good way to do the reverse. Descriptions of what exactly
each function would have been nice as well I guess.
Anyone else think that the update functions should really be passed the
symbol/byte rather than an index so that the zero node cases could be
handled in full there?
--Jamie
Post by Brandon Streiff
Pointer-arithmetic is fun!
.... when you're writing C. Not Java pretending to be C.
It would be nice to have some javadoc comments for functions... I mean,
it'd be nice to know what, say, SlideAndDecrement should return. The
node's index? It's parent? The current US national debt mod 256?
Or what 'work down the tree' in updateRevAdaptive really means aside
from some sort of kinky action that would make an environmentalist cry.
Sigh.
And this whole represent-the-tree-as-an-array thing is... odd. I am very
very tempted to gut the whole thing and actually have a proper tree
structure, since manipulating array indices directly totally breaks the
object-oriented paradigm (omigod not that word) that Java is designed
for. (as opposed to, say, a Tree class backed by an array implementation)
-- brandon
.
Loading...