@# Quotes DB     useful, funny, interesting





Google
 
Web www.quotesdb.info
Undernet  |  EFnet  |  Quakenet  |  Freenode  |  Dalnet  |  Ircnet  |  Galaxynet
Page: 1 2 3 4



Comments:

<0> hi teralaser
<1> :)
<2> or should i say nack !
<2> anyway, sup fellows ?
<0> I guess he still has urges
<3> Hello
<4> shines
<3> I'm pulling data back from a db that's hierarchical in nature and i guess self referential e.g. a category which has a parent category
<3> how can i represent that in java?
<4> and?
<5> Smithers: and?
<0> a tree ?
<4> create a cl*** that holds the data
<6> Some cl*** with a parent property of that cl***.
<4> and a ref to a child of same type



<3> i tried a tree map but it didn't really work
<3> e.g. a child may have several siblings
<0> do you mean data struct or gui representation ?
<4> then add a list
<3> data struct
<6> cl*** Thing { Thing parent; List children; ... }
<5> Talden: right
<3> yeah i then tried to use a hash map usign the parent as key and a list at each
<5> I was in the process of typing that
<0> you just described a tree, with circular references
<6> List<Thing> in 5.0 world
<4> I don't like the 5.0 world
<0> a Graph is the more general form
<3> but that didn't really work either
<5> Smithers: it should. It's the correct representation.
<3> because say I have a category called SoftwareDev and that is the parent of a category called OOP and say OOP is the parent of Java
<0> and
<3> when I try to print the hash map to e.g. the console...
<4> just use Talden's solion
<5> Why a hashmap?
<5> A hashmap is the wrong solution.
<3> i get OOP at the same level as software dev
<0> FFS, just because you can't view a structure on a 2d display doesn't make it wrong
<3> by the way the cl*** Categroy doesn't have any reference to its parent
<0> a hash map isn't a tree
<5> Why not store it as an actual tree... i.e., the way Talden showed you
<0> either
<3> becuase i have to implement the tree and have no time
<5> Smithers: talden just implemented it for you :)
<3> i want to use an api cl*** if possible
<5> like List?
<3> yeah
<5> just like Talden showed you?
<5> Smithers: there's a constant refrain in the channel, alas
<3> what u mean?
<5> the refrain goes something like "Talden showed you the right and simplest code"
<3> ok thanks Taldan :-)
<3> Talden even
<6> Heh
<4> heh?
<6> I hope the final code isn't that 'simple' ;)
<3> lol
<6> But still that's the gist.
<3> i didn't really explain myself correctly...will when i understand the problem properly though
<3> there are some reasons why some of the aformentioned mightn't work..
<3> or they might ...i just have to get myself together..
<6> Smithers... the Collection cl***es exist for the many cases when they are a good fit. Often the best fit is to build the structure into your cl***es directly rather than delegate structural responsibility to a set of standard cl***es...
<3> yeah..its just i have so much else to worry about...i'd have to test em and all so its an unlikely contender
<4> dude, just read the api docs
<4> or do the collection tutorial
<4> it really doesn't take that much time
<6> By the way it can be useful in a database representing a Parent-Child structure (singly rooted) to also manage an Ancestor Descendent structure with distances. This can simplify many queries.
<3> hmm
<6> The SQL to maintain the AD relation is simple enough and can deal with breaking into subtrees and moving subtrees... Finding grandchildren becomes trivial as does retrieving a path to a root... A reachability table is possible as well in a graph but it's not quite as simple to maintain.
<3> sounds like fun
<7> if I want to initialize a whole array to '0' , is there a way I can do that, and what if I would like to set array[10-20] to zero too ..
<7> since there is no pointer, in C I would just do a memset
<8> from debugging i know, that there is a problem with using the awt package on our server for some reason
<8> i read it is a known problem, something running under the name of "headless"
<8> can anyone point me to a workaround?



<0> yay what is the array type ?
<7> a byte array
<0> it is initialised to 0 already
<6> Arrays cl*** perhaps
<7> there is a whole thing of very simple things I am not quite sure how to do them in java yet
<7> it's declared like this
<7> byte[] rawPacket = new byte[48];
<6> yay_ - initially the array is cleared for you
<7> ok
<0> it is initialised to 0 already
<7> and _suppose_ I would like to say ..array from 10 to 20 = 1
<0> yay_ try the tutorial
<6> yay_ - if you want to fill a region with a value later then look at the fill methods of the Arrays cl***
<7> is there a way to do that ?
<0> read what Talden already suggested and/or use a loop
<0> RIF
<0> www.thejavatutorial.com and thinking in java are good places to start
<7> would it be something like Array.fill(rawPacket,10,20,1); (for example)
<0> TiJ has a section for converting C coders
<6> Arrays not Array
<7> calchas : ok I'm looking - but I am not totaly starting from nothing at all ..I did c/c++
<7> ok ok
<0> yay_ go and read that API
<7> sun.com/java?
<0> yay_ while this is true you will have to do things like READ the api docs
<7> I am using eclipse also, I was wondering ..is there a way to 'press f1' and have the related api documentation
<6> yay_ - ***uming that you don't need to do a little relearning will be a big problem... Java looks like C/C++ in many ways but it really really isn't.
<0> api docs are on the same page as the jdk download
<8> anyone can help me with that little "headless" problem ;)
<0> I'm sure eclipse has that functionality, may not be F1 though,
<0> READ it's manual :)
<0> newone sorry i have no clue
<8> ok
<8> i guess google is my friend then ...
<0> as always
<8> ;)
<7> also just another thing
<7> if I have my byte array, and I want to put in a long for the next 8 consicutive bytes
<7> would I find something usefull in Array ?
<0> no
<0> need to do the bitwise arithmatic yourself
<0> that sort of work isn't what java was designed for and is not supported much
<9> I have a JavaScript exploit for homework question...
<9> may I ask it
<9> :)
<10> no
<9> oh wait channel rules say I may not
<10> try #javascript instead
<9> relax guys , I'm just slightly intoxicated
<9> anyway
<9> I suppose most of the people here are "enterprise' cl*** developers right?
<9> guys?
<9> if you ever wrote a web application say "I!";
<9> so what was it? was it an accounting or ERP thing?
<11> no
<9> oh , lucky you then
<9> did I spell that one right?
<9> "lucky"?
<11> yeah
<9> 'cause I'm not american , nor british
<9> and I drank 3 Carlsbers
<9> and some other stuff
<9> Becks I think
<9> or was it beks
<9> anyway
<9> I have this major problem with the current trend in IT
<11> they let people like you in?
<10> too many drunk developers?
<9> (it's the reason I got drunk today too :) , ain't that lame)
<9> my girlfriend is attacked by cats
<9> kittens
<9> right now actually
<9> she's at my place


Name:

Comments:

Please enter the result of the sum 63 + 46 (to avoid spam):






Return to #java
or
Go to some related logs:

#AllNiteCafe
#MissKitten
getsystemtime api vc6
ubuntu a8n-vm networking
#linux
#linuxhelp
cowsay fuck
romaniairc
p0th undernet
robot chicken hump washing machine



Home  |  disclaimer  |  contact  |  submit quotes