Return Styles: Pseud0ch, Terminal, Valhalla, NES, Geocities, Blue Moon.

Pages: 1-4041-

What good are trees?

Name: Anonymous 2010-05-28 14:55

I've never had to use them.

Name: Anonymous 2010-05-28 15:07

I use them all the time

Name: Anonymous 2010-05-28 15:07

>>1
they smell good and you can pick fruits and stuff of them.
you should go more outside.

Name: Anonymous 2010-05-28 15:08

They're good for making paper, for one thing.

Name: Anonymous 2010-05-28 15:10

trees are used to group data for fast lookup.

*b-trees are used in sql databases to make greater than less than lookups work quickly.
*r-trees are used for spatial indexing.
*distributed hash tables can provide fast lookup of peers in a decentralized network by organizing nodes into a tree.

Name: Anonymous 2010-05-28 15:18

>>5
And how are those better than basic hash tables?

Name: Anonymous 2010-05-28 15:19

Surely you must have breathed Air/oxygen which was produced/recycled from CO2 by trees through photosynthesis.

Name: Anonymous 2010-05-28 15:30

>>7
* algae

Name: J 2010-05-28 15:34

They are used in some compression algorithms
http://en.wikipedia.org/wiki/Huffman_coding

Name: Anonymous 2010-05-28 16:06

So, to sum this up:

Trees are useful in very special circumstances, you never need to know them for general tasks and when you need them you'll find an implementation easily.

Name: Anonymous 2010-05-28 16:12

What good are strings?

I've never had to use them.

Name: Anonymous 2010-05-28 16:38

So, to sum this up:

Numbers are useful in very special circumstances, you never need to know them for general tasks and when you need them you'll find an implementation easily.

Name: Anonymous 2010-05-28 16:42

>>11
you've never had to use sequences of numbers?

Name: Anonymous 2010-05-28 17:10

>>13
If you are using strings for that instead of an array/list of numbers, then you are a moron (or an erlang user)

Name: Anonymous 2010-05-28 19:06

>>14
if you are using something for strings other than sequences of characters and something for characters other than sequences of bits (which are numbers), then you are a moron (or using a quantum computer, but then you have infinitely many problems).

Name: Anonymous 2010-05-28 19:15

>>1
They helped to make the best hardcover book of all time. SICP.

Name: Anonymous 2010-05-28 19:21

>>15
I see this has gotten out of hand. >>11 was me taking the piss out of >>1. In >>14 I was talking about the general case of needing a representation of a sequence of numbers (which a string like "12 13 14" is a poor data structure for), and not how strings are implemented in your computer. I hope thats cleared everything up

Name: Anonymous 2010-05-28 19:52

>>17
But >>13 never suggested converting a string of numbers into a longer string of digits and spaces, so why would you bring that up?

Name: Anonymous 2010-05-28 20:00

>>18
the way I interpreted his post was as an answer to the question "what good are strings". Therefor "you've never had to use sequences of numbers?" seemed to me as if he was suggesting, "strings are good for representing sequences of numbers". As for the format, it was an arbitrary decision and could have been represented in a different manner.
And just for the record, I believe that having strings by an array(or list) of numbers a la C (arguably) and erlang, instead of having a separate character type is stupid.

Name: Anonymous 2010-05-28 20:10

>>19
I once tied some cables with strings. Totally useful

Name: Anonymous 2010-05-28 20:24

THAT'S THE JOKE

Name: Anonymous 2010-05-28 20:55

What good are programming languages?

I've never had to use them.

Name: Anonymous 2010-05-28 21:34

>>6
Hash tables let you lookup a single node. Trees let you lookup classes of nodes.

Name: Anonymous 2010-05-28 21:46

LISP doesn't support tree traversal.
It has half a dozen mapping functions for lists, but nothing for lists of lists. I was quite shocked.

Name: Anonymous 2010-05-28 21:55

>>24
The assumption is that you will build the tree functions from the list functions as necessary.

Name: Anonymous 2010-05-28 22:05

Any programmer who can not construct and support their own binary tree structure should turn in their license.

Name: Anonymous 2010-05-28 22:18

>>25
>>24 is right; its actually impossible to work with trees in Lisp, since it doesn't support recursion derp derp derp

Name: Anonymous 2010-05-28 22:32

>>24
It has quite a few actually, it seems you haven't read your Hyperspec.

Name: >>28 2010-05-28 22:33

Not that writing your own is hard. Most of the time when you're using trees, you want to do fairly specific things.

