I always thought that the original bit was actually a qubit, because it had an indeterminate state, until it was asked a question, then it changed to either yes or no. Actually, I guess I didn't think that until I learned about ternary logic.
Don't sorry about "ruining" them with a "bad" programming language. If they stick with it at all, they are going to develop all kinds of crazy ideas and bad habits, which they will discard, one by one, if they go on to become good programmers.
Face it, even if you give them the best language and environment possible, most kids are going to get bored with programming, just like piano lessons, karate class, painting, etc. Programming seems cool, and they know it powers video games, but they really *don't* care about variables and functions and scope and types and classes -- and they won't unless they actually decide they want to become programmers.
Give them something fun and rewarding, where they get to play Stairway early on. RealBasic seems to be a good compromise of power, ease of use, user-friendliness, etc. If they want to stick with it, then they will be motivated themselves to learn LISP, python, c, to understand the concepts *behind* what makes the video games work.
With all of our technological advances, people can still manage to be pretty miserable. Look at the rates of anti-depressant usage in the US. Having things do not make you happy.
No matter how much create comfort we add to this world ( and don't get me wrong, we've added a lot ), the ultimate dysfunction of the human being is that they want utopia. As good as it is, it's never enough. In Buddhist terms, this is usually called "Suffering", but I think a better term is "Anguish", because it's more of a mental-emotional state then physical pain, which 'suffering' implies.
So yes, the purists changes the world, and this is 'progress' in the physical sense, but I don't know that this necessarily engenders enjoyment of life to its recipients. I spent some time with an indigenous family in the Amazon for a summer field school when I was in college. They basically lived in plywood, thatched-roof huts. They had the typical family/society drama, they always complained about not having enough food, clothes, and goods from the town, and not having access to medical care, but their day-to-day life seemed like a big, casual party. They were always gathered around the fire, cooking their next meal, making jokes, laughing. They would walk to take the bus into town, go hunting, wash their clothes in the river, and work in their gardens. It was a shock for me to get back and interact with my friends, whose main topic of conversation seemed to be the utter injustice of a traffic incident or a snafu at a bureaucratic office, and how it totally ruined their day. Then in the weekend, they would watch a mega-blockbuster movie with crazy special effects, and feel ripped off because there was some nonsense thing in the plot. For all the conveniences and entertainment we had, day-to-day life had more anguish for my wealthy western peers! It really sucked hanging around them initially.
So the world will always suck, if you have that attitude, no matter your material circumstances. If you enjoy yourself, life will be good. I think the pragmatists enjoy themselves more. There's a Buddhist saying that goes something like "The world is awash in thorns. You cannot cover the world in leather, but you can cover your feet in leather."
I guess what I'm saying is that there are plenty of card tricks, sleight-of-hand, and focused attention trick that do work, but this basketball passing and gorilla one *I personally* don't think works, but since everyone who watches it is alone at their computer, they think they're they only one smart enough to have caught it the first time around. In other words, it hasn't been tested; it's sort of taken as common wisdom.
It sounds like what you need to do is make attacking copy-cats part of the business model. You need to find partners who have the willingness and wherewithal to fight a patent infringement ( which means they will also be willing to put up funding for the international patents, etc ). Once you are successful enough to be on the radar screen, the Big Guys will copy you. By that time you have an established product, patents, and enough resources to fight it out in court, and eventually win or settle, which will be the pay-off of the investment.
We're not really in an era where you can have a business making a single thing anymore. We have tons of companies who can make all kinds of anything. Once they know there is a market for some gadget, they will produce it, except for very niche items ( which have a negligible market ). So don't really expect to be making this thing into your eighties, or to grow your company into the next Motorola. Being bought out is the business model.
Just ask the guy who runs Rondam Ramblings, who claims to be a genius ( several patents and a PhD, former employee of some NASA jet enginge laboratory denied a job at google for knowing too much LISP ( how's that for Geek cred? ), and millionaire angel investor:
Top Ten Geek Business Myths ( abridged ):
Myth #1: A brilliant idea will make you rich.
Myth #3: Someone will steal your idea if you don't protect it.
Myth #4: What you think matters.
Myth #6: What you know matters more than who you know.
Myth #9: The idea is the most important part of my business plan.
I recommend reading all of them; they are well-written and insightful.
So, if you're worried about someone 'stealing' your idea, making a bunch of money, and not sharing anything with you, Rondam says it won't happen. Nobody will ever steal your idea.
Are you worried more about your idea being stolen, or someone making money off of 'your' idea? Because making money is more about doing boring, stupid business stuff than having the Next Killer App. Remember Segway? Went nowhere, really. Want to really make money? Buy a dry cleaning establishment. One of the best, most guaranteed business investments out there. Except, it's all boring business stuff, like hiring and firing employees, working every day, having an accountant, paying taxes, etc. Buy an established one, with an existing clientele, rather than take the pains of starting up a business on your own. Saves a lot of the boring small-business start up crap.
I don't know. I know there are plenty of card and magic tricks and slight of hand tricks that people regularly fall for ( I've seen a few magic shows and I've never figured out a card or coin sleight-of-hand ), but those things are relatively small, especially when viewed from the audience looking at a stage.
Did you fall for the basketball-pass trick? I didn't, the first time I saw it -- I was like "1, 2, 3-- what the hell!?" Do you know anyone else who has fallen for this?
So there are slight of hand or observation tricks that do fool people, but I don't think this basketball is one of them. It's never done before a live audience, so we never hear ripples of laughter when the surprise happens. We just sit alone, in front of the computer, thinking we're smarter than the rest of the internet.
they'll form your typical bell curve, with the peak of the bell curve representing and energy level corresponding with infra-red radiation... This happens when enough energy concentrates (by random, highly unlikely chance) to create a photon with much higher energy than is typical for a radiating body.
So what process creates the other half of the bell-curve, the photons at a lower energy than infra-red radiation?
If we're going to model a brain, it's not really a human brain unless it has subjective experiences, would it? If it didn't, at some point, experience deja vu, then we can't really say we have a good model of the human brain, now would we?
I think everyone sees it the first time, thinks "I'm so clever; I passed the test designed to fool me" and then thinks that most every other member of the human race is a moron because they would never see it. Well, everybody sees it. This is a lousy test.
It's like Mike Royko's retirement party. He wrote in everyone's book, "You were my favorite; don't tell anyone else." So everyone thinks they're special.
Look at the instructions for a mercury thermometer break just below, it's a lot less paranoid for something like 10,000x the mercury.
No, they're not being paranoid. The problem is that CFL bulbs contain mercury vapor, which is what actually makes its way into the body, whereas liquid mercury doesn't enter the human body as easily.
Liquid mercury spills aren't that big of a deal; mercury vapor is very toxic.
I think people mostly go by what they perceive as the norm. In other words, "Locks keep an honest man honest". If you perceive yourself to be in a loosey-goosey, anything goes situation, you'll do what you see everybody else around you doing.
All its ancestors rgt values change, so there is only one case where no other nodes are affected: inserting the root in the empty tree.
I'm confused -- are you talking about INSERTs or UPDATEs? The only time when there is one transaction -- an INSERT -- is when you insert the root node. The only time when you can INSERT a node while having to make only one UPDATE to keep the tree ordered is if you INSERT one node on the rightmost side of the tree.
Have a look at this image. '19' is the rgt value of 'Portable Electronics', which is the rightmost node. '20' is the rgt value of 'Electronics', the root node. If you wanted to add one element, 'Gameboys' to the rightmost of the tree, just under the root node, that's one UPDATE: UPDATE tree SET rgt = 22 WHERE category = 'Electronics'; and one INSERT: INSERT INTO tree ( category, lft, rgt ) VALUES ( 'Gameboys', 20, 21 );
I realize there may be a distinction between SQL terms and tree manipulation terms, which is why I'm trying to be pedantic. If you are talking about 'updates to the tree' in an abstract sense, as in 'changes to the tree', then yes, there is only one time when there is one update to the tree, when you are INSERTing the root node.
Thanks for a constructive discussion, a actually learned something on/. today:-)
I don't know what you mean with the tree_id, but you have to update all nodes that follow the inserted one, so on average, half the nodes in the tree or half the rows in that table. According to your link 1
With a tree_id, you can store multiple trees in a single table with the appropriate columns. In other words, One table for each tree is a poor use of your relational system. It's like having a separate invoices table for each customer -- just add a customer_id column and you can have all the invoices for all customers in one table.
It's better to put a tree_id column ( or some other way of distinguishing the trees from each other ) in that table, and you can have as many "virtual" separate hierarchical trees in that table as you like. So then once you do that, tree_id is the way to specify which tree ( or subset of rows in the trees table ) you're talking about.
So yeah, on average ( if on average, people tend to put new nodes in the middle -- but are trees necessarily symmetrical? ), you would be updating half the rows in your *subset* of tree rows. If you only had one tree in the table, you would be updating half the rows in your table.
I don't think there is any situation where only one node is affected.
This would be rare, but if you add a node to the rightmost side of the tree, then the only update you need to do is update the rgt column value of the root node.
You've said in a very nice and kind way what I would have said in a more blunt way. Stephen Hawking is a very smart, well-educated guy in a highly specified field. Because of his fame and renown as a smart guy, he feels qualified to talk about whatever underdeveloped thoughts come into his head. I'm sure he's spent a lot of time thinking about this, and formulating his thesis, but he hasn't gone through the humbling process of learning what other smart people who can come before him have said. When I started college, I knew it all. When I left, I knew nothing.
A fun question to ask people is: "if you could only have one, which would you rather do: author a successful book or be parent to a successful child (raised by others)". The answers tell you whether the person sees themselves as a bundle of genes or as a bundle of memes.
Only if you assume that people's main goal in life is to reproduce themselves or achieve immortality in some regard.
Me, I'd rather be a parent to a child, because I've had more fun playing with kids and doing family activities than I've ever had writing, or talking to a group of people. I've heard a few writers talk about going on book tours and it sounds like hell. Also, fame seems to be universally hellish, unless the person is emotionally sick enough that they can't feel good from normal situations, but need the adoration of nameless strangers.
So my main thrust in life is to enjoy myself. At some point all of my progeny will die out ( if I ever have any ) and certainly all my writings and recorded thoughts will be obliterated. I don't worry too much about the future.
2 UPDATES, you forgot lft. And since the tree is bludgeoned into the square table, yes you have to 'traverse' the tree. That UPDATE accesses each row that is affected. My first impression was that every node/row was accessed.
Yes, I forget lft, but correct me if I'm wrong, those updates are done in one fell swoop, no? Here's the corrected query: UPDATE trees SET rgt = rgt + 27, lft = lft + 27 WHERE lft > 107 AND tree_id = 34 I don't know much about how databases write physical data, but I assumed that an update to a single row, regardless of how many columns are updated, counts as a single update.
How do you have to "traverse" the tree, any more than any other query? Do you mean the B-tree ( or whatever ) physical storage of the data on disk? In that case, any SQL query is a traversal of the "tree". But talking about this logical tree made up of rows in a database, you only need to access and write the rows that would be affected, which are all the rows to the right of the insertion point. In the example above, all rows with lft < 107 are not affected. Are you saying those rows have to be scanned? Well, any SQL queries have to scan the table the query refers to.
It's an intelligent hack, but it is not proof that RDBMS/SQL is a best fit for trees.
Well, I never claimed that RDBMS/SQL were the "best" for trees; op did that:) I was just trying to clue people in about what op was talking about. Is it any more a hack than any other data modeling in SQL?
Can you clue me in to some other data structures that a more efficient when dealing with trees? My initial inclination is that the modified pre-order tree has nothing to do with relational databases or SQL; it's a data structure that just happens to be implemented in SQL in these examples.
That's true, but you should mention that this data representation comes at a tradeoff for update efficiency - insertion of new nodes force you to update the entire subtree's left and right hand values.
This is not entirely correct. If you want to insert a new node, you need only update the values of the nodes to the right of the insertion point. This covers more and more nodes the closer you get to the left side of the tree. If you wanted to add a new node onto the right of the tree, you need update only one value, the rgt value of the root node.
I thought that this representation of the data structure was extraordinarily beautiful, in the sense of elegant. Perhaps you just don't like tree data structures, aesthetically?
Bonus points to the Onion for understanding and employing recursion in this parody.
I always thought that the original bit was actually a qubit, because it had an indeterminate state, until it was asked a question, then it changed to either yes or no. Actually, I guess I didn't think that until I learned about ternary logic.
Don't sorry about "ruining" them with a "bad" programming language. If they stick with it at all, they are going to develop all kinds of crazy ideas and bad habits, which they will discard, one by one, if they go on to become good programmers.
Face it, even if you give them the best language and environment possible, most kids are going to get bored with programming, just like piano lessons, karate class, painting, etc. Programming seems cool, and they know it powers video games, but they really *don't* care about variables and functions and scope and types and classes -- and they won't unless they actually decide they want to become programmers.
Give them something fun and rewarding, where they get to play Stairway early on. RealBasic seems to be a good compromise of power, ease of use, user-friendliness, etc. If they want to stick with it, then they will be motivated themselves to learn LISP, python, c, to understand the concepts *behind* what makes the video games work.
With all of our technological advances, people can still manage to be pretty miserable. Look at the rates of anti-depressant usage in the US. Having things do not make you happy.
No matter how much create comfort we add to this world ( and don't get me wrong, we've added a lot ), the ultimate dysfunction of the human being is that they want utopia. As good as it is, it's never enough. In Buddhist terms, this is usually called "Suffering", but I think a better term is "Anguish", because it's more of a mental-emotional state then physical pain, which 'suffering' implies.
So yes, the purists changes the world, and this is 'progress' in the physical sense, but I don't know that this necessarily engenders enjoyment of life to its recipients. I spent some time with an indigenous family in the Amazon for a summer field school when I was in college. They basically lived in plywood, thatched-roof huts. They had the typical family/society drama, they always complained about not having enough food, clothes, and goods from the town, and not having access to medical care, but their day-to-day life seemed like a big, casual party. They were always gathered around the fire, cooking their next meal, making jokes, laughing. They would walk to take the bus into town, go hunting, wash their clothes in the river, and work in their gardens. It was a shock for me to get back and interact with my friends, whose main topic of conversation seemed to be the utter injustice of a traffic incident or a snafu at a bureaucratic office, and how it totally ruined their day. Then in the weekend, they would watch a mega-blockbuster movie with crazy special effects, and feel ripped off because there was some nonsense thing in the plot. For all the conveniences and entertainment we had, day-to-day life had more anguish for my wealthy western peers! It really sucked hanging around them initially.
So the world will always suck, if you have that attitude, no matter your material circumstances. If you enjoy yourself, life will be good. I think the pragmatists enjoy themselves more. There's a Buddhist saying that goes something like "The world is awash in thorns. You cannot cover the world in leather, but you can cover your feet in leather."
I guess what I'm saying is that there are plenty of card tricks, sleight-of-hand, and focused attention trick that do work, but this basketball passing and gorilla one *I personally* don't think works, but since everyone who watches it is alone at their computer, they think they're they only one smart enough to have caught it the first time around. In other words, it hasn't been tested; it's sort of taken as common wisdom.
Exterminate all humans and have a utopia run by robots. Great Success! Computers and robots *never* make mistakes.
But if its as good as regular voice recognition technology, who could tell the difference?
It sounds like what you need to do is make attacking copy-cats part of the business model. You need to find partners who have the willingness and wherewithal to fight a patent infringement ( which means they will also be willing to put up funding for the international patents, etc ). Once you are successful enough to be on the radar screen, the Big Guys will copy you. By that time you have an established product, patents, and enough resources to fight it out in court, and eventually win or settle, which will be the pay-off of the investment.
We're not really in an era where you can have a business making a single thing anymore. We have tons of companies who can make all kinds of anything. Once they know there is a market for some gadget, they will produce it, except for very niche items ( which have a negligible market ). So don't really expect to be making this thing into your eighties, or to grow your company into the next Motorola. Being bought out is the business model.
Top Ten Geek Business Myths ( abridged ):
I recommend reading all of them; they are well-written and insightful.
So, if you're worried about someone 'stealing' your idea, making a bunch of money, and not sharing anything with you, Rondam says it won't happen. Nobody will ever steal your idea.
Are you worried more about your idea being stolen, or someone making money off of 'your' idea? Because making money is more about doing boring, stupid business stuff than having the Next Killer App. Remember Segway? Went nowhere, really. Want to really make money? Buy a dry cleaning establishment. One of the best, most guaranteed business investments out there. Except, it's all boring business stuff, like hiring and firing employees, working every day, having an accountant, paying taxes, etc. Buy an established one, with an existing clientele, rather than take the pains of starting up a business on your own. Saves a lot of the boring small-business start up crap.
I don't know. I know there are plenty of card and magic tricks and slight of hand tricks that people regularly fall for ( I've seen a few magic shows and I've never figured out a card or coin sleight-of-hand ), but those things are relatively small, especially when viewed from the audience looking at a stage.
Did you fall for the basketball-pass trick? I didn't, the first time I saw it -- I was like "1, 2, 3-- what the hell!?" Do you know anyone else who has fallen for this?
So there are slight of hand or observation tricks that do fool people, but I don't think this basketball is one of them. It's never done before a live audience, so we never hear ripples of laughter when the surprise happens. We just sit alone, in front of the computer, thinking we're smarter than the rest of the internet.
they'll form your typical bell curve, with the peak of the bell curve representing and energy level corresponding with infra-red radiation... This happens when enough energy concentrates (by random, highly unlikely chance) to create a photon with much higher energy than is typical for a radiating body.
So what process creates the other half of the bell-curve, the photons at a lower energy than infra-red radiation?
If we're going to model a brain, it's not really a human brain unless it has subjective experiences, would it? If it didn't, at some point, experience deja vu, then we can't really say we have a good model of the human brain, now would we?
Seen this? Pretty much the same thing.
Does anyone actually fall for this?
I think everyone sees it the first time, thinks "I'm so clever; I passed the test designed to fool me" and then thinks that most every other member of the human race is a moron because they would never see it. Well, everybody sees it. This is a lousy test.
It's like Mike Royko's retirement party. He wrote in everyone's book, "You were my favorite; don't tell anyone else." So everyone thinks they're special.
Look at the instructions for a mercury thermometer break just below, it's a lot less paranoid for something like 10,000x the mercury.
No, they're not being paranoid. The problem is that CFL bulbs contain mercury vapor, which is what actually makes its way into the body, whereas liquid mercury doesn't enter the human body as easily.
Liquid mercury spills aren't that big of a deal; mercury vapor is very toxic.
That's a good question. I don't think a lot of RDBMSes have floats as native column types. At least MySQL doesn't, anyway.
Yeah, I read that kind of hastily. Or, I just read what I wanted to read.
I think people mostly go by what they perceive as the norm. In other words, "Locks keep an honest man honest". If you perceive yourself to be in a loosey-goosey, anything goes situation, you'll do what you see everybody else around you doing.
My thought exactly. Didn't Nokia have a somewhat unpopular product in their web tablets, which did slight more than just surf the web?
All its ancestors rgt values change, so there is only one case where no other nodes are affected: inserting the root in the empty tree.
I'm confused -- are you talking about INSERTs or UPDATEs? The only time when there is one transaction -- an INSERT -- is when you insert the root node. The only time when you can INSERT a node while having to make only one UPDATE to keep the tree ordered is if you INSERT one node on the rightmost side of the tree.
Have a look at this image. '19' is the rgt value of 'Portable Electronics', which is the rightmost node. '20' is the rgt value of 'Electronics', the root node. If you wanted to add one element, 'Gameboys' to the rightmost of the tree, just under the root node, that's one UPDATE:
UPDATE tree SET rgt = 22 WHERE category = 'Electronics';
and one INSERT:
INSERT INTO tree ( category, lft, rgt ) VALUES ( 'Gameboys', 20, 21 );
I realize there may be a distinction between SQL terms and tree manipulation terms, which is why I'm trying to be pedantic. If you are talking about 'updates to the tree' in an abstract sense, as in 'changes to the tree', then yes, there is only one time when there is one update to the tree, when you are INSERTing the root node.
Thanks for a constructive discussion, a actually learned something on /. today :-)
Mark this on the calendar! :)
I don't know what you mean with the tree_id, but you have to update all nodes that follow the inserted one, so on average, half the nodes in the tree or half the rows in that table. According to your link 1
With a tree_id, you can store multiple trees in a single table with the appropriate columns. In other words, One table for each tree is a poor use of your relational system. It's like having a separate invoices table for each customer -- just add a customer_id column and you can have all the invoices for all customers in one table.
It's better to put a tree_id column ( or some other way of distinguishing the trees from each other ) in that table, and you can have as many "virtual" separate hierarchical trees in that table as you like. So then once you do that, tree_id is the way to specify which tree ( or subset of rows in the trees table ) you're talking about.
So yeah, on average ( if on average, people tend to put new nodes in the middle -- but are trees necessarily symmetrical? ), you would be updating half the rows in your *subset* of tree rows. If you only had one tree in the table, you would be updating half the rows in your table.
I don't think there is any situation where only one node is affected.
This would be rare, but if you add a node to the rightmost side of the tree, then the only update you need to do is update the rgt column value of the root node.
You've said in a very nice and kind way what I would have said in a more blunt way. Stephen Hawking is a very smart, well-educated guy in a highly specified field. Because of his fame and renown as a smart guy, he feels qualified to talk about whatever underdeveloped thoughts come into his head. I'm sure he's spent a lot of time thinking about this, and formulating his thesis, but he hasn't gone through the humbling process of learning what other smart people who can come before him have said. When I started college, I knew it all. When I left, I knew nothing.
A fun question to ask people is: "if you could only have one, which would you rather do: author a successful book or be parent to a successful child (raised by others)". The answers tell you whether the person sees themselves as a bundle of genes or as a bundle of memes.
Only if you assume that people's main goal in life is to reproduce themselves or achieve immortality in some regard.
Me, I'd rather be a parent to a child, because I've had more fun playing with kids and doing family activities than I've ever had writing, or talking to a group of people. I've heard a few writers talk about going on book tours and it sounds like hell. Also, fame seems to be universally hellish, unless the person is emotionally sick enough that they can't feel good from normal situations, but need the adoration of nameless strangers.
So my main thrust in life is to enjoy myself. At some point all of my progeny will die out ( if I ever have any ) and certainly all my writings and recorded thoughts will be obliterated. I don't worry too much about the future.
2 UPDATES, you forgot lft. And since the tree is bludgeoned into the square table, yes you have to 'traverse' the tree. That UPDATE accesses each row that is affected. My first impression was that every node/row was accessed.
Yes, I forget lft, but correct me if I'm wrong, those updates are done in one fell swoop, no? Here's the corrected query:
UPDATE trees SET rgt = rgt + 27, lft = lft + 27 WHERE lft > 107 AND tree_id = 34
I don't know much about how databases write physical data, but I assumed that an update to a single row, regardless of how many columns are updated, counts as a single update.
How do you have to "traverse" the tree, any more than any other query? Do you mean the B-tree ( or whatever ) physical storage of the data on disk? In that case, any SQL query is a traversal of the "tree". But talking about this logical tree made up of rows in a database, you only need to access and write the rows that would be affected, which are all the rows to the right of the insertion point. In the example above, all rows with lft < 107 are not affected. Are you saying those rows have to be scanned? Well, any SQL queries have to scan the table the query refers to.
It's an intelligent hack, but it is not proof that RDBMS/SQL is a best fit for trees.
Well, I never claimed that RDBMS/SQL were the "best" for trees; op did that :) I was just trying to clue people in about what op was talking about. Is it any more a hack than any other data modeling in SQL?
Can you clue me in to some other data structures that a more efficient when dealing with trees? My initial inclination is that the modified pre-order tree has nothing to do with relational databases or SQL; it's a data structure that just happens to be implemented in SQL in these examples.
That's true, but you should mention that this data representation comes at a tradeoff for update efficiency - insertion of new nodes force you to update the entire subtree's left and right hand values.
This is not entirely correct. If you want to insert a new node, you need only update the values of the nodes to the right of the insertion point. This covers more and more nodes the closer you get to the left side of the tree. If you wanted to add a new node onto the right of the tree, you need update only one value, the rgt value of the root node.
I thought that this representation of the data structure was extraordinarily beautiful, in the sense of elegant. Perhaps you just don't like tree data structures, aesthetically?