HNHacker News
TopNewBestAskShowJobs

davidmathers

1,945 karma · joined June 25, 2007

submissionscomments
davidmathers··on A data modeling challenge: relational vs document oriented for modeling orders
Yeah, total straw man. For e.g.:

Similarly, the order lines don’t contain product names, but rather foreign keys which point to a product table

Well, the product name could be the foreign key. Or it could not be. If you have 2 different products with the same name (or 1 person with 2 different names) then you have some complexity. Doesn't matter what kind of database you're using.

davidmathers··on Google Code University
this use of the word relation has fallen out of favour

Do you think that's true everywhere or just in web development world / MySQL world? I'd always guessed that, say, Oracle professionals know and understand the difference between "Chen--E/R model" and "Codd--relational database". But I'm not part of that world so I don't really know for certain.

davidmathers··on Google Code University
I'm not sure I understand what you mean about pointers though.

I'm talking about the practice, widespread in MySQL world, of all tables having a primary key of auto-increment integer.

There's nothing wrong, per se, with the example in the document as both Customer and Order are cases where an auto-integer is an appropriate primary key.

But I do think the reader could easily get the wrong idea, since the example consists of only those 2 tables.

Edit: Not that there's anything wrong with the practice. Just that your database is no longer a relational database. Knowing that fact and understanding why is, I think, a useful and educational thing for a student to understand.

davidmathers··on Google Code University
In order to combat this madness it should be spelled out to all beginners that "table" and "relation" mean basically the same thing. And that "relation" has nothing to do with "links" or "relationships" between tables or between entities.

This big misconception comes from Raymond Chen's idea of E/R modeling.

That's the fundamental idea. But there's also a slightly more advanced understanding. That is that your tables/relations can't contain pointers. If you put pointers in your relations then you've created a graph/network database.

Think about encapsulating an array inside an object class and exposing "push" and "pop" methods. Wouldn't you agree that when you use an object of that class you're using a stack, not an array? Because the interface is what matters, not the implementation. The situation with pointers in your tables is slightly more complex, but roughly analogous.

davidmathers··on Google Code University
the text you quoted doesn't claim anywhere that the word "relational" has to do with relationships between tables

Hmm, I disagree.

This type of structure is called a relational database: we have multiple tables that connect to one another via keys

The emphasis here is on the connections rather than the tables. Why say "multiple tables"?

In writing for beginners the author should just say something truthy like: "A relational database is a database where all data is stored in values of an algebraic data type called a 'relation'. SQL uses the word 'table' instead of 'relation', but the two words mean roughly the same thing."

davidmathers··on Google Code University
From Introduction to Databases and MySQL:

Such keys make it possible to relate the tables to one another, so we can, for example, find the customer information given a key value in the order table. A foreign key is a key used to link two tables together. Typically you take the primary key field from one table (customer) and insert it into the other table (order) where it becomes a foreign key (it remains a primary key in the original (customer) table). This type of structure is called a relational database: we have multiple tables that connect to one another via keys.

It's really jarring to see such wrongness published under the banner of "Google Code University." I've come to terms with the fact that in the minds of most web/MySQL programmers the term "relational database" means graph/network database. But I still don't expect to see it published by the denizens of a top engineering firm that hires only the best and brightest.

davidmathers··on Netflix CEO: In Ten Years, “We Will All Have A Gigabit To The Home”
Sonic.net Fusion is the way to go for DSL in SF.
davidmathers··on FizzBuzz without multiplication or division
Circular look-up table, reminiscent of Oliver Steele's FizzBuzz Station: http://osteele.com/archives/2008/02/fizzbuzz-station
davidmathers··on Eating Healthily for $3 a Day
Are you going to eat meat? Just try to capture a wild animal with your bare hands and eat it raw, you will look ridiculous. This isn't a practical option without technology.

Watch and learn: http://www.youtube.com/watch?v=9wI-9RJi0Qo

davidmathers··on Eating Healthily for $3 a Day
Golden Produce, a local shop

A few doors down from Golden Produce is El Castillito, the source of my staple food: the super carne asada burrito. At just over $8 it sounds more expensive, but OP doesn't mention how long his staple meal takes to prepare.

Preparation time is definitely a cost if you'd rather be doing something else. Like taking a walk to buy a burrito. So I don't think the $3 figure is entirely accurate.

This does make me curious about how my meal stacks up in terms of carbs/fat/protien/calories.

davidmathers··on Thomas Friedman: Amazon.you (1999)
This is not satire:

