HNHacker News
TopNewBestAskShowJobs

alejohausner

942 karma · joined January 11, 2015

submissionscomments
alejohausner··on Show HN: Primitive Pictures
There is lots of work on "artistic rendering" like yours, from the early 1990s to the present. It started with work by Paul Haeberli at SGI [1]. The first chapter in "Image and Video-Based Artistic Stylisation", edited by Paul Rosin and John Collomosse [2] describes many techniques you might be interested in. Have a look; you will like what you see.

1.http://dl.acm.org/citation.cfm?id=97902

2.https://books.google.com/books?id=YjXlTPFYGEYC

alejohausner··on Investing for Geeks
I don't know if you'll read this, but here is some info for you. I subscribed to Hulbert until mid 2014, and had a look at the yearly tables where he summarizes the performance of all the newsletters he tracks, with 1, 5, 10, and 15 year averages. With a bit of algebra, you can use those yearly 1, 5, 10, and 15 year averages to estimate the performance of the Prudent Speculator for single years, going back to 1992. Here's the numbers I got (percent/year):

2013 5.3

2012 17.8

2011 -2.3

2010 21.8

2009 38.4

2008 -43.0

2007 1.0

2006 14.6

2005 16.0

2004 27.1

2003 102.6

2002 -35.0

2001 11.2

2000 2.2

1999 19.1

1998 -0.1

1997 -15.5

1996 44.8

1995 56.4

1994 77.9

1993 -13.7

1992 35.6

You started in 2003, and dropped it sometime after 2008. The average for 2010 through 2013 is 10.6% per year, which is OK, but I think is in line with the broad market index.

One of the recent Hulberts has a recent semilog plot of the newsletter's returns, and by I eyeballing it can see that, while it outpaced the market from 2000 to 2007, it has pretty much tracked the market since 2008. So it hasn't beaten the index lately.

Hulbert also reports that the newsletter's author prior to 2002 (when he died) used margin to augment the returns. Since 2002 another person is picking the stocks, and they're not using margin, so that might account for the recent pedestrian returns. 10% is nice, but I agree it's not spectacular.

Looking at recent behavior dissuaded me from following it. I wanted a bit more money from my investments. But I can see how, in 2003, the previous decade made the plan look really good to you. I would have done the same thing as you.

alejohausner··on Investing for Geeks
I'll revise my position, but only slightly. Using the data that you pointed me at, if you had retired in 1929, you would have had to wait until 1944 before the market broke through permanently above the 1929 level, with dividends reinvested. So you would only have starved for 15 years, not 25.
alejohausner··on Investing for Geeks
>Always be invested in the market.

Yes, I've heard that a million times, but that kind of advice presupposes a bull market. What if it's 1967, and you're about to go into a 15 year period of up and down markets, with no real growth in stock prices? And that's before inflation; the market fell substantially during the horrible 70s if measured in real dollars. All kinds of stock enthusiasts (like most folks here) got eaten alive. Pessimism reigned by the early 80s. Most people said "I'll never buy stocks again.".

Ironically, when investors finally capitulated, the great bull market of the 80s and 90s started.

My point is that most people here are mesmerized by that bull market, and by recent gains. But historically the indexes have had huge, long term swings that probably exceed most people's investment horizon.

"Past performance is no guarantee of future results" is not just a legal disclaimer. It's a bitter truth. Our current optimism is strongly colored by recent gains.

What if you had retired in 1929? You would have received nary a return for 25 years.

Sure, indexes average 8 percent or so, over the very long term, but it can be an intolerably long averaging interval.

alejohausner··on Investing for Geeks
Why don't geeks read Mark Hulbert? Every time I see people discussing investing, it's usually about index funds. Stock picking is supposedly fool's gold, so you should buy the whole market, or so goes common wisdom.

But the market can be brutal. It can have decades-long stretches of terrible returns. If you had all your money in index funds, and retired in 1929, you would have made no money for 25 years. If you retired in 1967, 15 years. If 2000, 10 years. Do you have 10 years of living expenses saved up?

There are good stock pickers out there, people who focus on fundamentals. And you don't have to take their word for it. Mark Hulbert has been subscribing to many stock pickers' newsletters, trying out their picks, and reporting objectively on the results since 1980. Some libraries subscribe to his monthly report, but since investing is a very long-term process, the same handful of newsletters keep showing up in the report: you only need to look at a few recent Hulbert reports to find good stock pickers.

