HNHacker News
TopNewBestAskShowJobs

quizotic

401 karma · joined June 2, 2011

submissionscomments
quizotic··on Things I learnt making a fast website
Hilarious :-) I don't care whether the lessons are useful or not. I just want to be able to write like this.
quizotic··on PostgreSQL anti-patterns: read-modify-write cycles (2014)
The point is that if a user on the right entered the update command, it would NOT return until after the transaction on the left committed, because there's a database lock on the balance when the left transaction did its update.
quizotic··on PostgreSQL anti-patterns: read-modify-write cycles (2014)
The efficiency challenge with serializable transactions comes mostly in the context of distributed transactions.

Netezza/IBM had a reasonably efficient implementation. Instead of broadcasting individual locks, they shared ordering relations between transactions as they were discovered.

Essentially, when transaction A reads a record and concurrent transaction B modifies the record, then B serializes after A (even if B's modification occurs before A's read in real time). These ordering relationships form a a graph. If a new ordering relationship between transactions causes the formation of a cycle, then some transaction must be aborted.

quizotic··on PostgreSQL anti-patterns: read-modify-write cycles (2014)
Nitpick: while the gist is correct, the 2nd diagram illustrating how transactions don't help is subtly misleading. The diagram implies that time flows down in the diagram. If so, then the update on the right won't occur until after the commit on the left. The update on the left really does acquire "write" lock on the balance, so the 2nd update on the right cannot occur until after the lock on the left is released when the left commits.

That said, the effect is exactly as the author claims. The transaction on the right will ignore the change made by the one on the left.

quizotic··on Show HN: Emacs-Bootstrap
Wow! I use emacs every day, and this will make my life easier. Didn't know about these wonderful packages. And the automatic init-file generation probably save me hours and headaches.
quizotic··on Time for a Rigorous National Debate About Surveillance
This motivated me to sign up for ProtonMail. Now I want to send Mike Pompeo a congratulatory email! He seems like a decent guy. Does anyone know where to send an encrypted email to the incoming cia director?
quizotic··on SQL style guide
> Honestly, I think AS should basically never be used for tables.

I believe AS is required for self-joins. A common expository query is to find all employees who earn more than their managers, which can be expressed via "select name from staff as employee join staff as manager on (employee.manager_id = manager.id) where employee.salary > manager.salary".

Also, SQL allows a sub-select to be listed in the FROM clause. But in such cases, the sub-select must be given a name (tables have a name, but sub-selects don't).

As an aside, the keyword "AS" is allowed by not required.

quizotic··on AWS Dashboard – 500 Service Unavailable Error
And now the outage is over, at least for me
quizotic··on AWS Dashboard – 500 Service Unavailable Error
at least now http://status.aws.amazon.com/ reports increased error rates (as in 100%?)
quizotic··on AWS Dashboard – 500 Service Unavailable Error
I get this too. Their service status page doesn't indicate anything wrong, and ironically, the only way to contact them about the problem is to ... you guessed it ... sign into the management console :-)
quizotic··on [dead]
She made me laugh and I learned a thing or two (after 60 years on this earth). Can't ask for more.
quizotic··on Rapid recovery from major depression using magnesium treatment (2006)
Also, the date on the publication is Mar 20, 2006. Seems odd that there wouldn't be more recent research.
quizotic··on The sad graph of software death
I would give the same kind of advice that financial advisors give for getting out of credit card debt: "find the card with the highest interest rate, make minimum payments on all other cards, and pay as much as possible on the highest interest rate debt until it is paid off... then recurse"

To make the analogy work the backlog needs to get rated on how much each open issue costs the company. Most organizations use some stratified measure of "severity". Few actually try to put a price on a problem, but I think it's worth the effort to try.

quizotic··on What Is the Big Bang Theory?
Question re inflation and dark energy: current claims are that big-bang started with a very short period of inflation. Haven't heard/understood much on why inflations started or stopped. Now we posit dark energy, that causes accelerated expansion of the universe, with acceleration greater at greater distances and therefore earlier historical times.

So... is it possible that inflation and dark energy are related? When we see distant/ancient galaxies accelerating away from us, is there any chance we're looking at the ramping down of the original inflation of the big bang?

quizotic··on C++14: Transducers
> Why not accept that C++ isn't a functional language, and realize that many die-hard C++ users won't use these features

I'm a die-hard C++ user, and have come to love functional programming for a very C++y reason: improved performance that comes from lock-free parallelizability (if you never modify values, you don't have to synchronize access).

But I also love the simplicity that comes from not having to think so deeply about lifetimes and which portions of code can see which objects in which states. The abstraction of data-structure from algorithm is nice, the terseness is nice, the regularity is nice, but it's the lifetime and visibility simplification that helps me the most.

