What boyfriends and girlfriends search for on Google - <AUTHOR> http://www.predictablyirrational.com/?p=704 <comment><USER2> If you pair the questions together, they solve themselves!

<comment><USER3> I thought this was just a cute flippant answer until I went back and re-read both lists.

The pairing isn't perfect, but it is surprisingly good.

<comment><USER2> I'll admit, it's a tad sexist, but it's still good for a laugh.

<comment><USER3> It is hard to say anything true about relations between the sexes without being somewhat sexist. I think that's because nobody really likes the naked truth on that topic.

<comment><USER4> How would you back up that assertion?

Is true to say "most relationships could be improved by both people listening better?" Is it sexist?

<comment><USER3> Here is a good example.

Let me observe that both men and women don't just want to find someone of the opposite sex, they would like to be with someone who is as good as possible. When you are with a person who is as good as is possible for you to land, that person will be someone you have difficulty getting to be interested in you like you're interested in them.

So, for instance, a man who dares say something moderately insulting to a woman early on establishes that he thinks that he could do better. If he does not offend her too badly and turns around and gives her some hope, that gives her the message that he's someone she has a chance at but has to work for. If she believes that message, she'll think of him as a good potential catch.

Going the other way, a woman who doesn't feel compelled to return a man's calls promptly, puts off sex, and who insists from the start on time for herself is demonstrating that she believes she is a reach for him. If he believes her, then he is more likely to work to establish the relationship, including making the commitment to take care of her and help raise their children. (Which is what marriage is.) No man likes those games, but most of us respond to them.

These parallel pieces of advice are both effective and offensive. You'll find the advice for men as part of the standard repertoire in virtually any guide for pickup artists. It is standard because experience shows that it helps get women in bed. Conversely the advice for women is straight from [http://www.amazon.com/Rules-TM-Time-Tested-Secrets- Capturing...](http://www.amazon.com/Rules-TM-Time-Tested-Secrets- Capturing/dp/0446518131/ref=pd_sim_b_3). That is sort of a female counterpart to the pickup artists guide and is about how to land a man who will commit. The polarization of the reviews is evidence of both offensiveness and the gratitude of women who found the advice effective. (Read the reviews and you can verify the reasons for the votes.)

So there is a concrete example for you. Landing someone of the opposite sex and getting them to do what we want them to do is of interest to the vast majority of us. (Yes, some people are gay or asexual, but the vast majority are straight heterosexuals.) Yet advice that is effective for that is quite offensive.

And, of course, when we're offended by advice about the sexes, we usually call it sexist.

<comment><USER5> Seriously, The Rules simply do not work if you're looking for a loving, equal partnership. It's all manipulation and games. Same with the "pua" approach. The _vast_ majority of people do not behave this way toward partners or potential partners.

<comment><USER3> You are right that neither is a recipe for an equal partnership. Both are based on setting up a power imbalance from the beginning that makes what you want more likely to happen.

However I emphatically disagree about what the vast majority of people do and do not do. In our culture men generally prefer to date younger women of lower socioeconomic status who are physically smaller than themselves. And it seems like most women find this acceptable. How is that not a built-in power imbalance in the relationship? How does that square with having an equal partnership?

This is yet another example where an obvious truth about the relationship between the sexes offends people.

<comment><USER5> It's not offensive, it's just sort of incorrect. Most people date and marry those in the same age and socioeconomic bracket. You are greatly exaggerating the socially condoned differences.

Like any partnership, both parties bring valuable things to the table, some of which are less quantifiable and tangible than height and money - organizational and management skills, social benefits, etc. Depending on context, the partner with less physical and monetary power may still be the stronger party in a relationship. This is where trust and honesty and a will to please the other, rather than just take what you want, come into play to keep the power balanced and the relationship healthy. Any sufficiently imbalanced partnership, romantic or otherwise, is doomed to eventual failure.

</comment></comment></comment></comment></comment></comment></comment></comment></comment><comment><USER6> Is it me or is anyone else surprised that people use Google this way? I don't mean the content, I mean the kind of query.

I generally type specific words or phrases (often with a 'site:' prefix when I know where I'm looking). I never type full questions (i.e., sentences) into Google.

 __Edit __: My wife reminded me that there was a New York Times article in December about how children search this way automatically:[http://www.nytimes.com/2009/12/26/technology/internet/26kids...](http://www.nytimes.com/2009/12/26/technology/internet/26kidsearch.html)

<comment><USER7> I've started to do this more and more.

Think about this: Google is better at optimising itself for my query than I am trying to optimise my thoughts for google.

<comment><USER8> _> Google is better at optimising itself for my query than I am trying to optimise my thoughts for google._

What, no. Not even close. That would require natural language processing & i doubt google even dreams of that.

<comment><USER9> Not really. It just means that when people type "How do I" in front of a search and then click on a link with how do i and then whatever it was, then google picked the right result, even though it doesn't know that you are asking for instructions on how to perform a task.

<comment><USER10> The people who click those haven't seen all the answers (that would be listed with a non-human query). I want the best answers, not the most popular ones.

Further, typing long phrases or questions unquoted gives a lot of false positives. I don't want that, I want to capture the essential minimum I need to look for something specific.

<comment><USER9> Google doesn't give you the best answers, they give you the last answer someone else chose. That's how google works, because google believes the best answer is the one after which the searcher does not click on anything else.

How would google measure a "best" answer?

</comment></comment></comment></comment></comment></comment><comment><USER11> Note that this doesn't directly tell you what people want. It tells you what people want _and aren't getting_. For example, the fact that boyfriends don't search for "...love me" doesn't mean that they don't want to be loved; maybe they want to be loved but are loved enough.

<comment><USER8> Or sex is generally how love is expressed for guys.

for more sad/hilarious results, look up "how can i get my wife/husband.."

<comment><USER12> Hilarious indeed, number 10 on the "How can I get my wife" list is "s facebook password"

</comment></comment></comment><comment><USER13> Is anyone else a little disturbed that this has 121 points and is at the top of the HN frontpage? Maybe I'm just being grumpy but it seems like total fluff that's of no use to anyone. I'm surprised it hasn't been killed, are there no mods around today?

<comment><AUTHOR> I probably wouldn't have posted it a few months ago, but seeing some of what goes by lately I figured it wouldn't hurt. It's amazing that it got so many points though - it's really not _that_ interesting. Especially compared to some of my other recent submissions that I thought would be way more interesting to this crowd in terms of startups and hacking.

<comment><USER13> That I see as the problem, because now a whole bunch of other people will see this and think the same as you and we end up drowning in the stuff. Because of course this sort of stuff appeals to the lowest common denominator and doesn't require any mental effort whatsoever to process it tends to get lots of votes and drown out the more interesting but possible slightly challenging material.

<comment><AUTHOR> I think the site is basically at a point where either pg gets really strict about fluff/politics/economics or it will continue to slide.

<comment><USER13> It is the nature of these sort of sites that they're always right on the edge. Let's try not to push it over though :)

Maybe (probably) it will degenerate at some point like all the others have but it would be nice if it stayed around a little longer.

</comment></comment></comment></comment></comment><comment><USER14> "Everyone thinks of changing the world [his or her girlfriend or buyfriend], but no one thinks of changing himself." --Leo Tolstoy

<comment><USER15> buyfriend? intentional, mistake, or Freudian?

<comment><USER14> Mistake, Freudian, or my dyslexia :)

</comment></comment></comment><comment><USER16> This is an amazing visualization which does the same exact thing <http://hint.fm/seer/>

<comment><USER17> <http://i49.tinypic.com/nogciv.png>

</comment></comment><comment><USER3> I thought the obvious next version was interesting as well. It doesn't exactly paint a very nice picture of men.

 _How can I get my husband to_ ...fall in love with me again ...be more affectionate ...love me again ...help around the house ...want me ...be more romantic ...lose weight ...talk to me ...leave the house ...stop drinking

 _How can I get my wife to_ ...love me again ...swing ...lose weight ...shave ...trust me again ...love me ...shut up

I assume that I got more common completions for the first than the second because women are more likely to use Google to seek advice.

</comment><comment><USER18> If you intersect the two sets, everyone wants to get back together or scheme up a George Costanza-like plan to have the partner be the one to initiate a breakup.

</comment><comment><USER19> Hey, works across cultures! The results in German are pretty much an exact mirror image. That would be cool if it weren't so depressing.

<comment><USER20> I don't find it depressing at all. Men want a more active / interesting sexual life with their partner. Women want more bonding with their partner / want their partner to do stuff for them. It's nothing we haven't known for many millenia.

Clearly there are a lot more into relationships but these are the most common "entry-level" problems and there's nothing wrong with that. People who have enough experience at human relationships (because they're old enough) won't use Google to solve their problems, don't you think?

<comment><USER4> Actually, both partners want both. Perhaps there's a little more emphasis with women on the partner side but "last longer in bed" was also among the choices.