A wake-up call’s mother is unfolding. At the other end is a bell, which is telling us we have built a house at the foot of a volcano. The volcano is spewing lava, which says move your house. The road will be long and rocky, but it will trigger a shift before it kicks. We can capture some of it. IF the Middle East was a collection of gas stations, Saudi Arabia would be a station. Iran, Kuwait , Bahrain, Egypt, Libya, Iraq, and the United Arab Emirates would all be stations. Guys, here’s the deal. Don’t hassle the Jews. You are insulated from history. History is back. Fasten your seat belts. Don’t expect a joy ride because the lid is blowing off. The west turned a blind eye, but the report was prophetic, with key evidence. Societies are frozen in time. No one should have any illusions. Root for the return to history, but not in the middle.

http://www.tnr.com/blog/jonathan-chait/84059/tom-friedmans-v...

davidmathers··on Thomas Friedman: Amazon.you (1999)
Help. I may need an intervention for my curiosity problem. Here's the whole story, found in this book: http://books.google.com/books?id=HmyqbzrlVpkC

Bezos's story resonated among the book-buying public, the investment community, and beyond. At its peak, the story was so compelling that he was Time magazine's 1999 "Person of the Year." Months before Bezos earned that particular accolade, however, Friedman detected a flaw in the story. On February 26. 1999. Friedman's column "Amazon.you," asked: What's so special about selling books over the Internet? He introduced Lyle Bowlin, a professor of small business at the University of Northern Iowa and founder of Positively-you.com, a bookselling Web site. Bowlin, his wife, and his daughter ran Positively-you out of their spare bedroom. This arrangement let Positively-you cut its overhead even further than Amazon—according lo Bowlin, down to about $150 a month—and thus to undercut Amazon's prices. Friedman's conclusion? "For about the cost of one share of Amazon.com, you can be Amazon.com."

Not surprisingly, Friedman's column was good for Bowlin's business. Within ten days, Positively-you's business had grown by a factor of about thirty. Bowlin moved its operations out of the spare bedroom and into the formal dining room. Friedman responded with a follow-up column, "KillingGoliath.com," in which he summarized Positively-you's success in a two-word reply directed at the skeptical readers who'd questioned "Amazon.you." No, not those two words. This was, after all, the op-ed page of the New York Times. Friedman's response was a fully capitalized "YOU'RE WRONG."

That's where Scott Rosenberg entered the story. Rosenberg, the managing editor of Salon.com, was one of the skeptical experts to whom Friedman had directed his reply. In "Amazon vs. the Ants," Rosenberg explained that Friedman had captured only half the logic of the online marketplace. That half, the low cost of getting started, certainly allowed hobbyists like Bowlin to launch commercial ventures. The other half, in Rosenberg's view, was what set Amazon apart from Positively-you. He cited two fatal flaws with Positively-you's business model. The first flaw stemmed from scalability. Positively-you's overhead was lower than Amazon's precisely because it was a smaller operation. As business grew, Bowlin would have to relocate yet again, likely to a warehouse for which he might actually have to pay rent. He would also eventually run out of unpaid family membeis and need to hire employees. These costs would drive his overhead up and narrow if not eliminate any cost advantage that he maintained over Amazon. The second flaw dealt with the challenges and the expense of generating traffic comparable to Amazon's. Rosenberg simply assumed that Bowlin couldn't rely upon the substantial free publicity that he received by appearing in Friedman's columns. Rosenberg's conclusion? "If I were Amazon's Jeff Bezos, I wouldn't be too worried."

Lyle Bowlin and Positively-you then proceeded to fall from public view for about a year. They reappeared March 3, 2000, in columns written by Friedman and by Rosenberg. Friedman's "Saga of an Online Pioneer" told of Bowlin's attempt to leverage his early publicity into a real business. He raised $90,000, took a leave from his teaching position, rented office space, hired employees—and went out of business. Friedman considered Positively-you's failure instructive. He cited a number of lessons that he had learned about e-commerce. The two most significant of them were the difficulty of scaling costs and the challenge of driving traffic to a Web site. Rosenberg's column basically said "I told you so," which, of course, he had.

davidmathers··on The Origins of Altruism - Edward O. Wilson's Alternate Theory
Fascinating. Jerry Coyne (quoted in the article) has a blog post about the article:

http://whyevolutionistrue.wordpress.com/2011/04/17/the-bosto...

davidmathers··on Git is Inconsistent
OP is saying something like "when I cook things with my freezer they don't get hot." It's that non-sensical.

Git can't do (at all) what he wants to accuse it of doing wrong (because it has nothing to do with what git does). So I'm just pointing out the closest approximation to what he's aiming at is to use pull --rebase.

Personally I like to have a straight line history as a default and only merge when required. Rather than always merge by default.

