Better HN
topnewbestaskshowjobs
Log inSign up

panic

29,749 karma · joined Sep 16, 2009 (17y ago) · 3,593 submissions

Submissions

comment 14y ago · link · parent

I want to see how it would animate!

3422.

The HP-35(codex99.com ↗)

5 points · by panic · 14y ago · 2 comments

comment 14y ago · link · parent

They could normalize it in the following way before storing a hash:

1. If the last letter in the string is uppercase, flip the case of the entire string.

2. Make the first character lowercase.

This would allow for abC as well (if you "capitalized" the first letter while holding down capslock).

comment 14y ago · link · parent

If you're interested in helping out with the next stage of this research and you know someone with limited or no ability to use both hands who might also be interested, please visit http://www.braingate2.org/clinicalTrials.asp and let them know.

comment 14y ago · link · parent

Here's a direct proof for problem 3 that doesn't use any contradiction (perhaps someone will find it clearer).

Say you have N gas stations. For any n between 1 and N, say:

  * f_n is the amount of fuel in the nth station, and
  * d_n is the distance from the nth station to the (n+1)th.
You want to make sure that at each step along your path, you have more fuel than the distance you need to travel. Using our notation, for each step along the path, we want the sum of the f_n so far to be larger than the sum of the d_n. That's the same as saying the sum of (f_n - d_n) should never dip below zero.

So how do we show that we can visit all the gas stations while keeping the sum of (f_n - d_n) non-negative? Well, since we have just enough gas to get around the track, we know that the sum of (f_n - d_n) along the entire path is zero. In other words, if we write out the partial sums:

  S_1 = f_1 - d_1
  S_2 = f_1 - d_1 + f_2 - d_2
  ...
  S_N = f_1 - d_1 + ... + f_N - d_N
then S_N is zero, since the distances and the fuel amounts cancel each other out.

Now look through this list and find the smallest partial sum. Call it S_m. If we change our path to visit gas station 'm' last (and start at station 'm+1'), we get these updated partial sums as we move along our new path (call them U_n):

  U_1 = f_{m+1} - d_{m+1}
  U_2 = f_{m+1} - d_{m+1} + f_{m+2} - d_{m+2}
  ...
  U_{N-m} = f_{m+1} - d_{m+1} + ... + f_N - d_N
  U_{N-m+1} = f_{m+1} - d_{m+1} + ... + f_N - d_N + f_1 - d_1
  ...
  U_{N-1} = f_{m+1} - d_{m+1} + ... + f_N - d_N + f_1 - d_1 + ... + f_{m-1} - d_{m-1}
  U_N = f_{m+1} - d_{m+1} + ... + f_N - d_N + f_1 - d_1 + ... + f_m - d_m
Now note that:

  U_1 = S_{m+1} - S_m
  U_2 = S_{m+2} - S_m
  ...
  U_{N-m} = S_N - S_m
  U_{N-m+1} = S_N - S_m + S_1
  ...
  U_{N-1} = S_N - S_m + S_{m-1}
  U_N = S_N - S_m + S_m
Since S_N is zero, all the U_n are of the form S_i - S_m (for various i). And S_m is the least partial sum -- that means S_i >= S_m for all the S_i in the list. So each U_n is greater than or equal to zero, just like we wanted.

Therefore our last stop should be the gas station with the biggest fuel deficit compared to its distance from the next station (and we should begin our trip at that next station to guarantee we never run out of gas).

comment 14y ago · link · parent

There are infinitely many finite strings.

comment 14y ago · link · parent

I do this too. Though my thesaurus doesn't always have the right technical meaning of certain words.

I'd love to have a "programmer's thesaurus" with more detail on names that appear frequently in code. For one of the two hard problems in CS, the art of naming things has little reference material beyond raw source code.

comment 14y ago · link · parent

In what situation is the name 'anospic' acceptable? In a small scope, 'avg' or 'average' would probably read better. In a larger scope, you'd have to remember that it really means 'average_numbers_picked' each time it appears -- why not just use that name?

comment 14y ago · link · parent

Your argument only works if the 21x21 grid is known to be 4-colorable. But in fact, the 21x21 grid is known not to be 4-colorable.

3430.

I abandon my abusive relationship with Facebook(blog.plover.com ↗)

17 points · by panic · 14y ago · 5 comments

3431.

Fathoming Facebook(parislemon.com ↗)

2 points · by panic · 14y ago · discuss

comment 14y ago · link · parent

Given the collection of 2011 movies, the site probably used to look good in 2011. Maybe some CSS or templated HTML changed out from under it?

comment 14y ago · link · parent

Apple commercials aren't even really about Apple; they're about making consumers feel cool, special, hip, and creative because they use Apple products. It's the ultimate in feel-good messaging.