</comment></comment></comment><comment><USER21> You know, this is the second story about Google auto-completion this week. The behavioural economists have jumped on the Ajaxian/ReadWriteWeb/SmashingMag bandwagon memes.

</comment><comment><USER22> Try wife and husband ... "how can i get my wife to shut up"

<comment><USER23> I'm guessing that one pairs with, "how can I get my husband to stop drinking"...

</comment></comment><comment> joe-mccann Reading "Predictably Irrational" now and it is a truly fascinating book. This is a good laugh, but the book offers more useful data and insight.

</comment><comment><USER24> I wonder why the font on the middle line is slightly off...

<http://skitch.com/swombat/nqhn8>

<comment><USER25> Because OS X tries to compress letter spacing before cutting the line off.

<http://imgur.com/cyTjS.png>

See what happens when I resize this window? The text gets squished before it gives up and shows the "..."

<comment><USER24> Wow, very interesting. Thanks for the explanation!

</comment></comment></comment><comment><USER26> Nice post, but I get different results: For the boys (girlfriends) : <http://skitch.com/panman/nq5d5/google>

For the girls (boyfriends) : <http://skitch.com/panman/nq5d2/google>

Seem to be bore in sync..

</comment><comment><USER17> <http://i49.tinypic.com/nogciv.png>

</comment><comment><USER27> I'm surprised no one's pointed out the obvious. It's difficult to pull any interpretations out of this based on gender. Remember, there are girls who have girlfriends and boys who have boyfriends too.

</comment><comment><USER28> You can get a couple more if you drop the "to":

How can I get my gf

and

How can I get my bf

<comment><USER29> How can I get my parents works too.

<comment><USER30> I had it autocomplete [how can i get my par] and most of them were sensible suggestions, until it got to [how can i get my parakeet to eat my diarrhea]. WTF?</comment></comment></comment>


Flock 1.0 Beta Released: Surprisingly Very Good - <AUTHOR> http://www.techcrunch.com/2007/10/19/flock-10-beta-released-surprisingly-very-good/

<comment><USER2> It looks pretty cool, but it would take more than a few bells and whistles to pull me away from firefox and the 38 plugins I currently have installed.</comment>


Advanced MySql Exploitation - <AUTHOR> http://www.blackhat.com/presentations/bh-usa-09/DZULFAKAR/BHUSA09-Dzulfakar-MySQLExploit-PAPER.pdf

<comment><USER2> There are three ideas in this paper that may be news to you:

* in MySQL, you can "SELECT 0x414243" and get "ABC"

* you can append "INTO DUMPFILE foo" to a query and MySQL will write the results to the filesystem.

* MySQL won't let you tack an injected statement to the end of another query, but SQL UNION clauses will allow you to add arbitrary SELECTs to a victim query.

Combine these ideas and you can turn SQL injection on some (rare) server configurations into code execution.

</comment><comment><USER3> I had to think about this paper a bit. While it does describe some interesting ideas, nothing mentioned here will get past properly escaping input. That is, if you use DBI's quote method or parameterized queries in Perl or PHP's mysql_real_escape_string function or whatever is appropriate in your language and MySQL library then you'll be okay.

Does that seem correct?

<comment><USER2> No. "Properly quoting" inputs is the worst way to mitigate SQL injection flaws.

What you need to be doing is replacing your concatenated string queries with precompiled parameterized queries, where the values in your queries are replaced with placeholder strings (like "?" and ":varname"), and the values are passed in a seperate call. Every mainstream database API supports these.

<comment><USER3> I didn't say "properly quoting." I said "properly escaping" and mentioned the DBI quote method E.g. $safestring=$myDBIobject->quote($taintedstring)

From the O'Reilly book "Programming the Perl DBI"

"By far the most important utility method is quote(), which correctly quotes and escapes SQL statements in a way that is suitable for a given database engine."

If you're going to reuse a query with different values then it makes more sense to use parameterized queries. If you're going to reuse an input string in multiple queries which don't themselves get reused then it makes more sense to use an escape function like quote.

If you're using a method like DBI's "selectrow_array" which combines the "prepare," "execute," and "fetchrow_array" steps into one method call then you pretty much have to use the quote method.

<comment><USER2> Yes. That O'Reilly book is giving extremely bad advice. You should work from the premise that there is no safe concatenated string query (regardless of the corner cases where that isn't true).

<comment><USER3> That is absurd.

<comment><USER2> Here's what's happening here, Douglas. You're thinking, "I know how to quote my queries so they aren't injectable. I don't need to parameterize them."

Let's stipulate that you're right.

You are not the only programmer on your project --- at least not if your code means anything. Someone else is going to either (1) extend or (2) cargo-cult your query. And when they do that, one of two things is going to happen:

* They're simply going to forget to quote properly. For instance, they're going to add an ORDER BY clause, and they're going to accept "ASC" and "DESC" as input from their jQuery auto-loading Ajax table widget, and you're boned.

* They're going to quote using an unsafe quoting function, for instance with regular expressions, and they're going to miss truncation and character set attacks.

I can tell from your "that is absurd" comment that _you_ aren't going to be sold on any of this. That comment is also a pretty big tip-off that you're not particularly experienced --- and the only reason I say that is, _I have never worked a pentest where a client quoted string queries that didn't turn out injectable_. You might be the _one exceptional app_ in the world that gets it right, in which case, thank you for proving the rule for me.