alejohausner··on The Math Myth
Perhaps the biggest skill I got from university was knowing enough context to know which references (books, Wikipedia) I should consult, to solve a technical problem.
alejohausner··on The Math Myth
One of the commenters to the original article talks about this phenomenon specifically. Each math course you took taught you some ideas or techniques, but those techniques weren't really learned until you used them in the next course. For example, you didn't learn algebra well until you used it in calc 1; calc 1 skills are really cemented in difeq.

https://micromath.wordpress.com/2011/05/17/time-lag-in-learn...

alejohausner··on The Math Myth
Oddly enough, I never understood the epsilon-delta description of limits until I read David Foster Wallace's book on infinity. All through my degree in math I was taught about things without learning the historical context that created those things.
alejohausner··on Federal health expert drop flossing from health guidelines
Sorry to be pedantic but A => B is equivalent to !B => !A . Still, I agree that US dentists overemphasize flossing.
alejohausner··on After 100 years World War I battlefields are poisoned and uninhabitable
I saw that number too. But it's crazy wrong. A square mile has 2.5 million m^2, and I don't think the combatant nations produced 2.5 million tons of explosives altogether during the whole war. About 7 million tons (!!!) were dropped from the air during the Vietnam war. One ton per m^2 works out to 1.2 billion tons over the Zone Rouge that the article talks about. That just can't be right.
alejohausner··on After 100 years World War I battlefields are poisoned and uninhabitable
These are not fair comparisons, because you are talking about bombs dropped from the air, whereas WW1 was about shells fired from artillery. According to wikipedia [1], about 1 ton of explosives was fired per square meter of combat territory. If the Zone Rouge originally covered 460 square miles (= 1200 km^2 = 1.2 billion m^2), this works out to 1.2 x 10^9 tons of explosives (can that be really true? wow! [2]). In Vietnam, "only" 7.6 million tons were dropped from the air. That's a few orders of magnitude less.

1. https://en.wikipedia.org/wiki/Iron_harvest

2. My numbers don't add up. I just saw a BBC story about WW1 industrial production (tl;dr: allies vastly outproduced the central powers by more than 2 to 1). There's a graph showing that Germany produced 400,000 tons of explosives from 1914 to 1917. Four times that amount is less than 2 million tons, so the number in wikipedia (1 ton per m^2) is definitely wrong.

alejohausner··on A Medical Mystery of the Best Kind: Major Diseases Are in Decline
OK, I'll supply a citation, which argues the opposite. See the Wikipedia page on "radiation hormesis". Scroll down to "cobalt 60 exposure".

TL,DR: Many apartments in Taiwan were radioactive, because the steel in the structure had been mixed in with 60Co. Residents got big doses of gamma rays. And yet they didn't get much cancer! It turns out that no, gamma rays are not good for you; rather, most residents were young, biasing the sample (few young people get cancer). The study didn't account for this bias.

alejohausner··on The Godzilla of Solar Ovens
On sunny days, London's 'walkie talkie' building makes the sidewalk nice and toasty (and melts plastic bits on your car) with its south-facing concave glass wall: http://www.bbc.com/news/magazine-23944679

Not quite a solar furnace, though.

alejohausner··on A deportation at the UK border
Perhaps it's a generational thing. The OP and many posters here on HN had very nice, supportive parents who told them that the world is on their side, that they would succeed in whatever they tried to do, and that people are generally good-willed.

I on the other hand am afraid of figures of authority. I fear the police. I don't think that things will necessarily go well. And I'm especially afraid at the border. I answer the officer's questions as laconically as possible, usually in monosyllables. Things usually go well.

Imagine a thought experiment, where the OP's middle class white mind was teleported into an African American's body, dropped into a poor part of town, and stopped by the police. She would have been just as traumatized.

alejohausner··on Dr Heimlich saves choking woman with manoeuvre he invented
Heimlich means well, but the popularity of his maneuver is due more to his relentless promotional skills, and not to sound research. If someone is choking, it's best to slap them hard on the back a few times.

http://www.metroactive.com/papers/metro/01.05.05/heimlich-05...