Seriously: watch a Motorola Droid RAZR commercial, then watch an iPhone commercial. The difference is extraordinary.

I don't know which particular commercials you meant, but here are the ones I watched:

Droid RAZR: http://www.youtube.com/watch?v=yj9yisLa4ao (the first video for "droid razr advertisement" on youtube)

iPhone: The first video on http://www.apple.com/iphone/videos/

The Droid RAZR advertisement has very little footage of the phone itself, and doesn't demonstrate any of its features. Most of the ad is an action movie sequence.

The iPhone advertisement shows people using the Siri feature in realistic scenarios. The focus is on the phone itself and what you can (purportedly) do with it.

I've never understood this meme that Apple wins because of feel-good marketing. Apple's ads typically just show people using their product. This strategy wouldn't work if the product didn't have something intrinsically desirable about it.

comment 14y ago · link · parent

That's a false dichotomy. A good's price is tied to how much you'll pay and how much it costs. If an iPhone cost $200 more to make, it'd be a good bet that it wouldn't sell for the same price.

comment 14y ago · link · parent

You can find the original, less ad-encrusted version of this article at http://gravityandlevity.wordpress.com/2009/07/08/your-body-w....

3436.

Variable-length patents(johndcook.com ↗)

2 points · by panic · 14y ago · discuss

3437.

Lasagna Code(lispian.net ↗)

2 points · by panic · 15y ago · discuss

comment 15y ago · link · parent

That's kerning, not hinting. Hinting changes the glyphs themselves to lie more regularly on a pixel grid.

comment 15y ago · link · parent

I think we should teach children to understand mathematics at an algorithmic level and let them see that programming is a tool/hammer for executing those algorithms.

Computers are useful for doing math, but for most kids, and even most adults, that's one of least interesting things they can do.

A program isn't just a hammer. It can be a paintbrush, a tape recorder, a story, a symphony, or a lab assistant. And a program is more than any of these things -- a real-life paintbrush can't change the size of its bristles, and you have to draw every stroke by hand. On a computer, everything's just code. You can run your "paintbrush" routine billions of times, vary its parameters using your voice, or earthquake data, or a physics simulation, or anything you can imagine.

As a programmer, maybe I'm biased, but I can't imagine any job beyond the most menial where the ability to program wouldn't make me more productive.

3440.

How to Build a Stellar Team at a High-Potential Startup(entrepreneur.com ↗)

2 points · by panic · 15y ago · discuss

3441.

A look at Tim Cook, Apple’s new CEO(crazyapplerumors.com ↗)

1 points · by panic · 15y ago · discuss

3442.

Meet Ness, the Pandora for restaurant recommendations(gigaom.com ↗)

63 points · by panic · 15y ago · 22 comments

comment 15y ago · link · parent

It is incredibly annoying for the suggestion list to change after its first appearance. You may have been about to select a particular URL when it changes unexpectedly, and you end up navigating somewhere you hadn't intended.

comment 15y ago · link · parent

Enter

    javascript:document.getElementsByClassName('text-block')[0].contentEditable=true
into your address field and you can edit the isometric text! Pretty neat.

comment 15y ago · link · parent

OpenCL is a language designed for writing programs where performance is important. I'm not sure how you could abstract away from it or compile down to it without losing some control over the code's performance characteristics.

A compiler would be better off compiling directly to either native code (if running on a CPU) or something like PTX (for NVidia GPUs).

comment 15y ago · link · parent

Ed Catmull, president of Pixar, has made the same comment about their films. The entire video is worth watching, but the quote in question is at http://www.youtube.com/watch?v=k2h2lvhzMDc#t=22:01 -

The other thing to note is, there is a confusion, I think, that the people have and is — the books and press kind of work this way in that we think about "an idea." When we think of ideas for movies, we think about ideas for products. And it's usually thought of as some singular thing.

But the reality is, these successful movies — as with all successful products — have got thousands of ideas. It's just all sorts of things necessary to make it be successful. And you have to get most of them right to do it. And that's why you need a team that works well together.

comment 15y ago · link · parent

What "index" is this article asking Google to open? The index against which they run actual queries has to be tied to Google's core search algorithms, which I doubt they'd want to make public.

So would they open an "index" of web page contents? In this case, why would another search engine access Google's "index" rather than the original server? The original server is guaranteed to be up to date, and there's no single point of failure.

comment 15y ago · link · parent

In every Objective-C API I've seen that uses blocks, the framework takes care of the "[[... copy] autorelease]" bit. In practice, the code looks something like (to borrow your block with foos and bars):

    [array transformFoos:^(Foo*) (Foo* bar) {
        return bar;
    }];
I'm not sure there is a more succinct way to write a lambda with typed arguments and a typed return value.
1
114115116
120