Name: Anonymous 2010-05-28 22:43

>>28
I did actually and found nothing of that sort.
The closest in there are subst and friends.

Name: Anonymous 2010-05-28 23:00

>>30
besides copy-tree and the like, subst/-if/-if-not and related, do let you map over a tree and replace elements selectively.

Mind explaining what kind of functions you'd like to see? Most of the times I needed to work with complex circular lists, I was dealing with graphs and more complex structures, and for those, I needed a full-fledged graph manipulation library (which I did find, altough, the documentation sucked, but was overall easy to use).

Name: Anonymous 2010-05-28 23:26

>>31
I needed something mapcar-like to search for some tags in parsed HTML as returned by closure-html. See http://common-lisp.net/project/closure/closure-html/examples.html for how that looks like.

I ended up writing a recursive function to do it and just wondered why there isn't something like this built into the language when there are lots of other constructs you could also just reinvent on your own but are useful enough to include. Or maybe I'm just missing something obvious.

Name: Anonymous 2010-05-29 3:11

>>22
the story of /prog/

Name: Anonymous 2010-05-29 3:39

What good are hash tables?

I've never had to use them.

Name: Anonymous 2010-05-29 4:22

>>34
They can be useful if you have a lot of data and need a faster way than iteration to look up an element (and you cannot just use regular indexing because the keys are too large).

Name: Anonymous 2010-05-29 4:31

>>19
many languages do have a separate character type, but that character type is almost always an integral type.
in haskell this is not the case, until you do something like this:
both :: Arrow a => a b c -> a (b, b) (c, c)
both = join (***)

instance Num Char where
    fromInteger = chr . fromInteger
    (+) = ((chr . flip mod (ord maxBound + 1) . uncurry (+)) .) . curry (both ord)
    (*) = ((chr . flip mod (ord maxBound + 1) . uncurry (*)) .) . curry (both ord)
    (-) = ((chr . flip mod (ord maxBound + 1) . uncurry (-)) .) . curry (both ord)
    negate = chr . (ord maxBound + 1 -) . ord
    abs = id
    signum = chr . signum . ord

instance Real Char where
    toRational = toRational . ord

instance Integral Char where
    quotRem = ((both chr . uncurry quotRem) .) . curry (both ord)
    toInteger = toInteger . ord


too bad schemers are stuck with their http://en.wikipedia.org/wiki/Scheme_(programming_language)#Disjointness_of_primitive_datatypes.

Name: Anonymous 2010-05-29 11:08

>>36
It's not like Haskells solution is much better, really, since all you are doing is performing a type conversion before each (primitive number) operation and informing the type system that "it's cool bro". If the cost wasn't so minimal, you'd be better off converting once, doing your number operations and then converting back, which is what I'd do in Scheme (Yes, i fully accept it's cheating the type system). If we could agree on a method for doing generic functions, I imagine we could get a solution similar to the Haskell one, but getting Schemers to agree is....yeah.
On a separate note, with that solution can you intermix it with other Numeric types? I was under the impression that you couldn't mix types within a typeclass instance. So, with your solution I imagine that you can't do 'I' + 3 and get 'L'. Or will Haskell "do the right thing" as it does for other cases where you intermix numbers?

Name: Anonymous 2010-05-29 12:38

>>33
Lurk more.

Name: Anonymous 2010-05-29 13:08

What good is BBCode?

I've never had to use it.

Name: Anonymous 2010-05-29 14:57

>>39
Then you are not an EXPERT PROGRAMMER

Name: Anonymous 2010-05-29 16:16

If the cost wasn't so minimal, you'd be better off converting once, doing your number operations and then converting back,
it's nice to be able to do things like uncurry (flip (:)) . (ap ((!!) . (: [[]]) . f) (0 ^) *** ('0' +) . fromInteger) . flip divMod 10, tho.

On a separate note, with that solution can you intermix it with other Numeric types? I was under the impression that you couldn't mix types within a typeclass instance. So, with your solution I imagine that you can't do 'I' + 3 and get 'L'.
*Test> 'I' + 3
'L'
(0.00 secs, 0 bytes)
*Test>

but that's not actually mixing types. both 'I' and 3 in 'I' + 3 are Chars.

Name: Anonymous 2010-05-29 19:18

>>40
{b.i.o.u EXPERT PROGRAMMERS} use {i SexpCode}.

Name: Anonymous 2010-05-29 19:21

Do we have an Emacs major mode for SexpCode editing?

Name: Anonymous 2010-05-29 19:29