alejohausner··on Sorting algorithms visualizer
Well, spaghetti sort runs in linear time: O(n) time is spent setting up the device, and O(n) reading out the result. The actual sorting step is O(1) !!!

Unfortunately, it's limited to sorting numbers, and uses O(n) additional space (to be precise, it uses O(n) additional volume).

alejohausner··on Scratchapixel: Computer Graphics Programming from Scratch
I think that matrices seem difficult because they are taught by teachers who don't know how they play a role in geometry. Even points and vectors can be hard if the teacher doesn't show how to connect their algebra and their geometry.

Example: a parametric line segment: P(t) = t * A + (1 - t) * B: If t is 0, you get A. If it's 1 you get B. If it's 0.5, you get halfway between A and B. If negative, you're 'before' A. If t > 1, you're 'beyond' B. Then it's easy to see that restricting t > 0 gives you a ray. The geometry matches the algebra nicely.

Example: in ray tracing, you have to test whether a ray intersects a sphere. This gives you a quadratic equation. If the equation has two real roots, the ray hits the sphere twice. If just one real root, it touches it once (one hit point: ray is tangent to sphere). If no real roots, the ray misses (no hit points). I love how the algebra and the geometry correspond so nicely.

Once you tell a student that applying a matrix will change an object's shape, it's easy to get them to see how applying two matrices means applying two shape changes. Then if you apply the changes in opposite order, you get a different matrix product, and a different final shape. Again, the algebra corresponds to the geometry. And you've just taught them about non-commutative multiplication!