Edit: Ok, I'm not sure I understand the point of the pastebin. Maybe. If you want the lower C to become X you need to git checkout master and then git rebase c. Not the other way around. Is that it?

davidmathers··on Git is Inconsistent
The article is titled "Git is Inconsistent", it doesn't claim Git is WRONG, it claims it is INCONSISTENT.

Ok. The claim that git is inconsistent is wrong. From OP:

The problem with git’s merging is that it doesn’t satisfy the “merge associativity law” which states that merging change A into a branch followed by merging change B into the branch gives the same results as merging both changes in together in one merge.

There is no such concept in git as "merging both changes in together in one merge".

I have modified a shell script written by Simon Marlow that illustrates, using git, how merging two patches separately can give different results than merging two patches together.

The shell script doesn't do what is claimed. It can't because git has no facility for "merging two patches together". Git can only do 2 things with patches:

1. generate a patch

2. apply a patch

But! git has a function which is equivalent to combining 2 patches in a single merge:

git pull --rebase

The shell script does not use this command. It first applies 2 patches separately. It then applies 1 patch separately.

There are still some people who still think nothing is wrong with git; that it is okay for the result of a merge to depend on how things are merged rather than on only what is merged; that is it okay for two git repositories that pull the same patches to have different contents depending on how they pulled those patches. I don’t know what to say to those people.

This is just incoherent. I have no idea what to say in response because I have no idea what the intended meaning is.

davidmathers··on Git is Inconsistent
What a powerful insight. Only now do I see how truly wrong I was. I don't know how I could have been so blind.
davidmathers··on Circle-Ellipse Problem
I just found the talk on youtube for anyone who wants to preview it: http://www.youtube.com/watch?v=GDVAHA0oyJU
davidmathers··on Git is Inconsistent
pull the exact same commits in different order

Sort of. The OP doesn't write clearly. He's also confused about how git works. What he means is..

Say Bob has 2 commits (B1-B2) and Alice has 1 (A1)

Scenario 1: Alice merges each of Bob's commits in sequence (i.e. she replays his commit history onto her repo: A1-B1-B2).

Scenario 2: Alice merges only B2 (A1-B2).

The point is that, with git, Alice's repo will be different in each scenario. Because in scenario 2 git doesn't examine commit B1 and use that info to try and figure out what the content in commit B2 "means".

With darcs, on the other hand, her scenario 1 repo will be identical to her scenario 2 repo.

The flip side is that in scenario 2 git will always produce the same result for the same B2, because B1 is irrelevant. With darcs a change in B1 will change the result.

NOTE: "git pull --rebase" actually does "replay commit history" instead of "merge" when pulling code into your repo (result: B1-B2-A1). I use it as my default. The outcome is the same as darcs, the difference is that everything is explicit.

davidmathers··on Atlas Winced
I hope the OP isn't posting this simply because it's fun to bash Rand.

The OP is Jane Galt: http://www.janegalt.net/

davidmathers··on Git is Inconsistent
Here's the short version:

  I am the original sentence.
Alice commits a change in her repo:

  I am a different sentence.
Bob commits a change in his repo:

  I am the original sentence.
  I am the original sentence.
Now Alice pulls Bob's commit. What should happen?

The argument is that in certain cases it can be known which of Bob's 2 sentences is the original and which is the copy (due to context provided by an intermediate commit) and that therefore a correct VCS will figure out that the original is on the bottom:

  I am the original sentence.
  I am a different sentence.
But git doesn't look at history so will always produce:

  I am a different sentence.
  I am the original sentence.
I don't care. If you force me to care then I actually prefer git's behavior. Git is consistent: a merge will always produce the same result for the same files. I don't want history to matter.

The problem is not actually solvable. So git doesn't try to solve it. I think that's why it's called "the stupid content tracker."

EDIT: Is there anything worse than "smart" features that only work, say, 80% of the time? The closer they get to 100% the worse it gets, because then you start relying on them and they break right when you stop paying attention.

davidmathers··on OOP = FP?
Yes exactly. With the caveat that f should be a meaningful procedure that does some real work, not direct state manipulation.

The OP is kind of ridiculous actually.

davidmathers··on OOP = FP?
Alan Kay’s vision of object oriented programming was very different than that embodied in today’s popular OO languages such as Java and C++

That's because Java and C++ embody Barbara Liskov's vision of object oriented programming, primarily. The abstract data vision.

davidmathers··on MPlayer - Monday 18.4.2011 I will stop providing any service to MPlayer
I made the mistake of clicking a link on the blog and...

Now that Reiser is in jail for slaughtering his whiny bitch wife, someone really had to step in and fill the gap in the long line of psychopathic linux developers.