People who use prepared statements and who religiously keep user input completely out of query structure (for instance, by mapping table and column names, so user input simply can't be put into query structure) don't have to think about any of these problems. Why anyone would elect _to_ think about them is beyond me.

<comment><USER3> So you're saying...

Properly escaping queries is a bad idea because you might forget to do it and if you forget to do it then it doesn't work.

Here's a funny thought, though. I remember, many years ago, doing a code review and noticing something odd. The very smart developer who always used parameterized queries had written a simple insert into table X. It was all properly parameterized. Table X, however, had an on insert trigger which called a stored proc which was about eight pages long. In that stored proc, two of the parameters were concatenated into a select which was then eval-ed, thus leading to a very serious injection possibility.

So, in response to your last paragraph, yes, you still have to think about injection possibility even if you use prepared statements.

Really, that should be the first rule of designing for security: ALWAYS think.

<comment><USER2> That third paragraph, refering to dynamic SQL inside of a stored procedure, happens often enough that I thought it made sense to bring it up here several months ago:

<http://news.ycombinator.com/item?id=824594>

You'd do well to read the rest of the recommendations in that thread as well.

I cannot understand why anyone would opt for concatenated SQL over parameterized queries when both were available. It seems like simple, ignorant arrogance. As a contractor for small businesses who won't have their code reviewed by people like us, developers like you should be _especially_ sensitive to this issue; your customers are going to be screwed over by that code long after you've moved on.</comment></comment></comment></comment></comment></comment></comment></comment>


Types in JavaScript: why you should care - <AUTHOR> https://jcemer.com/types-in-javascript-what-you-should-care.html <comment><USER2> Since the author advocates for the use of Flow it is implicitly exposing the lack of a typing system in JS, but I wish the community was more explicit and critical about this fundamental problem.

All the new features of ES6/7/8 are great, but in the case of types the TC39 needs to adopt a more radical posture.

<comment><USER3> I think everyone who wants typing is using TypeScript, which is ES8 with optional typing.

Nobody in the JS community wants to make typing mandatory.

<comment><USER2> Typing could be perfectly optional like in the ES4 proposal 10 years ago.

Using TS is great for pure JS, but certain libs like Vue are still problematic. A "native" solution would be much better than TS or Flow.</comment></comment></comment>


Replicating SQLite using Raft Consensus - <AUTHOR> http://www.philipotoole.com/replicating-sqlite-using-raft-consensus/ <comment><USER2> Hello -- rqlite author here.

It was definitely interesting to code this. It was 50% to meet a need, 50% to better understand Raft consensus in general, and Ben Johnson's go-raft implementation in particular ([https://github.com/goraft/raft](https://github.com/goraft/raft)). As it happens Ben and I now work together, on InfluxDB ([http://influxdb.com/](http://influxdb.com/)), which has a new Raft implementation at its core.

Definitely fun.

</comment><comment><USER3> This exact problem was the final challenge of last year's Stripe CTF contest. They put together a really cool test harness that would systematically probe for any possible way that an unreliable network could cause the system to fail. In order to complete the challenge, you had to achieve a desired throughput without ever allowing the replicas to become inconsistent.

Unfortunately Stripe doesn't seem to have kept the main site[1] online, but the test harness is still available on Github[2].

[1]: [https://stripe-ctf.com/](https://stripe-ctf.com/) [2]: [https://github.com/stripe-ctf/octopus](https://github.com/stripe-ctf/octopus)

</comment><comment><USER4> > _While it is possible to continually copy the SQLite file to a backup server > every time it is changed, this file-copy must not take place while the > database is being accessed._

What about the `.dump` command?

I've been using it to backup SQLite databases since forever. It produces an SQL script (similar to `mysqldump`) that you can import back into another SQLite database, or even into another RDBMS. It's much more elegant than copying the database file itself.

But come to think of it, I never really checked whether the `.dump` command produces a consistent backup, and the official documentation doesn't seem to answer that, either. If you're familiar with the internals of SQLite, please let me know whether I should keep trusting `.dump`.

<comment><USER5> I'm not sure a backup that was never tested qualifies as backup.

<comment><USER4> The backups do restore properly all the time, I made sure of that.

I simply don't have enough transaction volume to test all the edge cases that might produce an inconsistent dump (and if I did, I wouldn't be using SQLite).

</comment></comment></comment><comment><USER6> SQLite is amazing. I wonder if it's usable as a replacement for Postgres for web apps, I'm not sure what happens when multiple processes try to write to it.

Regardless, this is a very interesting project, good job.

<comment><USER7> Multithreaded use is not supported. SQLite is not a replacement for Postgres—Postgres supports many advanced data structures (lists!), SQL commands, and is faster. But in certain cases, it is enough, and of course setting up SQLite is much easier.

<comment><USER3> > Multithreaded use is not supported

To be more precise, it's perfectly legal to use SQLite from multiple threads or processes at the same time. It will use its own mutexes and OS file-locking operations to ensure that at any given time, a database is being accessed by either a single writer, or an arbitrary number of readers.

In my opinion, the bigger issue is that clients can only safely access a SQLite database if it exists on a local filesystem. As soon as you decide you want to run multiple web servers, you're in trouble.

<comment><USER6> Sorry, yes, that's what I meant. I use it for a mostly-read-only Web app, but wasn't sure if it's a disaster waiting to happen. Good to know it's a viable alternative to postgres in multithreaded or multiprocess scenarios.

<comment><USER8> I ran it as a replacement for MySQL for 3 years, light usage php web app, around 100 - 200 users I guess.

It saved me quite some hassle and reduced the attack surface compared to MySQL.

FWIW I never bumped into speed issues. My biggest issue against it is that it would let me alter columns directly which effectively sabotaged my use of alembic when I started using Python/flask.

<comment><USER6> Huh, that sounds like it worked very well. Plus, the reduced overhead of backups etc is definitely worth it for small apps.

</comment></comment></comment></comment></comment></comment><comment><USER9> This looks like statement based replication, which can come out of sync if you're not careful to make your statements deterministic.

Any use of random(), as a trivial example.

</comment><comment><USER10> This is pretty cool!

Interestingly, once SQLite 4 comes out you'd probably implement this the opposite way, using Raft consensus (and something like etcd) for block storage, and using the SQL engine over arbitrary pluggable block storage.

<comment><USER11> sqlite4 seems not to be moving so fast - has it stalled?

</comment></comment><comment><USER12> ActorDB takes this concept much further. It replicates the WAL file (not sql statements).

[http://www.actordb.com](http://www.actordb.com)

[https://github.com/biokoda/actordb](https://github.com/biokoda/actordb)

</comment><comment><USER13> I skimmed the source and didn't see anything regarding leader election. Am I missing something or is this implementation encapsulating some of the underlying terminology/analogies traditionally used by Raft?

<comment><USER14> Wouldn't that be done by the underlying Raft implementation (goraft)?

<comment><USER2> Yes, that's right. 'go-raft' is imported by rqlite, and uses that package for consensus and leader election.</comment></comment></comment>


Your Favorite NP-Complete Cheat - <AUTHOR> http://www.codinghorror.com/blog/archives/001187.html

<comment><USER2> My favorite NP-Complete Cheat: using A* heuristic search to find a solution in the graph of possible Rubik's cube configurations.

</comment><comment><USER3> My favorite NP-complete cheat: You want to solve an integer programming problem, something like

      max sum_i x_i f_i

Where the x_i are restricted to be binary. The cheat: Just let the x_i be real numbers in the [0,1] interval, and solve the problem through a super-efficient linear programming solver. _If you happen_ to end up with a solution where all the x_i are binary, you have successfully found a solution to the original problem. If you aren't so lucky, well...

This is simple, fast, and works amazingly well amazingly often.</comment>


Twitter bot that tweets Wikipedia edits made from IP addresses of Congress - <AUTHOR> https://twitter.com/congressedits <comment><USER2> This feels like christmas morning.

And because it's wikipedia, we can harvest this data all the way back in time!

</comment><comment><USER3> Ohai! PirateParty dude here. Can we copy the code so that we can easily monitor other parliaments and senates around the world ?

<comment><USER4> According to [https://twitter.com/parliamentedits](https://twitter.com/parliamentedits), it looks like the source is here - [https://github.com/edsu/anon](https://github.com/edsu/anon)

Have fun :)

</comment></comment><comment><USER5> Some of these are pretty funny

[https://twitter.com/congressedits/status/487338666357174272](https://twitter.com/congressedits/status/487338666357174272)

which links to

[http://en.wikipedia.org/w/index.php?diff=616433636&oldid=614...](http://en.wikipedia.org/w/index.php?diff=616433636&oldid=614980617)

</comment><comment><USER6> I think there is a logical continuation. There are plenty of IP addresses owned by private companies that have mentions in wikipedia. Link changes done from those IP ranges with edits of articles that mention entity IP ranges belong to. Why stop at Congress when we can have similar data sets for Google, BP, Yahoo, Apple, etc.

</comment><comment><USER7> Nice one: [https://twitter.com/congressedits/status/486895711402070016](https://twitter.com/congressedits/status/486895711402070016)

<comment><USER8> I like this one, personally: [https://twitter.com/congressedits/status/487338666357174272](https://twitter.com/congressedits/status/487338666357174272)

</comment></comment><comment><USER9> What about other countries (Finland, Sweden, Estonia, Germany, France, Australia, New Zealand, Iceland, Singapore, China, India) or organizations (Microsoft, Google, Yahoo, Apple, Tata, Baidu, So, Pfizer)? Is there generic platform where information about IP ranges can be entered? Or are this 'one off' projects? Why not to make generic solution?

<comment><USER10> If you can identify the IP ranges you can configure anon [https://github.com/edsu/anon](https://github.com/edsu/anon) to listen for edits from them, and announce them using a particular Twitter account.

Honestly, I just put anon together in a few hours, and didn't put a great deal of thought into it. It might make sense to do what you suggest, and create a more generic webapp to deploy on Wikimedia labs, which manages the IP ranges, and Twitter accounts to post to.

</comment></comment><comment><USER11> Not sure what the benefit is. As LTE-enabled tablets and personal hotspots proliferate, it will be very easy to cover-up who made the anonymous edits.

What would really be interesting are edits made from known Tor endpoints.

<comment><USER12> Tor endpoints are forbidden from making anonymous edits to Wikipedia.

<comment><USER13> Lots of proxy servers (mine included) are banned as well.

</comment></comment></comment><comment><USER14> Just launched @PakistanEdits Unfortunately IP addresses of Govt. owned institutes are not available but its fun to see what is being edited from the whole country :-)

</comment><comment><USER15> I've just used the open source code to make one for the Australian Parliament, @AussieParlEdits

</comment><comment><USER16> It'd also be interesting to see what IPs from the FCC and NSA's ranges edit.

</comment><comment><USER17> It'd be brilliant if there was something similar for UK politicians.

<comment><USER18> There is!

[https://twitter.com/parliamentedits](https://twitter.com/parliamentedits)

Nothing tweeted yet except mention of the US Congress one, corresponding accounts also for Canada and Sweden and a mention of IFTTT and code at [https://github.com/edsu/anon](https://github.com/edsu/anon)

</comment></comment><comment><USER19> This is genius.</comment>


Ask HN: Are you excited about any upcoming computers, especially AMD laptops? - <AUTHOR> <comment><USER2> Not really. I have an 8 year old desktop and a 13 year old laptop with SSD upgrade. They work well enough for me.

I don't play any intense games nor require long battery life for the laptop. If I needed those attributes then I'd start looking.

Is there anything in an AMD laptop that you are looking for? That might help people better answer this question.</comment>


Create your own erasure code - <AUTHOR> https://hackthe.computer/problems/recover <comment><USER2> What if the parity bytes exceed 255? I'm assuming this is done with modular arithmetic, but does mod math work to recover missing data from the parity bits without trial and error? (i.e. is the recovery function a one-to-one mapping in reverse?)

I'm not well-versed in modular arithmetic, so excuse me if the answer is obvious to those that are.

<comment><USER3> For this particular case, this is not done using modular arithmetic. The parity values are simply rational - they might be fractional, negative, larger than 255, etc.

This erasure code is not at all optimal; it only serves to teach the basics of how one could work. In practice you'll definitely want a Galois Field or something.

<comment><USER4> Pardon my ignorance, but how would a system using a Galois Field work? All this stuff is really interesting to me.

<comment><USER5> In math a field is a structure with enough properties to be able to do polyoninals, meaning addition and multiplication. If you pick a field appropriately, you end up with some properties that guarantee that this interpolation trick works. If you pick it even more appropriately you can have the elements and operations efficient on computers. Turns out that a Galois Field has all those properties.

Specifically, you start with the base field of integers mod 2 and it turns out addition is xor, and multiplication is and. From that, you can create polynomials. Just like you could create a field by considering a set of elements modulo some prime, if you pick a "prime" polynomial and take the set of polynomials modulo your "prime" polynomial, then you get another field. Prime in this case means irreducible, which means you can't factor it.

So what people do is pick an irreducible polynomial of degree 7 and that maps perfectly to a byte. So for example a byte with bit pattern 01100011 would be the polynomial x^6 + x^5 + x + 1. You can then generate some tables that make multiplication and addition of these elements modulo your irreducible polynomial fast, and then apply this interpolation technique.

Hopefully that helps explain it. I was a little loose with terms and details so some stuff might be wrong.

</comment></comment></comment></comment><comment><USER6> Good heavens, Fixedsys as a webfont.

<comment><USER7> Also .computer

<comment><USER8> And kungfury.actor

</comment></comment></comment><comment><USER9> This post made me listen to erasure. Thank you.

Also, sorry for the OT.

</comment><comment><USER10> What if the three points are colinear? Do we assume a straight line polynomial?

<comment><USER8> Yes. If you have a "parabola" with 3 colinear points, your parabola is a straight line.</comment></comment>


SQL Pie Chart - <AUTHOR> http://code.openark.org/blog/mysql/sql-pie-chart

<comment><USER2> "...conclude with what, I hope you'll agree, are real-world, useful usage samples."

I can't tell if the author just has incredibly dry humor and this whole thing is a joke... or actually believes this is useful?

It's probably the most convoluted use of SQL I've ever seen, but I guess it's kind of impressive that it's possible...</comment>


Show HN: Curated, free collection of trendy CSS text shadows - <AUTHOR> https://www.mixfont.com/shadows <comment><AUTHOR> Hi HN! I noticed a lot of folks are adding these long shadows to different UI elements, so I put together a collection of these long text shadows as a reference! Hope it's helpful and would love to hear your feedback.</comment>


Delta Pointers: Buffer Overflow Checks Without the Checks [pdf] - <AUTHOR> https://www.cs.vu.nl/~herbertb/download/papers/delta-pointers_eurosys18.pdf <comment><USER2> This is pretty well known technique (tagged pointers themselves go back forever, and using tags for this purpose it's easy to find papers from the 2000's). In fact, it was already being implemented in ASAN on architectures with hardware support :)

[https://clang.llvm.org/docs/HardwareAssistedAddressSanitizer...](https://clang.llvm.org/docs/HardwareAssistedAddressSanitizerDesign.html)

Where there is no hardware support, the real world overhead is 35%+ (which this paper finds as well), and you end up with other issues to contend with (you have to de-tag the pointers in a bunch of cases, most kernels don't like them, etc), so software-only approaches have mostly not been bothered with.

<comment><USER3> Paper author here, thanks for the interest :). I just wanted to elaborate on the overhead numbers you mentioned.

I am not specifically familiar with the 35%+ numbers, but you should take into account the cost of any defense on top of the cost of putting tags in pointers, because that makes all the difference.

We found in our experiments on SPEC CPU2006 that, without static analysis for optimizations, the cost of pointer tagging itself (tagging + masking) is 22% geomean, which is almost entirely due to masking on loads/stores. This is with a 64-bit masking constant (0x80000000ffffffff) which is unique to our approach and is relatively inefficient on x86. With 32-bit masking (0xffffffff constant), which is more common, the number is about 14%.

This only covers metadata management and is not useful on its own, so you need to implement some kind of defense on top of this which is usually costly. The hardware support used by HWAsan only removes masking overhead by having the (ARM) hardware ignore the upper byte of the pointer, which is a nice way to not having to pay for masking.

By the way, source code for Delta Pointers is online since today! [https://github.com/vusec/deltapointers](https://github.com/vusec/deltapointers)

<comment><USER2> "I am not specifically familiar with the 35%+ numbers, "

This is confusing to me

Last sentence of second paragraph of your paper:

"We show that Delta Pointers are effective in detecting arbitrary buffer overflows and, at 35% overhead on SPEC, offer much better performance than competing solutions."

:)

" This only covers metadata management and is not useful on its own, so you need to implement some kind of defense on top of this which is usually costly. The hardware support used by HWAsan only removes masking overhead by having the (ARM) hardware ignore the upper byte of the pointer, which is a nice way to not having to pay for masking."

I'm aware :) There are thoughts and plans here.

<comment><USER3> Ah, I thought you were referring to HWAsan with the 35%, hence the confusion.

</comment></comment></comment></comment><comment><USER4> It really is a clever hack to catch a bounds error by forcing a segfault.

Where to put the tag is a problem for replacing pointers generically, but I think it's still pretty reasonable to use the 64-bit pointer version with just a minimum of language support. The trickiest buffers are often under 64K and we usually want to keep them small to live in cache, so if you have a "safe_alloc" function, all your IO loops, parsers, etc. that are dealing with user input could benefit from this.

</comment><comment><USER5> I still don't understand why CPUs don't provide support for 'fat pointers'. ARM has 'load pair' to update two registers in one go, it would just need a 'load/store from array' instruction to check that a pointer is inside the pair address to have a very efficient mechanism (efficient from an instruction count point of view at least, of course the data bandwith and cache impact are still here).

<comment><USER2> "Fatter than normal" pointers have a _lot_ of disadvantages (it's been explored extensively as part of CHERI, etc) for the upsides they give you. For the purpose of use after free/buffer overflow finding, it's IMHO, not a great fit (there are other uses, of course).

"Tagging within existing sized pointers", ARM does have some hardware support for (see [http://infocenter.arm.com/help/index.jsp?topic=/com.arm.doc....](http://infocenter.arm.com/help/index.jsp?topic=/com.arm.doc.den0024a/ch12s05s01.html))

It won't verify tags, but it has explicit support for ignoring bits, which is very helpful.

<comment><USER6> If by "fatter than normal" you mean using bits of the memory address to do interesting things, SPARC does so with ADI in hardware:

[https://lazytyped.blogspot.it/2018/02/libcmalloc-meets- adihe...](https://lazytyped.blogspot.it/2018/02/libcmalloc-meets-adiheap.html)

<comment><USER2> No, by fatter than normal I mean, say, 96 or 128 bit pointers.

I'm aware of SPARC ADI :) It does not have fatter-than-normal pointers, it uses 4 bit tagging of the memory address by reusing bits 63-60 of the pointer.

That is "tagging within existing pointers"

<comment><USER6> As I said it depends on what you mean by "fatter than normal".

</comment></comment></comment></comment></comment><comment><USER7> In the paper, the authors claim that the additional pointer arithmetic consists only of register operations & so one wouldn't expect any overhead. Then, it is surprising that the paper mentions 35% overhead on integer benchmark. wondering where that comes from...

</comment><comment><USER8> Hmm.

> User-space pointers in Linux are 47 bits. We limit this to 32 bits to > support 32-bit tags.

<comment><USER9> c'mon, most vulnerable networked software don't need no 4GB - just because it doesn't work 100% don't mean its worthless</comment></comment>


Sod – An Embedded Computer Vision and Machine Learning Tiny C Library - <AUTHOR> https://sod.pixlab.io/ <comment><USER2> I was interested until I saw you have to purchase something to train your own models. I am wondering how this compares to Darknet by Joseph Redmon [1]. You can do most of what I see on the Sod site, and train your own models. It's in C too.

[1] [https://pjreddie.com/darknet/](https://pjreddie.com/darknet/)

<comment><USER3> Just a quick heads-up that Joseph Redmon isn't working on the development on Darknet any longer, and the YOLO fork by AlexeyAB [0] (now on YOLOv4) is one people should also consider using moving forward[1].

[0] [https://github.com/AlexeyAB/darknet](https://github.com/AlexeyAB/darknet)

[1] [https://mobile.twitter.com/pjreddie/status/12538910781821992...](https://mobile.twitter.com/pjreddie/status/1253891078182199296)

<comment><USER2> Yes, I have been following darknet for a while now. I haven't tried YOLOv4 yet. Any comments on what SOD brings to the table in comparison to darknet?

<comment><USER3> Honestly, I'm not sure. It seems like they cover slightly different fields, despite having some overlap. AFAIK, Darknet doesn't natively do a bunch of the image processing work that Sod can do, like edge detection with Canny, because if you wanted that, you'd just use OpenCV.

I'd imagine that based on the licensing, this is probably closer to the open- sourcing (well, sort of, since the commercial applications and GPU training requires a paid license) of an internal tool that the company is using on the backend of their own API-driven machine learning business. So, it covers some things that Darknet isn't really designed to do, since real-time object detection isn't the main area they're really interested in.

<comment><USER2> Real-time object detection is what YOLO does and darknet implements it, but I see where you are going with the edge detection in SOD vs. darknet. You add in OpenCV if you want to use it.

</comment></comment></comment></comment></comment><comment><USER4> Knowing that some schools and universities are testy to use GIMP because it's a derogatory term, I'm wondering how "SOD" will fare. "Sod off" and "you're a real sod" are not exactly terms of endearment and are very much still in current usage (particularly by the kind of people who might be offended by using something that refers to them).

<comment><USER5> I don't know, I haven't never hear "sod" as slang before, had to check urban dictionary [1]. Maybe I'm not streetwise enough :-)

1: [https://www.urbandictionary.com/define.php?term=SO%20D](https://www.urbandictionary.com/define.php?term=SO%20D)

<comment><USER6> It's also in the real dictionary. [https://dictionary.cambridge.org/dictionary/english/sod](https://dictionary.cambridge.org/dictionary/english/sod)

It comes from sodomy. It's interchangeable with fuck in many contexts.

<comment><USER7> Except it's much milder, there's no problem with saying "sod off" on tv during the day, for example. Apparently the British Communications Regulator, Ofcom[0], sees it as "Mild language, generally of little concern", whereas _fuck_ is "Strongest language, unacceptable pre-watershed. Seen as strong, aggressive and vulgar. Older participants more likely to consider the word unacceptable."

[0] [https://www.mirror.co.uk/news/uk-news/read-what-ofcom- thinks...](https://www.mirror.co.uk/news/uk-news/read-what-ofcom- thinks-47-8987533)

</comment></comment></comment></comment><comment><USER5> It seems like they go out of their way to hide the real identity of the ppl behind this (feels like a solo developer). Why would someone do this?

[http://symisc.net/contact.html](http://symisc.net/contact.html)

<comment><USER8> It is indeed interesting! I had some use case in mind so I tried to find more about company. sysmic is owned by Pixlab, but both have zero info about people involved. Interestingly, even their linkedin page (../company/pixlabio) doesn't lists any individual and given the work they are doing, I doubt it's single person effort. Well, someone mentioned darknet project, looking into that instead.

</comment></comment><comment><USER9> So this is like the printer model, sell the printer (library) for free and charge for the toner (model).

<comment><USER10> Can you develop your own models?

<comment><USER11> Doesn't seem like it. The GPU module required for training CNNs is sold separately[1]:

> A GPU capable special SOD release which is not available to the public is > required in order to train your own CNN model.

There are some bits included for training "RealNet" models[2] but I'm not sure what those are or how they work. The documentation suggests that RealNet models can be trained in reasonable timeframes with a CPU.

[1] [https://sod.pixlab.io/cnn_train.html](https://sod.pixlab.io/cnn_train.html)

[2] [https://sod.pixlab.io/c_api/sod_realnet_train_start.html](https://sod.pixlab.io/c_api/sod_realnet_train_start.html)

</comment></comment></comment><comment><USER12> What kind of embedded processor is this meant for? cortex-m3 low level or more like a cortex A class?

</comment><comment><USER13> Click. No Q16.16. Close tab.

<comment><USER14> Can you elaborate what you mean by this?

<comment><USER15> "Q16.16" seems to refer to fixed floating point precision ([https://en.wikipedia.org/wiki/Q_(number_format)](https://en.wikipedia.org/wiki/Q_\(number_format\))). The parent comment is unhappy that SOD doesn't support floats with 16 integer bits and 16 fractional bits. I'm unsure why lack of support for 32 bit floats is such a problem considering that SOD is suppose to run on such resource constrained devices. Is there a particular domain where this is necessary?

<comment><USER16> _> "Q16.16" seems to refer to fixed floating point precision_

Floating is the opposite of fixed in this context. The GP is unhappy that it doesn't support fixed point numbers of a common fixed point number format.

This is not just nitpicking, because the difference in time and implementation cost between floating and fixed point can be huge on systems where floating point operations aren't offloaded to a pipelined FPU. Fixed point arithmetic on the other hand, even if your hardware doesn't support it directly, can easily be implemented in terms of integers.</comment></comment></comment></comment>


Ask HN: Where to get quality market research data and analysis? - <AUTHOR>

If I wanted to research a specific market are there any good sites or resources you'd recommend?<p>I'm okay with paying for good stuff. <comment><USER2> It really depends on the what you're looking for and the industry that you're focusing on. Some basic info:

1\. Google whatever you can. Google itself also offers some data services (<http://www.google.com/insights>).

2\. Use your local public library and/or your university library. They have tons of research databases and quite a few of them can be accessed from home if you have a library account with them.

3\. I often go to competitor websites and go to their "About Company" page or their blogs to get more information about the market. If the company is public, look at their corporate presentations. There's tons of valuable stuff in there.

4\. For surveying, Google has their insights tool (link above) and I know several people also use Amazon Mechanical Turk (<http://www.mturk.com>)

5\. Check out <http://www.slideshare.net>, they have lots of great presentations written by students and experts.

6\. If you want to have in-depth, targeted discussions with industry experts, consider professional firms for this. A firm I've used before: <http://www.glgresearch.com> (while they have a strong experts network not all industries are well represented; they are also quite expensive)

These are a few off the top of my head. Will post more as I think of them. Feel free to contact me if you need market research help.

</comment><comment><USER3> Some excellent sites that aggregate research from reputable firms: <http://www.marketresearch.com/> <http://www.giiresearch.com/> You can also learn to do your own, at www.ResearchRockstar.com</comment>


Techcrunch interviews Zuckerberg - <AUTHOR> http://www.techcrunch.com/2008/12/07/interview-with-facebook-ceo-mark-zuckerberg-products-funding-competition/

<comment><USER2> His discussion of the handling of personal data was atrocious. 'We'll give the data to others if they give us a boatload of money and let us use theirs. If not, well, the user agreement prohibits it' and also 'we won't compete with app developers unless we do'. He really makes google look principled...

<comment><USER3> It is a little strange, when somebody who holds so much personal information about people says something like that. It is one thing to do what he is doing with MSN; but to come out and say it. I would have preferred if he had just lied.

<comment><USER4> _I would have preferred if he had just lied._

Would it have changed your opinion, then, if he did lie?

</comment></comment></comment><comment><USER5> There's nothing exciting here at all. Except for the bit about music, it's all the same stuff Zuckerberg has been saying for months.

<comment><USER6> Except I didn't notice the "sharing information more effectively" soundbite there.</comment></comment>


Show HN: Dependency-based prioritization makes HTTP/2 much faster than SPDY - <AUTHOR> http://blog.kazuhooku.com/2015/04/dependency-based-prioritization-makes.html

<comment><USER2> Are your timings based off of a single run each for Firefox and Chrome? The web is a very noisy place; to get good timing data you need to run many tests. WebPageTest (www.webpagetest.org) can be a good way to do this.

(I work on PageSpeed, and we need to run tests like this often.)

<comment><AUTHOR> Thank you for the suggestion.

In case of the benchmark, I run the server as a VM instance on the client machine so that the results would be reproducible (with network latency added by `tc qdisc` command).

PS. PageSpeed is a really nice service; and I agree that it is a useful tool for evaluating the speed in the real-world.

</comment></comment><comment><USER3> Seems like there is still a significant amount of initial latency by waiting for the first-byte of the HTML before making the subsequent requests for the dependent resources.

To actually minimize latency the server should understand what resources the HTML file is dependent on, and eagerly send those in addition to the request resource. i.e.

        client: send me index.html and dependent resources
        server: here is index.html, along with
                other initial resources you didn't ask
                for but will need

This avoids the latency of the second round-trip time to ask for dependent resources. Does anyone know if HTTP/2 allows for a scheme like this?

<comment><USER4> That is one of the main advantages of HTTP2 - it's called server push. When the server receives a request, it can send the headers for the requested resource plus the headers for as many related resources as it wants. The client can choose to either disable this, or reject pushed streams when it receives their headers.

</comment></comment><comment><USER5> I'm not sure I'm reaching the same conclusion.

\- Chrome is taking 618ms to load / vs 412 ms on FF.

\- FF loads all the .css & .js at 320ms as well as first 8 imgs

\- CH loads all the .css & .js at ~600ms as well as first 8 imgs

Before chalking up the advantage to dependency-based prioritization (which may be a good thing-I don't know) I would first explain why fetching "/" is so much slower on chrome.

<comment><AUTHOR> As described in note 5, "the network chart of Chrome includes a 0.2 second block before initianting the TCP connection, which has been subtracted from the numbers written in this blog text". That explains the differences of the numbers on the charts you pointed out.

<comment><USER5> Thanks, I missed that.

Might be worth re-running the tests without the block so the graphs can line up better and we don't need to subtract the 200ms? As you well know, implications of latency or packet loss are hard to extrapolate on real-world rendering.

<comment><AUTHOR> Unfortunately the block was always found on the test machine. The test was conducted using a VM running running on a host on which the web browsers were run, so there were no noise or packet loss; the results were reproducible.</comment></comment></comment></comment>


Equity for all? My experience as Carta's lone woman executive - <AUTHOR> https://medium.com/@emilykramer/equity-for-all-1ae9ac42679e <comment><USER2> I still can't quite figure out how we can properly distinguish (from a subjective viewpoint) whether people dislike us because of our personality, or because of some external, sometimes immutable characteristic (woman, black, Republican, Emo, geek, ...).

This article swings a bit more towards asshole though. Like, she accuses "Henry" of sexist comments, whereas his comments were at best just passionate if possibly too honest ("you're an asshole, nobody wants to work with you") and at worst benevolently sexist ("you were given a pass because you're a woman").

Looking forward to see how the suit will go.

</comment><comment><USER3> Kudos to Ms. Kramer for her courage. She is taking a great risk to her wealth and her career in the hope of achieving justice.</comment>


Peter Thiel invests to create floating micro-countries - <AUTHOR> http://www.washingtonpost.com/blogs/blogpost/post/peter-thiel-founder-of-paypal-invests-124-million-to-create-floating-micro-countries/2011/08/17/gIQA88AhLJ_blog.html

<comment><AUTHOR> Seasteading by Patri Friedman: <http://seasteading.org/mission/intro></comment>


Show HN: A Code Generator in Eclipse - <AUTHOR> https://github.com/telosys-eclipse-v3/TelosysToolsPlugin <comment><USER2> If you prefer to avoid Eclipse just use the CLI version of Telosys (it's licence is LGPL). See [https://github.com/telosys-tools-bricks/telosys- cli](https://github.com/telosys-tools-bricks/telosys-cli)

</comment><comment><USER3> Has Eclipse been rewritten yet? Last time I used it was 10 years ago (for ActionScript 3) and it was a completely bloated, over-engineered nightmare.

</comment><comment><USER4> License proliferation is a problem. There is no good reason for new projects today to be using the Eclipse Public License or any other vanity license. If one of { MIT, Apache, GPL, LGPL } aren't attractive for some reason, then at least use MPL 2.0 or offer it under dual-license with one of these. Picking some goofy community license like EPL is a great way to make sure a project is seen as an option for people who inhabit that community, but nowhere else.

<comment><USER5> The project in question is a plugin for the Eclipse IDE. They went with an Eclipse license. If this project is not specifically "for people who inhabit that community," then who is it for?

<comment><USER4> This may be shocking to hear, but sometimes with open source people re-use source code, which results in the useful parts existing in a new form that's different from the way it was originally published.</comment></comment></comment>


Analysts Say Apple Should Buy DuckDuckGo Search Engine - <AUTHOR> https://baseread.com/analysts-say-apple-should-buy-duckduckgo-search-engine/ <comment><USER2> There seems to be another thread on this topic:

[https://news.ycombinator.com/item?id=23461515](https://news.ycombinator.com/item?id=23461515) "Apple Should Buy a Search Engine, Analyst Says"

<comment><USER3> We moved the comments thither. Thanks!</comment></comment>


The Y Combinator - <AUTHOR> http://mvanier.livejournal.com/2700.html <comment><USER2> Add your own abstraction layer:

"The Y combinator allows us to define [1] in computer languages that do not have built-in support for [2], but that do support first-class [3]."

An example:

[1] startups

[2] operating costs

[3] solutions

Your turn!

</comment><comment><USER3> Richard Gabriel also tried to explain Y:

<http://www.dreamsongs.com/NewFiles/WhyOfY.pdf>

<comment><USER3> P.S. This is the best explanation of combinators I've seen on the web (and includes Y of course):

<http://users.bigpond.net.au/d.keenan/Lambda/index.htm>

</comment></comment><comment><USER4> Pretty good write up. The only part I did not care for was the pompous: "[...]I think the reason is that he wanted to attract the kind of programmers who were smart enough to have heard about the Y combinator"... The author has confused ignorance with intelligence.

</comment><comment><USER5> Here is a derivation of the Y Combinator in Perl:

<http://use.perl.org/~Aristotle/journal/30896>

</comment><comment><USER6> Ah, a new internet meme. A few years ago, it was Haskell monad tutorials. Now that everyone is hearing about YC, they think they need to learn what the Y combinator is and then blog about it.

Why not just contribute to the Wikipedia article?

<comment><USER7> Having read Mr. Vanier's musings on programming languages for several years, I highly doubt this situation is as you posit.

Regardless, I'd much rather see the web full of blogs on theoretical computer science than blogs on the lives of "stars" and "fashion models".

</comment></comment><comment><USER8> I thought the allusion to Y Combinator was about turning a simple operation (program) into a recursive one (business).</comment>


Coral Reef Starter Kit - <AUTHOR> https://www.udel.edu/udaily/2019/october/3D-printed-coral-study-damselfish-Danielle-Dixson/ <comment><USER2> The difficult thing here is these appear to need planting by hand. The problem with coral planting is not a lack of corals to plant, it's finding people to give up their time for boring, repetitive work that can often feel like shoveling snow while it's still snowing.

<comment><USER3> While I don't have any formal marine biology training, I have extensive dive experience and certification. I would readily do this for a year if someone paid all my living and working expenses in some remote tropical island somewhere.

<comment><USER2> There is some demand for it; resorts with a house reef will sometimes hire someone to maintain it. You would need training; not a marine biology degree, but at-least a month of on the job experience. Also should be comfortable mixing concrete in 40 humid degree heat.

<comment><USER3> Not really interested in doing it for a resort (where you are essentially the underwater equivalent of their handyman), I meant on a large scale in a marine sanctuary where I can help preserve the wonder and awe I experienced on my first dives for future generations.

I don't think the world at large truly understands how bad it is for coral reefs these days. I've only been scuba diving for a bit over 20 years and many of my favorite dive sites are virtually unrecognizable from 10-15 years ago.

</comment></comment></comment></comment><comment><USER4> I understand that it might make sense to use 3D printing for this experiment given the small scope. However wouldn't we realistically use a cheaper and faster method of production? Are those materials only usable for 3D printing?

<comment><USER5> A methallic mold would be much faster and cheap.

</comment></comment><comment><USER6> I've seen a number of similar research projects but the issue is economic incentive and scale. Until those are addressed this is continental shelfware.

</comment><comment><USER7> FYI - The article keeps talking about cornstarch filaments - that's PLA, a very common filament material.

</comment><comment><USER5> Really interesting project with lots of potential. Printed corals should decrease survival of the fishes (they arent corals and will be colonised by algae), but some fish refuges is better than none even if non perfect.</comment>


The iOS Beginner blog series - <AUTHOR> http://kentnguyen.com/ios/ios-beginner-series-intro/

<comment><USER2> I find it incredibly ironic that this won't load on my iPad (iOS 5.0).

<comment><USER3> checking now

<comment><USER2> Working now :). I've seen my iPad act strangely before, so it could have been something on my end or just server traffic.

</comment></comment></comment><comment><USER3> hey guys, thanks for visiting my sites. Due to unexpected traffic, it's currently under heavy load. So the response time could be slow. Be patient

<comment><USER4> Time to implement some form of caching perhaps?

<comment><USER3> It's back now. Fault PHPFog's cloud architecture

<comment><USER5> You should check out Pagoda Box. You can store cached files in a writable directory that is shared across all of your app instances. Scaling is totally seamless.

<comment><USER3> i will. any other php cloud service you can think of. im a seasoned heroku user by the way. still nothing match it for php

<comment><USER6> [http://tjstein.com/2011/09/running-wordpress-on-heroku- and-a...](http://tjstein.com/2011/09/running-wordpress-on-heroku-and-amazon- rds/)

Possible?

</comment></comment></comment></comment></comment></comment><comment><USER3> haha thanks @dqminh i didnt post this coz its not really technical, i thought HN crowd would prefer the other post</comment>


SEO: If you are clicked in the search results, does that boost your SERP? - <AUTHOR>

The recent thread about SEO inspired this.
Ive been reading SEO blogs and books extensively for the last half a year and having come across this topic.<p>If your site is the most often clicked search result, will you rise in serp? <comment><USER2> No, traffic is not a factor. Nor "clickability". Your "clicks" will increase if you increase your ranking.

For example if your tittle says "CLICK HERE AND YOU WILL BECOME MILLIONAIRE" and the one above says "Meh." probably, your site will get a few more clicks, maybe because its better optimized than the one above but that's not a factor.

Optimization is not a factor. Reputation, links pointing at you and rich content it is.

<comment><USER3> But how can you know this?

Google's algorithms are proprietary, and they have data from tons of sources beyond links (including clicks) that they could be using to guide search relevance. How do you know that they're not?

<comment><USER4> I don't think number of clickthroughs is considered because of how easy it would be to game.

EDIT: In fact, I recall a guy using MTurk to test this theory. IIRC, He had two similar pages and was having people execute search queries and click on his site to see whether its position would improve as a result of it. Unfortunately, I don't know whether he shared the results.

</comment></comment></comment><comment><USER3> I've wondered about this too.

It's difficult to dissect because there's a general correlation between the sites that are clicked on and the sites that are linked to. (The exception being aggressive linkbait, which everybody clicks on but then feels deceived and doesn't want to link to.)

If someone knows the answer to this, I'd like to know as well.</comment>


Two Startups in Thirty Days (Video) - <AUTHOR> http://www.axosoft.com/blog/2012/08/30/video-startups-days/

<comment><AUTHOR> Here are some things that didn't make it into the video (camera's weren't running 24/7, so it was hard to catch all of our 'moments'):

-We had just completed a major release of our software that included a new dashboard, so doing a dashboard product was definitely a contender for the 30-day project. We were almost ready to rule it out, though, when we saw a dashboard product (Dashku) on the Hacker News home page getting some love. This influenced us by leading us to believe the demand could be there.

-At the exact same time, there was another story on the HN homepage by a developer who wrote about why he would never develop an app for the Twitter platform. This influenced us a bit, too, as an Android Twitter client was a leading contender on our list — which we subsequently dropped.

-It took a solid week to come up with the name Dashzen, and we probably wasted too much time and involved too many people with the naming early on.

-In the past, Axosoft has done 30-day projects like this, but only involving developers. By including marketing and QA, we were able to build more solid products that also had better UIs and branding compared to what we've done in the past.

-Even though both products' home pages describe our pricing models, there is no charging mechanism built yet. Until we build one, both products are actually free.

-If we decide to film the event again next year, we'll do a few things differently, like: set up a "camera room" where anyone can go in and record their thoughts at any time; set up daily scheduled meetings; and possibly incorporate some kind of pitch event.</comment>


Apple Enables Advanced Mobile Location in 11.3 Beta - <AUTHOR> https://9to5mac.com/2018/01/25/advanced-mobile-location-iphone/ <comment><AUTHOR> Interesting follow-up to [https://news.ycombinator.com/item?id=16149365](https://news.ycombinator.com/item?id=16149365) (in which AML wasn't mentioned at all).

I'd never heard of AML ([https://en.wikipedia.org/wiki/Advanced_Mobile_Location](https://en.wikipedia.org/wiki/Advanced_Mobile_Location)) but it sends the location information via SMS.</comment>


Prettier 2.0 – Opinionated JavaScript formatter - <AUTHOR> https://prettier.io/blog/2020/03/21/2.0.0.html <comment><USER2> A bit irritating that formatting zealots are changing the defaults. What can possibly drive the decision to change whatever option it is they landed on and deployed? It's contrary to everything they claimed Prettier was about: for better or worse, we have decided on X so we can all move on to more important issues.

I feel like the cost of changing defaults is wildly underestimated because it's decided on by people who are so deeply engaged in the product.

It means either all my code now needs a config file added or all my code will need to be updated.

<comment><USER3> Is the cost really that high? For the vast majority of projects, all developers will need to do is run "yarn prettier".

We can't expect everything to be perfect on day one, nor should we be stuck with the poor choices we made when starting a project. Maintainers should be allowed to change their mind after careful consideration and community consensus.

<comment><USER4> Part of the calculus for the cost is losing the immediate utility of git blame once every file has been reformatted.

<comment><USER5> Configure your git blame to ignore cleanup changes.

[https://www.moxio.com/blog/43/ignoring-bulk-change- commits-w...](https://www.moxio.com/blog/43/ignoring-bulk-change-commits-with- git-blame)

<comment><USER2> This changes everything. Thank you!!!

<comment><USER6> If GitHub doesn't automatically support the feature (article says it doesn't) I don't think it'll be very useful for many teams.

<comment><USER7> If you can use GitHub but not Git, I'm not sure you can really say that you know version control. Fine for designers who are just helping out in projects and don't really know to but developers who manages merges, backports and alike should really know the insides of Git, not just the GitHub GUI.

</comment></comment></comment></comment></comment></comment></comment><comment><USER8> > Improved method chain breaking heuristic

This is great! When I'm _scripting_ in Node.js I tend to prefer either of these two styles, with the second one being normally a cleaned-up version of the first one:

        const res = base
          .map(a => a.b)
          .filter(b => /abc/.test(b))
          .join('\n');

        const res = base.map(extractB).filter(isAbc).join('\n');

The second one would be split into different lines with Prettier 1.x, which was annoying since I would explicitly extract those methods into separated functions for clarity. So this is amazing for my personal projects.

However at the same time I'm not thrilled about prettier breaking changes. It _is_ supposed to be the one way of doing things, so now a project might have different people with different prettier versions, making it a ping-pong game if someone has prettier 1 and someone else prettier 2.

<comment><USER9> I prefer Gofmt's strategy/philosophy, which is to mostly let the developer control breaking, and only format around it. Gofmt will format everthing strictly, but will leave decisions about "layout" to you.

This is a wiser design because the formatter _can 't_ know what the best layout is, and a formatter really ought to only format something where there's is an _unequivocally, universally correct way of formatting something_.

As an example, sometimes table-driven test are better written compactly, sometimes better verbosely. As a naive example:

      for _, c := range []testcase{
        {input: 1, expect: 10},
        {input: 2, expect: 20},
        {input: 3, expect: 30},
      } {
        assert.Equal(t, c.expect, someFuncToBeTested(c.input))
      }

If the formatter starts splitting each testcase entry up over several lines, like so:

        {
          input: 1,
          expect: 10,
        },

...then you potentially lose readability. In other cases, you have more complicated structs that might fit on one line, but deserve to be formatted across multiple lines.

This is something Prettier doesn't always do correctly, and with Prettier, you _don 't have a choice_. Opinionated is good when there is just one answer, but not when there's a range of possibly answers.

<comment><USER10> You've perfectly explained my daily frustration with Prettier. I am sad a few times a day about this for a project I'm on at this time.

</comment></comment></comment><comment><USER11> I'm still really hoping for Jinja2/Django template support: [https://github.com/prettier/prettier/issues/5754](https://github.com/prettier/prettier/issues/5754) / [https://github.com/prettier/prettier/issues/5581](https://github.com/prettier/prettier/issues/5581)

<comment> j-f1 This is actually quite challenging because the template language allows you to insert template tags into any location in the template file, and while people _usually_ put them in reasonable places, there's no guarantee. For example, someone could do a thing like `{{ less_than }}div class="foo">abc</div>` and that would be totally valid but a nightmare to parse.

That's different from a more structured template-style language like JSX, where there are only a few valid places to embed JS expressions so it isn't too challenging to make them all look good.

</comment></comment><comment><USER12> Related from 2018: [https://news.ycombinator.com/item?id=16549966](https://news.ycombinator.com/item?id=16549966)

2017: [https://news.ycombinator.com/item?id=14108718](https://news.ycombinator.com/item?id=14108718)

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

</comment><comment><USER13> Did they change an option to disable lineWidth? In 1.* it was not possible, which was my single biggest issue with Prettier. Many times it made code less coherent, due to forcing a few lines to be collapsed into one.

See Prettier example in ESLint section of "How I Learned to Stop Worrying and Love the Types & Tests", [https://p.migdal.pl/2020/03/02/types-tests- typescript.html#e...](https://p.migdal.pl/2020/03/02/types-tests- typescript.html#eslint).

<comment><USER14> Why not just change it to a high value? Or prettier-ignore exceptional lines?

<comment><USER15> if you put a high lineWidth value, you'll have your object literals or destructuring mostly one-lined, etc.. often not desirable (for 4+ props)

That's mostly why I don't like prettier, sometimes you want a bit of control over code formatting when several options are possible, prettier don't allow it. I use vscode formatter (actually it's TypeScript compiler formatter) instead

Other things I dislike with prettier, like how it'd force parenthesis in a `2 + 3 * 4` expression, where it's a bit superfluous. Or string templates line returns on expressions [https://github.com/prettier/prettier/issues/3280](https://github.com/prettier/prettier/issues/3280)

<comment><USER16> You can controll the formatting with empty comments

eg, if you dont like

        const {a, b, c} = props;

you can do

        const {
          //
          a,
          b,
          c
        } = props;

<comment><USER17> But please don't.

</comment></comment></comment></comment></comment><comment><USER18> In order to get this working with vim's prettier highlighting, I had to add this to `.prettierrc`:

        {
          "trailingComma": "es5",
          "arrowParens": "always"
        }

Prettier 2.0 changed this to be the defaults, but for some reason the editor plugin wasn't acknowledging it.

Also I added a script command to format all the code in package.json:

        {
          "scripts": {
            "prettier": "prettier src webpack data --write"
          }
        }

Then `npm run prettier` got me sync'd with the latest defaults (the trailingComma and parens styling).

It even formatted my JSON and SCSS files. Didn't recognize prettier could do that.

<comment> crooked-v > but for some reason the editor plugin wasn't acknowledging it

Is it using a bundled pre-2.0 version of Prettier?

<comment><USER18> Not sure, but it's this package: [https://github.com/prettier/vim- prettier](https://github.com/prettier/vim-prettier)

</comment></comment></comment><comment><USER19> I have been looking for, but haven't found, a similar package for Java projects. Ideally my team can add it as a save-hook for everyone using IDEA, then we can have a pre-commit hook that checks to ensure compliance. Would be eternally grateful for anyone that can point me in the right direction!

<comment><USER20> I suggest [https://github.com/google/google-java- format](https://github.com/google/google-java-format)

<comment><USER21> I'm very happy using this, coming from prettier with JS/VSCode and looking for a similar dev experience in Java/Intellij - it has an IntelliJ plugin that works well. Last time I looked I couldn't find any good IntelliJ plugins for the Java implementation of prettier which was a dealbreaker - I need the format on save. Anyway, this is a great tool, just works.

Only couple of issues it has is no 'ignore formatting for this piece of code' feature and it occasionally formats comments oddly (i.e. enough to make them unreadable) in certain edge cases like in ternary expressions, so you have to manually edit comments from time to time, but this hardly ever comes up.

<comment><USER22> > I need the format on save

Check out Preferences -> Tools -> File Watchers.

<comment><USER21> Great shout! Didn't know about this feature but this solves the problem elegantly. Will give it a try.

</comment></comment></comment></comment></comment><comment><USER23> finally you can run `npx prettier --write .` and get a folder formatted without any installation or configuration. This is a great decision. Congratulations on the release team!

<comment><USER24> That's probably useful in some cases but I'd still recommend pinning the version, since different versions of prettier format code differently and different team members will end up with conflicting changes.

<comment><USER25> ^^^ what the op said. You'll regularly seen diffs in minor versions, and even patch versions.

</comment></comment></comment><comment><USER26> IMHO, when writing long logical expressions, putting the logical operators to the beginning of each following line (instead of to the end) makes them much easier to read.

</comment><comment><USER27> Doesn't it defeat the idea of "one formatting to rule them all" if they change the rules?

<comment><USER28> I'm not sure how dedicated prettier is to "one formatting to rule them all" since it's configurable per-project. Switching between different projects with different prettier configuration is very low friction.

Speaking for myself, I advocate "one formatting to rule them all" in terms of just taking defaults, and one of my arguments is that, if there's something universally wrong about a prettier default, then it should be changed universally. And if it isn't universally wrong, just go with the default.

<comment><USER27> Yes.

Some things are obviously bugs, especially the chained line break problem.

Bur the semicolons config they added back in the days just baffled me.

</comment></comment></comment><comment><USER29> Friendly reminder that this will not necessarily build the same code from two different sources with the same AST. For that, you can use: [http://estools.github.io/escodegen/demo/index.html](http://estools.github.io/escodegen/demo/index.html)

</comment><comment><USER30>
      const identity = function (value) {
        return value;
      };

This change is really confusing to me. I've never seen anyone who puts a space after the `function` keyword in an anonymous function.

<comment><USER7> Not sure how much open source you've done, but StandardJS is used in a lot of open source JS libraries/projects, and they have the "Add a space after keywords" and "Add a space before a function declaration's parentheses" rules in it, so plenty of open source projects does it like this.

</comment></comment><comment><USER31> Prettier is one of my favourite pieces of software! I only wish they had a binary that doesn't rely on Node.js

<comment><USER32> Why?

Are you avoiding NPM as well?

Seems like a curious requirement for JS development

<comment><USER33> I avoid NPM if I can for JS development (after all not all JS/TS development requires NodeJS) so it is painful to see people use npm as the installation method for their projects or tools when I am trying to write something simple.

For what it is worth, the replacement for NodeJS (Deno) is removing the use of npm, so I am not alone in my dislike of the centralised registry idea it seems.

<comment><USER34> Deno will fail at this, they are fixing something that isn't broken.

<comment><USER35> IMHO, Deno's approach to package management, that is to say, no package management ("packages" are just source files that you'd import directly using urls or file paths), is a breath of fresh air compared to the status quo in node where to import some javascript that's already hosted at some url (say on github), you first have to "package" it by describing it with some manifest, uploading it to some registry at a different url than the original, and then "install" it using a package manager from that other url, and at the end of the day not even have any guarantee that the content of that thing you installed actually matches what you saw at the original url.

Deno's approach on the other hand is doesn't force any of that indirection onto the user, and is analogous to (and compatible with) the model of modules on the web. Package management systems can be easily layered on top of that if the use case actually warrants that extra indirection, rather than having it baked into the core of the runtime.</comment></comment></comment></comment></comment>


The Most Expensive Thing in the World - Priceless Object - 900Billion US$ - <AUTHOR> https://www.scribd.com/document/388195735/Priceless-Object-The-Most-Expensive-Thing-in-the-World <comment><AUTHOR> "Take mud, the most humble material on earth, mold it and assign it the highest price in the world. Change it as many times as necessary" Current Price - 900Billion US $ - Fiat Money</comment>


Code Is Not Literature (2014) - <AUTHOR> http://www.gigamonkeys.com/code-reading/ <comment><USER2> Discussed at the time: [https://news.ycombinator.com/item?id=7091495](https://news.ycombinator.com/item?id=7091495)

Thread from 2017: [https://news.ycombinator.com/item?id=13855185](https://news.ycombinator.com/item?id=13855185)

</comment><comment><USER3> People don't voluntarily read code because most code isn't readable.

<comment><USER4> That is a reason people do not read code, but imo not the primary one. I don't read code because, unless I am forced, it is a waste of time. I used to grade assignments for an intro CS class @ Stanford, and if I had to read your helper functions it was because your code didn't work. Not because I wanted to.

Not to start wars, but imperative code especially is a waste of time to read unless forced, as I need to understand your desired goal AND how you chose to get there. See for + if vs filter, for example. I would rather just read a function comment or class comment or some doc instead (assuming its up to date...)

<comment><USER5> Sounds like you haven't read much good code. I have worked on a lot of "reasonably good" code I didn't mind reading. Reasons for code to be good or bad vary. The Linux memory management code (linux/mm), for example, is rather hard to read, but also a big technical accomplishment. So it's still interesting (and I read it just out of interest). Code that pushes around data is nice if it's well organized and named. Etc.

<comment><USER4> No I've read good code. At work you don't have the liberty to sit and understand every line of a library you're using does or some other teams work.

I did not say code should not be read, just that it shouldn't be expected to be read. Make it clear before you ever get to the code what's going on

</comment></comment></comment></comment><comment><USER6> A table of contents may make codebases easier to read. I have no problem reading code from systems I know well, because I know how to move. Other codebases I don't know where to start

</comment><comment><USER7> Code is screenplay.

</comment><comment><USER8> "computers aren't paintings"?

</comment><comment><USER9> Most code is unreadable, but that doesn't mean there isn't beautiful code out there worth reading.

[https://norvig.com/spell-correct.html](https://norvig.com/spell-correct.html) is like poetry— or at least what I imagine poetry is like to people who like poetry.

Reading it changed the way I look at code, and inverted what I consider good code.

If it's not in a super high level language it probably won't be beautiful, at least not in the same way as Norvig's spelling corrector. For lower-level code, approaching it like a scientist, as OP suggests, may be right; I wouldn't give up on a reading group for sufficiently high-level code.

<comment><USER10> > ...or at least what I imagine poetry is like to people who like poetry.

Which isn't poetry. Poetry is its own thing. We are not required to compare non-comparable things.</comment></comment>


The web equivalent of donating an organ - <AUTHOR> http://matchstrike.net/strikepad/2009/12/the-web-equivalent-of-donating-an-organ/

<comment><USER2> That's cool that you guys were able to work it out. There seems to be an increasing number of checks that a name has to pass to be "valid".

Can you get the domain? Can you get the twitter account? Can you get the facebook account?

Depending on the market there are probably others.

What checks does a name need to pass for you?

<comment><USER3> In most cases, the name probably doesn't matter too much. If the content posted adds value and the particular social network entity is linked prominently, people will likely follow/friend it regardless.

With this app, things were a bit hairier because the name of the twitter game was '@libs', so just saying the name of the game in a tweet could lead users astray. Certainly, constraints such as this should be taken into consideration before deciding on a name.</comment></comment>


The Monty Hall Problem - <AUTHOR> https://www.montyhallproblem.com/ <comment><AUTHOR> this is a logic problem that seems intuitive - but isn't. You are given 3 doors and told there is a prize behind one. You pick. Before you open your door, the host opens one of the remaining....leaving two closed doors: the one you pick and the unopened one you didn't pick. Then the host asks "want to switch your door for the one that's left." The right answer is....always to accept the switch.</comment>