Web server in one line of bash - <AUTHOR> http://www.razvantudorica.com/08/web-server-in-one-line-of-bash/ <comment><USER2> If you have python, then these are really useful, just serves up the current directory.

      Python 2.x:
      python -m SimpleHTTPServer

      Python 3.x:
      python -m http.server 8000

<comment><USER3> Or for https (e.g. when developing for Chrome's speech recognition API):

        twistd --nodaemon web --path=. -c snakeoil.crt -k snakeoil.key --https=8443

And to generate a 100-year localhost key/cert for use with this:

        openssl genrsa -passout pass:dummy -out snakeoil.secure.key 1024
        openssl rsa -passin pass:dummy -in snakeoil.secure.key -out snakeoil.key
        openssl req -new -subj "/commonName=localhost" -key snakeoil.key -out snakeoil.csr
        openssl x509 -req -days 36500 -in snakeoil.csr -signkey snakeoil.key -out snakeoil.crt

<comment><USER4> erm...chrome speech API?!? What exactly are you doing? and how can I do it too?

<comment><USER3> I'm doing: [https://github.com/jawj/pigeonsim](https://github.com/jawj/pigeonsim) (now with speech recognition + geocoding, supporting a beam-me-up gesture).

Web speech API: [http://updates.html5rocks.com/2013/01/Voice-Driven-Web- Apps-...](http://updates.html5rocks.com/2013/01/Voice-Driven-Web-Apps- Introduction-to-the-Web-Speech-API)

</comment></comment></comment></comment><comment><USER5> Since everyone uses the one line of bash to just start their favourite complex network utility, I'll also contribute mine:

while true; sudo /usr/sbin/apachectl start; break; done;

<comment><USER6> Why is there a while true?

<comment> alex-g Otherwise the break has nothing to break out of.

</comment></comment></comment><comment><USER7> This seems to be straight from Wikipedia and then wrapped in a while loop: [https://en.wikipedia.org/wiki/Netcat#Setting_up_a_one- shot_w...](https://en.wikipedia.org/wiki/Netcat#Setting_up_a_one- shot_webserver_on_port_8080_to_present_the_content_of_a_file)

netcat's cool, but the post could've gone a bit further. If it's an intro "how to do this", maybe explain the moving parts for beginners?

</comment><comment><USER8> > As root you can run:

Unless the specified 'index.html' is only readable by root, you don't have to be root to run that.

Only the low ports are restricted from regular users.

</comment><comment><USER9> We've used a similar trick to copy files between coworkers:

      on server: while true; nc -l $PORT < $FILE; done
      on client: nc $SERVER $PORT > $FILE

Quick, simple and easy to fire up. You can continue to hack on the file and nc will serve up the latest saved version.

<comment><USER10> Is your while loop missing a "do" statement, or am I missing something?

</comment></comment><comment><USER11> In one line, using Go and goe [1]. :)

        $ goe 'net/http' 'ListenAndServe(":8080", FileServer(Dir("/usr/share/doc/")))'

[1] [https://github.com/shurcooL/goe](https://github.com/shurcooL/goe)

</comment><comment><USER12> That's not a one-line script. That's a multi-line script with the linebreaks removed.

<comment><USER13> I suggest you don't say things like that around Perl programmers.

<comment><USER14> Most Perl one-liners don't have semicolons.

<comment><USER13> The language lends itself to that, but as far as I am aware there is no prejudice against Perl one-liners that do contain semicolons.

</comment></comment></comment></comment><comment><USER15> socat version; no loop, as it forks a separate process for each connection:

        socat TCP-LISTEN:8080,fork,crnl SYSTEM:'printf \"HTTP/1.1 200 OK\\n\\n\"\; cat test.html'

The extra quoting you need to do the the SYSTEM argument makes this rather cumbersome. socat is a powerful tool, but can sometimes be a pain to use.

Here's one use I found for it recently, when I wanted to do some experimentation with multicast:

        socat - UDP-DATAGRAM:184.108.40.206:4242,ip-add-membership=126.96.36.199:10.0.0.10,ip-multicast-loop=0,bind=:4242

This causes socat to bind to the multicast group 188.8.131.52 on the interface that has the unicast IP 10.0.0.10, sending and receiving on port 4242 over UDP, reading from stdin and writing to stdout. It basically gives you a simple chat service over the local network.

</comment><comment><USER16> $ busybox httpd

Works even in an initramfs, and in some embedded systems. Serves up the current directory, and you can even have CGI scripts in cgi-bin.

<comment><USER17> Woah, I didn't realize busybox had an httpd. Truly a sweet piece of software.

<comment><USER18> It often won't, as features ("applets") are chosen at compile-time.

</comment></comment></comment><comment><USER19> I remember trying to write a web server that can respond to requests in bash, several years ago. Since it didn't have sockets support that part was going to be handled by netcat. The problem I ended up with was that bash couldn't read and write to the same pipe. The mkfifo solution was the closest that I got to. It turns out that ksh was perfectly capable of reading and writing to the same pipe at that stage. Not long after I got stuck with bash, awk started to support sockets so I used that. Then bash started to support sockets, and many more features, so I suspect it's possible to write a solution in bash now that doesn't need netcat, but might still need a fifo.

</comment><comment><USER20> Nice. However:

        $ curl localhost:8080 & curl localhost:8080
        <!doctype html>
        [...]
        curl: (7) Failed connect to localhost:8080; Connection refused

Yes, the server "restarts" after each request, and during the restart, it's not listening.

That's not what I would call a "server".

<comment><USER15> The socat version I posted [https://news.ycombinator.com/item?id=6224060](https://news.ycombinator.com/item?id=6224060) fixes this problem, but is a bit more cumbersome.

</comment></comment><comment><USER21> If you have node-static installed.

      npm install -g node-static
      # serve up the current directory
      $ static
      serving "." at http://127.0.0.1:8080

More at [https://github.com/cloudhead/node- static](https://github.com/cloudhead/node-static)

<comment><USER22> Similarly, if PHP 5.4 (or greater) is installed:

        php -S 127.0.0.1:8080

<comment><USER23> This my defacto, PHP is installed on all the Linux servers I manage, mostly Debian/Ubuntu with DotDeb repos. You could probably get nc to pipe the output of php-cli for older PHP installs.

[http://stackoverflow.com/questions/3940046/can-i-use- netcat-...](http://stackoverflow.com/questions/3940046/can-i-use-netcat-to- run-php-cli-w-arguments) seems to have a basic example.

</comment></comment></comment><comment><USER24> I can recommend 'woof' [1] for simple ad-hoc sharing of files through HTTP. It has some extra features, like quickly sharing a directory as tar file.

[1] [http://www.home.unix-ag.org/simon/woof.html](http://www.home.unix- ag.org/simon/woof.html)

</comment><comment><USER25> Another one: [http://paulbuchheit.blogspot.com/2007/04/webserver-in- bash.h...](http://paulbuchheit.blogspot.com/2007/04/webserver-in-bash.html)

</comment><comment><USER26> You can actually write a web server in pure bash, with no netcat, using /dev/tcp (bash magic). [https://www.gnu.org/software/bash/manual/html_node/Redirecti...](https://www.gnu.org/software/bash/manual/html_node/Redirections.html) [http://www.linuxjournal.com/content/more-using-bashs- built-d...](http://www.linuxjournal.com/content/more-using-bashs-built-devtcp- file-tcpip)

<comment><USER27> That's demonstrating an HTTP client, not a server. I don't think there's a way to make /dev/tcp accept incoming connections.

</comment></comment><comment><USER28> I like woof,which is a single file and can also serve itself.

[http://www.home.unix-ag.org/simon/woof.html](http://www.home.unix- ag.org/simon/woof.html)

</comment><comment><USER29> Netcat for 21st Century Ncat -- [http://nmap.org/ncat/](http://nmap.org/ncat/)

</comment><comment><USER30> Since nobody mentioned ruby version

ruby -run -e httpd . -p 5000

</comment><comment><USER31> On Debian 7.0 (Wheezy) argument "-l 8080" without "-p" causes netcat (v1.10-40) to listen on a random port. I must run "nc -l -p 8080" to listen at 8080.

</comment><comment><USER32> Adding my two cent:

        twistd web --path . --port 8080

</comment><comment><USER33>
      npm install -g serve
      serve

</comment><comment><USER18> I'm sure I've seen an example of using /dev/tcp - a bash builtin.

</comment><comment><USER34> Quite interesting, specially with the limitations of the file:// protocol

</comment><comment><USER35> http-server works well if you have node installed. [https://npmjs.org/package/httpserver](https://npmjs.org/package/httpserver)

</comment><comment><USER36> Anyone got a one-line or so version with BASIC auth?

</comment><comment><USER29> netcat is the most handy service I have seen on Linux. Any more like this?

<comment><USER13> Look into Socat. Socat is to netcat as Vim is to vi.

</comment></comment><comment><USER37> Neat trick, but probably too limited to be of much use. Also, stopping it is kind of a nuisance.

<comment><USER38> Why? It only takes one ^C

<comment><USER39> For me, it doesn't even respond to ^C (or even ^\\). I had to ^Z it, and then `kill %1`.

Could be an OS-dependent thing. I'm using OS X.

<comment><USER40> Indeed. It could use in front of while loop something like:

int_cmd(){exit 1;}trap 'int_cmd' 2;

</comment></comment></comment></comment><comment><USER41> nice

</comment><comment><USER41> nice share</comment>


Checkout systems are going autonomous - <AUTHOR> https://www.technologyreview.com/s/608765/i-tried-shoplifting-in-a-store-without-cashiers-and-heres-what-happened/ <comment><USER2> On one hand I'll be happy when this happens.

On the other hand the huge downside is that it's not really compatible with the fresh fruit and veg section where things are sold by weight. I assume it would lead to more prepackaged fruits and vegetables and a consequent increase in waste.</comment>


Firewatch creator vows DMCA retaliation against PewDiePie for racist slur - <AUTHOR> https://www.polygon.com/2017/9/10/16285188/pewdie-pie-racist-slur-firewatch-retaliation-dmca <comment><USER2> Racist slur aside, H3H3 went to court and won against a DMCA takedown initiated by Bold Guy.

The judge ruled that talking over copyrighted content "quintessentially transforms" it into something new.

Additionally, Firewatch's website gives express permission to stream its content.

And DMCA misuse carries ridiculous penalties in the USA.

So good luck there guy!!</comment>


It's time for companies to act: US eases sanctions on export of tech to Iran - <AUTHOR> https://www.accessnow.org/blog/2013/05/31/its-time-for-companies-to-act-us-eases-sanctions-on-export-of-tech-to-iran

<comment><USER2> Hm. Am I reading into this or is this article suggesting that we "help" the Iranian people avoid their governments censorship by setting up encryption and Tor nodes?

Are we to believe that folks in Iran trying to avoid the govt dont have these tools already?

And if they dont, do you want to be the person that shows someone how to setup encrypted communications over Iran's "Internet" and potentially put that persons life in danger?

<comment><USER3> I read it the same way. And it's about giving Iranians EASIER access to iPads, Android phones, MacBooks etc so they can gain more information about what is going on in the rest of the world. Given how important technology played in the Arab Spring uprisings it seems strange the US even put these sanctions in place to begin with.</comment></comment>


How classroom technology is holding students back (little evidence they help) - <AUTHOR> https://www.technologyreview.com/s/614893/classroom-technology-holding-students-back-edtech-kids-education/ <comment><USER2> Potentially interesting topic. But I wouldn't know. Website requires four clicks to make it readable. And fuck knows just how may more as I scroll.

Fuck these publishers and fuck the people who implement this nonsense.

/rant</comment>


Ask HN: How many hours of office time you spend on internet? - <AUTHOR>

Just read a survey that says people spend over 6 hours of office time in surfing internet! Just wondering how much time HNers spend on internet while working? <comment><USER2> About 90% as we develop directly on servers on the internet ;-)</comment>


Baijiu - <AUTHOR> https://en.wikipedia.org/wiki/Baijiu <comment><USER2> >also known as shaojiu

As I understand it, Soju in Korea and Shochu in Japan both derive from this historically, and in turn shaojiu derives from simple grain distillation that came from Mesopotamia.

</comment><comment><USER3> Baiju is a great love of mine. I've gone through countless bottles of it while in China and in the famous Chinese Mai tai a la LiPo Lounge in SF.

</comment><comment><USER4> Lived in China for a while. Us (admittedly, extremely white) American ex-pats had a very fratty attitude toward "the baij."

Maybe it's because we could only afford the cheap stuff — but any baijiu we got our hands on was really, really nasty. Only palatable with a 1:25 Sprite solution.

<comment><USER5> I've tasted expensive Baijiu. It's also pretty nasty, possibly even moreso to my taste than the cheap stuff. I think it's one of those machismo things where everyone pretends they like something that is objectively terrible to prove their manhood, or something. Comparable to ultra-bitter IPAs in the west.

</comment></comment><comment><USER6> Chuhais for everyone!

</comment><comment><USER7> Why is this on hacker news, lol.

<comment><USER8> There was a reference to this from a post earlier today [https://news.ycombinator.com/item?id=21742485](https://news.ycombinator.com/item?id=21742485)

"Baijiu is the world's most popular spirit, with 10bn litres sold each year, almost entirely in China. The second most popular spirit in the world is vodka, with just 5bn litres sold."

I think this comes as quite a surprise to many people in the west.</comment></comment>


Defining Development Experience - <AUTHOR> http://elegantcode.com/2010/07/10/defining-development-experience/

<comment><USER2> Like a lot of these Junior-Midlevel-Senior ratings, it exhibits a big disconnect between Midlevel and Senior.

A clear path exists between Junior and Midlevel, but the Senior criteria seem orthogonal. For example, "Can elucidate requirements" appears out of nowhere. Neither Junior nor Midlevel have anything to do with elucidating requirements.

Also, this seems to be tailored to large corporation style development, but nowhere does "working in a team environment" or "leading a team" appear.</comment>


How Third-Party Licensing Can Ruin Your Launch - <AUTHOR> http://www.softwarebyrob.com/2009/03/12/how-third-party-licensing-can-ruin-your-launch/

<comment><USER3> To be fair, this is kinda how many b2b companies work - not just this one. At my work, we get vendors that promise everything, charge a ton and we set up all our data in their product, deliver on less than half of what they claimed and by that point it's too late/expensive to move away from them.

It's why I don't trust enterprise vendors. They make their money of few, very high margin sales. They claim things like "support packages", but really that's just a way to let IT managers pass the blame onto someone else - <USER2> users can blame the vendor rather than blaming you (even though you chose the vendor)

It's dangerous to work with any company to whom losing you as a client would radically alter their finances. To illustrate the difference: if I cancel a 37signals-style app at $40/mo, sure they loose money and they don't want that, but it doesn't really alter their financial picture. They don't need to lay off staff or adjust salaries or anything. If my business terminates our contract for one of our "enterprise" packages, that company is losing $50,000+. At that point, they might need to let people go. Someone is probably losing a huge sales commission that will significantly impact their life. They're going to do everything to prevent that. Since actually creating a quality product is difficult, they tend toward lock-in and promises. So when the IT manager is asked "why are we still using this horrible product?" they can say, "it would cost so much more to transfer out since all our data is in it and we can't get it out without essentially re-doing all that data entry" and, "they've promised XYZ that will fix things in 6 months." By the 6 month mark, the IT director can pass the blame onto the company saying, "how was I supposed to know they wouldn't deliver?" if anyone still remembers.

I'm sorry you got snagged by such a bad company, but there are many worse companies out there. Always beware of any company that can't lose you as a customer. People think that means they'll get good service from them. Really, it means that they'll use any underhanded trick to keep you on the hook hoping that you won't take the steps to rid yourself of them - for example, once you give functionality, it's very hard to take it back and if we had offered lots of options and moved down to 4 within our firm, we'd never hear the end of it, right decision or not.

<comment><USER4> OT/separate question, but how would you recommend a new company venture into the enterprise software model? There will always be a first customer a startup would need that would be critical to the finances/bottom line

<comment><USER3> Well, when you don't charge hefty fees for software, no matter how small you are, the revenues aren't critical.

For example, if I launch service X - say a website spell checker like we saw here not long ago - and charge $20/month, the $20/mo from my first customer becomes 100% of my revenues until I get another customer. So, loosing that customer means that I loose 100% of my revenues! However, the absolute drop in revenues is only $240/year - not pocket change, but also not an amount that I'd compromise my morals over.

The issue with many enterprise companies is that they get a dozen people paying $50,000/year and at that point, losing one customer is a big deal both in terms of percentage and in terms of absolute revenue lost. If you're a company of 6 people and you loose an account paying you $50,000/year, your ability to pay salaries, etc. changes drastically. If you're a company of 6 people and you loose $240/year, it doesn't matter if they're your only customer, it doesn't affect whether you can pay salaries. It still might not be profitable, but individual customers don't determine your fate - masses of customers do.

Mostly, I just don't think you can act morally in a relationship where the other party holds so much sway over your livelihood. If they hold that kind of sway, you will do whatever you can to prevent them from exercising that power - promising changes you have no intention of making, trying to make it hard for them to leave by locking-in the data, etc. And in business, that happens when you're selling a product at such a high price to so few customers. If you base your business model off of selling at lower prices to more customers, no single customer can hold that sway over you because, while customers are always important and should be well-treated, if they decide to go another way it can be an amicable break because they aren't hurting you that much.

Really, I think that the enterprise model is broken. A lot of it is based off of trying to sell products to pointy-haired bosses by slick salespeople for lots of money and then locking the customer into your system. _shudder_. I'd suggest a completely different route for enterprise software: go as open and cheap as you can and build on volume. Rather than worrying about someone leaving, give them a reason to stay. The enterprise vendors we interact with don't have that attitude. They don't roll out something useful unless it can go on a checklist. They don't care about the quality of something since that's subjective and isn't as easily seen in "requirement evaluations". Disrupt the system. Heck, go open source and offer a hosted solution. Businesses love paying for hosted solutions because they can wipe their hands of it. Likewise, you can assure them that, if at any time in the future you become an evil company, they can take the code and host it themselves. That gives you a consumer-facing drive to improve, rather than lock-in. Heck, if the company needs something different, they can program it themselves and give it back to you! Free development! And you get a good reputation as a hosted service that doesn't lock people in and is constantly giving people more reasons to love you. That's the models that I'd recommend. People will pay for your expertise - you developed it, you administer it, you make sure it continues to work with no hassle on their end. That's a lot of value compared to many enterprise apps that are expensive _and_ require companies to have someone to deal with it.

Just make sure that you don't get into a situation where your morals might be challenged by your wallet. When that happens, you'll start doing evil things to your customers.

<comment><USER5> The real problem is that those same pointy-haired bosses create a positive feedback loop when they look at prices. If company A is charging $50,000/year for a product, and company B charging only $500/year for a competing product, the PHB immediatly wants to know _what's wrong with product B_ , and never asks why company A is gouging them.

It creates incentive for "enterprise" companies to continue charging exorbitant prices, because PHB's tend to conflate price with value...

</comment></comment></comment></comment><comment><USER6> Somewhere, stallman is laughing heartily.

<comment><USER7> Yeah, he's going "That's what you get for trying to sell software, fascists"

</comment></comment><comment><USER8> Was the vendor's concern that a customer of yours could just pull your royalty-free license out of your uncompiled source and then gain access to their product without paying for a license? So, you would be distributing their registration key for free use with every purchase?

That sounds like a legitimate concern. If someone was distributing a valid registration key and fully-functioning application for one of our products (in exchange for a single royalty-free license), I'd give a blanket 'no' too.

<comment><USER5> Considering it's C#, and a "compiled" DLL is just preassembled bytecode anyways, I can't imagine it would be much more work to disassemble the DLL anyways...

<comment><USER8> ...which likely explains the vendor's 'no' to a dll distribution as well.

Crappy to have happen to the author, but I can understand the vendor's decision in this particular risk/reward choice.

<comment><USER9> Especially if the vendor's library has a higher sale price than the submitter's app.</comment></comment></comment></comment>


Configuration-free build system for C++17 - <AUTHOR> https://github.com/xyproto/sakemake <comment><AUTHOR> This is my first stab at a configuration-free build system for C++17. Tested on macOS, Arch Linux and Ubuntu 17.10. The idea is to make something that is as easy as go build for building executables.

It takes a lot of hassle away from building or starting small C++17 projects, and it auto-detects libraries.

It uses `pkg-config` and pacman/apt/homebrew for finding compilation flags only based on included headers. Examples for configuration-free use of GTK+3 and SDL2 are included in the project.

Of course, some projects need additional configuration, but the idea is that compliant projects may advertise themselves as "configuration free".

Feedback is welcome.</comment>


Ask HN: Adsense banned me while owing me 30k. What could I have done? - <AUTHOR> This actually happened last year. Google banned my Adsense account and never gave me a clear reason why. I appealed twice, but they rejected both without telling me why. At this point, I gave up after that reading about how notorious they're being apathetic towards people in my situation. I couldn't find any guideline or stories of people getting anywhere beyond where I was.
I was wondering if anyone from HN has gone through something similar, and was able to successfully appealed the ban. Or if they were able to at least escalate their matters to the point where they were able to talk to a human being in Google.
My website is www.modd.io. It's a simple HTML5 gaming website. Afaik, I wasn't breaching Adsense's policies.
Thanks in advance guys. <comment><USER2> There was recently a class action over this practice: [https://www.bleepingcomputer.com/news/google/google- agrees-t...](https://www.bleepingcomputer.com/news/google/google-agrees-to- pay-11-million-to-owners-of-suspended-adsense-accounts/)

You should act quickly to either submit a claim as part of the settlement, or exclude yourself from the settlement: [http://www.adsensepublishersettlement.com/](http://www.adsensepublishersettlement.com/)

I would look over the terms of the settlement and see if they work for you ASAP, since the deadline is in 3 days.

<comment><AUTHOR> wow I didn't know about this. Thanks you. Just out of curiosity, why would one want to exclude themselves from this settlement?

<comment><USER2> If you read the terms and are unhappy enough with them that you would want to file your own lawsuit, then you should exclude yourself. If you accept the terms, then you're giving up the right to sue them separately.

</comment></comment></comment><comment><USER3> This:

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

Also this:

[https://pastebin.com/qw3inbz4](https://pastebin.com/qw3inbz4)

[https://pastebin.com/cGGV3kpE](https://pastebin.com/cGGV3kpE)

<comment><USER4> Well that sucks...

</comment></comment><comment><USER5> Google is human unfriendly. They only care if their bottom line is in danger. Make a lot of noise on social media(involve your user base if possible.)

You probably thought of this already but why can't you sue them? Even if you lose,you might at least get a review of the ban. Do they have a non- arbitration TOS?

</comment><comment><USER6> Is it a bad idea to sue? I mean, they're Google, but, if they owed you the money...?

Just find a friend of a friend who is a lawyer and who will file it for you?

</comment><comment><USER7> Is it possible to always withdraw funds on the go? Why wait accumulating 30k?

<comment><USER3> Google enforced scheduled payouts to benefit from traffic driven by publishers but be able to avoid paying off accumulated fees on a short notice with some standard excuse.

</comment></comment><comment><USER8> Seems like there would be click rings extorting adsense users; pay up or we'll get your account banned.</comment>


New Spacesuit Unveiled for Starliner Astronauts - <AUTHOR> https://www.nasa.gov/feature/new-spacesuit-unveiled-for-starliner-astronauts <comment><USER2> I think it's generally agreed upon that the Space Shuttle program was needlessly wasteful and more PR- than science-driven. A heavy space plane has zero advantages over a capsule for most work done in LEO. It's good to see this renewed focus on more practical designs.

(If that's incorrect and you're qualified to correct me please do.)

 _Having said that_ , the name Starliner writes a check that a manned capsule won't ever be able to cash. This is the first time I've heard of Boeing's Starliner and it got me really, really excited until I pulled up a picture of it. They really should have picked a less grandiose name.

<comment><USER3> Shuttle flew a decent number of missions for the National Reconnaissance Office, conducting secret experiments and deploying spy satellites. Most of the missions are still classified, but many folks have said the military needs drove the design of the Shuttle program. There are pretty obvious advantages to a spaceplane if your goals include capture of enemy satellites. [http://www.space.com/34522-secret-shuttle- missions.html](http://www.space.com/34522-secret-shuttle-missions.html)

It turns out a lot of science space research is heavily driven by military space presence. For example, Hubble has a 2.4m mirror because there was already a factory making that size for dozens of spy satellite. [https://en.wikipedia.org/wiki/KH-11_Kennen](https://en.wikipedia.org/wiki/KH-11_Kennen)

And ever heard of "The Dish" at Stanford? It's a 150-foot radio telescope the US Air Force funded during the Cold War to ostensibly "study the chemical composition of the atmosphere." Total BS. The Air Force built it to intercept signals from Soviet radar systems after they bounced off the moon.

(Thankfully Stanford got to keep it and it's been used for hundreds of projects since then.)

<comment><USER4> Retrieval of objects in space and bringing them back to Earth is about the _only_ mission where the Space Shuttle was superior to capsule designs. This was also used in a handful of science missions for studying long-term exposure of various materials.

But the vast majority of the Shuttle's 130 flights would have been better served by an Apollo or Gemini derived design.

<comment><USER3> From what I've read, Shuttle also did quite a bit of satellite repair (like fixing Hubble). And the orbiter's cargo bay certainly was useful to transport many parts of the ISS.

The Department of Defense still actively uses a spaceplane-ish vehicle. It's just a much smaller unmanned one called the X-37b. Many folks speculate it's used to repair and refuel spy satellites, and potentially even rendezvous with and and hack enemy satellites. [https://en.wikipedia.org/wiki/Boeing_X-37](https://en.wikipedia.org/wiki/Boeing_X-37)

Generally I totally agree though-- capsule design makes way more sense for anything leaving or reentering atmosphere. The upcoming Orion are clearly in that directly.

<comment><USER4> > From what I've read, Shuttle also did quite a bit of satellite repair (like > fixing Hubble)

It did, but a capsule can do the job just fine too – for JWST, it is (or was) planned to do repairs using the Orion capsule and a mission module docked to it.

> And the orbiter's cargo bay certainly was useful to transport many parts of > the ISS.

Kinda, yes. But an unmanned rocket could have done the same job, and likely cheaper than the Shuttle.

Most of the civilian Shuttle missions could have been easily served by other, much cheaper craft – but who knows what happened during the classified ones, it might actually have been cheaper to the taxpayer at large (if not NASA) to have one craft to serve both roles.

> The Department of Defense still actively uses a spaceplane-ish vehicle. It's > just a much smaller unmanned one called the X-37b. Many folks speculate it's > used to repair and refuel spy satellites, and potentially even rendezvous > with and and hack enemy satellites. > [https://en.wikipedia.org/wiki/Boeing_X-37](https://en.wikipedia.org/wiki/Boeing_X-37)

We don't really know, but given how little fuel capacity it has and how long it stays in orbit, it's more likely that the DoD's stated purpose of long- endurance testing of new spy hardware is true.

<comment><USER5> The X-37 has demonstrated over ten times the delta V of the space shuttle. Why do you assert that it a limited fuel capacity?

<comment><USER6> If the rumor is that it's being used to refuel satellites, there are two considerations:

1\. Can it get to many satellites? Yes, it has good delta V, though I think you're mixing the X-37's delta V with its boosters and the delta V of the Shuttle orbiter without its SRBs and external tank.

2\. Can it carry fuel for those satellites? No, not much. The X-37 has a maximum total takeoff weight of 5000 kg, while the Shuttle can get 27000 kg to LEO. Unfortunately, only one X-37 will _fit in the payload bay_ of the Shuttle, so we can't actually lift five X-37s in the Shuttle.

Many large satellites weigh more than the X-37's total mass. The biggest individual consumer, the ISS, requires about 7000 kg of fuel annually to stay in orbit. A KC-135 in-air refueling tanker is much faster than an oceangoing supertanker, but you wouldn't use the former to empty an oil rig!

<comment><USER3> The ISS needs that much fuel to boost it's altitude due to drag in LEO. But the refueling of satellites by the X-37 is hypothesized to be at much higher altitudes where there is very little drag.

These satellites don't need altitude boosts-- they use propellant for orbital changes (e.g. to "re-task" a spy satellite to a new region). But instead of chemical rockets they often use xenon gas ion engines.

The key thing with ion drives is their "specific impulse." High-thrust chemical rockets are needed to get out of the atmosphere and perform fast burns, but ion engines are often >10x more efficient once already in orbit. And because there isn't a chemical reaction, there is less corrosion and they can last for years.

Refueling xenon for the ion drives of spy satellites would double or triple their mission lifespan. They don't need much -- maybe just a couple hundred kg. And this could literally save billions of dollars since these satellites are so expensive to build.

[https://en.wikipedia.org/wiki/Specific_impulse#Examples](https://en.wikipedia.org/wiki/Specific_impulse#Examples)

</comment></comment></comment></comment></comment></comment></comment></comment><comment><USER7> These are just suits meant for in-vehicle use and not meant for EVAs, correct?

<comment><USER8> Correct. I don't think Starliner has any EVA capability in fact.

<comment><USER9> If your EVA is really short (and really, really, really needed), I imagine these will do.

<comment><USER5> That would probably be an EVOS rather than an EVA.

</comment></comment></comment></comment><comment><USER10> These are still not very cool. Why is there such a big disconnect between Hollywood movies, and these real space suits? I mean, even the shade of blue isn't particularly nice. If this was a toy, I don't think it would sell very well.

I know it doesn't really matter and the function is far more important than the aesthetics. But still... can they hire some of these Hollywood guys?

I think Elon Musk has the right idea: [http://www.dailymail.co.uk/sciencetech/article-3573869/Elon-...](http://www.dailymail.co.uk/sciencetech/article-3573869/Elon- Musk-wants-create-superhero-astronauts-SpaceX-hires-Marvel-costume-designer- make-spacesuit-Mars.html)

I do think these NASA suits are getting better, though: [https://en.wikipedia.org/wiki/Z_series_space_suits](https://en.wikipedia.org/wiki/Z_series_space_suits)

<comment><USER11> Because Hollywood movies are not generally based in, you know, reality. They're meant to be flashy and futuristic because that is what the audience expects in sci-fi movies. Real life isn't flashy and futuristic, though, and there's a lot of requirements to the suits which aren't super exciting.

So, yknow, good thing it's not a toy but a functional piece of clothing that's supposed to help astronauts do their job.

<comment><USER12> PR is certainly part of their job. I think OT has a point.

<comment><USER11> Not really. Their job is to keep astronauts safe. Glitz and glam don't keep astronauts safe, boring does.

Flashy lights and colors will most likely distract the astronauts in flight.

<comment><USER13> Without PR, there is no public interest, no funding, and no astronauts in flight needing protection.

Why do you think there is big announcement, press event if not for PR?

<comment><USER14> PR is other peoples jobs, just not the people designing a suit. IMO, critical safety systems are reasonable exceptions to the PR game.

</comment></comment></comment></comment></comment></comment><comment><USER15> Boeing's announcement: [https://news.ycombinator.com/item?id=13484880](https://news.ycombinator.com/item?id=13484880)

</comment><comment><USER16> What is the benefit of having the helmet attached to the suit directly instead of detachable like the existing suits? If I was spending months in one of these aboard the space station, I think I would prefer to not have the helmet flopping around behind me all the time.

<comment><USER17> Perhaps just so that it's there if you need it?

<comment><USER16> Maybe they could put it on a leash.

</comment></comment></comment><comment><USER18> So I assume the starliner has touch screens too, when I saw those on the Dragon Crew I thought "Gee how are they going to use those in gloves?" Sking and trying to use your phone is challenging this is just flying through space :-).

While not EVA suits they presumably work during a depressurization event so I wonder if they are candidates for mars suits.

<comment><USER19> Resistive touch screens still exist, and would probably still be preferable from a reliability point of view (I have all kinds of troubles with capacitive screens when there's sweat, humidity, low temperatures, etc)

<comment><USER18> Oddly I've found resistive touchscreens to be _less_ reliable but anecdotes are not data so it could just be I'm unlucky.

One of the interesting things I also find is that using a touch screen on CalTrain while it bounces around is difficult, I can't imagine what it will be like to hit the correct control button on the touch screen of a rocket under boost.

</comment></comment></comment><comment><USER20> Put the zipper to the front side. You could wear it alone without asking for help from another astronaut and save time in case of emergencies.

<comment><USER21> You think the issue of where to put the zipper didn't come up in the thousands of man-hours it took to design that thing?

<comment><USER17> Design by committee?

In which case the zipper is definitely in the least practical place.

Anyway, it's an interesting question that possibly has some story to it which would be interesting to hear.

<comment><USER21> > In which case the zipper is definitely in the least practical place.

Argh! How would we even know it's in the least practical place? Is it because you don't put on your coat that way?

These things are not designed with the same constraints. Getting into a space suit is a slow deliberate process, with people there to help.

<comment><USER17> I can think of at least one edge case where things might be different.

Emergency re-entry, time to put on your suit, but everyone else is dead.

But anyway, I'm just saying it would be _interesting_ to know why certain design decisions were made, what trade-offs were considered, requirement constraints.

Saying something like _you reckon they didn 't think of that_ doesn't _add_ to the conversation.

</comment></comment></comment></comment></comment><comment><USER22> The photo made me wonder if NASA had consulted Nike's marketing department.

<comment><USER23> The shoes are Reeboks, not Nikes. I'm not even kidding: [http://www.boeing.com/space/starliner/](http://www.boeing.com/space/starliner/) (scroll down to the suit and click the plus next to the shoe)

</comment></comment><comment><USER24> "The most important part is that the suit will keep you alive"

That's more important than the color of the suit.

</comment><comment><USER25> Next time they might want to consider hiring a professional seamstress.

</comment><comment><USER26> > Touchscreen-sensitive gloves

So... has anyone rocked some snapchat during a spacewalk yet?

<comment><USER27> Who knew this is how exciting the future would be: Snapchat in space! Maybe they could make the claim of "First app used by a human in a vacuum and micro- gravity".

All the startups in Silicon Valley are vying for that. /s

<comment><USER5> [https://xkcd.com/713/](https://xkcd.com/713/)

</comment></comment></comment><comment><USER28> They should have hired Hollywood to do the designs.

<comment><USER29> The same people who wrote Armageddon? Reality and Hollywood are two unrelated concepts.</comment></comment>


Learn C The Hard Way by Zed Shaw - <AUTHOR> http://www.udemy.com/learn-c-the-hard-way/ <comment><USER2> I was wondering how this compares with or compliments K&R, when I came across [this section][1] of the book that seems to slap it in the face. Here's a section from the second paragraph:

 _You see, "K &R C" is actually riddled with bugs and bad style. Its age is no excuse. These were bugs when they wrote the first printing, and the 42nd printing. I hadn't actually realized just how bad most of the code was in this book and recommended it to many people. After reading through it for just an hour I decided that it needs to be taken down from its pedestal and relegated to history rather than vaunted as state of the art._

This seems a bit hyperbolic to me... I just read K&R several years ago during school (could definitely use a re-read) but remember absolutely loving it for the combination of brevity and density of information conveyed. I'm not much of a C programmer though so I don't really know. Could a modern C programmer respond / elaborate?

[1]: [http://c.learncodethehardway.org/book/learn-c-the-hard- waych...](http://c.learncodethehardway.org/book/learn-c-the-hard- waych55.html#x62-31400055)

<comment><USER3> It's a bit like claiming memcpy() is bugged because it can crash your program. Well, true, it is good style to program defensively against memory corruptions, buffer overflows etc, and in that respect K&R may teach students bad habits.

I think it's a bit much to say that it should never have been written like that, as at the time people knew so much less about building complex projects, sources of error and defensive programming.

Keeping a book up to date takes a lot of effort, as I'm sure Zed (npi) appreciates. It's an old book, it has warts. As you stated, the density of information was what many people like about the book, so any replacement for it will have to replicate that. I don't think the criticism is unfounded though.

<comment><USER4> memcpy is just fine because it has a size parameter. I think you mean strcpy(), which does cause defects.

<comment><USER5> Nah, memcpy shouldn't exist (just not for buffer overflow reasons). memcpy is there because someone got their knickers in a twist over possibly being a few cycles faster than memmove, even though the chances that actually matters is tiny, while the chances that you'll accidentally use memcpy when your memory overlaps is much larger.

<comment><USER6> actually that justification for memcpy is quite poor. usually, performance wise, it is quite easily beatable once you start using the hardware. most implementations I've seen loop byte copies in the most naïve way possible... almost every architecture supports 32-bit copies, most support more... :)

incidentally I've saved some .2-.8ms per frame in a "AAA" (I use the term loosely and with disgust) game title by replacing compiler generated assignment operator in one struct with an explicit 128-byte copy. copying individual bytes is slow, and the compiler is never as sufficiently smart as people claim.

in analagous cases involving memcpy, the fact that memcpy is not memmove saves much less than actually copying the data in a way that squeezes everything out of the data buses. :)

<comment><USER7> _"almost every architecture supports 32-bit copies"_

How much of that was true at the time that function was created?

Also, on 'just use memmove': it would not surprise me if ancient Unices used memcpy instead of inlining it to copy really small buffers (such as 14-byte- max filenames), not for speed, but for the byte savings (even if singular 'byte' is the correct way to phrase that). With small buffers, the overhead of that 'if' can become substantial.

</comment></comment></comment></comment></comment></comment><comment><USER4> Just a warning to everyone, like the book this course is in development as I write the book. It's covering a lot of the chapters, but I have to go back and clean up some videos and do the final ones. That's why the price is low for now.

<comment><USER8> What's your method for making the ePub version of your books? I'm considering writing a custom program for my own stuff, but I'd love to be able to use something off the shelf.

<comment><USER4> I'm ditching ePub. It's a crap format that has a bewildering number of options and it seems every viewer wants to implement some different subset of them.

From now on, it's PDF and HTML only.

<comment><USER8> Glad to hear it. When people ask me about ePub/Mobi, I tell them that both formats are broken and that if I ever produce them it'll only be as a stupid marketing gimmick.

What we really need is a format that works across different devices. If only there were a _portable document format_ that solved this problem...

<comment><USER9> Yeah, because PDFs work really great on devices of different screen sizes.

Also, the author should stop promote the epub version if he won't do it.

<comment><USER8> This is a limitation of the device, not the format. Why do people expect to be able to read heavily formatted books on every device they own? For books made up mostly of natural language text, this might be a reasonable expectation, but technical books have a different set of design constraints that make them ill-suited to general e-readers.

<comment><USER9> _This is a limitation of the device, not the format._

No it's not. The kindle works fine for programming books, I'm currently reading Bjarne's "The C++ Programing Language" on my kindle, on PDF actually. The book itself lies on my bookshelf but why would I bother to open it?

The PDF isn't tailored for the kindle but it has wide enough margins so that when you crop it it works quite well on the kindle. The kindle is not the limitation nor the problem.

The problem is rather the crippled format that you get in a fullsize PDF. What exactly are you going to read it on? Print it out? (seriously?). On your monitor? Not really... On your tablet? You're joking right, reading a book on a glossy LCD?

Having a book as a PDF is quite useless for other than using it as a reference.

Now I don't know about any potential issues with epub/mobi, and honestly I couldn't care less in this case. The site mentioned (and still does) that an ePub will be available and if so I kind of expected an ePub version of it, in my eyes that was an incentive to take the course.

If that isn't going to happen an ~A5 PDF will work great too, since there actually exist devices that you can read it on comfortably.

And I kind of have a hard time to see why the book, as it is portrayed in the HTML-version wouldn't be able to work as an epub - but OK, if that's the case (or if epub truly is just a mess) that's surely not the case for a portable- device-friendly-PDF.

Also, it really cracks me up to see someone talk about broken formats and in the same post make an argument for PDF.

</comment></comment></comment></comment></comment></comment></comment><comment><USER10> In case one does not want to spend $29, the free HTML book [1] (currently in beta) is good enough. I have been following along the book, and can vouch for it. It is a great way to learn to code in C.

[1] <http://c.learncodethehardway.org/book/>

EDIT: By posting the link to the book, I by no means meant that the videos are redundant. I would love it if more people en-roll for Zed's Udemy course and support him.

<comment><USER11> How much $$ have you spent on lattes reading his free book?

Books, videos and course materials don't just happen because we say so. Real people create this stuff.

<comment><USER12> It amazes me that people invest 20 hours in reading a book and complain about the price. If we assume roughly $40/hr for a $80k programmer, this is about $800 worth of time you're investing. Does a "hard" investment of $29 (4%) really make that big of a difference?

<comment><USER13> I always use "let's assume roughly X/hour" as a joke.

You don't get paid for your spare time, except in opportunity cost. If someone applies 20 hours of their time at work, then yes, that's pocket change. If they apply 20 hours of their time at home, that's not time that they'd get paid for anyway, so the analogy is as foolish as the claim that every pirated copy of a movie would have been bought were it not for pirates.

Instead, I'm choosing between 20 hours of reading a book and maybe 20 hours of watching television (for example), which costs the electricity that the television consumes (since the cable or internet is paid for already). I suspect you'll find 20 hours of TV will cost less than $29. Or maybe it's 20 hours of running over the course of a couple of weeks. That's free, except maybe for the cost of the water to rehydrate. That's probably cheaper than $29, too. If you want to do the analysis in terms of how much it will earn you in the future, that's also valid I guess. But it complicates things, since it's hard to quantify how much the relaxation you get from watching TV or destressing from running is worth.

Let me just say, I don't think people should complain about the price of a good book when it's <$50-100 (depending on material). But the X/hour analogy only works if you're taking work time, and then many companies will often be willing to refund you that money anyway.

Last note: this isn't $29 for a book. It's $29 for a video course (though admittedly a non-HTML version of the book is thrown in at the end). The book itself is available for free, which is all that the OP was pointing out.

<comment><USER12> True, but by working for "roughly X/hour" you've established that the typical exchange rate for your time is roughly X/hour. If I were to ask you to do some work for my during your off time, I would have to pay about X ± X/2 depending on how you guarded your time. So what if someone only values their time at X/4? That's still $200 worth of spare time.

<comment><USER13> That's fair, if we're continuing a monetary analogy (which I did do).

My spare time is worth happiness/distraction to me. Not money. I will confess that in that particular regard, I may differ from some, or perhaps even most, others.

</comment></comment></comment></comment></comment></comment><comment><USER14> I just scanned through the free HTML book and this looks definitely a good start for a modern "get started fast" book about C: everything is important about the language seems to be covered. Good work.

</comment><comment><USER15> I'm excited - Learn Python the Hard Way completely jumpstarted me into what has become a large internal django site, and I refer back to it often. I really enjoy python, and I thank Zed for the straightforward aproach.

So even though I love python I want to see if the same technique can introduce me again to C, a language I never felt comfortable with.

<comment><USER4> Try going through the HTML version, and drop comments when you hit problems. That'll help me make the book solid.

<comment><USER16> Are guest comments ever going to be an option? I don't really want to make a disqus account. I understand if not, but I figured I'd ask anyway.

<comment><USER4> No, I'm fully blocking and moderating comments. They are for serious students who need help, not drive-by netizens. In the past I had them open, but after the first two hits by HN or reddit I had to lock it down so that students wouldn't get thrashed.

<comment><USER16> FWIW i signed up to your udemy course, but I don't particularly feel like making a disqus account to also comment on the book, that's what's bothering me. I guess I will just abstain from commenting though, it's fair enough.

</comment></comment></comment></comment></comment><comment><USER17> What I really like about LCTHW (after reading K&R and then just _not doing anything with it_ ) was starting you out using the tools and best practices right from the beginning. Make and valgrind up front. It got me over the hump of syntax&language --> actually using.

</comment><comment><USER18> I disagree with your disdain for IDEs... I hope that you are not totally misleading the people who will learn from your book because learning how to use the capabilities of Visual Studio or any decent IDE is very valuable. How are they going to debug complex graph data structures in their CS class if they don't have a great debugger? How are they going to understand the power of intellisense in modern programming? How are they going to learn about compiler flags without getting a headache? How much time are they going to waste compiling and linking with the commandline?

I like the no-copy-paste and straight notepad approach trust me. It works for everyone, it's a solid way to get these things into your brain. You need to write code, there's no way around it. But to tell people to never use IDEs because they are bad and they make you a bad programmer is BULLSHIT.

<comment><USER4> IDEs are bad for you. It's much better to simply use a real programmer's editor that you can craft into being what you need. In fact, I can usually take vim plus cscope, exuberant ctags, and ack and demolish any code base you throw at me. Similar with emacs and other power editors.

IDEs are usually useful if you're stuck using them to build GUIs or use specialized build tools they require.

<comment><USER19> Please dear wizard, here's a list of requirements for a fellow programmer that he can currently do with Visual Studio and wants to do the same with vim:

\- find in files (in vim, not in bash)

\- replace in files

\- rename symbol (uh-oh...)

\- quick open file in project (visual assist feature)

\- list of files in project (not in directory)

\- build system (something easy to use, not that make bullshit)

\- go to declaration/definition ( sometimes I get a list of 30 matches from ctags, so I would like something that actually works )

\- view call hierarchy (callers, callees)

\- code completion (something that works and is easy to use, like in visual assist)

\- watches

\- breakpoints in disassembly

\- step into disassembly

\- memory view while debugging

\- edit & continue

\- memory (data) breakpoints

We're talking about large C/C++ codebases, obviously. You might get 50% of the features above after tinkering for a few days/weeks/months with your vim with (probably) much worse usability, when you could have used Visual C++ from the get-go and enjoyed a "real programmer's editor", as you put it.

This bullshit religion you are introducing only hurts potential programmers because instead of focusing on getting their job done they have to reinvent the wheel every time they have to write a line of code. I'm not saying it's a bad thing for a young mind to experience the horror of having to debug a 500.000 LOC codebase with a stone-age debugger, just for the kicks ("that's how your old man was programming back in the day, son"), but when you have to meet deadlines and release something going vim-only can quickly become a liability.

<comment><USER20> Sadly in Linux you don't have the luxury of Visual Studio and I've tried doing portable C/C++ in Windows (with cygwin and various make programs). It just doesn't work right.

But I agree with overall sentiment. We shouldn't try to make programming hard. It is hard already.

</comment></comment></comment></comment><comment><USER21> Nevertheless, Zed is helping lots of people out there who is eager to learn coding like me, I could imagine back in the days if you want to learn coding there are tons of resources out there, probably too many, that you don't know which one is good and it cost you money. Now, people like me can always go to his book finish the course and look for what is missing without spending a buck.

</comment><comment><USER22> I'm really glad to see that C can get in the spotlight even on HN.

<comment><USER23> Is it really surprising that C can get in the spotlight even on Hacker News? It's the quintessential hacker programming language!

<comment><USER22> I guess I wasn't feeling an optimist on the day I posted that... Good Point!

</comment></comment></comment><comment><USER24> There's also a "Learn Python The Hard Way" course: <http://www.udemy.com/learn-python-the-hard-way/>

</comment><comment><USER25> There is a typo in the first sentence: "This will be the companion course to my new book, "Learn C The Hard Way" whch I'm working on right now".

You probably want to fix that.

</comment><comment><USER26> I'm really considering to take this one, but I've would like to consider other alternatives, anyone knows other online c classes?

<comment><USER4> The video course is being worked on by me while I write the book, so expect it to be rough around the edges.

But, I say try going through the HTML version online, and as you do get stuck write comments to ask me questions. That's why I put it online for free, so that I get student feedback while I write the book.

</comment></comment><comment><USER27> It's funny how, I started getting annoyed seeing people still learning to code on books while free tutorials were starting to pop up everywhere on internet.

And now people are starting to charge for those tutorials. And I know people here in HN love Zed Shaw. But come on, there are hundreds of free great tutorials to learn C on internet.

<comment><USER4> My HTML version is still free, and if you tell me of the free C books I'll link to them here:

<http://programming-motherfucker.com/become.html>

<comment><USER27> Right, started reading into it. Very good! Thanks.

</comment></comment></comment><comment><USER28> I am working with his learn python the hard way course on udemy and his book and videos have helped me get going

</comment><comment><USER29> Most awesome. Even though it have plenty already, I would be more than happy to pay more for more chapters.

</comment><comment><USER6> I did look at this book a while ago, I was unable to make amendments to the code examples. early versions made common C gotcha mistakes, although of the more subtle and less disasterous kinds... starting with non-standard entry- point function signature and generally relying on non-standard features of particular compilers. fortunately someone else seems to have gotten there in the end... i'd be wary, simply because the author is (as much as I am a fan of much of his work) clearly not an experienced C programmer.

<comment><USER4> I am a very experienced C programmer, and I have full comments on any page. You find an error, drop a comment and I'll fix it immediately.

Chances are though, you're someone who read the K&R chapter, then went through nitpicking minor semantics about things like "NULL is 0" and then consider all the code broken in the book.

But, any errors you find, let me know and I'll fix them. Just don't call me an inexperienced C programmer.</comment></comment>


What is a coder's love like? - <AUTHOR> http://werd.io/2014/4d-79-20-6c-6f-76-65-20-69-73 <comment><USER2> ...

My love is like localhost, always there when you call its name

My love is like fopen("a"), always growing to the end

My love is like SYN, looking for a connection

My love is like gdb, willing to take things step by step

My love is like DUAL_EC_DRBG, sneaky 'round the back door

My love is like Lisp, if parentheses were hugs</comment>


Huawei's Undocumented APIs – A Backdoor to Reinstall Google Services - <AUTHOR> https://medium.com/@topjohnwu/huaweis-undocumented-apis-a-backdoor-to-reinstall-google-services-c3a5dd71a7cd <comment><USER2> Seems like a dead story:

> Update: The "LZPlay" website and download links are no longer accessible. > Even if you grabbed the APK before it was gone, it no longer works, as the > special certificate required to access the "backdoor" is either revoked by > the developer or Huawei. In addition, existing devices that used LZPlay to > install GMS no longer passes full SafetyNet Attestation, rendering many apps > and services unusable, such as Google Pay and many games.</comment>


Ask HN: Why is the Peter Thiel Trump donation story buried by HN? - <AUTHOR> The story http://nytimes.com/2016/10/16/technology/peter-thiel-donald-j-trump.html has been submitted multiple times but each time it was flagged and removed. It made it twice to the front page   https://news.ycombinator.com/item?id=12716514 https://news.ycombinator.com/item?id=12716678 with many points and comments but still got removed... Given that Thiel just became a part time advisor of YC that's a weird coincidence. <comment><USER2> Moderators have not intervened on these donation stories. They received a number of flags from users who believe they don't belong on Hacker News, probably because political stories are specifically called out as off-topic by the submission guidelines.

(See also [https://news.ycombinator.com/item?id=12716673](https://news.ycombinator.com/item?id=12716673))

</comment><comment><USER3> I would bet it's because all political stories get buried on HN. Per HN guidelines:

"Off-Topic: Most stories about politics, or crime, or sports, unless they're evidence of some interesting new phenomenon. Videos of pratfalls or disasters, or cute animal pictures. If they'd cover it on TV news, it's probably off- topic."

[https://news.ycombinator.com/newsguidelines.html](https://news.ycombinator.com/newsguidelines.html)

<comment><USER4> Few weeks ago there were constantly at least 5/30 pure political stories on the main page. And this wasn't a problem. They weren't flagged or manually 'downweighted' by moderators like now ([https://news.ycombinator.com/item?id=12715332](https://news.ycombinator.com/item?id=12715332)).

But these stories were mostly anti-Trump...

<comment><USER5> Perhaps they changed their policies.

Isn't it nice to be able to go somewhere and _not_ discuss the same [series of colorful expletives expunged] topics we can discuss everywhere else? It's not like HN has much of a unique take on the topic, at least from what I've seen. Well, except for maybe being more generally grammatical than the usual set of flamewars. But it's still the usual set of flamewars.

</comment></comment></comment><comment><USER6> This is partly why I like hckrnews.com as my front page. Stories that are flagged yet have massive upvotes still appear there, and I'm happier for it.

</comment><comment><USER7> It's getting flagged because people are tired of reading about Donald Trump and tired of reading about Peter Thiel. I doubt there's any larger conspiracy.

</comment><comment><USER8> I'm not very political and I haven't decided who to vote for yet, but I don't understand why the tech industry is so anti-Trump.

He seems like a relatively sincere and smart guy to me, and some of his policies seem to be better for business.

Is it because of tougher immigration laws? Are there other reasons based on his policies, or is it mostly just emotional?

<comment><USER9> _He seems like a relatively sincere and smart guy to me_

I challenge you to post one quote from Trump that "seems smart".

<comment><USER8> I watched a few of his recent speeches and a lot of what he says seems pretty reasonable. I think he started out being more extreme to grab attention and now that he's got momentum he's mellowed out and actually developed rational policies.

Most people are very emotional about it and seem to have knee-jerk reactions, so I'd like to hear from people who actually read his finalized policies and have specific criticisms about them, not just referencing scandals.

<comment><USER9> Absolutely has to be a troll. EOM

</comment></comment></comment></comment><comment><USER10> Thiel was on the fence about donating earlier, but Trump's alleged acts of serial sexual predation, accusations that Hillary was on drugs and should be in jail, that people are rigging the election in the media and at voting booths...it took those to really seal the deal!

more on-topic, seems problematic for the tech community when prominent tech folks take a strong stand against free speech, for authoritarian anti-free- press candidates. (while claiming libertarian leanings, to boot!)

</comment><comment><USER11> (At the risk of getting downvoted by HN folks...)

Isn't it obvious? It's because Peter Thiel is a part-time partner at Y Combinator.

> I'm delighted to announce Peter Thiel is joining YC as one of the (now 10!) > part-time partners.

Source: [http://blog.ycombinator.com/welcome- peter](http://blog.ycombinator.com/welcome-peter)

Reference: [https://en.wikipedia.org/wiki/Peter_Thiel#Y_Combinator](https://en.wikipedia.org/wiki/Peter_Thiel#Y_Combinator)

</comment><comment><AUTHOR> To the HN mods. Now how do you explain that this post got flagged and removed...?

<comment><USER2> When a story says [flagged], it's because users flagged it.

<comment><AUTHOR> So a handful of users can decide to bury a subject even though a great majority of HN users find it useful? This post is within the HN guidelines (it's not about politics it's about HN processes).

<comment><USER12> That's how user generated content works.</comment></comment></comment></comment>


Marijuana Use in Early Adolescence - <AUTHOR> There is an ongoing body of research showing that people who start smoking marijuana before puberty have significantly worse outcomes than those who start after or do not start at all.
I am one of the ones who started early, and my life has been plagued with mental health issues. I think having a high IQ at baseline has saved me trouble, but judging by this research I am suffering some damage.
Anyone else on here who started smoking weed at age 12-13? What's your life like? <comment><USER2> > There is an ongoing body of research showing

Can you add links to the research?</comment>


CloudFlare Suffers Major European Outage - <AUTHOR> http://www.techweekeurope.co.uk/cloud/cloud-management/cloudflare-suffers-european-outage-194020 <comment><USER2> Really this should read, "Telia having problems in EU".

They are a big transit providing, clearly causing issues for quite a few services in all directions.

Some content providers use Telia to reach the Internet in part or full.

Some ISPs use Telia to reach the Internet or parts of it.

<comment><USER3> CF seems fair, redundancy is a thing.

<comment><USER4> Following the same logic, every website is responsible for itself.

<comment><USER5> Extrapolating ad absurdum, yes, but at Cloudflare's scale there should be enough redundancy that a single carrier couldn't bring it down.

</comment></comment></comment></comment><comment><USER4> I don't understand people taking it to Twitter to moan about it. Shit happens and it only happens 0.001% of the time in this instance.</comment>


Ask HN: Anonymous, secure proof of identity after quorum? - <AUTHOR> let's saY there were 100 people charged with making a hard choice. No one is willing to publicly suport the hard choice unless they are certain the majority hold that opinion
Now, a watcher wants to create a website that correctly and anonymously reveals how many people would be willing to make the hard choice.
Furthermore: As soon as a Majority have eXpressed that they are willing to make that hard choice, everyone who holds that opinion should learn each other's identities. And thus feel emboldened to publicly anounce their opinion.
There are many dificult parts here: how would you confirm, that only the 100 people are able to vote, and have their vote only count once.
How would they feel confident that their identity is anonymous?
I'm less interested in game theory about how people would try to trick the system, more in the technical feasibility of creating such a site.
Completely theoreticaly of course. <comment><USER2> I think you will find Debian election process interesting for what you are trying to do : [https://www.debian.org/vote/2019/vote_001_tally.txt](https://www.debian.org/vote/2019/vote_001_tally.txt)

<comment><AUTHOR> Thanks! A few questions:

how does srivasta identify their secret token?

Let's say I wanted to e-mail all of the owners of bookstores in my home town, and have them vote...

What secret would they use with my system to prove that they were one of the owners without revealing their identity?

<comment><USER2> People sign their vote, I'm not sure how the details work, you will need to look at the details of Devotee, look at [https://lists.debian.org/debian- devel-announce/2019/04/msg00...](https://lists.debian.org/debian-devel- announce/2019/04/msg00006.html) and [https://salsa.debian.org/debian/devotee](https://salsa.debian.org/debian/devotee)</comment></comment></comment>


Betteridge's Law of Headlines - <AUTHOR> http://en.wikipedia.org/wiki/Betteridges_Law_of_Headlines <comment><USER2> For a laugh, I've made a userscript[1] that highlights (lowlights really) HN headlines that conform to this law.

The result looks like this: <http://testing321.netau.net/betteridge- sample.png>

Improvements welcome, especially if instructive. :)

[1] <https://gist.github.com/2908570/>

[Chrome: drag 'raw' link to omnibox to install]

[Based on <http://news.ycombinator.com/item?id=3934937>]

<comment><USER3> Will this userscript stop people from posting linkbait articles?

</comment></comment><comment><USER4> Sounds like a great title for a new blog entry. Does Betteridge's Law apply all of the time?

Obviously this is true about factual reporting -- the _real_ law seems to be making a judgment on the supportability of the facts, which is only important when you are doing factual reporting. If you are doing analysis, many times the entire purpose is to answer some tough question, so having a head with a question mark makes sense.

Also note that if you couldn't answer the question with a "no" then there wouldn't be much point in doing the analysis in the first place. Many times the nature of these stories are such that you could call it either way, and what the editor wants is for you to go research it and make the best guess you can. That's a fair type of analysis article Note the I believe analysis and commentary articles should be clearly-marked and set aside from normal reporting.

What I see a lot of -- in major media outlets -- is analysis pieces masquerading as news stories. From bloggers I see a lot of half-baked opinion pieces with question mark heads where the blogger basically just throws a couple of facts out and waves his hands around some, hoping to stir up a fight. It's true that question marks in headlines are a warning sign, but it's a heuristic, not a law.

</comment><comment><USER5> _"The maxim trends towards being universally true"_

I realize it is a little pedantic but I think it is reasonable when an encyclopedia article contains a line like that. After three or four minutes on the terrible NYT and Washington Post advanced article search I found the following:

Who Will Be Next to Call Nuclear Energy Indispensable? [http://rendezvous.blogs.nytimes.com/2012/06/08/who-will- be-n...](http://rendezvous.blogs.nytimes.com/2012/06/08/who-will-be-next-to- call-nuclear-energy-indispensable/?scp=6&sq=&st=nyt)

Who Made Those Fingerprints? [http://www.nytimes.com/2012/06/10/magazine/who- made-those-fi...](http://www.nytimes.com/2012/06/10/magazine/who-made-those- fingerprints.html?_r=1&scp=10&sq=&st=nyt)

When Should Juvenile Offenders Receive Life Sentences? [http://learning.blogs.nytimes.com/2012/06/08/when-should- juv...](http://learning.blogs.nytimes.com/2012/06/08/when-should-juvenile- offenders-receive-life-sentences/?scp=1&sq=&st=nyt)

Who Should Teach Our Children? [http://opinionator.blogs.nytimes.com/2012/06/07/who- should-t...](http://opinionator.blogs.nytimes.com/2012/06/07/who-should-teach- our-children/?scp=15&sq=&st=nyt)

What is IPv6 and Why Does It Matter? [http://www.washingtonpost.com/business/technology/what-is- ip...](http://www.washingtonpost.com/business/technology/what-is-ipv6-and-why- does-it-matter/2012/06/06/gJQAbClTIV_story.html)

In light of a comment about NYT / Washington Post being off topic to HN and or scoped to assertions only:

Is It Worth It Being Wise? <http://www.paulgraham.com/wisdom.html>

Could VC Be a Casualty of the Recession? <http://www.paulgraham.com/divergence.html>

<comment><USER6> He should have said any headline that is a yes or no question.

<comment><USER7> That wouldn't have been as good a headline.

</comment></comment></comment><comment><USER8> The usual phrasing of the law is nice and snappy, but I think one of the examples in the Wikipedia article -- "Can the middle class be saved?" -- demonstrates that the right formulation is something like this: If a headline is in the form of a question, the right answer is almost certainly whatever answer is least surprising. If you see a headline along the lines of "Did we really evolve from apes?", "Does the earth still go round the sun?", "Can humanity survive?", etc., it probably means that some crackpottish idea has come up that would make the answer "no", and that the headline writer knows that actually endorsing it would be a step too far.

</comment><comment><USER9> My favorite joke about this adage is that the following headline goes with it perfectly.

A news editor prints a story about the adage, with the headline: Betteridge's Law of Headlines, is it true?

<comment><USER5> That reminds me of a similar story about double positives that I can never remember the details of. Fortunately wikipedia came to the rescue:

 _"During a lecture the Oxford linguistic philosopher J. L. Austin made the claim that although a double negative in English implies a positive meaning, there is no language in which a double positive implies a negative. To which Morgenbesser responded in a dismissive tone, "Yeah, yeah."_ [1]

[1] <http://en.wikipedia.org/wiki/Sidney_Morgenbesser>

</comment></comment><comment><USER10> Stay up to date on this pressing issue by following my pet robot, @questionheds. <https://twitter.com/#!/questionheds>

</comment><comment><USER11> This is especially true of British tabloids, in particular the Daily Mail.

I often find it interesting to read the headline and then the final paragraph of the article text.

For example headline: "X causes Y" Final paragraph: "No links were found between X and Y"

<comment><USER5> As an American I was wondering about non EN-US language headlines. Can anyone comment on non-english language publications?

<comment><USER12> I can't remember seeing any headlines phrased as questions in any credible German news paper (there's one on 'Sun' level named 'Bild' which I refuse to read, so no comment on that).

There are also some weekly news papers which sometimes contain longer opinion pieces; those might have question marks in their headlines, but usually they aren't too sensationalist.

</comment></comment></comment><comment><USER13> It would be interesting to analyze a large body of headlines to see whether exist many pairings of similarly worded headlines with and without question marks.

</comment><comment><USER14> It seems most fear-mongering in the media is phrased this way.

"Coming up at 11. Are children being killed by breastfeeding?!"

<comment><USER15> upvote for humour.

</comment></comment><comment><USER16> Obligatory Saturday Morning Breakfast Cereal: [http://www.smbc- comics.com/index.php?db=comics&id=2075](http://www.smbc- comics.com/index.php?db=comics&id=2075).</comment>


Symfony, Doctrine and MariaDB: they can be friends - <AUTHOR> https://marenkay.com/2018/06/12/symfony-doctrine-mariadb/ <comment><AUTHOR> I started a summer season series on Twitter [https://twitter.com/marenkay/status/1006286995767877634](https://twitter.com/marenkay/status/1006286995767877634) (now to be found with #summersymfony) on common pet peeves and quirks one encounters when working on Symfony projects.

The series will go on for at least a month and take apart small stuff from real world projects.

I'd be happy to get some feedback and/or suggestions!</comment>


Ask HN: Is HN an echo chamber? - <AUTHOR>

From my observation, the software community seems to be largely segmented into two main subcultures or school of thoughts (while there are many other shades in between or at their intersection): the hacker one and the non hacker one (I will use "enterprise" for lack of a better word).
The hacker subculture has a more craftsmanship oriented approach to software development while the enterprise subculture has a more engineering oriented approach.
Some technologies that tend to be more commonly associated with the hacker subculture would be Linux, Python/Ruby/Go, REST, etc. And with the enterprise: Java/C#, Windows, Oracle, SOAP, UML, etc. (I might be a bit off here)
Obviously, Hacker News is largely dominated by the hacker subculture and since it is my primary source of information, I am sometimes wondering if I am missing out on some valuable knowledge from the other side of the industry (e.g. I stumbled upon infoq.com recently and realised I didn't understand half of the jargon - IT governance, AOP, DDD, APM, etc.).
Do you think my assessment is somewhat accurate? If so, any actionable advice on how to get more exposure to the non-hacker side of the industry? <comment><USER2> Other than working at an enterprise-type company, getting exposure through watching videos might help. And remember - the best definition of enterprise software that I've ever heard is: enterprise software is when the person buying the software almost is never the one who uses it.

[https://www.oracle.com/javaone/sessions/index.html](https://www.oracle.com/javaone/sessions/index.html)

Based on your brief posting, you might be interested in more CIO-style matters.

[http://www.cioinsight.com/ciovideos/](http://www.cioinsight.com/ciovideos/)

Really, I personally believe the more exposure you have to fields outside of your profession (at least the one you are in for now), the better mental model of the world you want to be part of you produce.

I used to work in enterprise software so I can say for sure that it its own unique bubble, just like startups.

In fact, read this book:

[http://www.amazon.com/Seeing-like-State-Certain- Condition/dp...](http://www.amazon.com/Seeing-like-State-Certain- Condition/dp/0300078153)

</comment><comment><USER3> I work on enterprise software, and I can tell you that Linux is very big in the enterprise space - it's not just a hacker thing. For example, IBM makes it available on all their server platforms, even their largest mainframes.

And from reading the comments on HN for a few years, I know that there are others here who work on enterprise software.

 _" I stumbled upon infoq.com recently and realised I didn't understand half of the jargon..."_

The jargon is an ever-changing spew of new names created by marketing people for the same old shit. I've worked in enterprise for my whole career and I don't even understand most of the jargon on my employer's web site.

<comment><USER4> _" The jargon is an ever-changing spew of new names created by marketing people for the same old shit."_

The same could be said for the hacker side of things where people re-invent the same things and give it new names.

There's also a lot of hacker jargon like: Kanban, Agile, Lean, Functional Programming, Iterate, Ideate, Hack (which means basically everything within the context it is said), etc.

</comment></comment><comment><USER5> Hacker News is far, _far_ less of an echo chamber than Reddit or Product Hunt.

<comment><AUTHOR> I agree and didn't mean this as a criticism of HN (there is indeed a lot of variety here compared to other online communities). My question was more along the lines of: "Is there anything of value to be learned from the enterprise software world?"

<comment><USER6> _My question was more along the lines of: "Is there anything of value to be learned from the enterprise software world?"_

It kinda depends on what your interests are, and where exactly you draw certain lines, but I'd give that a qualified "yes". Actually, to me, I consider enterprise development to be far more interesting that, say, working on consumer facing webapps or something. And I am biased, as my own startup is a vendor of "enterprise" software.

But, yeah, the enterprise world has some really big, hard and fun challenges to deal with... and I guess I take a somewhat expansive, "big-tent" view of what falls into the enterprise space. From where I'm sitting, using Hadoop, Kafka, Spark, Storm, Giraph, Hama, etc. for complicated backend analytics and real-time business intelligence is amazingly interesting stuff. And distributed systems of all kinds fall into what I'd consider enterprise. The recent talk about a "data center operating system"? That showed up here at HN, but I still consider it an enterprise topic (but not necessarily exclusively so).

Anyway, things like MDM (Master Data Management), BPM (Business Process Management), BRMS (Business Rule Management Systems), Decision Support Systems, BI, Predictive Analytics, Real-time Marketing, SOA, etc., have lots of fun and interesting aspects.

FWIW, another good site for keeping up on the enterprise side of things is:

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

<comment><AUTHOR> Thanks! Any other resources you can recommend? I'd be especially interested in related books/online courses if you know any.</comment></comment></comment></comment>