Show HN: Download the first 10,002,378 HN comments/stories as one archive - <AUTHOR> Magnet link: magnet:?xt=urn:btih:44c65b5779d9d8021e002584fa73740f36d052a6&dn=10m_hn_comments_sorted
Go to https://hn-archive.appspot.com/ for the torrent file / source code.
I'll be semi-frequently checking the story and answering any questions which may come up. <comment><USER2> Somehow I can never turn down a data dump, despite never having done much with one.

Some day!

</comment><comment><USER3> Thank you for this! I'm training word2vec on it right now - will take several hours.

If anyone else is interested here is the (terrible) code to get it into a prototype format. [https://gist.github.com/binarymax/d3691180e65ff7f0dec5](https://gist.github.com/binarymax/d3691180e65ff7f0dec5)

<comment><USER4> Keep us posted on your discoveries. It would be interesting to see how different the embedding is to word2vec trained on a different corpus. I imagine borrowed words like "python" are clustered with programming languages rather than snakes in this case.

As a side note, not really having looked too deeply into word2vec, does word2vec capture multiple meanings? If so, how?

<comment><USER3> All done, results are very promising! Examples are too long so here is one below, and this gist has more: [https://gist.github.com/binarymax/6befa448df3f5fd6dba9](https://gist.github.com/binarymax/6befa448df3f5fd6dba9)

            Starting training using file 10m.txt
            Vocab size: 305432
            Words in train file: 565170189
            Alpha: 0.000045  Progress: 99.91%  Words/thread/sec: 107.57k
            real   174m19.955s
            user   1315m35.661s
            sys    3m27.011s

Enter word or sentence (EXIT to break): startup

            Word: startup  Position in vocabulary: 390

                                                          Word       Cosine distance
            </comment></comment></comment><comment></comment><comment></comment><comment></comment><comment></comment><comment></comment><comment></comment><comment></comment><comment></comment><comment></comment><comment></comment><comment></comment><comment>
                                                      startups      0.808231
                                                  bootstrapped      0.719379
                                                  entrepreneur      0.707722
                                                        starup      0.698379
                                                 bootstrapping      0.698216
                                                     incubator      0.683647
                                                      founders      0.664983
                                                       scrappy      0.660502
                                                 entrepreneurs      0.660176
                                               entrepreneurial      0.656120
                                                            yc      0.652160
                                                     cofounder      0.651848
                                                            vc      0.650642
                                                     fledgling      0.636813
                                                    cofounders      0.632761
                                                       venture      0.622636
                                                       company      0.617562
                                                    incubators      0.612947
                                                        statup      0.608451
                                                       founder      0.608080
                                              entrepreneurship      0.604812
                                                            sv      0.603689
                                                         bigco      0.602171
                                                   startuppers      0.592669
                                                     cofounded      0.588964
                                                  entrepeneurs      0.585747
                                                          solo      0.582533
                                                 entreprenuers      0.564045
                                                   boostrapped      0.562884
                                                  solopreneurs      0.559994
                                                    cofounding      0.559840
                                                       statups      0.558347
                                                      business      0.552922
                                                  bootstrapper      0.551885
                                                     techstars      0.545766
                                                 bootstrappers      0.545263
                                                       fintech      0.545090
                                                      fundable      0.542542
                                                       shotput      0.541257
                                                   accelerator      0.540787

</comment><comment><USER5> [https://hn-archive.appspot.com/](https://hn-archive.appspot.com/)

Clickable

<comment><AUTHOR> Thank you.

</comment></comment><comment><USER6> Someone should map the use of tech buzzwords over the years. Would be pretty funny to look at.

<comment><USER7> This could be a good starting point: [http://dclure.org/essays/visualizing- the-humanist/](http://dclure.org/essays/visualizing-the-humanist/)

</comment></comment><comment><USER8> I wish it included upvotes/downvotes. Why are those secret? It would be fun to work on ranking algorithms, and any inc effective requires knowing who is doing the up/down voting.

</comment><comment><USER9> > 10,002,378

what date range does this correspond to? How big is the archive?

<comment><AUTHOR> It is from story 1 to comment/story 10,002,378 :-)

The archive is 1.12GB big and contains 1 JSON document / per line. The JSON document is approximately the format returned by the official HN API (although there are some exceptions since some of the comments are not available through the official API and those had to be retrieved through the Algolia API and/or scraped from the site).

<comment><USER9> Thx. Great job. Now I just have to dust off some LDA code and see some topics...

</comment></comment></comment><comment><USER10> Does this include [dead] comments?

<comment><AUTHOR> Yes, dead comments were fetched / scraped from the website (so it might not be perfect since it uses regex to parse HTML :p).

</comment></comment><comment><USER11> Which pieces of data are included with each comment/link?

<comment><USER12> [https://github.com/HackerNews/API#items](https://github.com/HackerNews/API#items)

Also the file is ~5.3GB when decompressed, if anyone is wondering.

</comment></comment><comment><USER13> What license applies to the archive? Creative commons?

</comment><comment><USER14> meta data request: can someone scrape the tracker and provide a log of the all the IPs that participated in the swarm?</comment>


Learning Game of Life with a Convolutional Neural Network - <AUTHOR> http://danielrapp.github.io/cnn-gol/ <comment><USER2> This is the perfect place to quote one of the hacker koans:

In the days when Sussman was a novice, Minsky once came to him as he sat hacking at the PDP-6.

"What are you doing?", asked Minsky.

"I am training a randomly wired neural net to play Tic-Tac-Toe" Sussman replied.

"Why is the net wired randomly?", asked Minsky.

"I do not want it to have any preconceptions of how to play", Sussman said.

Minsky then shut his eyes.

"Why do you close your eyes?", Sussman asked his teacher.

"So that the room will be empty."

At that moment, Sussman was enlightened.

<comment><USER3> If you don't understand this (like me), see [https://en.wikipedia.org/wiki/Hacker_koan#Uncarved_block](https://en.wikipedia.org/wiki/Hacker_koan#Uncarved_block) for an explanation.

According to that link, it's based on a true story:

      So Sussman began working on a program. Not long after,
      this odd-looking bald guy came over. Sussman figured the
      guy was going to boot him out, but instead the man sat
      down, asking, "Hey, what are you doing?" Sussman talked
      over his program with the man, Marvin Minsky. At one point
      in the discussion, Sussman told Minsky that he was using a
      certain randomizing technique in his program because he
      didn't want the machine to have any preconceived notions.

      Minsky said, "Well, it has them, it's just that you don't
      know what they are." It was the most profound thing Gerry
      Sussman had ever heard. And Minsky continued, telling him
      that the world is built a certain way, and the most
      important thing we can do with the world is avoid
      randomness, and figure out ways by which things can be
      planned. Wisdom like this has its effect on
      seventeen-year-old freshmen, and from then on Sussman was
      hooked.

</comment></comment><comment><USER4> Neat example! I had not run across convnet.js before, so thanks. Karpathy was I believe one of Hinton's students. I looked over my archived courses last night and saved all of Hinton's videos and viewgraphs from his coursera class in 2012. Really good stuff, and it is a real shame that COursera does not continually re-run that course on auto-pilot (I am sure that Hinton and his students are too busy to participate in the forums but the videos, auto- generated homework, and the quizes would stand on their own without TA intervention.)

Convolutional networks, deep learning, and machine learning in general are arguably the most disruptive technologies in our lifetimes. BTW, pardon the shameless plug, but I just started a new blog this morning to host ML resources and my own experiments: [http://blog.cognition.tech/?view=classic](http://blog.cognition.tech/?view=classic)

<comment><USER5> That course was fantastic. Work prevented me from doing the assignments, but I've also archived the materials.

</comment></comment><comment><USER6> Cool, but convo nets are not the right tool though. Neural networks have an implicit smoothness and locality prior (which is what back propagation exploits) which this game does not really posses. Decision trees (e.g. random forests), are able to deal with sharp discontinuities better and would be more appropriate. I would expect less training, and perfect results.

<comment><USER7> I agree decision trees are more natural here, but even they are overkill, I think: all that needs to be learned is a function from the 8 neighbors to the center, which means from 8 bits to 2 bits, or in other words, there are just 256 values to be learned.

Literally any reasonable learning algorithm, even nearest neighbor, will learn that fairly quickly. The article had to use millions of samples, which is extremely excessive - a more efficient algorithm should only require thousands.

What might be interesting could be to see whether the neural network learns the underlying rule, that placement does not matter, only the sum matters, and that the crucial value is "3". That would be cool to see.

<comment><USER8> _... there are just 256 values to be learned_

This is a very good point and it's the reason why I don't find much value in GAs. There is an inherent conflict between "an algorithm for a specific problem" (which can be optimized to run in a short time - the above problem can be reduced to a lookup in a 256 x 2 bit matrix and thus run in O(1)) and "an algorithm for any problem (in a class)" which, while theoretically capable of finding a solution, is prohibitive in time and/or space.

As far as I can tell, GAs are barely any better than a random walk and thus not useful for any non-trivial problems. I am not yet sure if NNs are in the same category, though I suspect they are.

</comment></comment></comment><comment><USER9> Convolution is a comonad. [http://kukuruku.co/hub/haskell/cellular-automata- using-comon...](http://kukuruku.co/hub/haskell/cellular-automata-using- comonads)

I love it when there's a nugget of rigor behind things like this that can be pulled out and applied elsewhere!

</comment><comment><USER10> I guess it works for a few specific cases you mentioned, but the example animation at the end diverges after twelve steps[1]

[1] [http://imgur.com/a/gcUCH](http://imgur.com/a/gcUCH)

<comment><USER11> It does seem like it wasn't trained in the most optimal fashion.

\- The conv layer has only 20 relu units, I'm not sure if that suffices to memorize the rules. The net might be "underfitting" the rule set, and therefore making mistakes in rare pixel arrangements.

\- More worryingly it's also strange that the author uses a fully connected layer right after the conv layer (this is implicitly added in ConvNetJS when you specify a loss layer). This means that the output neurons are a function of the entire preceding CONV layer activations everywhere, while the game of life rules are local. The way to do this would be to instead use a 1x1 CONV layer with 2 neurons on top of the first 3x3 CONV layer, and interpret it as computing the class scores at every spatial position. However, in this case you'd want to apply the loss on every spatial position, and this "fully- convolutional" loss use case is not supported out of the box in ConvNetJS, but could be written.

\- However, with a fully-convolutional loss zero-padding of 1 used around the borders might cause trouble. Normally this is okay with images, but here this might cause trouble because the neurons all share parameters spatially (and hence compute the same function) and don't "know" if they are at the border on in the middle of the image. I'm not sure how how this game of life handles boundary conditions, but if borders obey different dynamics then you'd want to distinguish the border pixels with a special "border" feature vector at the input. E.g. each pixel is a 3-vector, with a 1-hot encoding for (border, positive pixel, negative pixel).

\- And it's also strange that the author uses "regression" loss for some that is a binary classification problem.

So, nice attempt but several funny choices, and clear why it didn't fully work :)

<comment><USER5> Comments like this, and Hinton's Coursera course remind me that there's a whole "Black Art" to training these systems.

Do you think a similar approach could be used to learn to generalize Navier- Stokes by looking at fluid flows?

<comment><USER12> It's not any more of a black art than programming is. There's no magic to it, you just have to know what you're doing. Also, you should use some kind of scheme (like bayesian optimization) to optimize the hyperparameters of many experimental models. That's the best way to make sure you're getting the best results (but of course takes a while, so you do have to be selective about _which_ parameters you optimize or what combinations you allow).

And I'll also aknowledge that "programming" is a vastly more mature field than "deep learning" or even "machine learning". So it's fair to argue that there's much we don't know, but there's more and more we do.</comment></comment></comment></comment>


You can now be identified by your 'brainprint' with 100% accuracy - <AUTHOR> http://www.kurzweilai.net/you-can-now-be-identified-by-your-brainprint-with-100-accuracy <comment><USER2> In the experiment, they used only 50 subjects and they were able to distinguish between all of them. For me, it's not clear that the "100%" will be maintained when they use a larger group.

Also, in the previous experiment they used 32 subjects and got a "97%". I'm not sure what that means, but I guess it's 31/32\. So perhaps they reduced the error rate or perhaps they were lucky and didn't get the problematic subject / collision.

<comment><USER3> For the earlier experiment, subjects were presented with words, not images. This is (ostensibly) what lowered the error rate.

I agree it is hard to tell if this result will be consistent with a larger sample pool.

</comment></comment><comment><USER4> I think this has been mentioned before on HN. Finger prints, retina scans, brain scans are not passwords, they're userid's.

If the scanner could read a password out of my head then it would be a password. But merely knowing it's my brain isn't good enough (for secure transactions at least).

<comment><USER5> Yup, you just nailed it. Here is the best writing on just that I've found (and have shared before on HN):

[http://blog.dustinkirkland.com/2013/10/fingerprints-are- user...](http://blog.dustinkirkland.com/2013/10/fingerprints-are-user-names- not.html)

Biometric data makes for great usernames, but not so much for a password. How do you "reset" your brainwaves? The wishy-washy part of TFA on that made me question the entire premise.

<comment><USER6> That's not a complete complaint. If the password were your brainwaves, why would you still need to reset it? Did someone else steal your brain and you need to make sure they no longer have access?

<comment><USER7> > Did someone else steal your brain and you need to make sure they no longer > have access?

Password databases get compromised all the time; so would a "brainprint" database. You can change a password.

<comment> Lx1oG-AWb6h_ZG0 That's what one-way hash functions are for. You never store the raw fingerprint data, just its unique salted hash so the data cannot be reused elsewhere.

<comment><USER8> That's the same reasoning for text passwords, yet there are huge password dumps every year.

It only takes one place where security standards aren't implemented properly to have your print leaked forever.

Never mind a malicious user managing to alter the code to leak the print before it's hashed.

Or even someone physically accosting you and retrieving a brain scan. They could do the same thing and force you to give up a password, but at least the password you can change later on.

<comment><USER7> > Or even someone physically accosting you and retrieving a brain scan. They > could do the same thing and force you to give up a password, but at least > the password you can change later on.

For that matter, a password is always your choice to reveal or not, taking the cost and alternative into account. Biometric information isn't.

</comment></comment></comment></comment></comment></comment></comment><comment><USER9> > Will it still work when I'm drunk?

Not working when drunk a potentially useful feature in some areas.

<comment><USER10> It would probably be better if it still works, but is able to read your state ie figure out whether you are drunk or not.

</comment></comment><comment><USER11> Well, people change over time. Not to mention trauma. Things could happen that change these "brain signatures". This experiment is really lacking seriousness.

<comment> rm_-rf_slash What happens when you take LSD and suddenly all of your brainscan passwords fail?

I mean, hell, how can it differentiate between sober and drunk? Or high? Or even sleep deprived?

<comment><USER11> Also mood swings, being sexually aroused, etc.

<comment> rm_-rf_slash I guess in that case I would appreciate a cortisol bomb preventing me from cashing out at an ATM at gunpoint.

</comment></comment></comment></comment><comment><USER12> I wonder if this is like rfid chips that were only supposed to work up to a couple feet away but special equipment can now read them far away.

TSA doing brainprint scans someday _shudder_

<comment><USER13> "Stand still and think of the worst experience of your life. Thank you, next!"

</comment></comment><comment><USER14> the cool thing about stuff like this (I am familiar with a few different efforts along this vein) is that you can combine something you are with something you know. the downside of fingerprints and retinas is they can be passively recorded and replayed, but with the brain, you could build an authenticator that only works when the user is cooperating with the authentication scheme, and, recording and replaying the electrical signal from the brain won't spoof the authenticator.

until you really refine the task down to take a few seconds and you have dry cap electrodes, it's still untenable, but progress has been made on the latter.

</comment><comment><USER15> > _" It's only a three-point difference, but going from 97 to 100 percent > [accuracy] makes possible..."_

For some reason, this made me extremely annoyed. In terms of uncertainty, this is the largest chasm in the world.

</comment><comment><USER16> Well, It's not like we are gonna wear an EEG 24/7 just to unlock our smartphone or pass security at work...

I think that we can build a device that can capture a brainwave et replay it.

<comment><USER17> > I think that we can build a device that can capture a brainwave et replay > it.

I want such a device that can play back into my own brain.

<comment><USER18> I see a huge market here for replaying orgasms.

</comment></comment></comment><comment><USER19> Need to conceal your identity? Take some LSD before going to the airport.

</comment><comment><USER20> TL;DR

It's NOT 100% accurate</comment>


BlackRock's Message: Contribute to Society, or Risk Losing Our Support - <AUTHOR> https://mobile.nytimes.com/2018/01/15/business/dealbook/blackrock-laurence-fink-letter.html <comment><USER2> Blackrock's attempt to distract public and political attention from the fact that they control such a vast amount of capital. Good PR. Won't achieve anything but good PR.

</comment><comment><USER3> Sounds like I'll be divesting myself from any BlackRock investments. I invest to make money, not for some "social justice" platform which usually is justice only for the chosen. Plus the focus on the "climate", a non-science based position is dumb.

</comment><comment><USER4> Where Black Rock and others could really big positive impact is enforcing the good corporate governance practices. I know that asset managers like Black Rock have showed some initiative, but they surely could use much heavier hand.

<comment><USER5> My understanding is that this - is - the heavy hand, right?

</comment></comment><comment><USER6> dupe: [https://news.ycombinator.com/item?id=16156145](https://news.ycombinator.com/item?id=16156145)

</comment><comment><USER7> But are they not themselves part of the problem they decry?

</comment><comment><USER8> Damn commies!</comment>


5 Exciting Things to Look Forward to in HTML 5 - <AUTHOR> http://www.readwriteweb.com/archives/5_exciting_things_in_html_5.php

<comment><USER2> Practically speaking, I wonder how long custom tags will remain as flexible as they appear in the spec. It won't take long for search engines to decide their preferred tags, how they're weighted and how they relate. Then our tag schema will pretty much have to follow suit to rank well. It'll be like the rel naming conventions, only on a larger scale.

</comment><comment><USER3> I really like the custom tag names rather than constantly doing <div id="something">.

</comment><comment><USER4> Will the video tag work with any video format across browsers? be limited?

<comment><USER5> Firefox and Opera are both backed Ogg Theora [1] [2]. WebKit (Safari and, I guess?, Chrome) looks like it has QuickTime formats with more being supported down the road [3]. (These are all pretty old articles I remember from the top of my head. I'd predict that the body of video formats will probably stabilize soon with Theora winning.)

[1]: [http://www.bluishcoder.co.nz/2007/05/support-for-html- video-...](http://www.bluishcoder.co.nz/2007/05/support-for-html-video- element-in.html)

[2]: [http://dev.opera.com/articles/view/a-call-for-video-on- the-w...](http://dev.opera.com/articles/view/a-call-for-video-on-the-web- opera-vid/)

[3]: <http://webkit.org/blog/140/html5-media-support/>

</comment></comment><comment><USER6> <canvas> is already here and supported by all major browsers. Except IE, of course.

<comment><USER7> But they are adding text support to <canvas>, and for that I celebrate. I look forward to not drawing my graph labels with the Hershey vector fonts.

</comment></comment><comment><USER8> contentEditable and designMode is nothing new.</comment>


Cut and paste your surroundings using AR - <AUTHOR> https://github.com/cyrildiagne/ar-cutpaste <comment><USER2> Well it's COPY and paste, still it's very cool

<comment><USER3> Yes... for the sake of reality, I hope it's copy and paste.

<comment><USER4> Would also be cool to be able to cut items out of the augmented reality, though that's a whole different ability. Removing them from actual reality may indeed be difficult in some cases.

</comment></comment></comment><comment><AUTHOR> video demo: [https://twitter.com/cyrildiagne/status/1256916982764646402](https://twitter.com/cyrildiagne/status/1256916982764646402)

<comment><USER5> Does anyone know a good way to link to Twitter videos directly? They deliberately obfuscate this option and their "Copy video address" is deliberately broken.

<comment><USER6> You can take that "copy video URL" and paste it into streamable.com, which will download it and re-host it for you.

</comment></comment></comment><comment><USER7> Amazon is essentially the closest thing to the inverse of this app, where I view a picture of something I want online and "paste" it into my room

</comment><comment><USER8> Awesome application of cutting edge research (a CVPR '19 paper).

<comment><USER9> Can you point out which paper that you are referencing to?

<comment><USER10> Presumably this, which is linked as a reference in the github OP:

[http://openaccess.thecvf.com/content_CVPR_2019/html/Qin_BASN...](http://openaccess.thecvf.com/content_CVPR_2019/html/Qin_BASNet_Boundary- Aware_Salient_Object_Detection_CVPR_2019_paper.html)

</comment></comment></comment><comment><USER11> This is really cool, but it also feels to me like doing this implies a level of technology that skipped an important step. Why aren't there cheap 3D scanners that can just make a point cloud with multiple cameras and spit out a blender model? That would be so incredibly useful for game devs.

Maybe that's naive of me. But I'm not sure why.

<comment><USER12> There are tons of 3d scanners, including ones that can live on your phone (I think Autodesk made one), up to professional grade ones with a turntable and cameras. They spit out an STL that can be imported into Blender and used for whatever purpose you like.

I think practically this sort of thing is not that useful -- it's easier to iterate on 3d models in a 3d editor (especially since for animation purposes you need to have a parameterized model) rather than trying to get something from a real object.

<comment><USER13> Out of curiosity, are scanned models less efficient to display than hand- crafted ones?

</comment></comment></comment><comment><USER14> I was skeptical when clicking on the link, but this is a very nice idea, almost feels like a natural way of using a smartphone.

</comment><comment><USER10> I really like this, it looks cool so will garner wider interest in the techniques which will likely be positive.

I wonder how well it performs when not copying from minimalist background environments - probably not so great, but this is still an excellent demo.

</comment><comment><USER15> This is amazing.

I'm curious how well it works if I have a wood desk or a wallpapered wall.

</comment><comment> sid- Wow ! Amazing concept and execution...loved it.

</comment><comment><USER16> Would be cool to go the other way too

<comment><USER5> Most components are already here: you can have a rough 3D scan of a real-world object using your smartphone. The conversion to 3D-printable format can be automated, although the final result could be funny, and I don't think coloring can be implemented easily.

<comment><USER16> Making real objects would be super cool but I was originally thinking just automatically grabbing stuff off of images and putting them in ar which I imagine is much easier

</comment></comment></comment><comment><USER17> This is some real cool stuff with so many possible applications. Great job!

</comment><comment><USER18> Neat example of using phone to copy and paste. Looks promising.

</comment><comment><USER19> Hesitant to call it AR, but super cool nonetheless.

<comment><USER20> Augmented Reality. Adding copy/paste as a feature to reality definitely falls under that banner.

</comment></comment><comment><USER21> This is awesome!

</comment><comment><USER22> Amazing!</comment>


Cambodias 2nd-richest man donates 98% of his fortune to the poor in his hometown - <AUTHOR> http://timesofcambodia.com/cambodias-second-richest-man-donates-98-fortune-poor-residents-hometown/ <comment><AUTHOR> Each villager will receive US$500,000, or 500 times the average annual wage

</comment><comment><USER2> This is inspiring; thank you for sharing.</comment>


Payola – A Rails engine for Stripe - <AUTHOR> http://www.petekeen.net/introducing-payola <comment><USER2> Congrats, Pete! You literally wrote the book on Stripe integrations and it's awesome seeing you embrace open source as a way of sharing your knowledge. I _love_ how well thought through everything you've done is. I can't wait to see what you do with subscriptions!

As the author of the Koudoku gem[1] that Pete mentions, I'd encourage people familiar with it to keep a close eye on Payola as well. Given Pete's technical excellence, great implementation choices, and broad experience with different types of Stripe integrations (my primary interest has been SaaS products,) Payola could very well supersede Koudoku when he tackles the subscription side of things.

[1] [http://github.com/andrewculver/koudoku](http://github.com/andrewculver/koudoku)

<comment><USER3> As a minor contributor to the Koudoku gem, I have to say that the structure and especially the test coverage of payola are amazing. Well done, Pete! Looking forward to how you integrate subscriptions into this

</comment></comment><comment><USER4> Seems like this is a little bit cleaner than using stripe-ruby + stripe_event + checkout.js. I've never tried stripe-rails.

I get the idea behind making this code async. I've never experienced slowness with Stripe's API, but I'm sure it happens!

One of the pain points for me is keeping all of my Stripe data in sync with my AR models.

Would would be helpful for me would be a generator for a set of ActiveRecord models representing all the stripe data, and have all the webhooks populate those tables(and maybe rake tasks as well to initialize things).

</comment><comment><USER5> This looks great--thank you!

Does anyone use ActiveMerchant? I looked at it several years ago and it seemed to be just a mess: scanty documentation, hard to install/set up, lots of bugs. So I've always gone with rolling my own payment code (usually Stripe, sometimes PayPal), and it'd be nice to stop that, one way or another. It seems like ActiveMerchant will be Payola's main competitor.

<comment><USER6> ActiveMerchant's entire purpose is about abstracting all the different payment gateways into one API. If you know for sure you're going to use Stripe, or if you want to use Stripe specific features (of which there are quite a lot worth using) ActiveMerchant is less valuable to you.

It's also worth noting that ActiveMerchant hails from a time long before Stripe or even Braintree, and so it supports gateways that are quite a bit more complex. (disclosure: I wrote the ActiveMerchant Stripe support).

<comment><USER5> Yes. Now that I look over the ActiveMerchant docs again, I have a few observations/questions:

\- With AM, you have to accept the credit card details (even if you don't store them), and then send them on the the payment gateway. Even with AM's Stripe implementation, it's your Rails app sending the info to Stripe. There is no Javascript sending the details straight from the user's browser. (Or am I mistaken about that?) So you have a higher PCI burden than if you used Stripe in the normal way.

\- AM doesn't provide any persistence, just an API to the payment gateway, so you would still have to roll you own tables/models for payment success/failure.

\- I don't see support in AM for subscriptions.

Looking at AM again now, perhaps my previous comment was too harsh, although that's how I remember it when I checked it out long ago. Even now, I'm tempted to say that Payola's landing page _already_ has better documentation than AM.

<comment><USER7> ActiveMerchant is just an abstraction layer around various gateways. It's goal was never to provide a full-stack solution, but to simply making working with numerous gateways easier because you have a common interface for working between all of them.

As for subscriptions, that's a feature that could be added but many of the Gateways that ActiveMerchant supports don't have subscriptions baked into them (compared to say Stripe).

You could of course have your application store the credit card information and manage the charges yourself using ActiveMerchant, but that opens a bunch of PCI compliance and such.

If you just need to accept money and aren't already bound to a specific merchant account, then plain ole Stripe or Payola are a better option.

</comment></comment></comment></comment><comment><USER8> The main thing preventing me from using stripe directly in my applications is that it does not calculate sales taxes. The added complexity to do so makes it complex to integrate.

That aside, thanks for the book, I am buying it as I am sure that the advice will be relevant for the payment platform I will use (hesitating betweek Chargify and Recurly right now).

</comment><comment><USER9> I look forward to when the gem will be updated with the possibility for subscriptions.

<comment><USER10> Was just about to say the same. Commenting here so I don't forget.

</comment></comment><comment><USER11> Can't speak to the code, but the name seems unforunate:

[http://en.wikipedia.org/wiki/Payola](http://en.wikipedia.org/wiki/Payola)

<comment><AUTHOR> It's money related and customers are never going to see it so I thought it worked well. If people think it's offensive I'll think about changing it.

<comment><USER12> There's a food product named Soylent... So I wouldn't worry about it too much.

<comment><USER13> That's a poor choice of name, too.

</comment></comment></comment></comment><comment><USER14> Awesome! I'm about a month away from adding Stripe into my app.

Thanks for the work on this.

</comment><comment><USER15> This seems pretty great: like an open source Gumroad or Cargo service.

</comment><comment><USER16> Love that this gem does things the right way, like including background jobs. As a Rails newbie trying to build billing, all the code/tutorials/gems I could find weren't nearly this high quality or robust.

<comment><USER17> He wrote the book on payments with stripe. Which also happens to be a high quality book and worthy of a purchase.

</comment></comment><comment><USER18> So, is this only needed if you want to do asynchronous processing with Stripe? I vaguely recall integration with Stripe was really simple probably because it was synchronous.

<comment><AUTHOR> A basic Stripe integration is pretty simple, but to do anything more advanced you end up writing a lot of boilerplate code. Payola (and the other projects mentioned in the post) attempt to simplify and eliminate the boilerplate that you'd otherwise have to write.

</comment></comment><comment><USER19> Like many others, I've read Pete's book, and it's very good.

</comment><comment><USER20> Does anyone know of something similar for Paypal?

<comment><AUTHOR> Right now things are Stripe-specific for expediency, but there's no reason why Payola couldn't be extended to multiple payment providers, as long as they provide the same basic capabilities.

<comment><USER16> This would be nice because it's always a good idea to have a fallback payment processor.</comment></comment></comment>


Polytope Model - <AUTHOR> https://en.wikipedia.org/wiki/Polytope_model <comment><USER3> See also: [https://polyhedral.info](https://polyhedral.info)

The ideas here go back a long way. As mentioned on Wikipedia, the Polly project for LLVM uses this approach.

There is also work for MLIR to use the polyhedral model ([https://github.com/tensorflow/mlir/blob/master/g3doc/Rationa...](https://github.com/tensorflow/mlir/blob/master/g3doc/RationaleSimplifiedPolyhedralForm.md)).

<comment><USER4> This is really cool and good to know about. I hadn't heard of this technique before, but have caught some interest in SPIRV lately while learning about WebGPU. Well I just noticed that Polly is used in the LLVM SPIRV backend... Makes sense! [https://github.com/KhronosGroup/LLVM-SPIRV- Backend/blob/mast...](https://github.com/KhronosGroup/LLVM-SPIRV- Backend/blob/master/polly/lib/Analysis/PolyhedralInfo.cpp)

I'm very excited about the potential for writing GPU code from whatever high level language is convenient. (Which will not be WSL, by the way).

<comment><USER5> It would be news to me that the PolyhedralInfo interface is actually used anywhere. As the file comment says, this was "work in progress" a few years ago and it shares the same drawbacks as Polly (unfortunately).

Polyhedral development in LLVM stagnated a while ago, maybe we find the people and time to actually land the PolyhedralValueInfo (see for example this talk: [https://www.youtube.com/watch?v=xSA0XLYJ-G0](https://www.youtube.com/watch?v=xSA0XLYJ-G0)).

<comment><USER6> Albert Cohen from Google gave a really good lecture on polyhedral compilation in the real world at PLISS [1] this year: slides [2], lecture videos [3, 4].

A core problem of the polyhedral approach, is that the thing that makes it so appealing (it being expressive enough to enable the many interesting program transformations), is costly for large programs making, the overall optimisation process and hence the compiler hard to scale. Naturally, this difficulty makes for interesting research problems.

[1] [https://pliss.org/](https://pliss.org/)

[2] [https://pliss2019.github.io/albert_cohen_slides.pdf](https://pliss2019.github.io/albert_cohen_slides.pdf)

[3] [https://www.youtube.com/watch?v=mt6pIpt5Wk0](https://www.youtube.com/watch?v=mt6pIpt5Wk0)

[4] [https://www.youtube.com/watch?v=3TNT5rFVTUY](https://www.youtube.com/watch?v=3TNT5rFVTUY)

</comment></comment></comment></comment><comment><USER7> > _no iteration of the inner loop depends on the previous iteration 's > results_

> _a[i - j][j] = ... + a[i - j][j - 1]_

Not seeing how the iteration for _j_ doesn't depend on the result for _j - <USER2> if it's invoked right there in the expression.

<comment><USER8> This is hard to grasp without a diagram. The detailed example is probably easier to understand.

The result computed in the current iteration is a[i - j][j]. The result computed in the iteration before that is a[i - (j - 1)][j - 1].

<comment><USER7> I guess the page would benefit from listing the entire thing in the replacement code, instead of just the inner line. Then non-mathematical people like me would maybe have a chance at getting it without ramping up caffeine dosage to dangerous levels, so as to see the missing parts in the fabric of mathematical possibilities.

</comment></comment></comment><comment><USER9> That's fun, a few years ago in one of my course our teacher explained this model to us. He then basically said to us « well we're like 50 to work on this in the whole world, so it's a really small community and everyone knows everyone » (as everywhere, I guess).

And, indeed, he is in the community page ( Christophe Alias )

</comment><comment><USER10> This might be the most interesting compiler optimization technique I've ever heard of.</comment>


Facebook taps lawyer who helped write Patriot Act as new general counsel - <AUTHOR> https://thehill.com/policy/technology/440085-facebook-taps-lawyer-who-helped-write-patriot-act <comment><USER2> To those unsure as to why this is particularly relevant: the Patriot Act is notable for drastically expanding the surveillance powers of the US government [1]. I wonder what this lawyer will do at Facebook?

[1] [https://www.aclu.org/issues/national-security/privacy-and- su...](https://www.aclu.org/issues/national-security/privacy-and- surveillance/surveillance-under-patriot-act)

<comment><USER3> It isn't relevant, though. The PATRIOT Act had pretty broad support. Just because she helped write it doesn't mean that she supports it more than other lawyers – just that she's a talented enough lawyer to be working on such major projects. It's the same as complaining about individual multi-millionaires who optimize their taxes.

<comment><USER4> > The PATRIOT Act had pretty broad support.

By whom? Congress, constitutional lawyers, or the people?

<comment><USER5> Sadly, both Congress and the people at the time [1][2]. It was full-on panic mode in response to 9/11\. I don't remember much about the constitutional lawyer side at the time. A couple years later the public started changing its mind [3], though Congress arguably still isn't even close.

[1] [https://www.govtrack.us/congress/votes/107-2001/s313](https://www.govtrack.us/congress/votes/107-2001/s313)

[2] [http://www.sheldensays.com/debating_the_usa_patriot_act.htm](http://www.sheldensays.com/debating_the_usa_patriot_act.htm)

[3] [https://news.gallup.com/poll/9205/public-little-concerned- ab...](https://news.gallup.com/poll/9205/public-little-concerned-about- patriot-act.aspx)

</comment></comment></comment></comment><comment><USER6> Any time I see arguments to effect of "lawyer X lawyered for Y, and Y is bad, so lawyer X is bad," I remember an episode from Star Trek: TNG called "The Measure of a Man," in which Picard is chosen to defend Data's right to self- determination as a sentient being, and Riker is chosen to make the opposite case for the character that wants to treat Data as a machine, a weapon that can be reallocated freely like a Jeep or a rifle. Riker struggles with this, but ends up giving the best case he can so the matter can be settled without any doubts. Doing a bad job on purpose leaves room for doubt and summary judgement, which is far from ideal.

I think the PATRIOT Act is complete bullshit, but I'm not going to hold a grudge against anyone that worked on it, only those who passed it and continue to vote to renew/strengthen it, who also refuse to listen to arguments against it.

<comment><USER7> This doesn't convince me, because 1) in the real world there are often major monetary asymmetries in law, meaning one team has access to much more lawyers' time 2) your example is mostly irrelevant since it's not like the lawyer was a defense attorney, she voluntarily wrote an oppressive law and then spent much of her time afterwards defending/upholding it.

If you read the article you see that not only did she write the law, the Bush administration gave her major credit for leading the patriot act project. How is that at all similar to playing devil's advocate?

<comment><USER8> There is also the argument that the PATRIOT Act was flawed not for its stated intent, but for the nuance (or lack thereof) of its implementation. And the designer of the bill is the one responsible for said nuance, especially considering that she designed it at a time when it would have been political suicide for many lawmakers to oppose it for its nuance. She could have taken the opportunity to create something in keeping with civil liberties, and instead she did quite the opposite.

Absent additional context, it is very reasonable to expect her to disregard civil liberties in the remainder of her career.

</comment></comment></comment><comment><USER9> "How can we possibly form a legal case that justifies mass surveillance?"

'I think I know just the guy...'

Edit: I was going to pre-emptively delete this as a joke/low-effort comment, but I think it's a tad useful in highlighting what Facebook "use case" this lawyer would be good for.

<comment><USER10> I don't see your comment as joke/low-effort in this context. Facebook has repeatedly shown itself to be so morally bankrupt that such "jokes" reflect reality, and aren't jokes anymore. With impending regulation that will attempt to control and/or break up Facebook, this move is yet another sign that the company has no soul left in it.

</comment></comment><comment><USER11> Facebook is the defense contractor that is building America's Great Firewall and social credit system, so it makes sense that there is a revolving door with the authoritarian regime.

<comment><USER12> I'm not familiar with either of those two projects. Perhaps the latter is the aggregation of numerous "good customer" scores, plus actual credit rating, plus the no-fly list. But I haven't heard about an actual program that implements a social credit score that FB is implementing.

<comment><USER11> Facebook's social graph and engagement data combined with data already obtained by governments makes an elaborate social credit score easy to generate.

As for the great firewall, Facebook has been in talks with lawmakers who want Facebook to do more to prevent "fake news" which is another way of saying that lawmakers want to use Facebook to control the news narrative.

So far, Facebook has been extremely complaint with both of these areas. This new hire is further evidence that Facebook plans to support user privacy only after offering the government plenty of reassurance that its interests and patriot act powers will not be adversely impacted.

I've been concerned/cynical about Facebook's stance on this stuff for a while, but this hire is really chilling. If anyone reading this hasn't read the Patriot Act, give it a read. It is shocking both in how stupid and technologically naive the wording is, as well as in its blatant disregard for the bill of rights. It's definitely the most shameful piece of legislation passed in my lifetime.

<comment><USER13> I'd say it's the media and general public that want Facebook to curb "fake news", more so than Washington.

<comment><USER11> See the tit for tat between Facebook and lawmakers:

[https://www.wsj.com/articles/mark-zuckerberg-facebook- made-m...](https://www.wsj.com/articles/mark-zuckerberg-facebook-made- mistakes-on-fake-news-privacy-1523289089)

Zuck is _losing on purpose_ here by admitting they screwed up, so that he can pivot into a negotiating stance to determine what level of control government will get. This is not all decided yet, it is still in play but this hire suggests that some progress was made in the negotiation.

</comment></comment></comment></comment></comment><comment><USER14> Someone tell these yahoos that optics is a thing.

I expect the next statement to be about transparency and connecting communities. Just like the last one. And the one before.

<comment><USER15> for facebook optics is not a thing.

they know they have a stranglehold on people addicted to their products, and advertisers who pay through the nose to sell things to those addicts.

Honestly, why bother with optics? No one's going to like the company ever again except their employees, but no business or politician or organization is going to not take facebook's call.

<comment><USER16> Why bother with optics? Well, for one thing, presumably they still need to recruit people once in a while (including people with lots and lots of options).

<comment><USER10> IMO, the kind of people who work for and who would join Facebook are the ones who're self-selected to not care about morals or the ill effects of their work on billions of people. So optics doesn't come into the equation for Facebook to recruit people. Those who do care about optics would never even dream of working at Facebook.

<comment><USER17> You're exaggerating. What are those ill effects exactly?

<comment><USER16> Consult the N apologies Zuckerberg has issued on things like privacy for some examples.

</comment></comment></comment></comment></comment></comment><comment><USER18> I dont consider Facebook inherently evil and even their more recents f-ups around user privacy and security I had attributed to incompetence of the employees (anyone working at a large co would know - this is all very common).

But when they hire people like this, I dont know how to excuse them anymore...

</comment><comment><USER19> Duplicate of [https://news.ycombinator.com/item?id=19725489](https://news.ycombinator.com/item?id=19725489) which was discussed yesterday?

<comment><USER20> Unfortunately that story was sinkholed by mods and this one too seems to be experiencing the same fate (it's dropping way faster than normal).

</comment></comment><comment><USER21> Tech people should get it out of their heads that the stewards of industry follow the same virtuous passions that got these techies into tech in the first place.

I became so disgusted by "leadership qualities" showcased in the past 3-4 years that I am now setting up multiple federated servers with all kinds of FANG-functionality replacements so that the new generation of techies is still allowed to dream about better world freely, instead of taking xyz-pill everyday, turning them into cynics.

</comment><comment><USER22> You'd think if nothing else their PR department would've caught this. These headlines just write themselves.

</comment><comment><USER23> OT: What a pathetically annoying case of autoplaying, non-dismissable, autoplaying video (mobile).

Completely destroys a decent story.

</comment><comment><USER24> I thought rats are meant to flee sinking ships rather than board them!

Sorry - could not resist the joke!

</comment><comment><USER25> Am I the only one who read this title and immediately thought of a wiretap?

</comment><comment><USER26> I for one don't let Facebook use me. This makes little difference to me.

<comment><USER27> Facebook probably has a lot of data on you regardless. Are you in any friends' address book? Do you use a loyalty card at the grocery store? Ever walk in a mall? Own a car? Pay property tax? Have a mailing address?

<comment><USER28> Futility is a terrible reason to stop fighting.

<comment><USER29> 100% but just not using Facebook is not a very effective strategy. And thinking that not using Facebook protects you from Facebook could be dangerous.

<comment><USER28> Legally, it does. If they use my information in a way that is not allowed, I am not required to use arbitration. I can sue. Users cannot.

<comment><USER30> Good luck with that.</comment></comment></comment></comment></comment></comment>


Pattern Matching with TypeScript - <AUTHOR> https://pattern-matching-with-typescript.alabor.me/ <comment><USER2> TC39 published its stage 0 proposal for pattern matching in ECMAScript a couple of days ago: [https://github.com/tc39/proposal-pattern- matching](https://github.com/tc39/proposal-pattern-matching)

</comment><comment><USER3> Pattern matching without support for algebraic datatypes really misses the point. What you want is to be able to declare all the shapes of your data, with descriptive names, and then be able to say definitely "these are the _only_ such shapes."

Pattern matching without exhaustiveness checking and algebraic datatypes is really just a disguise: syntax level changes when the issue is a semantic (i.e. language-level) problem.

<comment><USER4> > Pattern matching without support for algebraic datatypes really misses the > point.

That's really not true, Erlang has neither static types nor sum types (which I expect is what you mean by ADT rather than including product types) yet several of its construct (not least of which "assignment") make great use of pattern matching. Pattern matching is one of the most important tools in Erlang's toolbox.

> What you want is to be able to declare all the shapes of your data, with > descriptive names, and then be able to say definitely "these are the only > such shapes."

> Pattern matching without exhaustiveness checking and algebraic datatypes is > really just a disguise

Also not necessarily true, closed sum types are probably the best default but OCaml's polymorphic and extensible variants are genuinely great tools.

<comment><USER5> 'the point' that OP cares about is exhaustiveness. one can disagree of course; but without exhaustiveness what you really have is destructuring (this is not what OP cares about)- erlang is a fine example

<comment><USER6> Without exhaustiveness checking, you still get a more advanced typecase-like control flow construct, not just destructuring.

In practice (and non-trivial code), exhaustiveness checking plays much less of a role, especially if you already have an object-oriented language.

In basic OO languages, you get exhaustiveness through abstract methods AND get the ability to add subtypes to an existing sum type.

One advantage of pattern matching is that it's easier to add actions (instead of subtypes), a.k.a. the expression problem. But that's a modularity issue, has nothing to do with exhaustiveness, and can also go the other way (as pattern matching makes it hard to add new variants to an ADT in a modular fashion).

Another advantage is that pattern matching can be a poor person's tree parser, but for that, exhaustiveness doesn't buy you much, because ADT patterns also typically allow for patterns that aren't allowed by the underlying tree grammar, so you'll have an `_ -> assert false` fallback case often enough.

<comment><USER7> > But that's a modularity issue, has nothing to do with exhaustiveness, and > can also go the other way (as pattern matching makes it hard to add new > variants to an ADT in a modular fashion).

I would disagree on this point. With exhaustiveness checks you get at least errors in every place you match against a data type you just extended with a new variant. So your compiler can point you to the places you have to edit after adding new variants to your ADT. That's a helpful feature.

<comment><USER6> Note that I talked about doing it in a _modular fashion_. With an ADT, you have to rewrite every single pattern match in your code to support the new variant. (And you don't even get warnings if you have a general fallback case that matches everything.)

In an OO language, the equivalent to simple pattern matching would be to dispatch on an abstract method of a shared supertype. If you add a new type and forget to implement the abstract method, you get a compiler error. There's your exhaustiveness checking and it's entirely modular as you don't have to touch your original code.

As I said, that's one side of the expression problem. OO languages conversely have a problem (unless they support multiple dispatch or methods external to a class) when they have to add new actions. With ADTs, that's just a new function. With inheritance, you have to add a new method to every single class that implements a variant.

<comment><USER7> The expression problem has two sides, right. I don't advocated that pattern matching on ADTs is "the better" solution. Neither the OO approach is.

There isn't usually a 100% modular solution, because you want to stay flexible respectively in either dimension, to some extend. You have to chose between trade-off (as always).

That's way I like hybrid languages like Scala where I can actually make an informed choice whether it's more likely to add new variants or more functionality in the future. But when I have to do the thing I didn't anticipate in the first place I want help from the compiler to avoid errors. That's way an exhaustiveness checker for pattern matching is a very welcomed and neat feature.

<comment><USER6> > There isn't usually a 100% modular solution, because you want to stay > flexible respectively in either dimension, to some extend. You have to chose > between trade-off (as always).

There are actually language mechanisms that can get you both. multimethods, for example, or their ultimate generalization, predicate dispatch. Few languages support them, though, because they are overkill for most application domains (though there are some, such as computer algebra, where they can be very useful).

Note also that while many OO languages constrain you in having methods only occur within a class definition, this is not a requirement. Multimethods invariably need to be more flexible (because there's no privileged "self" object), but the multimethod approach can also be applied to single dispatch. See also partial classes and related techniques.

Also, ADTs in their basic form are still a very specialized, limited form of sum types. Even if you want sum types, better extensibility is often needed (though ADTs remain a very useful special case), as well as the ability to actually describe subtypes of a sum type.

See how OCaml ended up with having polymorphic variants and extensible variant types and Scala with case classes, for example.

<comment><USER5> it is well known the expression problem is trivial in dynamic (untyped) languages—however, static type safety is a requirement of the problem definition of the expression problem.

<comment><USER6> I didn't mention dynamic typing anywhere?

<comment><USER5> no, but multi-methods are 99% of the time found in dynamic languages, right?

<comment><USER6> 1\. Multimethods simply are a rare feature in general.

2\. Multiple dispatch and static typing are completely orthogonal features.

3\. Strictly speaking, you don't even need multiple dispatch. The key feature of multimethods that you need is the ability to add a method outside the class body.

<comment><USER5> under definition 3 then extension methods are also multi-methods - doesn't seem right. even c# has extension methods

<comment><USER6> Extension methods do not support dynamic dispatch and hence are not proper instance methods. Try MultiJava's open classes for an approach that works.

</comment></comment></comment></comment></comment></comment></comment></comment></comment></comment></comment></comment></comment></comment><comment><USER8> Well, that was disappointing. I thought we left this kind of over-abstracted code behind with Java. A simple one-level switch on typeof or instanceof really does not deserve to be called "pattern matching". Given that TypeScript supports tagged union types it would make far more sense to actually use them and stop using instanceof all together.

If are we going to do this kind of thing why not a least do it simply:

        switch(typeof x) {
          case "string":

or

        switch(x.constructor)
          case Thing:

Ok, so TypeScript can't handle the types for this yet but it's valid JS so you get the idea.

<comment><USER4> > If are we going to do this kind of thing why not a least do it simply:

I expect it's because actual type-switching allows the compiler to type-assert at the same time. So it knows what within the String branch the value is an actual string. Whereas typeof() is severely limited (only primitive types) and switching on an arbitrary property tells pretty much nothing to the compiler.

<comment><USER8> Yes, that's the current state of things. But support for control-flow typing of my above two examples seems like an easy addition to the TypeScript compiler - if that's what you want. Personally I'd like to see JS support for proper pattern matching, i.e. TC39, then TypeScript can build on that.

<comment><USER4> > But support for control-flow typing of my above two examples seems like an > easy addition to the TypeScript compiler - if that's what you want.

The first one is not useful and the second one is nonsensical (as there is no guarantee that there's any relation between #constructor and the type of the variable)

</comment></comment></comment></comment><comment><USER9> The original code with the switch statement is by far the easiest to read, as well as being by far the fastest and most concise to write and (though it's unlikely to matter) by several orders of magnitude the fastest to run as well.

The proper way to pattern match on types in JavaScript (and therefore TypeScript) is to first of all _not_ if you can avoid it, but failing that a simple if-else chain checking `typeof(arg) === "primitiveType"` and `arg instanceof ReferenceType`, with ample use of the `debugger` statement to ensure inputs have the types and map to the branches you're expecting them to.

TypeScript is great for adding type safety and better self-documenting qualities to a JS codebase. But attempting to preserve the semantics of its "imaginary" extensions to the JS type system (interfaces, generics) at runtime is a recipe for bugs, severe confusion and reams of pointless boilerplate.

</comment><comment><USER10> It would be nice to be able to use the annotations directly, we support this in flow-runtime[0] but I think it would be fairly straightforward to support in TypeScript too,

It looks like this:

        import t from 'flow-runtime';

        const makeUpperCase = t.pattern(
          (input: string) => input.toUpperCase(),
          (input: number) => input
        );

        console.log(makeUpperCase("foo bar"));
        console.log(makeUpperCase(123));
        console.log(makeUpperCase(false)); // throws

[0] [https://codemix.github.io/flow-runtime/#/docs/pattern- matchi...](https://codemix.github.io/flow-runtime/#/docs/pattern-matching)

<comment><USER11> Shouldn't the uppercase of a number be a string?

        const makeUpperCase = t.pattern(
          (input: string) => input.toUpperCase(),
          (input: number) => '' + input
        );

Otherwise you get odd behaviours like:

        makeUpperCase('1') + makeUpperCase('1') = '11' (probably what you want)
        makeUpperCase(1) + makeUpperCase(1) = 2 (probably not what you want)

<comment><USER12> ...wait. Why would the uppercase of '1' be '11'? It would just be '1'.

<comment><USER13> I had to reread it a few times to parse it. Its result of "adding" the uppercase of 1 that should be 11, not the uppercase itself.

In other words, the result of "makeUppercase" should be a string, not a number.

<comment><USER12> I see it now.

</comment></comment></comment></comment></comment><comment><USER14> Combining switch statements with destructuring [1] can be very useful:

        type ASTNode = { tag: 'BinOp', op: string, left: ASTNode, right: ASTNode }
                     | { tag: 'UnaryOp', op: string, arg: ASTNode }
                     | { tag: 'Literal', value: number };

        function evaluate(node: ASTNode): number {
            switch (node.tag) {
                case 'BinOp':   { const { op, left, right } = node;
                                  return evalBinary(op, evaluate(left), evaluate(right)); }
                case 'UnaryOp': { const { op, arg } = node;
                                  return evalUnary(op, evaluate(arg)); }
                case 'Literal': { const { value } = node;
                                  return value; }
            }
        }

[1] [https://ponyfoo.com/articles/es6-destructuring-in- depth](https://ponyfoo.com/articles/es6-destructuring-in-depth)

<comment><USER4> That's just sad if you've used languages with actual pattern matching though. It's like C's unsafe unions being back with a furor.

</comment></comment><comment><USER15> Cool to see a post about this sort of thing! I came up with a similar pattern a while ago (using Flow instead of TypeScript) for a lambda calculus evaluator. I ended up using a code generation approach so I define my datatypes in one file and the `match` method and `Matcher` interface are generated for me.

Here's where I define the five cases for a lambda calculus expression undergoing evaluation:

[https://github.com/alangpierce/LambdaCalculusPlayground/blob...](https://github.com/alangpierce/LambdaCalculusPlayground/blob/master/typeDefs.js#L137)

Here are the autogenerated types for those cases (there's other code to make it work at runtime):

[https://github.com/alangpierce/LambdaCalculusPlayground/blob...](https://github.com/alangpierce/LambdaCalculusPlayground/blob/master/types.js.flow#L458)

And here's a simple example of using it:

[https://github.com/alangpierce/LambdaCalculusPlayground/blob...](https://github.com/alangpierce/LambdaCalculusPlayground/blob/master/ExpressionEvaluator.js#L231)

</comment><comment><USER16> The technique mentioned in the article of using an interface for pseudo pattern matching with anonymous implementation is basically the visitor pattern (yes I know patterns are BS once your language is sufficiently powerful but lets ignore that).

It is basically how you implement pattern matching for any language that has OOP dispatch but lacks structural typing (but hopefully has anonymous classes).

One way to facilitate the above pattern is to use a code generator. A Java one I have played with is derive4j [1]. I'm not sure if typescript has a preprocessor but that would be one way to make the lack of structural pattern matching easier to deal with.

[1]: [https://github.com/derive4j/derive4j](https://github.com/derive4j/derive4j)

</comment><comment><USER17> This article seems relevant, [https://www.typescriptlang.org/docs/handbook/advanced- types....](https://www.typescriptlang.org/docs/handbook/advanced- types.html#discriminated-unions) . Particularly the part on discriminated unions. I'm just now learning TypeScript, so I have yet to actually implement anything this way.

</comment><comment><USER18> This looks a bit overdone. For the first example I'd just do it like this:

        const numbers = [,'one','two','three']
        function matchNumber(n: number) { return numbers[n] || n }

</comment><comment><USER19> steal Haxe's, they even already have code to compile it to JS.

[http://haxe.org/manual/lf-pattern-matching.html](http://haxe.org/manual/lf- pattern-matching.html)

</comment><comment><USER20> I saw a talk using interfaces to validate API calls/responses with typescript. I've been working in dynamically typed languages for a long time and I've built up habits that make it so I rarely run into issues where I am expecting a Number and get a String or that I can't determine this as the cause quickly, so typescript didn't appeal to me previously. Uisng interfaces to enforce uniform object structures is a game changer though and a use for typrscript that I didn't anticipate.

</comment><comment><USER21> I actually discovered this in the TypeScript 1.x days (2013 I think) but I didn't even consider it pattern matching. I was probably calling it a type safe switch statement.

As the article points out, the value in doing this is if you have a lot of calling code that creates a switch statement, say on a "type". This solution will give compiler errors at all the callers if you add a new type, but a switch statement will not and just hit the default.

</comment><comment><USER22>
      function calculatePaymentAmount(payment) {
        if(typeof payment.payByCard != "number") throw new Error("payment.payByCard=" + payment.payByCard);
        if(typeof payment.cardFee != "number") throw new Error("payment.cardFee=" + payment.cardFee);
        if(typeof payment.payByCash != "number") throw new Error("payment.payByCash=" + payment.payByCash);
        if(typeof payment.cashDiscount != "number") throw new Error("payment.cashDiscount=" + payment.cashDiscount);

        if(payment.payByCash <= 0 && payment.cashDiscount != 0) throw new Error("payment.payByCash=" + payment.payByCash + " payment.cashDiscount=" + payment.cashDiscount);

        return payment.payByCard + payment.payByCard * payment.cardFee + payment.payByCash - payment.cashDiscount;
      }

When an error is thrown, a core-dump should be generated, logged, and a developer notified, and the app should restart. The compiler can only catch so many bugs.

</comment><comment><USER23> There's pattern matching for javascript already: [https://github.com/z-pattern-matching/z](https://github.com/z-pattern- matching/z) , works pretty good, also match objects, very powerful

</comment><comment><USER24> The last example is a classic visitor pattern. The earlier ones (using structs of functions) are a variation on this that seems a bit closer to the spirit of pattern matching.

<comment><USER25> hi, i am the author of the article.

> The last example is a classic visitor pattern

you are absolutely right about the visitor pattern. will add the specific reference to the pattern in a revised version.

thanks for pointing out!

</comment></comment><comment><USER26> It's amazing that people still design languages without algebraic data types.

<comment><USER14> You can declare union types in TypeScript:

        type BinaryNode<T> = { tag: 'leaf', value: T }
                           | { tag: 'branch', left: BinaryNode<T>, right: BinaryNode<T> };

Then things like the following will typecheck correctly:

        function traverse<T>(node: BinaryNode<T>): void {
            switch (node.tag) {
                case 'leaf':
                    console.log(node.value);
                    break;
                case 'branch':
                    traverse(node.left);
                    traverse(node.right);
                    break;
            }
        }

In this example, once the compiler recognizes the tag is 'leaf', it knows there is a node property and will report an error if you try to access the left or right fields, which do not exist. The reverse is true for 'branch'.

Not as nice as Haskell for sure, but the presence of union types is something I've found very handy.

You can also declare tuple types:

        type MinMaxAvg = [number, number, number];

and do pattern deconstruction (though not pattern matching) in function arguments and assignments:

        function test([min, max, avg]: MinMaxAvg): void {
            // ...
        }</comment></comment>


Updating Rails - <AUTHOR> http://railsapps.github.com/updating-rails.html

<comment><USER2> Better advice:

make sure you have Gemfile and Gemfile.lock checked into git so you can rollback if necessary. Then type "bundle update rails".

rvm gemsets are not necessary for bundler controlled apps.

<comment><USER3> They're not necessary, but it sure is nice to simply archive your current gemset and have at it. If the update doesn't work out, you don't have to download and recompile your old gems again. It's a convenience, nothing more, nothing less.

<comment><USER4> Not sure why you'd have to download and recompile your old gems again using plain old Bundler.

The strategy I've been using (and I think is becoming more popular) is just to install all of your gems in one big pile, and use `bundle exec` to run your app in the limited environment provided by the Gemfile.lock. So if the update doesn't work out, you just twiddle a line in your Gemfile and `bundle exec` will magically load the older version (after `bundle install`, of course, which in this case will do zero network I/O).

</comment></comment></comment><comment><AUTHOR> I wrote the article because a Google search for "updating rails" doesn't show any helpful results. With the urgent need to update to Rails 3.2.11 because of the recently announced security vulnerability, developers need to know what to do (especially part-time and hobby developers).

<comment><USER5> I wrote a slightly different article: <http://bottledup.net/2013/01/10/bundler-and-gemfile/>

It focuses on Bundler and your Gemfiles so that people understand not only how to update rails, but their other gems too. Personally I don't like rvm gemsets for bundler controlled apps (like rails) and think that rvm, bundler, rubygems and so on only serve to confuse the same part-time and hobby developers.

</comment></comment><comment> chao- Operations noob here. Honest question: _How do I apply the patch file?_

I've never seen one before, and I've managed to gather, via Google and Stack Overflow, how to use a git .patch (I think anyway), but I deploy on Heroku and can't directly access the source of my gems.

I already have the workarounds in place for now, but I'm very bothered that "use the patch" is a meaningless phrase to me. It seems like a useful thing to know for future scenarios.

<comment><USER6> You do not need a patch file

All you need to do is:

        update your Gemfile to the correct version of Rails
        run **bundle update rails** in the root of your directory
        then **git commit -am "update rails"** to save the files
        then **git push heroku** to update on Heroic

The Heroku email has the information for all the Rails versions - if you are running 3.1.4, then you need to update to 3.1.10, if 3.2.X then 3.2.11 is your new version - this should be a safe update. Just pick the latest number for the X.Y version that you currently have in your Gemfile.

<comment> chao- Right. I understand that much, but entire swaths of our application become unusable when I upgrade. Chalk it up to "legacy" code from when I was first learning Rails.

Since that is fundamentally my own problem, and I have to deal with it over time and within my team's constraints, I didn't want to bore anyone with the details of why I don't just update the gem.

Thank you for the reply/help, but my question remains: Is it possible to use the these kinds of patch files on Heroku, and if so, how?

\--

EDIT: Responding to tomfakes here since HN won't let me:

I am only going from 3.2.2 to 3.2.11. I think the breakage is query-related, and it's actually quite embarrassing how bad so much of my old code is (procedural doesn't even begin to describe it). But this is how one learns, I suppose, and now I'm very incentive to go back and refactor/fix all of it.

I'm just worried about the in-between time, and bothered that this process of "applying a patch" is a mystery to me.

<comment><USER6> It seems strange that your app is so broken with a minor version update. Are you sure you are changing just the last number in the string, and not trying to jump a full version of Rails?

<comment><USER7> Rails 3.2.9 contains at least two API changing merges.

      https://github.com/rails/rails/pull/7509
      https://github.com/rails/rails/pull/7661</comment></comment></comment></comment></comment>


My Quantum Circuit Simulator: Quirk - <AUTHOR> http://algorithmicassertions.com/2016/05/22/quirk.html <comment><USER2> Interesting! (For me it looks like "Nielsen Chuang in your browser".)

As I am curious since I am developing some quantum simulation on my own ([https://github.com/stared/quantum-game](https://github.com/stared/quantum- game) \- one photon, but spatial degrees of freedom and more physical interactions).

Side remark - for plotting states:

\- did you consider using colors (see [http://nbviewer.jupyter.org/github/qutip/qutip- notebooks/blo...](http://nbviewer.jupyter.org/github/qutip/qutip- notebooks/blob/master/examples/example-qubism-and-schmidt-plots.ipynb))?

\- is there some slider, so I can lookup state at any stage (not only the last one)?

<comment><USER3> > _did you consider using colors_

I did consider it, but I never experimented with it. For a small number of qubits, I think oriented circles are much clearer. Then they get gradually worse as you move up towards 16 qubits. Once the amplitudes get close to pixel-sized, you're probably forced to use color if you want to show a decent 1-to-1 representation.

Some of the downsides:

\- Color-blind unfriendly.

\- Worse absolute accuracy at a glance. I can guess the absolute angle of a short line to within a couple degrees (~100 distinguishable buckets). For hues that's probably more like 20-30 buckets, though relative comparisons would still be ~100 buckets accurate. The angular velocity at a glance probably also suffers.

\- Circular motion, where the center is not at 0 (e.g. watch the X^t gate), won't look quite so circular.

\- I already use color to hint at meaning (green is densities/probabilities, blue is amplitudes, yellow is volatility).

> _is there some slider, so I can lookup state at any stage (not only the last > one)?_

Drag an amplitude display (the green 'Amps' thing in the toolbox) onto the circuit. Put it where you want to see the state. Resize it to cover everything.

(At the moment the inline displays are limited to covering 8 qubits. I was worried about performance when they get large. It'll be fixed in the future.)

 _Edit_ : Gah, there's a bug where the amplitude display is showing 'NaN' unless all the covered qubits are not entirely Off. Not sure how that slipped in.

 _Edit #2_ : Oh, it's happening on my work machine but not on my home machine. So probably related to webgl being terrible.

<comment><USER4> I am a newb dev, so I am curious to know what you used to build the simulator. You name-dropped webgl, but what else is needed to put together something like this, with the nice drop down menus, the drag and drop, and all that?

<comment><USER3> The drag-and-drop is done from scratch. Quirk just listens to browser events like mousedown/mousemove/mouseup and turns that into manipulations of the circuit. Getting it to work well across all the browsers, and modes of interactions, is quite finicky. For example, mobile browsers refused to not scroll even if `event.preventDefault()` was called, so I had to overlay the drag targets with transparent divs that have `touch-action: none`.

Quirk doesn't have menus.. you might be thinking of the recording of Davy's simulator? Those menus also look custom-made. I actually wouldn't call them "nice", because they lack important polish. Read this: [http://bjk5.com/post/44698559168/breaking-down-amazons- mega-...](http://bjk5.com/post/44698559168/breaking-down-amazons-mega- dropdown)

I'm sure there are libraries for menus and things like that, but I generally prefer to try to do it myself unless those libraries have a _really_ good interface.

<comment><USER5> > I actually wouldn't call them "nice"

You're being polite... Those drop downs are hideous!

</comment></comment></comment></comment></comment><comment><USER6> What's a good primer for understanding this? Given I have an EE degree, but only very basic quantum mechanics?

<comment><USER3> The post [and me, since I wrote it] recommends the video series Quantum Computing for the Determined [1].

If you're more familiar with physics than programming, Leonard Susskind's 'Quantum Mechanics: The Theoretical Minimum' [2] might work better. But I agree with Scott Aaronson that learning about quantum information before learning about quantum physics is easier than the opposite direction [3]:

> _There are two ways to teach quantum mechanics. The first way -- which for > most physicists today is still the only way -- follows the historical order > in which the ideas were discovered. [...]_

> _Today, in the quantum information age, the fact that all the physicists had > to learn quantum this way seems increasingly humorous. For example, I 've > had experts in quantum field theory -- people who've spent years calculating > path integrals of mind-boggling complexity -- ask me to explain the Bell > inequality to them. That's like Andrew Wiles asking me to explain the > Pythagorean Theorem. [...]_

> _The second way [...] starts directly from the conceptual core -- namely, a > certain generalization of probability theory to allow minus signs._

1: [https://www.youtube.com/playlist?list=PL1826E60FD05B44E4](https://www.youtube.com/playlist?list=PL1826E60FD05B44E4)

2: [http://www.amazon.com/Quantum-Mechanics-Theoretical- Leonard-...](http://www.amazon.com/Quantum-Mechanics-Theoretical-Leonard- Susskind/dp/0465062903)

3: [http://www.scottaaronson.com/democritus/lec9.html](http://www.scottaaronson.com/democritus/lec9.html)

<comment><USER7> > But I agree with Scott Aaronson that learning about quantum information > before learning about quantum physics is easier than the opposite direction.

I'm unconvinced that this is anything but Scott's personal opinion. Basically all teaching methodology advocates for concrete examples over abstract concepts. You can't get much more abstract than generalization of probability theory to allow minus signs.

It might work well for some people, and I'm happy it worked for you.

<comment><USER8> I don't really think the physical approach is any more concrete than Scott Aaronson's approach (at least in the way most people talk about concreteness wrt pedagogy). The point of having examples is to illustrate how general principles work in practice by specializing. You can do this just fine in quantum information/computation by discussing particular algorithms, problems, etc.

Frankly having taken both QC courses and QM courses, I found the physics- oriented exposition used a bunch of verbiage to phrase things in an experimental/physical way without really specializing the mathematical objects in any sense (eg, Stern-Gerlach experiments). That particular sort of concreteness can be helpful in other parts of physics, but physical intuition is weak to nonexistent in QM.

Anyway, I'm nowhere near a physicist so take my review with a grain of salt.

</comment></comment></comment></comment><comment><USER9> Why does this site's header image seem to say "Bugs" (in near-white text) around (763,108)?

<comment><USER3> It's just a joke about bugs being subtle and hard to find despite hiding in plain sight. I'm kind of impressed you spotted it; I wasn't sure anyone ever would (it's harder to see on some monitors than others).

</comment></comment><comment><USER5> This looks great!

I noticed that custom gates were on your "work in progress" list. Does that include being able to reuse a circuit as a gate in another circuit? That's a killer feature for me. Being able to "abstract away" things like the Grover diffuse operation. That, or even copy & paste functionality to speed up designing those repetitions.

<comment><USER3> Yes, that's one of the things I plan to do [1].

(You can copy individual gate parts by holding shift as you grab them. I'm considering adding ctrl as a another modifier, meaning 'grab the whole column'. I understand that these modifiers are not discoverable.)

(At the moment, when I want to make a really large repetitive circuit, I copy the URL into a text editor and do my copy pasting there. I understand that it would be totally ridiculous to expect users to do that.)

1: [https://github.com/Strilanc/Quirk/issues/148](https://github.com/Strilanc/Quirk/issues/148)

<comment><USER5> Being able to copy & paste a column would speed up design. Certain quantum algorithms rely heavily on repeated application so not having a shorthand feels tedious.

Ideally, from my perspective as a user, I'd like some kind of selection box that I can drag over a portion of the circuit and duplicate everything highlighted.

PS: I like that you maintain the circuit in a URL linkable form. Very handy!

<comment><USER3> There's a few gates that you can _only_ create by editing the URL ;).

Examples include the X-axis post-selection gates "|+⟩⟨+|" and "|-⟩⟨-|", some square-wave gates "X^⌈t⌉" and "X^⌈t-¼⌉" that were made redundant by the counting gate, the impossible universal-not gate "__unstable__UniversalNot" [1], and the error injection gate "__error__".

1: [http://physics.stackexchange.com/a/247178/911](http://physics.stackexchange.com/a/247178/911)

</comment></comment></comment></comment><comment><USER10> Very nice. I know nothing about quantum circuits, but just as a piece of software this is very cool.

My one criticism: there's something about the visual style of the interactive elements that makes them appear non-interactive until interacted with. The whole application initially looked like a static image to me before I started clicking around and fiddling with it.

<comment><USER3> Thanks, that's useful to know.

</comment></comment><comment><USER11> This is awesome. If you want a cool side project, you should definitely make this into a kerbal space program like game where you build quantum computers & optimization patterns. It would probably be super fun for you to build and also a fairly profitable venture given you have much of the codebase writeen.

</comment><comment><USER4> Can someone do a back of the napkin calculation to compare the performance of a quantum simulator with the real deal?</comment>


Blackphone - <AUTHOR> https://store.blackphone.ch <comment><USER2> I hate to break it to you, but this is not going to keep you safe from a state-level adversary.

I could drone on about this for pages and pages, but the sad fact is that if you are a target, it doesn't matter that you are using a "secure phone", "secure OS", or "encryption".

Time and time again, these systems have been broken or breached with simple tradecraft and subtle sabotage.

The Pentagon has a concerted (and expensive) effort to validate or verify the absence of "backdoors" or evidence of "additional circuitry" on ASICs or subsystems of it's major weapons systems and associated gadgetry. Do you?

I tell people that their simplest way to avoid having their communications intercepted is to NOT. USE. AN. ELECTRONIC. COMMUNICATIONS. DEVICE.

UBL used couriers, flash drives, and cutouts. If you need that level of protection, SO SHOULD YOU.

When I need to communicate secretly I BUY SOMEONE A BEER.

<comment><USER3> > I hate to break it to you, but this is not going to keep you safe from a > state-level adversary.

I don't really like this kind of anti-crypto argument. At this point I think making normal communications between normal people less embarrassingly mass- snoopable is a very worthy goal. For the time being, people who really, _really_ have something to hide need to be extra careful (as has always been the case).

Which is not to say I'm feeling particularly enthusiastic about this device.

<comment><USER2> It's not anti-crypto. It's PRO-tradecraft.

Introducing technology into a system can WEAKEN your security. Knowing that is almost 90% of the battle.

<comment><USER3> I think you're focusing on people who are under a specific, clear and present surveillance threat. Different arguments apply to those people to the majority of people who "value their privacy" in a more nebulous sense.

</comment></comment></comment></comment><comment><USER4> A prerequisite for security is free software. Critical applications like the Silent Circle ones are proprietary, afaict. I have zero trust in the Blackphone and would not purchase one.

<comment><USER5> This Verge article [1] says "The company will open source the vast majority of its code for the phone in order for third parties to properly audit its techniques, find holes, and ultimately help to improve the product."

1\. [http://www.theverge.com/2014/2/24/5441642/blackphone- silent-...](http://www.theverge.com/2014/2/24/5441642/blackphone-silent- circle-geeksphone-pre-order-launch)

<comment><USER6> If they do, that would go a long way to convincing me this is a tidbit more secure than any other random Android device.

They should really have released their code at the same time they released their phone though.

<comment><USER7> I've talked to Silent Circle at conferences and what not. It is not like they have some crypto noob working on their project...They have Phil Zimmerman.

But, knowing nothing about them, when I asked them ``How does your protocol compare to TextSecure's Axolotl?'' the response was ``We have Phil Zimmerman''. So....I'm still a bit put off by them.

Some of their code is already open-sourced here. [https://github.com/SilentCircle](https://github.com/SilentCircle)

<comment><USER8> As someone who works at Silent Circle (though not someone who can speak FOR SC), I'd say "Axolotl and SCIMP are both very good". Also, I don't know who you talked to, but keep in mind that not everyone working for SC is technical and can explain (or sometimes even knows) what Axolotl is/how it works.

</comment></comment></comment></comment></comment><comment><USER9> Transparently marketing fear. Apparently this phone is for you if you ever [0]:

> speak personally with a partner

> worry about your kids

Shameful.

[0] [https://www.blackphone.ch/individuals/](https://www.blackphone.ch/individuals/)

<comment><USER10> I think most people _need_ some fear about state spying. Most are still treating it like it's no big deal. It's like the Stasi are here and no one gives a damn. That _should_ scare people. Maybe we're deeper into Huxley's world than we thought.

<comment><USER11> Amusingly enough, I think a large part of why people aren't more scared are sentiments like the ones you just expressed. It is plainly _not_ "just like the Stasi are here" and the average person can see that. By overstating the threat we de-legitimise our concerns and apathy grows (similar to the effect the DARE program had on drug use). Is the expansion of state level surveillance cause for concern? Of course it is! However, we are by no means living in a police state and saying so is an insult towards the people working very hard to effect policy to keep it that way. In short, in my opinion, we should spread less fear mongering and more political activism if we want to see change in these policies.

</comment></comment></comment><comment><USER12> Shipping in June is not exactly 'here'. Come back when independent people can verify and reproduce the software it is running.

Open sourcing "vast majority of its code" is not good enough -- this thing is selling security and if you can't rebuild it all yourself there's really no point.

</comment><comment><USER13> So I'm guessing this still has a black-box baseband?

<comment><USER14> I'd say so.

See comments from previous post about a month ago: [https://news.ycombinator.com/item?id=7062748](https://news.ycombinator.com/item?id=7062748)

</comment></comment><comment><USER15> It's a bit disconcerting to see that it comes with software "enabled for at least 2 years of usage".

<comment><USER5> Why? I believe that sentence refers to extra software/services that'd normally be paid.

<comment><USER8> It does, you get 2 years' worth of subscription to various services.

</comment></comment></comment><comment> line-zero "A $700 high-powered tracking device that protects your privacy!" What a scam.

<comment><USER16> But ... but it's black !

</comment></comment><comment><USER17> How compatible is the OS with 'normal' android apps?

Since 4.4 I have been able to, at least to some level, revoke some basic rights that apps have, like seeing my contacts (through app shield or whatever). If I am able to download apps from the 'normal' Android store, is access that those apps have somehow controlled as well? Some sort of sandbox mode would be nice.

</comment><comment><USER18> From an interview I read a while ago I got the impression that Blackphone wouldn't claim to protect from state-level adversaries, and maybe if you were to ask them to be explicit about it they really don't. One could easily come away with another impression from the description here though.

That's a shame, since protection from state level adversaries is really what's at the top of my feature wish list, and that probably goes for a fair amount of other people too, in this day and age.

Is anyone here aware of cell-phone-like projects that have potential to resist exploitation of the type we've seen reported from Five Eyes? I'd be particularly curious about ways to mitigate the location tracking.

</comment><comment><USER19> I am not sure why do anyone needs that.

You can have basically secure messaging on the phone today. You can use Replicant (libre software) on many phones where there probably are no backdoors, you can use OTR with Xabber (you can build it yourself), there are probably applications for PGP too.

Yeah, Replicant will fail to work on many phones and on those that work, half of the functionality is missing ( [http://redmine.replicant.us/projects/replicant/wiki/Replican...](http://redmine.replicant.us/projects/replicant/wiki/ReplicantStatus#Replicant-42) ) - but trying to sell non-free phone as "secure" is snake-oil anyway. In my humble opinion.

<comment><USER20> Reminds of this classic comment: [https://news.ycombinator.com/item?id=9224](https://news.ycombinator.com/item?id=9224)

Guy complaining that dropbox is useless because "For a Linux user, you can already build such a system yourself quite trivially by getting an FTP account, mounting it locally with curlftpfs, and then using SVN or CVS on the mounted filesystem."

</comment></comment><comment><USER21> Sadly, we live in a world where it's quite possible that phones like these are nothing more than a ploy to lure NSA targets in. They need to get people, who have something to hide, to feel safe again.

</comment><comment><USER22> For $629 you could by quite a few one-time or short-time use trac phones that you buy with cash. Wouldn't that be more secure/private than this?

<comment><USER23> Burners are an effective defense against single-phone-number taps.

But in an era of dragnet surveillance and meta-data analysis [1] they're not very useful.

Unless you're calling varying phones, at varying places, from varying places, at varying times, all with no discernible pattern or schedule -- it would be easy enough for them to identify a network of burners and determine which ones belong to which individuals on the network based on that meta-data. And if anyone in the network carried or used a 'real' phone alongside the burner, it would only get easier.

And you can Google search on the news wires to see how well people do at this game, even when they _know_ their lives are literally on the line and thus devote a significant portion of their effort toward it.

[1] Done well-enough to be confident-enough to lob hellfire missiles at SIM cards in not-quite-friendly countries...

</comment></comment><comment><USER24> What about the 'second operating system?' The baseband software? [http://www.osnews.com/story/27416/The_second_operating_syste...](http://www.osnews.com/story/27416/The_second_operating_system_hiding_in_every_mobile_phone)

</comment><comment><USER25> Does it protect against this [http://abcnews.go.com/blogs/headlines/2006/12/can_you_hear_m...](http://abcnews.go.com/blogs/headlines/2006/12/can_you_hear_me/) ?

</comment><comment><USER26> It seems like just avoiding mainstream popular services is enough to regain a lot of privacy, if the agencies look no further than Verizon, Google, Twitter, Facebook. They know exactly what my parents activities are.

</comment><comment><USER27> "Select 3rd party apps". Now there's a crazy idea -- what if the maker of the device vetted the apps that run on the device?

Crazy idea. It just might work.

</comment><comment><USER28> WHY use a vpn when you can already use Tor on android?

</comment><comment><USER29> So is this PrivatOS open source, or irrelevant?

</comment><comment><USER30> Hardware android buttons? What is this, 2010?

</comment><comment><USER31> Nope, it's still there.

</comment><comment><USER32> That "unique combination" does not assure me but reminds of the curse "may you live in interesting times".

</comment><comment><USER33> Gee, you think being on Blackphone's mailing list I would like maybe get an email that it's available.

Edit: Ha! I just received the email...</comment>


Google's data-gathering app may have also violated Apple's policies - <AUTHOR> https://www.cnet.com/news/googles-data-gathering-app-may-have-also-violated-apples-policies/ <comment><USER2> I wonder how much collecting is happening on android then. Facebook and google had to sneak around the App Store with enterprise certificates cause this wouldn't have been allowed on the App Store, but since google controls the play store they can push whatever the want out, no?

I've only ever had an iPhone for smartphones so I'm not sure what it's like on android</comment>


Moscow Chess Tournament: Two Days, 10 Players, and Still No Wins - <AUTHOR> http://gambit.blogs.nytimes.com/2009/11/06/players-remain-deadlocked-at-moscow-tournament/

<comment><USER2> "Players Remain Deadlocked at Moscow Tournament"

Deadlocked? In my experience those things never resolve!! But then again I often times expect people to behave robotically...</comment>