Is anyone actually working on that Greasemonkey script, anyway?

http://twitter.com/Cairnarvon/status/14957176188

Name: Anonymous 2010-05-29 19:59

>>44
I was considering it, but >>43 has provided a more tempting proposal.

Name: Anonymous 2010-05-29 20:41

>>44
Hipster shit.

Name: Anonymous 2010-05-29 21:45

>>46
Listen here, jerkface.

Name: Anonymous 2010-05-29 22:27

What good are magnets?

I've never had to use it.

Name: Anonymous 2010-05-29 22:37

>>46
What, Twitter? When it's become so popular even politicians and grandmothers are using it, I think it stops being ``hipster shit'' by definition. Meanwhile, hating Twitter has become a hipster fad akin to not having a Facebook out loud and being proud of not owning a TV.
It's fair enough not to have a Twitter account of your own because you don't think it's useful or you don't trust Twitter to be competent enough to keep your data safe, but hating it because people use it is childish.

Name: Anonymous 2010-05-29 23:31

>>49
I was proud to have no TV before the internet was cool, i.e. when it actually was cool (read: devoid of advertising.) Now that the internet has TV (complete with ads--gotta love it, this is actual piracy) the fact that I do not own a television is sort of meaningless.

Twitter is difficult to hate. They don't seem to be doing anything underhanded and the users are less annoying than one would expect. I have an account but I haven't used it in any capacity for quite some time.

Facebook is easy to hate, though. The network gives people all the tools they need to be as annoying as possible (you'd have to hand out free cellphones to make it any worse), and underhandedness seems to be in the mission statement somewhere.

Name: Anonymous 2010-05-29 23:46

>>50
Facebook as a platform is exactly as good or bad as your circle of friends. If you hate it, you have only yourself to blame.

Name: Anonymous 2010-05-30 1:20

>>49
hating hipsters has become a hipster fad.

>>51
yeah, once you block the ads and set the privacy options not to share every single detail you put on your profile with everyone.

Name: Anonymous 2010-05-30 1:36

>>49
I don't have a Facebook account but I don't understand people loudly exclaiming that (they don't have one) like a badge of honor.  Is it part of some attempt to sound nouveau-trendy?

I keep track of people I know with phone calls, liberal instant messaging, and very conservative text messaging; all of this is, of course, trumped by actually being there with them in person.

Name: Anonymous 2010-05-30 2:10

>>51
Haha wow. No.

Name: Anonymous 2010-05-30 2:17

>>54
Idiot with shitty friends detected.

Name: Anonymous 2010-05-30 4:50

The disparity between >>1 and >>51-55 concerns me. I fear the content of this thread and therefore I am electing not to read it from it the beginning!

Name: Anonymous 2010-05-30 6:16

>>56
DISPARITIZE MY ANUS

Name: Anonymous 2010-05-30 8:07

I have a TV in my room only for consoles. However I hate everything on TV and I only download some american TV shows. Does that make me a hipster?

>>51
None of the people I consider friends have facebook. Neither do I. WHERE IS YOUR GOD NOW?

Name: Anonymous 2010-05-30 11:22

>>52
share every single detail you put on your profile
Again, the problem there isn't Facebook, but you. Don't fucking put it on the public Internet if you don't want people to see it. Social networking exists entirely to disseminate the information you give it.

>>58
You should be downloading British TV shows instead.

Name: Anonymous 2010-05-30 15:32

Tv, facebook, and twitter are shit

The only thing you should be doing is watching b-rated movies with girlfriends that you aren't dating just for the sex.

Name: Anonymous 2010-05-30 16:12

>>60
I'm glad that's working out for you.

Name: Anonymous 2010-05-30 19:34

>>59
You should be downloading British TV shows instead.
Fully one third of the TV shows Xarn lists as his favorite on his Facebook profile are American!

Name: Anonymous 2010-05-31 1:15

>>59
I do like Charlie Brooker. I watch some of his shows on Youtube from time to time.

>>60
No, you should watch those things with some bros. I have yet to meet a girl who gets the appeal of MST3K. Nevermind non-riffed masterpieces such as Samurai Cop.

Name: Anonymous 2010-05-31 16:09

This needs a good bump.

Name: Anonymous 2010-05-31 16:17

>>64
It really didn't.

Name: Anonymous 2010-05-31 22:11

>>62
The other four are all British. I wonder why he doesn't watch any Belgian TV.

Name: Anonymous 2011-02-03 8:09

Don't change these.
Name: Email:
Entire Thread Thread List