Hacker News .hnnew | past | comments | ask | show | jobs | submit | jonnyba's commentslogin

I think if they did this app developers would need to sign and submit four different binaries (iphone, iphone_2x, ipad, ipad_2x). Technically you can already do this. I guess if it's a paid app, the user would have to pay for each device type.


A week later, the candidate discovers that the company instead hired someone else that happens to knows absolutely nothing about template metaprogramming. Except that person is whiter / younger / less married than said candidate.


What does metaprogramming have to do with that complaint though? It is trivial to generate lawsuit without regard to feedback. Watch:

Does Google have family leave? --6 weeks, paid.

Did I get the job? --No

Because I plan to have kids??? See you in court!


if the number of different weights is finite and small, you could create a bucket for each different weight.

for example if the possible weights are .25, .5, and .75, put all items into one of those buckets (array backed). The bucket then gets a weight of (individual weight)*(bucket size). First randomly choose a bucket based on the bucket weight, then randomly choose an object from the bucket.


Still O(n).


Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: