Want to Know How VCs Calculate Valuation Differently from Founders? - <AUTHOR> http://www.bothsidesofthetable.com/2010/07/22/want-to-know-how-vcs-calculate-valuation-differently-from-founders/

<comment><USER2> I just watched (well, really mostly listened to) the video embedded in the article and I highly recommend it.

I was involved in VC negotiations during the bubble and was a bit confused about some of the stuff beyond the basics. Luckily, we had good lawyers and my partners were fairly well versed in finance.

I've also noticed that many people have are confused about how the corporate governence works. They also talk a little about how the board of directors work and how it interacts with investor rights.

Finally, if you're not comfortable with finance, you might need to watch it a few times before you fully understand what they're talking about, but it's well worth it.

</comment><comment><USER3> This was an awesome post and very informative. I especially liked how he explained that the share pool would come out of the founders pool. That's something important to keep in mind as that's a huge amount of equity!

Sometimes I wonder if Mark knows that he could be getting much better deals if he didn't tell us all these things?

</comment><comment><USER4> Why video? Isn't this the kind of information you would like to refer to frequently, which is hard to do in video format?

</comment><comment><USER5> Well if you have raised 6 millions and you sell the company for 10 million, and still manage to get 1.6 million, then I think you made a very good deal.

</comment><comment><USER6> As a young entrepreneur starting out, this video explained a number of terms (pun intended) that I had no idea about before.

Thanks Mark Suster!</comment>


WordPress caching: Varnish or Batcache? - <AUTHOR> http://hmn.md/testing-batcache-versus-varnish/

<comment><USER2> One of these things is not like the other. :)</comment>


The Anti-Heisenberg Principle: A Diagnostics Manifesto - <AUTHOR> https://bespoken.tools/blog/2016/11/28/diagnostics-manifesto <comment><USER2> one thing is missing in the list: a time machine - the system should capture verbose information about events occuring before the error - all these DEBUG/INFO messages you usually disable in production. Without that you have to change the log level and try to repeat the error condition. And dont go too far, or you'll end up with a cluster of log aggregation machines just for collecting the logs from one application. Like 'logstash/kibana' behemoth ;)

</comment><comment><USER3> If you log all payloads now your logs are subject to DPA and possibly also PCI - potential security fail.

<comment><USER4> That was one thing I noticed as well; selective logging of request parameters is safer, but requires more effort.

<comment><USER5> What are DPA and PCI?

<comment><USER6> PCI is probably refering to [https://en.wikipedia.org/wiki/Payment_Card_Industry_Data_Sec...](https://en.wikipedia.org/wiki/Payment_Card_Industry_Data_Security_Standard)

DPA might be [https://en.wikipedia.org/wiki/Data_Protection_Act_1998](https://en.wikipedia.org/wiki/Data_Protection_Act_1998)

</comment></comment></comment></comment><comment><USER7> Clearly given a lot of thought to an often overlooked aspect of programming.</comment>


Vitamin D and Immunity [video] - open-source-ux https://www.youtube.com/watch?v=W5yVGmfivAk <comment><AUTHOR> Knowing that Vit D may be helpful for respiratory tract infections, as discussed in this video, I ordered a bottle from Amazon shortly after learning of Corona virus. It might not help me specifically, but I'm hedging my bets.

<comment><USER2> FWIW, I did the same thing. I used to routinely take a Vitamin D supplement anyway, and had gotten away from the practice, so I figure it probably can't hurt to take it up again.</comment></comment>


Facebook open sources DensePose - <AUTHOR> https://research.fb.com/facebook-open-sources-densepose/ <comment><USER2> I wonder how they arrived at Creative Commons' CC-BY-NC as the license. These licenses are not meant for code but for artwork, right? I recently noticed the same with the FastPhotoStyle code [1] by NVidia, so I'm wondering if there is something that draws their legal departments to this license?

EDIT: Creative Commons actually _discourage_ the use of their licenses for code [2].

[1]: [https://github.com/NVIDIA/FastPhotoStyle](https://github.com/NVIDIA/FastPhotoStyle)

[2]: [https://creativecommons.org/faq/#can-i-apply-a-creative- comm...](https://creativecommons.org/faq/#can-i-apply-a-creative-commons- license-to-software)

</comment><comment><USER3> "real-time approach for mapping all human pixels of 2D RGB images to a 3D surface-based model of the body."

"Our work shows that one can efficiently compute dense correspondences between 2D RGB images and 3D surface models for the human body. Unlike common works in human pose estimation that operate with 10 or 20 human joints (wrists, elbows, etc), this work accounts for the entirety of the human body, defined in terms more than 5000 nodes. The resulting speed and accuracy of our system accelerates connections with augmented and virtual reality. Earlier works on this problem would require computation in the order of minutes, initialization by an external system e.g. for human joint localization, while being particularly brittle. DensePose operates at multiple frames per second on a single GPU and can handle tens or even hundreds of humans simultaneously."

GitHub: [https://github.com/facebookresearch/DensePose](https://github.com/facebookresearch/DensePose)

</comment><comment><USER4> _Why_ does facebook _need_ this...?

Does it further their _mission_ (statement) to " _bring the world closer together_ "? [https://www.facebook.com/zuck/posts/10154944663901634](https://www.facebook.com/zuck/posts/10154944663901634)

Or is this a sophisticated way of tracking/analysing what people are doing in their personal videos so that Facebook can target people with more Ads?</comment>


Elementary Theme and Docky - <AUTHOR> http://tanu.wordpress.com/2009/12/20/elementary-theme-and-docky/

<comment><USER2> I thought it was a theme for the set of widgets of enlightenment : <http://trac.enlightenment.org/e/wiki/Elementary></comment>


Loopt to work in the background on iPhone via deal with AT&T - <AUTHOR> http://www.businessinsider.com/loopt-to-run-in-the-background-on-iphone-2009-6 <comment><USER2> Most relevant sentence: "After the 14-day trial, the always-on feature will cost $3.99 per month, added to your AT&T bill."

<comment><USER3> AT&T disgusts me. How much money has the iPhone dropped in their lap? And all they do with that money is drag down the entire user experience with horrible, overpriced service which cripples the device severely.

They have had time, however, to try to squeeze as much money from this venture as possible while they still have exclusivity. I've now received two emails from AT&T about their navigation app. They charge $9.99 _per month_ for it. How many other iPhone app developers can send out an email to every single iPhone owner at will? Zero. The rest of us have to charge 99 cents (one time) if we want to get noticed on the App Store.

And now that they've cashed in on Apple's brilliance and innovation, they're going to do the same with Loopt. They are the perfect example of a company willing to do whatever it takes to increase profits, but not willing to do much of anything to help their customers.

<comment><USER4> It seems to me that this would be Loopt's business model?

I can understand bashing AT&T I hate their service, but I think Loopt charges for their service on most providers.

Oh and the $9.99 per month thing made me choke too. Especially when TomTom has a $99 app.

<comment><USER5> AT&T isn't the only company with a $/month GPS app on the App Store.

Not that its clear if map updates will be free or in-app purchases with TomTom.

</comment></comment></comment></comment><comment><USER6> PG on Loopt CEO, Sam Altman:

 _I was told I shouldn't mention founders of YC-funded companies in this list. But Sam Altman can't be stopped by such flimsy rules. If he wants to be on this list, he's going to be.

Honestly, Sam is, along with Steve Jobs, the founder I refer to most when I'm advising startups. On questions of design, I ask "What would Steve do?" but on questions of strategy or ambition I ask "What would Sama do?"

What I learned from meeting Sama is that the doctrine of the elect applies to startups. It applies way less than most people think: startup investing does not consist of trying to pick winners the way you might in a horse race. But there are a few people with such force of will that they're going to get whatever they want._

(source: <http://www.paulgraham.com/5founders.html>)

<comment><USER7> I still can't believe he manages to cut the deals that he does. I was really shocked when it showed up on Boost Mobile.

Is Loopt really that great? Does he prove that it makes money for the phone company? I guess that must be the pitch, since it would be easier to track what's driving spending from a pre-pay customer.

</comment></comment><comment><USER8> Loopt is not running in the background, AT&T is just updating Loopt from their own data.

<http://daringfireball.net/linked/2009/09/04/loopt-location>

</comment><comment><USER9> Cool for people who use Loopt I guess BUT this is really not fair to other developers (especially the competitors of Loopt).

It feels like one of those "Well, if I let YOU do it I have to let EVERYONE do it" type of things, and AT&T should have said no.

I also find it interesting that Apple isn't mentioned anywhere in the deal, which is strange because the article makes it seem that AT&T has the power to just tell Apple to break one of its developer rules for a special case. Shady, if I do say so myself.

<comment><USER10> From the article:

"The app isn't running in the background; it's working server-to-server."

So presumably all they've done is a deal with AT&T to access the cell-location data for a subscriber, and using the app to tie that into their Loopt identity. Nothing special going on inside the iPhone OS.

<comment><USER11> Interesting. So it shouldn't affect battery life.

</comment></comment></comment><comment><USER12> Why do I get this feeling that Loopt simply struck a deal for access to location/tracking/logging data that AT&T is already collecting for its own purposes...

<comment><USER13> Because that's basically what the article says?

The real question is why AT&T is proactively tracking phone location (if they are).

<comment><USER10> Probably something really sinister, like the ability to route your phone calls to you, or something.

</comment></comment></comment><comment><USER14> In reference to pricing, I think you guys are forgetting the study which found that the majority of iphone users make over $80,000 in salary. There is quite a lot of disposable income in that population. Therefore it only makes sense that they would attempt to milk every dime. Especially when competitors are sure to emerge in the next 2-3 years.

<comment><USER15> "...study which found that the majority of iphone users make over $80,000 in salary."

Are these professionals really the target market for Loopt though? Loopt seems more useful to teens/college kids etc.

<comment><USER14> When you consider that location based services like Loopt can be used to feed Apps like Foursquare.com you realize this technology has broad applications for iphones majority audience. Foursquare is a mobile social media platform that allows users to see what bars their friends are situated at.

</comment></comment></comment><comment><USER16> I would pay 4 bucks a month... if everyone else paid 4 bucks a month and did the same. They won't do that, however.

</comment><comment><USER17> I do something like this with <http://github.com/tylerhall/sosumi>

I was planning to write something which alternates between Sosumi and Clarke (Skyhook FireEagle updater for Mac) so when you are at your computer and updating you don't eat into your iPhone battery.

<comment><USER18> If you're using Brightkite, you can get background location on your iPhone using this: <http://github.com/HiroProt/playnice/tree/master>

Of course, that's a total hack ;)

</comment></comment><comment><USER19> I'm surprised people aren't more up in arms about AT&T continuously tracking their location.

<comment><USER20> It's more or less required for cell phone service. They need to know what cell you are in order to connect incoming calls.

Besides if you're using AT&T you're either ignorant or unconcerned about privacy. They have looong history going back to the Clipper chip, PATRIOT act era wiretaps, of "selling out" their customers.

</comment></comment><comment><USER21> The Nike + iPod app runs in the background. Does that not count as a third part application?

</comment><comment><USER22> This is really exciting news; traditionally the carriers have been a bit closed in nature, and this represents a healthy step forward for people like myself who use and enjoy Loopt. Look forward to seeing this technology progress!

</comment><comment><USER23> as an entrepreneur: wow, that's a pretty good hack. not many people could have pulled that off.

as an iphone owner: oh no WAY am i going to pay extra for that. at&t already charges through the nose and gives me lousy service in return.

</comment><comment><USER24> As a complete side note; how many people do you know that use Loopt? I'm curious as to how well they're doing in comparison to say something like Facebook.

</comment><comment><USER25> This is highly unfair: to provide a technological boost only to a single application is not what I'm comfortable to name as a 'free market'.

</comment><comment><USER26> Apps have been running in the background since Backgrounder was published on Cydia. And it doesn't cost anything to do so. Backgrounder lets me set up my TomTom, Flow Chat (IRC), and AMBER Alert to background themselves automatically... and my 3G[s] still runs plenty fast.

</comment><comment><USER27> Antitrust, much?

<comment><USER28> Funny, what with the Apple / Jobs etc. in context, I read that as Antichrist...

</comment></comment><comment><USER29> wow!

<comment><USER30> You know, you could give some context to this comment, and perhaps comment on the article since you know more.

<comment><USER30> Guh, I was trying to point out you're probably the Sama and maybe get some info on the actual deal. Not get you down-voted. Your comment was perfectly acceptable considering your connection to Loopt.</comment></comment></comment>


Ask HN: Criteria for making a good take-home dev quiz? - <AUTHOR> I have never been a fan of the take home development test when your interviewing for a job. After hiring over the last few years I see the importance now. What are some good problems to include when creating a take home project? I assume something technically related to our product or space, but do you make them start from scratch or give them a broken app and have them fix it? <comment><USER2> I got my first job with a take home project and I'm kinda terrible at programming trivia so I sort of like them.

Mine was from scratch and was a vague outline of an application and left room for me to make many decisions, add things, but still get the gist of the goal done.

The end product didn't have to be fully functioning, but just showed how it would work, etc.</comment>


How do I get over my bad habit of procrastinating? - <AUTHOR> http://www.quora.com/Life-Advice/How-do-I-get-over-my-bad-habit-of-procrastinating

<comment> extra-ordinary I should really write a bookmarklet or something so I don't have to log in to read Quora links on HN :(</comment>


Oracle Hires Mark Hurd As Co-President - <AUTHOR> http://www.nytimes.com/2010/09/07/technology/07oracle.html?_r=1&hp <comment><USER2> _"H.P. found no evidence of sexual harassment, but said Mr. Hurd had tried to conceal a personal relationship with Ms. Fisher by removing her name from his expenses for meals. "_

Interesting. He's a multimillionaire CEO and couldn't be bothered to just pay for the dinners out of his own pocket, but expensed them to the corporate card instead? It must be good to be da king. Until you're not...

<comment><USER3> That's normal behavior for HP executives. The company also paid for them to make personal trips in HP's jets.

<comment><USER4> I've heard there are sometimes insurance reasons for that. i.e the senior execs can _only_ fly on private flights.

<comment><USER5> Can you explain the reasons?

<comment><USER6> After some quick googling, I found more references to this claim, but only in comments on articles:

<http://www.networkworld.com/community/node/37608>: "The use of a corporate jet is often required by corporate policy intended to protect the executive from the threat of violence or abduction. "

[http://www.swamppolitics.com/news/politics/blog/2008/11/auto...](http://www.swamppolitics.com/news/politics/blog/2008/11/auto_officials_nailed_on_priva.html): "Most corporate CEOs in companies with corporate jets are REQUIRED to use those jets as their ONLY mode of travel, as per the insurance requirements of being the Chief Executive Office and Chairman of a Publicly Traded Company.".

<comment><USER7> > "Most corporate CEOs in companies with corporate jets are REQUIRED to use > those jets as their ONLY mode of travel ..."

That would make getting a cup of coffee from the local café a serious PITA. I guess that's why they have executive assistants?

</comment></comment></comment></comment></comment></comment><comment><USER8> It is a bit funny seeing one Oracle exec who had an affair (Charles E. Phillips Jr) getting replaced by another. Someone could base a movie on them.

It's good to see Mr Hurd back at work so soon. He seems a good match and well qualified. Besides seeing how Oracle does under him, it'll be interesting to see what influence he has on decisions affecting the industry in general.

In particular, some wonder how much Android will be affected by the JAVA case against Google. Others wonder about the future of other open-source projects such as VirtualBox (development appears to be continuing)

If they need another exec with a colorful past, there's always former Broadcom CEO Henry Nicholas. He was accused of putting drugs in others' drinks; an airline pilot complained of pot smoke so thick that a gas mask was needed.

[http://marketplace.publicradio.org/display/web/2008/06/06/he...](http://marketplace.publicradio.org/display/web/2008/06/06/henry_nicholas/)

Steve Jobs used LSD when he was younger and turned out pretty well. Sun had other that did the same. I heard one former Sun exec in a PBS interview talking about that experimental period, trying to expand the mind. Basically he said drugs failed at that, and the expanding experience came later... the internet

There's a little bit of related history at this link that mentions Suns' fifth employee:

[http://www.huffingtonpost.com/ryan-grim/read-the-never- befor...](http://www.huffingtonpost.com/ryan-grim/read-the-never-before- pub_b_227887.html)

<comment><USER9> I know this is the internet and all, but it would be prudent not to cast aspersions about executives having an "affair" when the fact was that Hurd left for other reasons.

<comment><USER10> Uh,

Hurd left because of unethical behavior which many would interpret as evidence he was having an affair.

HP didn't have overwhelming evidence of an affair (and an act isn't necessarily grounds for termination) but the world already a preponderance of evidence. I don't think Mark Hurd is going to be starting any civil cases on the subject any time soon.

<comment><USER11> Not quite.

Hurd left because of a sexual harassment case where a contractor (Jodie Fisher) claimed that she stopped getting work after turning down his sexual advances. According to both parties, no affair existed.

So while there is good evidence that he wanted an affair, there is no evidence he had one.

<comment><USER10> "This year, Mr. Phillips acknowledged having an affair after a woman he had been seeing put up a Web site and billboards detailing his extramarital relationship."

[http://www.nytimes.com/2010/09/07/technology/07oracle.html?_...](http://www.nytimes.com/2010/09/07/technology/07oracle.html?_r=1&hp)

... The original post, btw, simply said Hurd had an affair, neither it nor I say he was fired for having an affair...

<comment><USER12> Mr. Phillips != Mr. Hurd -- the question is whether Hurd had an affair, not Phillips.

<comment><USER13> oracle.morality++;

</comment></comment></comment></comment></comment></comment></comment><comment><USER14> At HP, Hurd was famous for ruthlessly cutting jobs. If I were a former Sun employee, I would be very scared of this guy.

<comment><AUTHOR> Hurd's only real achievement at HP was finishing Fiorina's work and applying the coup de grace to the HP Way. HPers loathe him. They'd have been dancing in the street when he left, if they didn't know that the board was so happy with his performance that his successor was guaranteed to carry on in the same style.

Of course, if there are Oracle employees who have a problem working for people with Hurd's attitude, they haven't been paying attention.

<comment><USER15> I worked for Snapfish (division of HP) for about six months last year. It was quite disappointing. This isn't a company that's ever going to innovate again.

I grew up loving HP calculators, and detest anything that doesn't run on RPN. I have an HP-15c app on my iPhone (notibly, _not_ the one done by HP, which is inferior.)

Carly and then Turd killed any sort of innovation in this company. They're purest evil, and I can see why Oracle would like to hire this sort of executive.

<comment><USER16> Why are they evil? Maybe they're just business people. This is an honest question. You're not the only person I've heard react that way. Merely cutting R&D just doesn't seem inherently evil to me, even if it turns out to be the wrong decision.

<comment><USER17> I think he means 'evil' in a 'you just ruined something that I thought was great' sense.

<comment><USER18> Not exactly. HP developed the first Memristor.

<http://www.hpl.hp.com/news/2010/apr-jun/memristor.html>

<comment><USER17> I speculated what he meant, I didn't make the claim myself.

</comment></comment></comment></comment></comment></comment></comment><comment><USER19> So.. If under his watch HP made a lot of money with service parts, and substantially reduced R&D spending, he may be a great fit for Oracle. In the sense that they will spend as little as they can on improving Solaris, and just try to make it necessary for the enterprises to integrate with the rest of Oracle portfolio? :-) If I recall correctly, that's the market potential that the recent memo was referring to.

<comment><USER20> Those kinds of things only work once. I think every IT manager out there knows Solaris is dead, and will be pushing to migrate to open-source alternatives. And every other product that Sun brought to Oracle is also suspect.

I just recently quit working at an IT managerish job, and I hope the one thing I left them with is "never, ever buy an HP printer."

</comment></comment><comment><USER21> Since Oracle is a direct competitor to HP, I wonder if HP (or even the SEC) are going to be investigating the hire for conflicts of interest regarding trade secrets just like they went crazy when engineers left Google for Apple.

</comment><comment><USER22> When was the last time a "Co-President" worked well?

Serious question, I'm just having trouble thinking of one.

<comment><USER3> Oracle has been running with two presidents for a while now, so presumably it's working.

Larry and Sergey are co-presidents of Google.

</comment></comment><comment><USER23> when Oracle bought Sun many analysts speculated that Oracle will sell Sun Hardware Division, of course even more analysts speculated the obvious which is, Oracle is taking a dive into the hardware business

When I read this all i was thinking was, Mark Hurd seems like a hardware guy, Oracle really wants to get this hardware business right!

<comment><USER24> Hurd is the guy who managed to single handedly destroy the remains of HP's engineering ability. I give it about a week before the last Sun guy leaves.

Of course this could be a cunning plan to avoid the costs of redundancy payments - hire Hurd and watch all your best engineers resign for free.

<comment> brown9-2 _Hurd is the guy who managed to single handedly destroy the remains of HP's engineering ability_

I thought Carly Fiorina was blamed for this? How many people can single- handedly destroy something?

Let's be realistic, CEO's aren't able to get much done without the approval of the board of directors, who are elected by the company's shareholders. There are very few "single-handedly"s in business. You can't blame just the CEO, as there are people above him/her. Blame the board, blame the shareholders who didn't/don't value "HP's engineering ability".

<comment><USER24> Fiorina destroyed HP as a great engineering company turning it into a printer ink marketing scam.

Hurd managed to get almost every remaining engineer to leave - see the stories posted here at the time.

</comment></comment></comment></comment><comment><USER25> I doubt Phillips will have a problem finding another job.</comment>


What does it mean when we say that a language is expressive? - <AUTHOR> <comment><USER2> I was hoping someone who had researched this issue would answer, but since nobody else is answering at all, I'll offer you an unresearched answer about the ordinary use of the term in the industry.

Any Turing-complete language can do any information processing that any other can do _given infinite time_. If you wait long enough for it to finish, the same inputs will produce the same outputs.

So, "expressive" can't mean "capable of expressing things other languages can't" in an algorithmic sense. So then, in what sense? In the mostly subjective sense that the language makes it _relatively easy in practice_ to specify a _relatively wide variety_ of algorithms and data structures _with the built-in language itself_.

For example, a language that requires every element in an array to be of the same type and the index numbering to always start with zero would be less expressive than one that allowed elements of arbitrary size and index numbering that started with a specified value. With the former, you could still solve the problem by various means, such as using "void pointers" in the array (a void pointer can point at anything, so an array of them can point to any collection of arbitrary things), or by wrapping array access in a function that converted your index numbering to the approved zero-based numbering.

So, you could do what you wanted with either language, but one would make you build the features yourself while the "more expressive" language would have a much easier built-in way to do it (to "express" your design preferences.)

Expressiveness is subjective, because "relatively easy in practice" is in the eye of the beholder, but like "good" restaurant food, there is some amount of general agreement.

So why wouldn't every language be as expressive as possible? Because some things that are easy to express are bad ideas. You may accidentally tell the machine to do something the hard way without realizing it, because it was easier to write. Some people would prefer a language that is in a sense only half built, which they then customize with careful specifications. After all, any function that you write yourself becomes very easy in practice to use _after you write it_. Others would prefer what is called "batteries included" languages that have lots of pre-built functionality, since even if it is not fully customized, it will often be good enough.

Maybe that will give you a start at understanding the admittedly vague and subjective meaning of programming language "expressiveness".</comment>


Brilliant or insane code? - <AUTHOR> http://www.stavros.io/posts/brilliant-or-insane-code/ <comment><USER2> This is in the zip documentation as the way of solving this problem. Sort of surprised the author didn't look up the documentation before writing what is otherwise a very good post.

        The left-to-right evaluation order of the iterables is guaranteed. This makes
        possible an idiom for clustering a data series into n-length groups using
        zip(*[iter(s)]*n).

[http://docs.python.org/2/library/functions.html#zip](http://docs.python.org/2/library/functions.html#zip)

<comment><USER3> Recently I was downvoted 2-3 times on S.O. for an answer that was claimed to be non-idiomatic. So, I cleaned it up, but it really irked me. What I had written was totally fine. It shouldn't have hurt anyone's eyes. It was direct. It was in-your-face. It was not magic.

Reading this post brought back that feeling.

If people don't understand a completely valid and terse way of coding something, sometimes instead of bothering to understand it, they will bash it. Sometimes, this is a totally valid way to vent frustration, and then they learn something new, and all is good. But sometimes, it just gets left as "this is wrong" and then someone else thinks it is wrong, and so on. _That_ is wrong, and tech leads or architects that enforce such crap will bug the living shit out of good developers and lose them.

I appreciate clarity. But, terse one-liners can be just as clear if not clearer than code that unnecessarily adds more methods/functions/names/local vars and claims to be "more testable", etc.

You shouldn't have to sacrifice the ability to be terse and clear at the same time. Testing is no excuse for code bloat. You can likely write a test that executes the behavior without having to atomize it. Assess the amount of production and test code you are writing. How much more code are you actually having to write in order to test, both in the tests themselves and in the code which you are having to test?

It happened here with Python and it happens in many languages. It even happens with laws and regulations in government. If someone gets the same thing done just as ethically but without the bureaucracy, just appreciate it as another perhaps better way of doing something. Don't bash it publically because you don't understand it.

<comment><USER4> I think the mentality can be extended to most code-reading. Don't get it by skimming? Must be crap code. I only got away from that when I changed my litmus test towards whether I could write on top of the codebase successfully, not how it looked. Today my only real point of judgment about the look of code is whether it's written in a style that increases average error rate.

w/r to Python in particular, it has a history of ending up with idioms that are "tricky" and not particularly more or less terse than other techniques, but are able to exploit the standard library functions to get a faster-running result.

This is, of course, at odds with the motto of "there should be only one (obvious) way to do it," so every experienced Python programmer has to internalize a small dictionary of idiomatic one-liners for these exceptional cases. (Fortunately, it's not that big. I can only think of three or four off the top of my head.)

<comment><USER5> _style that increases average error rate_

Errors per LOC is allegedly constant, across all languages.

I also consider the cost of change when designing things.

I once created an HL7 wrapper that was a marvelous thing of beauty. Fluent API, clever use of the type system. But no one could maintain it, including me. It had too much magic. So I scrapped it, went with a dumber implementation.

<comment><USER6> > Errors per LOC is allegedly constant, across all languages.

If this is true, then a more verbose style will have a higher error rate. (more LOC to do the same task -> more errors)

<comment><USER7> > Errors per LOC is allegedly constant, across all languages.

This implies that more expressive languages(more expressions per line) are less prone to errors.

You conclusion would be correct if he had stated that error per expression was constant between languages.

<comment><USER8> Don't confuse correlation with causation. It may not be that more lines is the cause, but that the method of thinking that some languages require you to think in is error prone, and it just so happens that such a language also needs more LoC.

</comment></comment></comment></comment></comment></comment></comment><comment><USER9>
        i = iter(array)
        return zip(i, i, i)

There you go. All but neceessary magic gone with just one line more.

<comment><USER10> It is clearer, but uses a fixed number of arguments, so may be unsuitable for some applications.

<comment><USER11> The current function has the same restriction. In their case it's in the form of " * 3 ".

<comment><USER12> That `3` can be trivially replaced with a variable in a way that `(i, i, i)` cannot. But still, the refactoring of the iterator into a separate variable is the key step which reinforces that the same object is being passed 3 times

</comment></comment></comment></comment><comment><USER13> I'm glad Clojure has top-level support for this operation... it's quite flexible too, and the presence of partition-all makes it explicit what you should expect if the sequence doesn't evenly partition.

        user=> (partition 3 [1 2 3 4 5 6])
        ((1 2 3) (4 5 6))
        user=> (partition 3 [1 2 3 4 5 6 7])
        ((1 2 3) (4 5 6))
        user=> (partition-all 3 [1 2 3 4 5 6 7])
        ((1 2 3) (4 5 6) (7))
        user=> (partition 3 3 (repeat 0) [1 2 3 4 5 6 7])
        ((1 2 3) (4 5 6) (7 0 0))

<comment><USER14> FAO: iamgopal - your account has been dead for over a year for no discernible reason, only people with showdead on can see your posts.

</comment></comment><comment><USER15> From Itertools Recipes [6]:

      def grouper(iterable, n, fillvalue=None):
          "Collect data into fixed-length chunks or blocks"
          # grouper('ABCDEFG', 3, 'x') --> ABC DEF Gxx"
          args = [iter(iterable)] * n
          return zip_longest(*args, fillvalue=fillvalue)

\- What is the most "pythonic" way to iterate over a list in chunks? [1]

\- Idiomatic way to take groups of n items from a list in Python? [2]

\- Python "Every Other Element" Idiom [3]

\- Iterate an iterator by chunks (of n) in Python? [4]

\- How do you split a list into evenly sized chunks in Python? [5]

[1]: [http://stackoverflow.com/questions/434287/what-is-the- most-p...](http://stackoverflow.com/questions/434287/what-is-the-most- pythonic-way-to-iterate-over-a-list-in-chunks)

[2]: [http://stackoverflow.com/questions/2461484/idiomatic-way- to-...](http://stackoverflow.com/questions/2461484/idiomatic-way-to-take- groups-of-n-items-from-a-list-in-python)

[3]: [http://stackoverflow.com/questions/2631189/python-every- othe...](http://stackoverflow.com/questions/2631189/python-every-other- element-idiom)

[4]: [http://stackoverflow.com/questions/8991506/iterate-an- iterat...](http://stackoverflow.com/questions/8991506/iterate-an-iterator-by- chunks-of-n-in-python)

[5]: [http://stackoverflow.com/questions/312443/how-do-you- split-a...](http://stackoverflow.com/questions/312443/how-do-you-split-a-list- into-evenly-sized-chunks-in-python)

[6]: [http://docs.python.org/3/library/itertools.html#itertools- re...](http://docs.python.org/3/library/itertools.html#itertools-recipes)

<comment><USER16> Figured I would add my own [7]. I know the example prompt might seem a bit specific, but it can come in really handy sometimes (for example, iterating through get parameters). Always a fan of idiomatic and one-liner python.

I should mention that I ended up using the fourth version (seemingly the slowest) but it is actually the fastest depending on your input -- as the length of the elements gets larger, the fourth method tends to vastly outperform the others.

[7] [http://stackoverflow.com/questions/16685545/elegantly- iterat...](http://stackoverflow.com/questions/16685545/elegantly-iterating- over-string-replacement)

</comment></comment><comment><USER17> I think the code is pretty ok, except for the stupid name, docstring and that it is a method and not a free function.

        def chunks(seq, n):
            "groups the elements of the seq into a list of n-sized chunks."
            return zip(*[iter(seq)]*n)

<comment><USER18> The original docstring is a complete red herring... yours is much better, but I'd go one further and include an example.

</comment></comment><comment><USER19> It does not rely on an implementation detail, that is how iterators work. He's just supplied the same iterator to a function which consumes iterators... that's exactly the expected behaviour.

<comment><USER20> The fact that zip evaluates its arguments in order is an implementation detail. It could evaluate them in reverse order, in which case this code would not behave as expected.

<comment><AUTHOR> That's what I meant, thanks for clarifying. It does seem that the zip() docs make a guarantee of left-to-right evaluation, though, so my apprehension proved unfounded.

</comment></comment></comment><comment><USER21> You can also do

        zip(arr[::3], arr[1::3], arr[2::3])

which is nearly as fast but doesn't work with iterators. If you want to use iterators you could also do

        zip(islice(arr, 0, None, 3), islice(arr, 1, None, 3), islice(arr, 2, None, 3))

which is a tad slower.

</comment><comment><USER22> It wouldn't have occurred to me to do this a different way. Isn't this a very basic use of zip()?

</comment><comment><USER23> The part that annoys me is that the docstring mentions "dictionaries" when I see no `dict`s.

<comment><AUTHOR> Yeah, looks like a remnant that was never updated.

</comment></comment><comment><USER24> It's not brilliant.

This accomplishes the same thing without being hard to understand:

        from itertools import islice

        iterator = iter(array)
        try:
            while True:
               yield list(islice(iterator, 3))
        except StopIteration:
            pass

<comment><AUTHOR> Sure, there are many ways to do it, but I think the author was going for speed here.

<comment><USER24> I'd be surprised if my way is slower. Any time you unpack into a function such as zip() python has to create an intermediary list to store all the results before calling the function.

<comment><USER25> You could always use izip:

[http://docs.python.org/2/library/itertools.html#itertools.iz...](http://docs.python.org/2/library/itertools.html#itertools.izip)

<comment><USER24> I was a bit wrong about that. For some reason I imagined that there would be quite a few args being passed to zip, when in fact there are just the three iterators. It does create a temporary list, but it's so small it's negligible. Using izip wouldn't really change anything.

</comment></comment></comment></comment></comment><comment><USER26> like dict(zip( or dict(getmembers(asdf)).keys(), it's idiomatic code. it wouldn't have occurred to me the first time i had to write such a function, but now that i've taken a few moments to read the article i find it clearer than the list comprehension version (because the constant only appears once) and nicer than the numpy version in that it doesn't require an extra dependency.

may save a few keystrokes some rainy day. good post.

</comment><comment><USER27> Even more interesting to me:

In [3]: ar = [1, 2, 3, 2, 4, 6, 3, 5 ,7, 3, 5, 8]

In [4]: %timeit zip( _[iter(ar)]_ 3) 100000 loops, best of 3: 2.02 us per loop

In [5]: %timeit zip(ar[0::3], ar[1::3], ar[2::3]) 1000000 loops, best of 3: 1.37 us per loop

In [6]: %timeit zip( _(iter(ar),)_ 3) 1000000 loops, best of 3: 1.34 us per loop

From which I conclude: \- zipping slices is even more efficient, and arguably easier to grok \- but you get about the same runtime by multiplying a singleton tuple rather than a list

However if you want to generalize the chunk size, multiplication seems to win out over slicing (with tuples still being more efficient than lists):

In [7]: chunk1 = lambda n, it: zip( _[iter(it)]_ n)

In [8]: chunk2 = lambda n, it: zip( _(iter(it),)_ n)

In [9]: chunk3 = lambda n, seq: zip(*(seq[i::n] for i in xrange(n)))

In [10]: %timeit chunk1(3, ar) 100000 loops, best of 3: 2.32 us per loop

In [11]: %timeit chunk2(3, ar) 1000000 loops, best of 3: 1.83 us per loop

In [12]: %timeit chunk3(3, ar) 100000 loops, best of 3: 3.55 us per loop

</comment><comment><USER28> Maybe I'm misreading it, but to me the far more heinous crime than using difficult code (setting aside that it's in the docs) is that the docstring is a total lie.

        """Parses an array of xyz points and returns a array of point dictionaries."""

        'Only, it doesn't really. It takes an iterable of points...and returns an iterable of 3-tuples of groupped points'

The wrongness of it would cause me to double-take, because even if I were familiar with this usage, it isn't what the comment suggests is happening. A docstring more like:

        """Parses an iterable of values [x,y,z,x,y,z...] and returns an iterable of 3-tuples: [(x,y,z),(x,y,z)...]"""

Would be a lot more clear by simple virtue of truth, even if it didn't explain the code step by step.

</comment><comment><USER29> I made a few more interesting (to me) measurements. As always, you have to measure your performance with your actual input data to see what's "best".

Test 1: Boring, small array of integers

        In [28]: arr = range(0, 300)

        In [29]: %timeit [(arr[3*x], arr[3*x+1], arr[3*x+2]) for x in range(len(arr)/3)]
        10000 loops, best of 3: 27.2 us per loop

        In [30]: %timeit numpy.reshape(arr, (-1, 3))
        10000 loops, best of 3: 45.2 us per loop

        In [31]: %timeit zip(*([iter(arr)]*3))
        100000 loops, best of 3: 6.25 us per loop

This roughly matches the article's timing ratios, so far so good.

Test 2: Use numpy's random number generation to get a small array of floats

        In [32]: arr = numpy.random.ranf(300)

        In [33]: %timeit [(arr[3*x], arr[3*x+1], arr[3*x+2]) for x in range(len(arr)/3)]
        10000 loops, best of 3: 54 us per loop

        In [34]: %timeit numpy.reshape(arr, (-1, 3))
        1000000 loops, best of 3: 1.06 us per loop

        In [35]: %timeit zip(*([iter(arr)]*3))
        10000 loops, best of 3: 39.7 us per loop

numpy is two orders of magnitude faster here; it's evidently using a highly optimized internal codepath for random sequence generation, which I'd guess is a common thing to do in numeric analysis. I assume it's using a generator, so there's no actual array being created, blowing up the CPU cache lines etc.

Test 3: Verify that analysis by interfering with numpy

        In [36]: arr = [x for x in numpy.random.ranf(300)]

        In [37]: %timeit [(arr[3*x], arr[3*x+1], arr[3*x+2]) for x in range(len(arr)/3)]
        10000 loops, best of 3: 26.2 us per loop

        In [38]: %timeit numpy.reshape(arr, (-1, 3))
        10000 loops, best of 3: 48.5 us per loop

        In [39]: %timeit zip(*([iter(arr)]*3))
        100000 loops, best of 3: 6.55 us per loop

Yep.

Test 4: Larger data set, no interference

        In [40]: arr = numpy.random.ranf(3000000)

        In [41]: %timeit [(arr[3*x], arr[3*x+1], arr[3*x+2]) for x in range(len(arr)/3)]
        1 loops, best of 3: 624 ms per loop

        In [42]: %timeit numpy.reshape(arr, (-1, 3))
        1000000 loops, best of 3: 1.06 us per loop

        In [43]: %timeit zip(*([iter(arr)]*3))
        1 loops, best of 3: 335 ms per loop

The numpy time doesn't change _at all_ from test 2 despite the larger size, but the others suffer. Again, I suspect numpy is being intelligent here; my guess is that it doesn't actually apply the function and generate the real output, it just wraps the random generator in another one.

Test 5: Larger data set, interfering with numpy

        In [44]: arr = [x for x in numpy.random.ranf(3000000)]

        In [45]: %timeit [(arr[3*x], arr[3*x+1], arr[3*x+2]) for x in range(len(arr)/3)]
        1 loops, best of 3: 321 ms per loop

        In [46]: %timeit numpy.reshape(arr, (-1, 3))
        1 loops, best of 3: 354 ms per loop

        In [47]: %timeit zip(*([iter(arr)]*3))
        10 loops, best of 3: 83.6 ms per loop

There we go; we're back to roughly the original timing ratios.

So, surprise! You always have to measure. Measure, measure measure. My bias is to write code first for legibility and modifiability, and then optimize hot spots if needed (and add comments, please, when you do so).

Without doing deeper analysis I'd say one moral of the Python story is, this shows the potential power of generators. But in real-world data sets this isn't always ideal -- is it faster to load up the whole data set in memory and blast through it, or load it from disk on demand with a generator? In _really_ high performance scenarios, is it faster to preprocess the data to fit into the CPU's cache lines? You can't tell without measuring, and you have to measure in the environment you're deploying to, since the answer may be different on a machine with 1GB RAM vs. one with 128GB RAM, or 32KB L1 cache vs. 8KB.

<comment><USER30> The numpy example becomes fast when you use numpy arrays. Try %timeit numpy.array(arr); numpy.reshape(arr, (-1, 3));

and then just %timeit numpy.array(arr), you'll see that the reshape takes no time at all. Type conversion from python list to numpy array is what kills the performance.

<comment><USER31> A point of clarification here - numpy's reshape operation stays fast as long as the array is a numpy array.

Which is exactly what the parent comment was all about - the author figured that the reason numpy was significantly faster was because it was accessing / working with the data in a different fashion.

So, in order to test that theory, he converted the numpy.array into a normal python array _before_ he proceeded to do any timed operations with zip vs. numpy.reshape, etc.

This is a more realistic playing field if you're considering data that was created outside of the numpy environment. At _some_ point, if you're going to work with numpy.reshape, it will need to be type converted / "imported" into numpy data types.

For the purposes of this test, it's much more "fair" to include both the time numpy spent on splitting the array as well as that conversion time. The reshape process in numpy had essentially O(1) time with native data types indicating that it had done some behind the scenes work that allowed for such speed. The parent example is much more realistic in capturing the time of the behind the scenes work by forcing each method to start from the same _exact_ same data objects.

<comment><USER30> My reply was in response to the statement "numpy is two orders of magnitude faster here; it's evidently using a highly optimized internal codepath for random sequence generation", which is false, it's not because of highly optimized internal codepaths for random sequence generation, it's because the code produced a numpy array (or didn't have to do type conversion). But I agree, when using numpy to produce a timing comparison, it would be fair to start with a numpy array, or to show the time involved in the creation of the array.

<comment><USER29> Thanks for your comments. I hope it didn't sound like I was negatively comparing numpy's array/sequence operations to anything. I know very little about numpy, and I assume that "real" numpy solutions don't look anything like what's being discussed here. I only included those measurements since the article's author did.

To clarify my points a bit, the optimizations I alluded to (in "highly optimized internal codepath") were meant to include things like using a generator, i.e. at no point is there an actual array of input random numbers. The fact that in numpy the 300-element "array" and the 3,000,000-element "array" had identical timings suggests exactly that; I disagree that it's an issue of internal representation, unless the concept of a numpy array subsumes the concept of a generator, in which case I think we're all saying the same thing.

That kind of optimization is only possible in this case because by the definition of randomness nobody could know what the values were until they were enumerated, so it's 100% transparent to use a generator. That's not how real-world data works, hence my forced-native-array measurement and pudquick's reply.

</comment></comment></comment></comment></comment><comment><USER32> We all love short and fast. But this is definitely an interesting approach. I'd love to see similar approaches to problems if you guys can point out to some.

<comment><AUTHOR> I would also, I love this sort of thing. How about:

        >>> some_boolean = False
        >>> ["Thing 1", "Thing 2"][some_boolean]
        "Thing 1"

<comment><USER33> Yeah, but unlike the hack in the article, the more readable version of that code,

      "Thing 1" if some_boolean else "Thing 2"

is also almost twice as fast(775 vs 1340 ns, on my machine).

<comment><AUTHOR> I was more posting it for the "cute hack" value, rather than speed. Speed was significant in the post because the author needed their library to be fast.

</comment></comment></comment></comment><comment><USER34> Insane, because it relies on the zip implementation detail. If you cared about a measly factor of 4 in performance you wouldn't be using python anyway.

<comment><USER35> Any developer can care about performance. And should never be mocked for achieving above 200% performance compared to an alternative implementation... Let alone 400% performance compared to the alternatives.

<comment><USER34> If that 400% performance improvement was achieved by sacrificing code readability, on a project that has deliberately chosen to prioritize readability over performance, then yes they should be mocked. Or at least told not to do it.

</comment></comment></comment><comment><USER36> My vote: Code is unreadable crap written to be discarded later. Spend some time typing it out. You're writing for the x # of people (including the author) that will have to read it countless times in the future. I would be better if they didn't have to think about the "cleverness" when they come across it. Unless of course, you're participating in an obfuscated code contest.

</comment><comment><USER37> The pairwise recipe function in itertools demonstrates just that (using tee instead of multiplying the iterator):

[http://docs.python.org/2/library/itertools.html](http://docs.python.org/2/library/itertools.html)

      def pairwise(iterable):
        "s -> (s0,s1), (s1,s2), (s2, s3), ..."
        a, b = tee(iterable)
        next(b, None)
        return izip(a, b)

</comment><comment><USER38> I wouldn't call it insane, neither brilliant. I use this function to split a sequence into pairs (or triplets, or fourths, etc):

      def paired(t, size=2, default=None):
        it = iter(t)
        return itertools.izip_longest(*[it]*size, fillvalue=default)

I use it in a formatter which outputs alphabetized data in columns, where the order should run down the columns instead rowwise.

</comment><comment><USER39> If it's actually faster, the speed actually matters, and you wrap it with a well commented explanation and descriptive name, I'd consider it reasonable. Otherwise, just write out what you're doing. It's definitely clever, but fewer lines of code is not an optimization.

</comment><comment><USER40> My question is, at what point does it become incumbent on the language to provide a more meaningful idiom for this kind of expression? I think the point at which constructs like this leak into your official documentation is a pretty good line to start thinking about it. :)

</comment><comment><USER41> >"there should be one — and preferably only one — obvious way to do it"

Oh. Well. OK.

</comment><comment><USER42> An aside: the animated expansion of the code blocks make the site feel twitchy

<comment><AUTHOR> How do you mean?

</comment></comment><comment><USER43> Brilliant and insane?

<comment><AUTHOR> Hah, yep, I hadn't considered it can be both.</comment></comment>


UK Conservatives Want Restrictions on Posting and Sharing Online - <AUTHOR> http://www.independent.co.uk/life-style/gadgets-and-tech/news/theresa-may-internet-conservatives-government-a7744176.html <comment><USER2> There are previous major discussions:

Here: [https://news.ycombinator.com/item?id=14382184](https://news.ycombinator.com/item?id=14382184)

And here: [https://news.ycombinator.com/item?id=14374533](https://news.ycombinator.com/item?id=14374533)</comment>


Scientists to nudge asteroid off course as practice for protecting Earth - <AUTHOR> http://www.independent.co.uk/news/science/end-of-the-world-plan-scientists-to-nudge-asteroid-off-course-as-practice-for-protecting-the-earth-a6675041.html <comment><USER2> But wait. What if it's not just an asteroid... [https://en.wikipedia.org/wiki/The_Dig](https://en.wikipedia.org/wiki/The_Dig)

</comment><comment><USER3> Understood that scientists would be able to break asteroid into pieces using many ways. I guess what they could take advantage of this asteroid is to put a drone or some sensor material on asteroid so that it would help space scientists for space research. Its almost like unmanned space mission, just put a drone-sensor on asteroid. It goes with the asteroid and sends down information which might be helpful. Any space scientists here in hackernews? What do you say? Would it be possible and beneficial?

<comment><USER4> I'm not sure there is a huge amount to be learned from asteroids unless we plan on bringing stuff back with us. We are certainly going to try to do that, and we have also landed a thing on a comet obviously which will teach us much more.

</comment></comment><comment><USER5> What's the whole thing about drilling a hole and dropping a nuke to split the asteroid up? I mean, I liked the Aerosmith song from that movie (Armageddon) but doesn't that actually seem like a sensible idea for a bigger rock?

Looks like some experts agree w me: [http://www.space.com/21333-asteroid-nuke- spacecraft-mission....](http://www.space.com/21333-asteroid-nuke-spacecraft- mission.html)

<comment><USER6> It works for small <10m astroids, but for anything bigger than that, its own gravity will pull the segments back together after the explosion since they do not reach escape velocity, and nothing will have changed due to conservation of momentum. A better method is to detonate an astroid up to 100m away so it heats up the surface. The heat will blow off small particles at more than escape velocity, so by conservation of momentum the astroid will be pushed in the opposite direction.

<comment><USER7> Can you explain why the nuke option wouldn't work? It seems to me that most of Earth's protection against asteroids is them burning up in the Earth's atmosphere.

Let's assume that you did blow up an asteroid, and the constituent parts loosely reassembled. Wouldn't they they break apart again as soon as they started to experience the turbulent effects of the Earth's atmosphere? And once they did, the surface area to mass ratio of the asteroid matter would be an order of magnitude or higher, pretty much guaranteeing all of the mini- asteroid parts would burn up.

No doubt I'm wrong. I'm a programmer, not a physicist or an astronomer. So I'm seeking to get 'educated' more than I am to argue with you.

<comment><USER8> Another issue that is usually the first objection is that receiving a thousand _highly radioactive_ rocks at very high velocity is a very efficient way for us humans to die in large numbers. Just one radioactive meteor would cause a lot of damage and be very difficult to seal off, but a thousand?

<comment><USER9> I think you're a bit confused by nuclear scare-mongering. Large fusion H-bombs put out stuff all radiation. And radiation isn't very deadly anyway.

</comment></comment></comment></comment></comment><comment><USER10> I'm sure this will not affect gravity paths somewhat as a butterfly effect.

<comment><USER11> Nope. Everything involved is way too small to do something like that. Worst case scenario is we get a shooting star.

<comment><USER12> Not true. Due to the butterfly effect, even tiny changes to a system will totally change the output given enough time. Simulations of the orbits of the planets turn out totally different after billions of years if the measurements of planets are changed by even an inch.

<comment><USER13> I get your point, but this thing is many, many orders of magnitude smaller than a planet.

</comment></comment></comment></comment><comment><USER14> Wouldn't it be funny if they nudge it off its current course, onto a collision course with us?

No, actually not that funny.

<comment><USER15> Or onto a collision course with a different inhabited planet. Who interprets it as an act of war.

This whole comments section is making me want to read some scifi about this. Anybody have any recommendations?

<comment><USER16> Starship Troopers covered it pretty well

"Thirty years before the First Interstellar War, a meteorite from Klendathu System was deviated from its star during the Operation Fedmil, the first contact in Klendathu. Thirty years later, the meteorite reached and hit Earth, destroying Buenos Aires, capital of Argentina, killing over 8.7 Million, and wounding a further 12.5 million."

"However, the United Citizen Federation claimed that the Arachnid launching a "Bug Meteor" by Bug Plasma from the Klendathu system towards Earth and destroyed the city of Buenos Aires."

</comment></comment></comment><comment><USER17> Well NASA recently made a statement that there's no significant asteroid going to hit Earth for centuries to come thus shunning growing rumours by conspiracy theorist about Planet X. SO why are they spending dollars on such a scenario (specially when NASA's budget has been reduced recently)? It could rather be spent on say human mission to Mars ETC which are near term possibilities.

<comment><USER18> Let's say a mass-extinction causing space object hits Earth every 100 million years ([https://en.wikipedia.org/wiki/Extinction_event](https://en.wikipedia.org/wiki/Extinction_event)) . That gives us a 1e-8 chance of all 7e9 people being wiped out in one year. That's an average of 700 people killed every year if it were spread out in time.

Definitely a serious risk even if not the most pressing right now. It is however more dangerous than terrorism in America, and plenty of money is being spent on that!</comment></comment>


Ask HN: Is it okay to accept work in a language you haven't done before - <AUTHOR>

What do you when your clients ask you do work you haven't done before, for example I can program in Javascript but not familiar with WordPress or PHP and MySQL, I have clients willing to pay to do WordPress sites and theme customization. I can do this with some time of learning but never done it to be honest. as a programmer I should be comfortable adapting to different languages though.<p>Is it my job as a freelancer to accept this and learn as I go with my career freelancing or happily decline? or what about if you get a job offer which the technology is something you haven't worked with what do you do in those situations? please inform me HackerNews. <comment><USER2> If you decline, you would be making the same mistake some companies do by only hiring developers with previous experience in a very specific set of technologies.

Every developer who works with WordPress/PHP/MySQL, or any other technology, at some point didn't have experience with them. Everyone has to start somewhere or there would be no developers at all.

Whether you disclose your lack of experience to the client depends on the nature of the job. If they only need a basic installation with some plugins and theme customization, take it. Give a reasonable time frame for delivery and deliver it.

If on the other hand, they need you to scale their multi-million page views network of blogs, or develop a mission-critical super-complex plugin in a short time frame, then you might want to tell them you haven't done this before, but are willing to work with them to help them achieve their goals.

</comment><comment><USER3> You actually allude to the answer in your question.

When you say that "as a programmer I should be comfortable adapting to different languages" you expose the key concept that will help you to make the decision.

You should do what you're comfortable with.

In theory, you're in this field because it's what you love to do. You enjoy it, and we're usually comfortable with doing things that we enjoy.

It follows, then, that you should progress when and only when you feel comfortable with making that progression. If you don't feel comfortable and confident in telling your clients that you'll do WordPress work for them, you should not tell them that.

Do what you're comfortable with. It's guaranteed to be better for both parties in the end, because you don't end up working on something you don't want to or aren't able to do, and your client doesn't end up with something that is built by someone not confident with the technology they used.

However, doing what you're comfortable with comes with one important caveat. You should never be too comfortable with what you're doing... that's a sign of stagnation, something which is sure to be deadly to your career.

In your role as a freelancer, it's not your job to accept a position which you're uncomfortable with. However, it is your job as a freelancer to keep learning, to stave off that stagnation.

Keep improving your skillset. Always be learning. Be comfortable, but don't stagnate.

</comment><comment><USER4> IMO, a large part of being a successful programmer is to know how / with what patterns to approach the problem at hand (in your case: the goal set by the client). the actual language most the time is just the means and quickly learned. that said, when it comes to actual code quality, experience is important too: each language or framework has its irks and special feature.

i have taken on freelancing work in languages and/or frameworks unfamiliar to me, but spent 1-2 weeks beforehand learning the basic stuff on my own time. if you feel unsure whether to take on the job or not it's probably best to be honest to the customer - let them know that it is your first project with language x or framework y, but that you'll be willing to invest in it and provide them with a good solution.

and last but not least there's the saying "learning by doing" :)

</comment><comment><USER5> Download WordPress and build something with it, on your own time. You'll spend your morning figuring out how to download everything and set up a development environment, and your afternoon seeing how plugins and themes work. 24 hours invested in yourself and now you will know what the client is asking for when they ask about WordPress work. Your freelancing career will "happily decline" if you don't make self-education one of your priorities between jobs. All professionals have to work to keep their skills current -- teachers have to take classes regularly, plumbers have to learn about new materials and building codes, lawyers have to keep on top of new laws and decisions relevant to their specialty -- software developers are no different.

</comment><comment><USER6> Sure, as long as you can deliver a quality product within the timeframe expected of the client. That's the way you learn.

It would also help to build up a network of devs with a variety of expertise, so that you can ask for help/tips/review as you take on new stuff.

I think it also depends on how big a step the new project is for you. Wordpress sites, fine. Build me a new operating system? Probably not :)

</comment><comment><USER7> Wordpress is really straightforward and easy to use but it depends on the project that you are taking. If you had any problem with WordPress development you could always use Stackoverflow or feel free to email me at kpourdeilami [at] gmail [dot] com :)

</comment><comment><USER8> Take the gig, get the specs, make it happen.

Else you will not grow brother.

</comment><comment><AUTHOR> All very helpful comments, thanks a lot everyone appreciate it.</comment>


Ask HN: Product request...make a ton of money - <AUTHOR>

A small wrist watch or ring for measuring blood pressure: Has a mini usb port for downloading your results for analysis. xml for data portability can be worn 24/7 for continuous monitoring should be less than $30 *Should be ACCURATE
Make this and wakemate has nothing on you. <comment><USER2> Why in the world do you need XML over USB? Analysis of what? Blood pressure measurements consist of two freaking numbers (and it's not the small daily fluctuations that people care about to begin with...)

FWIW, wrist monitors do go for around $30 <http://www.google.com/search?q=blood+pressure+monitor+wrist>

</comment><comment><USER3> An Italian coupe or convertible car for driving and looking sexy: _Has beautiful hand-made leather seats._ wheels for mobility _can be driven for as long as its gas tank contains gas_ should be less than $30 *Should be FAST

Make this and ferrari has nothing on you.</comment>


Show HN: Hire.Bid – marketplace for on-demand work, take two - <AUTHOR> We received some brutally honest feedback when we posted here about a month ago with comments along the lines of your concept is great, UI sucks, drop the buggy registration process, fix the fonts, etc. - so we took all that advice to heart and we redid the UI, we changed the registration process and flow entirely by implementing social logins and having it done via a popup modal, and we changed the fonts, and did a bunch of other stuff. Let us know what you think. https://hire.bid <comment><USER2> It's good to see you guys making an effort. I remember it was extremely minimal before, now it's looking pretty slick.</comment>


Microsoft launches a deepfake detector tool ahead of US election - <AUTHOR> https://techcrunch.com/2020/09/02/microsoft-launches-a-deepfake-detector-tool-ahead-of-us-election/ <comment><USER2> It's not just about whether if a text, image, sound or video is fake or not. It's about where you get your sources from or the narratives the news organization, or platform you read from. They can still coordinate a mass ban on any source for no particular reason.

A single source or narrative is extremely dangerous. Multiple sources and narratives paint the full picture and expose the lies and contradictions themselves. The moment a platform removes or censors a source for _no particular reason_ , it begs the question if it is biased, dishonest, doesn't fit their narrative or if they are trustworthy themselves. Which is why I am very skeptical with some of the sources in this 'Trusted News Initiative':

> The partners currently within the TNI are: AFP; BBC, CBC/Radio-Canada, > European Broadcasting Union (EBU),Facebook, Financial Times, First Draft, > Google/YouTube, The Hindu, Microsoft , Reuters, Reuters Institute for the > Study of Journalism, Twitter, The Wall Street Journal.

Once again, Do not believe _everything_ you see, hear or read on the internet. Use multiple sources and take some of the content they show with a grain of salt.

</comment><comment><AUTHOR> Do you think the people who believe all the "Bill Gates" conspiracy theories will believe Microsoft's claim that a video is "fake"?

<comment><USER3> It depends on if they want to believe the video or not. For many evidence is ammo not guidance.

</comment></comment><comment><USER4> >Microsoft launches a deepfake training tool</comment>


Give Away Free Rive - <AUTHOR> http://www.freerice.com/index.php Expand your vocabulary per a new years resolution perhaps and make the world a less hungry place. All with a few clicks. <comment><USER2> "Rive" being rice. :)</comment>


Speeding Up RSS - <AUTHOR> http://www.techcrunch.com/2009/07/09/speeding-up-rss/?awesm=tcrn.ch_5XG&utm_campaign=techcrunch&utm_content=techcrunch-autopost&utm_medium=tcrn.ch-twitter&utm_source=cotweet.com <comment><USER2> They should have mentioned <http://superfeedr.com> : that is exactly what we do ;)

</comment><comment><USER3> I suppose this is to compete with twitter which fulfills any realtime news needs I have.</comment>


Notebooks now make up over 70 percent of Mac sales - <AUTHOR> http://venturebeat.com/2009/01/26/notebooks-now-make-up-over-70-percent-of-mac-sales/ <comment><USER2> That's not so surprising. Notebooks as a whole are gaining a lot of ground and have been since LCDs became standard as monitors and Intel moved away from the Pentium architecture for their Core processors which bring mobile processing power not into parity, but close enough that people prefer the portability. Plus, how much value does an iMac give you? I'm not saying it's a bad machine, just that the big advantage over my MacBook Pro is the screen. Yeah, it's a little cheaper and a little more powerful, but (apparently) that's not enough for people to sacrifice the mobility of a notebook.

Even beyond that, I think it's safe to say that people are starting to demand mobility over power. Netbooks look like the next big thing, web browsing is often one of the most taxing things many people do on their computers, etc. The argument for desktops is diminishing - it's easy to get more than enough power for 95% of users in a notebook form.

And Apple buyers tend to be a little avant-garde (or at least we like to think so).

<comment><USER3> _"Plus, how much value does an iMac give you?"_

I do care gaming. It came with an 8800, mobile variant of course, but good enough of a reason back in April. It's still quite a bit better than the stock 9600 the new MBPs have. Plus the 24" screen is nothing to sneer at when you have to code all day. The 24" screen is an IPS screen compared to all MBs and MBPs TN screens. (Higher quality) I'd much rather have those three than a beefy laptop.

While not truly "coffee-shop mobile", it's still useful for when you drive to your parent's place for the holidays since all you need is iMac, keyboard, and mouse.

</comment></comment><comment><USER4> This isn't surprising as their desktop lineup is rather extreme; Your choice on the desktop is either a toy computer (that can't drive dual displays), an overpriced/overpowered super computer, or a monitor-computer chimera (that isn't upgradeable). I'm not sure if this is done on purpose, but I wouldn't be surprised if they just eventually stopped making desktops.

</comment><comment><USER5> I find any computer without at least a 20" screen unusable, so no notebook as a desktop replacement for me.

My custom-built desktop is also about 1.5-2x faster than any laptop currently made, so also no thanks in that respect.

<comment><USER6> When I got a 15" MacBook Pro (2.4ghz, 4GB RAM, 320GB HD, Glossy LED screen), I quickly discovered my desktop became obsolete and I unexpectedly stopped using it. It's not that it became obsolete tech-wise; there was just no reason to continue using it.

My MBP has enough power to run OS X + two VMs (Debian and WinXP) so everything I could ever need to do, I can do on my MBP. (For gaming, I installed Win XP on a second partition and boot to that when I need to get some FPS in.) And since I bring it to work and use it there too, it's basically the only computer I use from day to day.

(Of course, the downside to this is that it's also a single point of failure. Just yesterday I got to work and discovered my laptop's screen was blank. It turned out to be the infamous NVidia defect that created much commotion last year. But, even though I was 6 months past the warranty, Apple is fixing it free of charge: <http://tinyurl.com/ctz3h9>. Luckily, I also create bootable backups on a fairly regular basis.)

On the big screen issue, I've found it has less to do with the physical size of the screen as it does the screen resolution and your multi-tasking habits. If you really need more screen real estate, use the Unix screen utility or some form of desktop switching with keyboard shortcuts.

<comment><USER5> I tried switching to a laptop-only existence several years ago. Didn't work for me.

I have an Apple 23" Cinema Display as my primary monitor, and a 19" Hyundai as my second monitor. I'd be lost and be much less productive without this screen real estate.

And ever tried watching movies on a laptop? It sucks. But my Cinema Display handles this beautifully.

Glad it works for you. Won't work for me, however.

<comment><USER6> I frequently watch full-screen movies on my 15" MBP while laying on the couch 7ft away. In fact, I don't watch (or have) a TV, so it's really my only option. Then again, I have really good eyesight and I grew up without a TV in the house, so maybe that's why. :)

</comment></comment></comment></comment><comment><USER7> even if I worked in a windows environment I'd try and get a MacBook and install XP.</comment>