I don't know Haskell or OCaml. I wouldn't know a monad if it slapped me in the face. But functional C++ makes me happy

quizotic··on Agg: Parallel aggregations for PostgreSQL
While not 'vanilla' Postgres, this appears to be packaged reasonably as a PG extension. Since no vanilla PG code was changed, you should be able to upgrade PG without worry.

PG 9.5 introduces some support for parallelization along with custom scans. So this capability seems like a natural fit.

As for utility, big data queries tend to do heavy aggregations, and parallelization is a nice performance enhancement where it could be sorely needed.

Redshift has good name recognition, but under the covers, it's ParAccel, which started with an early (8.2?) version of Postgres and modified it.

quizotic··on Modern SQL: With – Organize Complex Queries
In the old days, SQL operated on rectangular tables and produced rectangular tables ... which doesn't work so well for data that's better modelled as a tree or graph. But there now lots of ways to produced multi-valued output and to operate on graph-structured data. In addition to PG's JSON, you might checkout recursive unions - which supports a subset of graph navigation. But while SQL may have grown just a tad more expressive, I'm not sure that performance is up to snuff. And even if it's now possible to express some things in SQL, it doesn't mean it's easy or readable.
quizotic··on Parallel Sequential Scan is Committed to PostgreSQL 9.6
Oracle has tons of "features" that postgres lacks:

* empty string == NULL in oracle

* ROWNUM: it's kinda like a limit, but not

* DUAL: hah. postgres eat your heart out.

And of course there are business practice differences:

http://www.businessinsider.com.au/oracle-customer-explains-a...

... but tongue out of cheek, if you can afford it, Oracle has solutions for just about every database problem in just about every vertical domain. They have really good engineers, really good testing, and they're #1 for a reason

quizotic··on Parallel Sequential Scan is Committed to PostgreSQL 9.6
Robert Haas is the real deal, and will certainly have tested this feature.

Perhaps I missed it, but I don't think the post specified how many rows were in the source. Could have been more than a million. Having a relatively expensive filter (regex) eliminating all results keeps the performance picture clearer. Anything done with a tuple that passes the filter would apply to both the regular and the parallel scan cases, so eliminating the results highlights just the difference between regular and parallel scans

quizotic··on Parallel Sequential Scan is Committed to PostgreSQL 9.6
The post shows a 3.5x performance improvement for requested 4-way parallelism, so that's a significant improvement right now!

You might be surprised how many queries are bound by memory bus bandwidth and CPU, rather than I/O ... but even I/O bound queries may benefit:

Remember that postgres is a "demand-pull" system. A sequential scan node returns a single tuple at a time, whenever its parent node asks for a tuple. So there can be considerable time between requests for an actual disk block.

Parallelizing the scan should result in more frequent requests to the disk controller, which could then have better opportunity to optimize reads - even for a single disk. Since most of the latency for spinning disks is seek time, having more outstanding block-read requests should help performance.

quizotic··on How Not to Be Wrong: The Power of Mathematical Thinking
Very fun read. Debunks casual and misleading uses of mathematics to make social arguments seem unassailable. For example, using percentages in an argument can be misleading when some quantities are (a) very small or (b) negative:

(a) at-home day care has SEVEN times the risk of infant mortality of commercial day care centers... but the mortality rate is SO low, that driving an extra ten minutes to the "safer" choice increases the overall chance of mortality (due to risk of car accidents)

(b) under Scott Walker, Wisconsin created HALF of all jobs created in the USA... ~18,000 net jobs were created, and Wisconsin created ~9,000. But neighboring Michigan created 13,000. Some states lost jobs.

More sophisticated examples of faulty reasoning using statistics. Don't know whether the book is really helping me to listen more critically, but it's fun to think I might be wiser, or at least less gullible, after reading it.

quizotic··on Same-Sex Marriage Is a Right, Supreme Court Rules
Yes, but why this minority? Why not allow 12 year olds to marry as a consititutional right? Why not allow brothers and sisters to marry? I'm not trying to make a slippery slope argument. I'm really asking.

States license things all the time, and the conditions of their licenses block certain people from doing certain things. Why are the courts blocking the right of states to license this activity (marriage) in this particular case?

Again, I'm personally happy with the outcome. It feels as wrong to me to say the LGBT can't marry as it would to say an interracial couple can't marry. But Scalia asks what the legal reasoning is, not whether it's the right outcome. What's different about this minority or this situation?

quizotic··on Same-Sex Marriage Is a Right, Supreme Court Rules
I'm glad that my LBG friends can now marry anywhere. But damn, Scalia's counter opinion (and Roberts' opinion) strike me as well-considered and well-argued in the 2nd half of http://www.supremecourt.gov/opinions/14pdf/14-556_3204.pdf . In brief, their view was that resolving this issue in the courts erodes the democratic process.

Can anybody counter Scalia, and say why the issue of gay marriage couldn't wait to be resolved by the states? Why is this class of license inequity different than other classes, where the states' right to license something is not resolved by SCOTUS?

quizotic··on Correlating Commissions with Happiness
"base salary is the amount you pay a salesperson to not close the wrong deals"

This doesn't mesh with my experience, but I love the phrasing. And it makes me wonder whether and how to reward walking away from a deal that could be closed, but would be problematic. I'm not smart enough to know how to do that.

quizotic··on Ask HN: What are the best tools for analyzing large bodies of text?
There are commercial products that do a decent job of what you want. I have experience with Oracle Endeca, and have heard that Qlik is even better. Both have easy ways to load and visualize.

There are research frameworks that are quite good. One is Factorie from U.Mass Amherst (factorie.cs.umass.edu) that supports latent dirichlet allocation and lots more. Stanford also has wonderful tools.

Yes, you can dump text into SQL, and postgres has some text analytics. But my guess is that you'll soon want capabilities that RDBs don't have. Mongo has some support for text, but not nearly as much as postgres. I think both SQL and NoSQL are currently round pegs in square holes for deep text analytics. They're barely ok for search.

quizotic··on Ask HN: What are the best tools for analyzing large bodies of text?
Man, this comment is simultaneously both SO right and SO wrong. I guess the tools we have today are set up for knowing what you want to learn. Named Entity Retrieval? Topic classification? Sentiment Extraction?

OTOH, why should OP have to know what's interesting a-priori? The mantra of big data is "listen to the data, let it tell you, leave your preconceived notions at the door." The fault is with our current tool chain. We need something that tells us what about the text is interesting before we dive in for a closer look.

I'm imagining a tool that told me: "this text seems to have a lot of opinions and sentiment," "it's about a product that was returned," "a number of people's names are mentioned," "this text was loaded along with some structured data that appears to reference a price, a location, and a date."

Why is it such a stretch to combine the tools we already have to generate and push summarizations? Maybe it's just the cost of computation? If you know you're looking for topic and don't care about sentiment, then you can avoid paying for it?

quizotic··on Taste for Makers (2002)
Back when I was a 16 year old mediocre chess player, the captain of our high school team took me aside, set up a position and asked "Do you like white or black?" I looked at the board and said "I don't know." And channeling a Yoda then decades in the future, he said "That is why you lose."

His name was Matthew Looks, and his point was that it doesn't matter whether you're right or wrong. It only matters that you have a visceral opinion.

If you believe something or care about something strongly, it gets you to engage. If it turns out that you're objectively wrong, the clash will focus your attention and you'll learn. Just having an opinion, just caring, will bring out a better game.

This is how I interpret PG's post on taste. Having good taste is wonderful. But having taste, even bad taste, is better than not caring at all.

quizotic··on Conway's Law
I think this emperor has no clothes! Take distributed concensus protocols: two-phase-commit (or RAFT et al). I have never worked in an organization that adopted a 2PC communication protocol. The only real-world example I know is a wedding ceremony: "Do you Jane, take Tarzan to be your ape-man? (Jane says 'I do') And do you Tarzan, take Jane to be your swinging partner (Tarzan says 'Woo hoo!'). I now pronounce you husband and wife (because you've each locally committed)" Can you imagine working in a place like that? And yet 2PC is part of most database design.

Or take a design that consists of functional transformations of a sequence of ASTs. What organizational communication structure is stateless? ("Don't tell me you already told me that a minute ago! I refuse to remember anything you say. ever. You want to tell me something, start from the beginning every time. And furthermore, I refuse to talk to you at all unless we're given an entirely new language in which to express our conclusions. Besides, you're nothing but a monad to me") Ridiculous for human communication, but arguably essential for large-scale distributed parallel computation.

Or take event-bubbling, or model-view-controller. Does any organizational communication system use those in anything other than a once-in-a-blue-moon, accidental way?

quizotic··on Conway's Law
I'm sure it's willful blindness on my part, but in 30 years, I can't think of a single example of a design I've helped create that was a reflection of the organization's communication structure. I've built object databases, distributed share-nothing databases, a sentiment extraction system, and a mobile geo-locations application. Can anyone give a real world example of Conway's law?
quizotic··on Vinod Khosla: I believe 70% of VCs reduce the potential of a company
and sometimes you learn about a person by working with them. Long ago, Vinod was an investor and director of two of my early companies. He was helpful, supportive, polite and wonderful.
← PreviousPage 3 of 5Next →