So I'll just forget this person exists. Shame on anyone who gives him a public forum.

davidmathers··on Is gravity not actually a force? Forcing theory to meet experiments
Newton is a self-anointed prophet.

It’s true that the faithful followers of self-anointed prophets will believe without question the dogma of their prophet and perpetuate the dogma.

But such cults have always come to an end.

The Newtonian cult called physics will also end.

w t f

davidmathers··on Writing Clear, Concise, Sentences
Note, Joseph M. Williams now has 3 different 'Style' books:

Style: Toward Clarity and Grace

Style: Lessons in Clarity and Grace

Style: The Basics of Clarity and Grace

I can't speak to the first 2, but I purchased the 3rd and found it to be excellent.

davidmathers··on Ask HN: How to stave off decline of HN?
Uh oh. Over the past 6 weeks I've had the feeling of being liberated from my years-long Hacker News addiction. Now you want to fix it and suck me back in.

I'm surprised to see so much focus on the comments. I think the front page is the primary problem. I wonder how much of the comment problem would fix itself if the front page had more signal and less noise. Maybe that's naive.

Personalization is most certainly the wrong answer for HN, but when I thought last week of my ideal solution to the problem this is what I came up with:

1. Personalized weighted point calculations. Each vote is multiplied by a number which ranges from 0 to 2 in .1 increments. Everyone starts at 1. Everyone who up-votes the same story as me gets .1 added to their weight. Everyone who up-votes a story I down-vote gets .1 removed from their weight.

2. New users can't submit stories during an initial probationary period. They also start out at .1 and get .1 added to their weight each week they're active on the site. After 10 weeks of activity they can submit stories.

3. Weights are applied to comment rankings but not derived from them. Comment rankings also need to be much harsher. We want fewer comments and higher quality comments. Maybe ((weight*2) -.5) for calculating comment points. But the floor is always 0.

I don't know if ideas along these lines could be successfully de-personalized.

These ideas I think are mistaken:

1. Any notion of explicit control. Such as: hard coded karma values, comment size, non-bayesian content filters, etc. (New user probation being the 1 exception)

2. Anything based on unweighted karma values.

These ideas I'm suspicious of:

1. Economic solutions. They strike me as having the same problem as micro-payments. I don't want to have to think about how I'm spending my alloted money each time I up-vote or down-vote. Also the purpose of money is trading, not creating artificial scarcity. And even assuming the goal of artificial scarcity is worthwhile (I don't) then it implies some kind of hard-coded explicit control to determine purse size, which will always be a mistake.

davidmathers··on Pick a number from 1 to 10
Also Dilbert: http://dilbert.com/dyn/str_strip/000000000/00000000/0000000/...
davidmathers··on 41,000,006 reasons why I think we're in a bubble
As the great philosopher Inigo Montoya once said: "You keep using that word..."

Let's talk about this chart for a second:

http://www.google.com//finance?chdnp=1&chdd=1&chds=1...

Ok, see that 4000% increase in 18 months? That's what a bubble looks like.

Now, please point out to me where on the graph it made more sense to invest your retirement money in the S&P 500 rather than Amazon.

Wait, you mean pets.com, not amazon.com? Fair enough. But now I'm not sure what your argument is. That color.com is going to fail and the investor are going to lose all their money?

That is what you're saying right? Because if you're saying they're taking a large risk that has a very small chance of paying off then you're saying nothing. That's what investors do. That's what makes us (as a society) all rich.

If your argument is that capital is being misallocated then you have to say why and where the capital should be allocated.

Which brings us to what is actually a bubble and not just people with lots of money taking big risks that may not pay off:

1. capital being invested by (otherwise) non-investors

2. who can't afford to lose

3. who have come to believe, with certainty, that they can't lose

That was the case in both the stock bubble and real estate bubble. It's not the case now. I guess the headline "valuations are unrealistically high" wouldn't generate as much heat and would require a coherent defense.

davidmathers··on Dropbox and why you should invest in people
Both of you (nadam and api) are arguing with a strawman, not what with Joel actually wrote: "they solve something that appears to be the template of a lot of problems"

If something actually is the template to a lot of problems then obviously it's going to be successful.

davidmathers··on What It Feels Like to Be Rich
Apropos:

The saying "It is not sufficient that I succeed. Everyone else must fail" has been associated with Larry Ellison so often that most people think it originated with him.

Actually, it came centuries ago with Genghis Khan. Ellison has referred to the quote in conversations, then laughed rather unconvincingly and tried to distance himself from the sentiment. But it sticks nonetheless.

http://www.forbes.com/2003/11/26/1126southwick.html

← PreviousPage 2 of 17Next →