And then I show them a translation matrix, and the inverse of the translation matrix (I don't teach them how to invert matrices; why bother them?). And I show them that the inverse makes sense: the translation amounts are the negatives of the original. And I show them that the product of those two matrices is the identity, which again matches the geometric fact: move, then un-move, is the same as doing nothing.

I talk about rotations using my body: I turn around the X axis, then the Y axis. The I repeat it in opposite order, and show that rotations usually don't commute.

What I'm trying to say is that matrices are confusing because teachers SUCK at explaining them. For the small subset of linear algebra that graphics needs, there are a lot of geometric intuitions that make it simple to explain the material.

alejohausner··on Scratchapixel: Computer Graphics Programming from Scratch
Agreed: moving, turning and stretching don't need matrices, to be understood. But moving the camera away from (0 0 0) is going to require a change of coordinates. I'm not sure how to explain that process in a simple way that avoids matrices.
alejohausner··on Scratchapixel: Computer Graphics Programming from Scratch
This. You went to the right high school. Matrices and vectors are just a subset of linear algebra, and can definitely be taught to teenagers.

When I teach graphics to 3rd-year college undergraduates, I tell them "this is what all that point-and-vector stuff you learnt in high school was really meant for". They've usually forgotten it all, but it comes back to them quickly, and the matrix stuff on top of that isn't very hard, so I can get them up to speed pretty quickly.

Most CS degrees require linear algebra, which talks about vector spaces, gaussian elimination, diagonalization, rank, which is all useless for graphics! Too bad that course is usually relegated to the math department, which doesn't know how fun and useful a small subset of linear algebra is!

alejohausner··on Scratchapixel: Computer Graphics Programming from Scratch
Ignoring matrix transformations is easy, as long as the eye point is at the origin. Then yes, the algebra is almost trivial: projection is just divide-by-z. But the moment you move the camera, or stretch and turn objects, or worry about clipping, you need the full machinery that matrices provide. They're not that mysterious. I wish they were taught in high school, because they would motivate kids to learn graphics and programming.
alejohausner··on Scratchapixel: Computer Graphics Programming from Scratch
Back in the mid 80s I rediscovered a form of Bresenham on PDP-11 assembler that used integer overflow to avoid branches. I've forgotten the details, but I remember that it was integer only, and used an accumulator word which, on overflow, became a small number (somehow triggering a change in the dependent coordinate). Damn I wish I could remember the details. One of these days I'll dig up the assembler specs and re-derive it.

Or maybe I'll discover I was using a branch after all!

alejohausner··on Scratchapixel: Computer Graphics Programming from Scratch
The reason that 4x4 matrices are used so much in graphics is their versatility: you can use them to implement modeling (placing an object into the world), viewing (changing a world point into camera coords), projection and clipping (putting a camera-coord point into clipping coords), color transformations (after all, both x,y,z,w and r,g,b,a are coordinates of a 4D point). That's why there's matrix multipliers built into all graphics hardware.

I understand where you're coming from: translating a point is just 3 additions, so why do a full matrix x point multiply? Scaling is just 3 multiplies, and so on. But if you've got a hardware matrix-point multiplier, all those transformations cost the same, so you're not saving time by devoting special code to each kind of transformation.

Moreover, you don't have to learn full linear algebra: to do graphics, you don't have to know how to invert a matrix, nor solve a system of linear equations, nor diagonalize a matrix. Graphics just needs a tiny subset of linear algebra.

When I teach graphics, I describe points, vectors, lines, circles, matrix-point multiplication, and matrix-matrix multiplication. It takes maybe two lectures, and it provides tools for lots of other parts of the graphics pipeline.

Once you have those tools, you can talk about the viewing transformation (just a special matrix), composite transformations (matrix-matrix multiplication), hierarchical objects (more matrix-matrix multiplication), projection (another special matrix), color transformations (another special matrix).

I also find that when describing ray tracing, you need to talk about going from (row col) pixel coordinates to a 3D point in space, where the ray starts. That's partly the INVERSE view transformation, and (yay) it's just a matrix.

When I was a wee lad in 1981 I did indeed try what you suggest: I worked out the algebra of projection, knowing just where the image plane was (using some points and vectors), and where the world point was. This give me an image point. I was very proud to be able to squeeze this into 50 opcodes on a TI-57 calculator. But when I became a man, and put away childish things, I saw that matrices describe the same process much more cleanly and simply. I wish I had known about them much earlier.

Hell, I wish high school math taught some points and vectors, and some simple matrix operations as I described above (not full-blown linear algebra). Then, they could use those tools to make pictures starting from just numerical descriptions of shapes! It would give many kids more enthusiasm for mathematics, and would start them on the way towards operators, groups, linear spaces, and all those things they might see later. All we would have to do is get education departments to teach the math teachers all this stuff. It would be exhilarating for everyone involved.

alejohausner··on Can’t Hack a Hacker: Reverse Engineering a Discovered ATM Skimmer
Great tip! I'll try that. ;-)
alejohausner··on An integer formula for Fibonacci numbers
Google "fibonacci generating functions", for a more careful derivation. The first hit is: http://austinrochford.com/posts/2013-11-01-generating-functi...
alejohausner··on Tendril perversion – spontaneous symmetry breaking, uncoiling helical structures
If a ribbon has half its curls one way, and half the other, its total twist is zero. I suspect that if you scrape a ribbon with a blade (thus making it want to curl up), hold its endpoints, and bring your hands together, it will settle into such a configuration.
alejohausner··on Hey Android, why no love for UTC?
Amen to that. I find it clumsy to require two finder windows open to move a file between them. Why not cut a file from one directory, open another directory, and paste it there? Ugh!
alejohausner··on Will We Glue Skyscrapers Together in the Future?
Boston's Big Dig tunnels used bolts glued with epoxy to hang the heavy roof panels that hung over the roadway. The epoxy failed catastrophically and the panels fell on a car, killing the driver.

Analysis of the accident blamed the workers who installed the bolts, but I think the big lesson is that construction sites are messy, and don't provide the best environment for the delicate chemical reactions needed to set adhesives properly.

alejohausner··on NASA proposes new propulsion to cut Mars voyage to 3 days
This doesn't make sense to me. The detached portion would be subject to radiation pressure from the ground-based propulsion lasers, and would quickly be pushed away from the spacecraft it was meant to act on.
alejohausner··on “GOTO Considered Harmful” Considered Harmful (1987) [pdf]
GOTO (considered harmful)^n, where n is an even positive integer
alejohausner··on Elon Musk Says SpaceX Will Send People to Mars by 2025
I agree. It's astronomically expensive to set up humans on the moon, and much more so on another planet. Think of the much much more productive ways that money could be spent here at the bottom of the gravity well.

As for asteroid mining, aren't metals available here on earth too, at a fraction of the cost? How about an R&D effort to make batteries and other technology out of easily-available metals here? Wouldn't that spending yield useful products much more cheaply than trying to get them from out there in the sky?

We have to stop reading science fiction and taking it as prophecy. The case for seeding our species on another planet makes no economic sense.

← PreviousPage 9 of 11Next →