Fake IDs in the age of the internet - <AUTHOR> https://melmagazine.com/there-is-a-fake-idgod-and-he-lives-in-china-641bdfd9745a <comment><USER2> The mass use of fake IDs of this sort is a bizarrely American problem. In the UK, you're considered an adult at age 18. Most (aside from the unfortunate 17-year-olds) university students can legally purchase alcohol, smoke, or gamble if they so choose.

But we don't have MADD, I guess.

<comment><USER3> I think a big part of the problem is that America is very large and very car focused. If you can reasonably walk to where you're drinking (or more importantly, walk home from there), then you're less likely to drive drunk. Many bars in America essentially require driving to and from.

<comment><USER4> I think the car-orientation of the US would greatly benefit from a European- style approach to teaching kids about alcohol.

I lived in Germany for a year as an exchange student when I was 16, the age at which kids can drink without a parent present. They can't get a license until 18. The vast bulk of kids there, in my experience, seemed to figure out sane drinking well before they got behind the wheel.

Coming back to the US and going to college, I watched kids drinking at 18-19 and driving, because they were inexperienced with alcohol, and in a culture that tends to encourage binge drinking.

It'll never happen; the US simply seems culturally incapable of healthy approaches to easing kids through becoming adults on a number of dimensions.

<comment><USER3> > the US simply seems culturally incapable of healthy approaches to easing > kids through becoming adults on a number of dimensions

I couldn't agree more, and numerous problems are pretty much a direct result.

<comment><USER5> The worst part is that teaching kids about alcohol safely at home, European style, is ILLEGAL in much of the US, meaning that social services might come take your kids if they discover you gave them a glass of wine at Christmas.

I grew up in Europe. I was planning on letting my kid try a small glass of wine with food in their early teens. But doing so in the US, I actually risk jail and loss of parental custody. Let that sink in...

The US has a really unhealthy attitude towards alcohol that results in binge drinking and excess in college, and society here almost prefers it that way which is depressing.

PS - I know many parents ignore these laws, but the point remains, the law makes no exception for parental consent or at home.

<comment><USER6> It boggles my mind that outside my small social bubble, people around my age (23) spend their whole weekends drunk. I'm not out to stop them and I accept their choices, but I wonder if it's also a result of our alcohol culture. Most people can't seem to enjoy just one or two beers.

<comment><USER7> I'd rather be drunk with them than hang out with you and risk falling off that high horse.

</comment></comment></comment></comment></comment></comment></comment><comment><USER8> > in my case, hidden inside a box of red chopsticks. Though I reflexively > tossed the utensils out with a glut of election mailers and Bed Bath & > Beyond coupons, I soon realized they just might contain what I'd been > waiting over two months for.

This is the weirdest part of the story for me. Does anyone else get boxes of chopsticks in their mail so regularly that they instinctively treat it as junk mail?

<comment><USER9> "This is the weirdest part of the story for me. Does anyone else get boxes of chopsticks in their mail so regularly that they instinctively treat it as junk mail?"

Actually, every two months or so we will receive an amazon package with some item that we never ordered and is not in our purchase queue, etc. Something we never even looked at.

I used to think this was just a mistaken fulfillment, etc., but now I think it's intentional. I think vendors are mining purchase history to determine likely new customers for item X and then sending a "mistaken" shipment to introduce the product.

I have no evidence to back up that conclusion.

<comment><USER10> If you don't already know, you should be really careful about this. It's something which scammers do once they've got hold of your card; websites often require you to purchase something shipped to the billing address already on your card before changing the address.

</comment></comment></comment><comment><USER11> _> The options for payment were Bitcoin and Western Union; since I'm neither a Russian hacker nor a Dark Web impresario, I opted for the latter._

This is so frustrating for me to read. Western Union has its own set of problems and its users throw money away on fees, but why is cryptocurrency being thought of as a only being used by Russian Hackers and Dark Web impresarios?

<comment><USER12> > and its users throw money away on fees,

Have you seen the transaction fees for Bitcoin lately?

<comment><USER13> Still cheaper than WU. A typical BTC txn fee is somewhere in the ballpark of $0.50 right now. The author of this article paid WU a txn fee of $14 if I'm reading it right.

</comment></comment></comment><comment><USER14> I've been interested in this topic for a while. The article was fairly good but I did have a few minor quibbles. For one, ordering from IDGod (the vendor in the story) is known to be very reliable. If packages get stopped at customs, a customer can contact support to get a replacement shipped at no charge. Additionally, the advanced scanner BarZapp is pretty much a non-issue. Almost any ID purchased from vendors on the subreddit mentioned in the article will pass those easily.

<comment><USER8> How will a fake id pass BarZapp? According to the article (I know nothing about this, so could be wrong) it looks up the id in a database and returns the name and dob of the owner. How could the made-up name be in the database?

Or are they cloning existing IDs, and the buyer doesn't get a choice in the name?

<comment><USER14> It's neither. All BarZapp does is read the barcode and check that it contains reasonable information and it formatted according to the standards. Vendors have figured out proper formatting so they look appropriate to BarZapp. Of course, no fake id will pass actual lookup in a database. Except of course cloned IDs, which are extremely rare in my experience. I've heard of stories of someone with a stolen DMV database who would sell fakes with real information for about $700 each, but I've never seen it myself, and no reasonable vendor doing anything like that would be selling through the clearweb.

<comment><USER15> At that point you're talking about identity theft which is a _whole_ different ballgame...

</comment></comment></comment></comment><comment><USER16> About 5 years ago I went to a getaway-type bachelor party. Along with us were the groom's future brother-in-law and two state police officers (friends of the groom, it wasn't that exciting a trip). At one point in the night, the brother-in-law (18) hands his fake ID over to the cops, they both stare at it and go, "Nope, no way I could tell that was fake."

Ever since I've been waiting for the US to suck it up and drop the drinking age back to 18, highway funds be damned.

<comment><USER17> Don't hold your breath.

</comment></comment><comment><USER18> A friend of mine from the University of Texas was arrested by Federal Agents while eating dinner in the cafeteria at Jester dormitory. He had purchased a card printing machine, a hologram printer, a blue portrait backdrop, etc. and set up shop in his dorm room. He made quite a bit of money before the law caught up to him and, despite being older and wiser, still has that felony charge hanging over him. A disgruntled customer who was turned away from a bar on 6th Street snitched. Nevermind that this kid looked 15 and it wasn't the ID that sold out his true age.

I am confident that these shipments from IDGod are being tracked and recorded, and a bust of the customers and/or IDGod is in the works.

<comment><USER8> I feel like a good seller is probably also someone who is choosy about his clients, and doesn't sell to baby-faced 15 year olds.

<comment><USER19> And probably doesn't keep his equipment in his dorm room in plain sight.

</comment></comment></comment><comment><USER20> I'm a bit disappointed in this article. Interviewing someone who bought fake IDs and a small scale seller from 1994 isn't that insightful. He should have tracked down a current seller and interviewed them.

Prices have dropped in the past 10 years which I assume means increased competition. It would be interesting to hear how that has affected the business. I'm also curious about the techniques they use. When I was selling IDs 13 years ago it was teslin, PVC card printers, and Alps printers. I assume the Alps printers are no longer used since they went out of production in 2003 or 2004.

A lot of IDs are _still_ fairly easy to replicate. The hardest thing is a real hologram which most IDs don't have.

<comment><USER14> Teslin and PVC are still big, although some states are using polycarbonate as well. Real holograms got a lot easier. IDGod (among other vendors), apart from selling IDs, also sells bulk holograms, so most vendors on Reddit now have them. The bigger hurdles are the higher security states with perforations, raised signatures, windows, etc.

</comment></comment><comment><USER21> Several of my friends are college bartenders who check these IDs regularly. Most fakes are easy to spot but its generally more of a hassle to actually bounce someone then let them get by. If a bar gets any heat, like a higher percentage of incidents outside in a given month, they'll step up their rejections. Attractive people, and specifically attractive women, are let in much more often.

</comment><comment><USER22> This reminds me of back in the day when someone broke into the Ohio DMV and stole the machine that made the IDs and starting making exact "fake" IDs.

<comment><USER23> Before the days of prevalent computers and searchable databases, one would just take someone else's information to the DMV and get a real ID with their info.

<comment><USER24> You didn't even need to use someone else's information, you could just use your own with a different DoB.

Growing up, my "fake" ID was my passport. When I applied for it, they read my birth year wrong (I guess my 7 wasn't too legible and they thought it was a 2). I could barely pass for my own age, let alone 5 years older, but it worked most of the time.

All my friends ended up using the flaw that I'd inadvertently exposed when their fakes got confiscated. It was just cheaper and more reliable to use an actual government-issued ID.

</comment></comment></comment><comment><USER25> So many interesting threads to discuss on this matter.

The problem in the US is too many people hate that others have freedom--hence the MADD group's desire to remove any semblance of fun in order to make everyone else as miserable as they are.

The US drinking age, if there should be one at all, should revert to 18 and the ID problem would pretty much disappear.

I can't describe all the ways that people have become emotionally and socially stunted simply because we have too many laws making typical, normal human behavior illegal in order so that some company can earn higher profits (think lawyers, think insurance industry). They've ruined our way of life and we need it back. We are a nation in hiding, ducking too many laws, too many cops, and too many restrictions. I'm not saying people should be free to drink and drive, but I am saying that all the laws limiting behavior have had tremendous negative consequences.

On to the lowly driver's license. Once upon a time, possessing one demonstrated that one could competently operate a motor vehicle. No more. Today, most "driver's" can't drive worth a damn, and the "license" they hold is an over-regulated, poorly implemented national identity card that you must have in order to get on a flight or enter certain Federal facilities. It's utterly stupid. Identity cards in general are dumb and over-wrought contrivances that are mostly totalitarian in nature "your papers please"\--how soon we forget. And now we have RealID, which is even worse, and soon there will be a massive data breach of all that RealID information the feds are hanging on to with all the attendant negative consequences for the people who willingly surrendered themselves to big government.

That there exists a thriving illegal Id industry in the 21st century makes me happy because it means the trap of tyranny isn't completed shut--there is still resistance, still a means of escape.

People, Americans especially, and HN readers most notably, need to forego their fears and re-learn what it means to be free again. Free doesn't mean "subject to incalculable bureaucratic restrictions on one's life." Quite the contrary. Be free, resist the bullshit!

The other, related matter that irks me is the background check. Never was there are more worthless, false sense of security than the background check. But that is a matter for another day.

</comment><comment><USER26> Interesting that they mention Boston - along with NC it's the only place where my green card has been refused as an acceptable form of ID. I have no idea why a federally issued photo ID with my name, DoB and photo on it apparently isn't enough to prove my age.

As a Brit, it amuses me that there are apparently so many balding 20 year olds with grey beards in the US that I am suspicious.

They also don't seem to like my SO's GA driver's license in Boston.

Edit - I should add that the second time we went back to the place which wouldn't take my green card as ID they didn't ID us at all

<comment><USER27> Boston is the real deal when it comes to ID crackdowns. About 150k college students so some tens of thousands of fake IDs, plus a history of blue laws. I believe that legally they are even allowed to refuse legitimate out-of-state US drivers' licenses (most places do not do this, but they can). Foreign passports also can be refused. And that's not even counting the notorious "box scanners" which, to my knowledge, are yet to be beaten reliably with a fake...

<comment><USER27> Meanwhile in the UK I have had many places accept my expired US license from a rural state most have not even heard of. Once at a supermarket, a cashier asked me for ID and I absent mindedly said "No thanks". He was satisfied with that answer, and I didn't realize what I had said until I had already left with my drinks in hand.

<comment><USER26> The UK is pretty relaxed.

If you're 16+ you can drink beer, wine or cider with your meal if it's bought by an adult. And in that scenario it would be rare to be asked to prove you aren't 15

<comment><USER28> I'm a 28 year old British man who is still regularly id'd. It's not all that relaxed in my experience...

<comment><USER26> I think it depends a lot on the town you're in and how old/young you look

</comment></comment></comment></comment></comment></comment><comment><USER29> Is that seriously how the driving license looks like in the US? It looks like a student card, I understand why it's easy to duplicate now.

<comment><USER30> Compared to what? I've seen much simpler driver's licenses from other countries. Up until recently (2013 maybe) the French driver's license was literally a piece of pink paper with a picture glued to it.

[http://flawlessfakeids.com/wp-content/uploads/French-Fake- Dr...](http://flawlessfakeids.com/wp-content/uploads/French-Fake-Driving- Licence-2.jpg)

<comment><USER31> Compared to Germany for example with a bunch of holograms and whatnot: [https://upload.wikimedia.org/wikipedia/commons/d/dd/DE_Licen...](https://upload.wikimedia.org/wikipedia/commons/d/dd/DE_Licence_2013_Front.jpg)

In contrast to e.g. the French, our drivers licence is a valid means of identification though.

<comment><USER32> That's the standard European driving license, which everyone has used since 2013, but many countries used from much earlier (2006-ish?).

This can prove your name and age, but not your nationality.

<comment><USER31> That's a fair point, you can't use a EU driver's licence for traveling.</comment></comment></comment></comment></comment>


Friendly Numbers - <AUTHOR>

http://mathema-tricks.blogspot.com/ <comment><USER2> Just a heads-up: You should really have put your link in the "url" box of the submission form, not the text box.

Also, a permalink to the post (ie, [http://mathema- tricks.blogspot.co.uk/2012/05/what-could-poss...](http://mathema- tricks.blogspot.co.uk/2012/05/what-could-possibly-make-two-numbers.html) ) would be preferable to just linking to the blog's front page, as the link would stay accurate even after other posts are made to the blog.

<comment><USER3> Another heads up. This poster has been spamming stupid math tricks for the last few months, often with multiple links to the same topic. A few weeks ago - probably after so many flags - the style switched from posting to the *tricks site to posting to an HN page, with the link forward to the real site as a comment. I assume so as to reduce the number of flaggings.

<comment><USER2> Ah, thanks for pointing that out. It did seem a little spammy, but I was giving hir the benefit of the doubt.

Next time my spam-sense tingles, I'll check their posting history before deciding whether to reply or flag.

<comment><USER3> Which wouldn't have helped here - new account with no history. BTW, interesting combination of 'his' and 'their' as two different ways to express the genderless third person singular. :)

<comment><USER2> Well, I'd flag a spammy-looking first post as spam when I'd give the same post from an established account the benefit of the doubt, so it would've helped in its own way.

I'm trying to get into the habit of genderless singular pronouns, hence "hir", but, TBH, simply forgot to when I typed "their" instead of "eir". I guess singular "their" just seems less jarring to me than singular "them", for some subconscious reason.

</comment></comment></comment></comment></comment><comment><AUTHOR> <http://goo.gl/Efsbd></comment>


TV really is dead: no TV schedule on CNN homepage? - <AUTHOR> http://www.cnn.com/ <comment><AUTHOR> Is this an example of the worst web design ever? I would have thought the most obvious reason to visit CNN's homepage would be to find a schedule of upcoming tv "shows". But it is nowhere to be found. What's more, the TV-text is also switched off - is it just sheer arrogance, or does even CNN not belive in TV anymore?</comment>


Listening to 'extreme' music makes you calmer, not angrier - <AUTHOR> https://www.theguardian.com/music/2015/jun/22/listening-heavy-metal-punk-extreme-music-makes-you-calmer-not-angrier-study <comment><USER2> (2015)</comment>


How Smart Is Bert? Evaluating the Language Model's Commonsense Knowledge - <AUTHOR> https://syncedreview.com/2020/08/12/how-smart-is-bert-evaluating-the-language-models-commonsense-knowledge/ <comment><USER2> BERT makes use of commonsense knowledge when solving CommonsenseQA questions and that fine-tuning can further enable BERT to learn to use its commonsense knowledge on higher levels.</comment>


Face substitution in JavaScript - <AUTHOR> http://auduno.github.io/clmtrackr/examples/facesubstitution.html

<comment><USER2> This is so awesome. The 'average face' is simply terrifying</comment>


Ask HN: How do I prevent database bottlenecks on my web app?  - <AUTHOR>

I have done web apps before but only in the classroom so I've not dealt with real customers and heavy database loads. Now I am working on my first serious web app for my startup which provides each customer with their own unique subdomain.<p>I understand that I will have to learn on to go but I would like to avoid the dreaded database bottlenecks I hear about as much as possible. To this end, what guiding principles can I use to design the schema? Will the relational database model I learnt in school be able to scale well or will it make bottlenecks  imminent? <comment><USER2> Relational databases handle systems much, much bigger than your app will ever be. You are highly unlikely to have scaling problems. If you do, yay. Concentrate on other sources of risk to your business, such as building someone that no one wants, or targetting a market of people who hate paying money for things.

</comment><comment><USER3> My advice about scalability for someone at your stage is to focus on making your data model clean and well-organized. Try to avoid obvious mistakes (such as querying for the same data over and over again). Make your code as clean as you can.

If you followed this advice, you shouldn't break until dozens of dynamic pages per second. And then adding a caching layer like memcached for the most common queries should take you up into the hundreds.

At that point you need more scalability work, but should have the finances for it as well. This would be a Good Problem to have. Don't worry about it until you get there.

Incidentally the main reason to keep your data model clean is not to help scalability (though it does surprisingly well for scalability issues), but to make maintenance of your code easier. Because as your vision of the product changes, you will find your code changing. And a solid data layout will make that process easier. (The end result is never ideal. Be pragmatic in your trade-offs, but not cavalier.)

</comment><comment><USER4> Normalize until it hurts, denormalize until it works.

Build your database tier using everything they taught you in the classroom. Normalization is your friend here. Why? When you've effectively normalized your database, you can monitor the results of queries and eventually introduce the optimizations that you need to make things run faster.

The problems that sites like highscalability.com deal with are far beyond the scale of most endeavors. If you run into massive scale problems, be very happy because it means you're building something that people want and you can afford to throw some money at the problem ;)

I know people who have production databases with 30+ terabytes that is sitting in a relational database. If you design well, you shouldn't have any problems reaching those goals.

</comment><comment><USER5> I agree with patio11.

Just build the app with whatever technology stack you are comfortable with (or want to do with). Keep the scalability problems for later. Get your customers first.

I usually (done it just twice) launch with sqlite. Makes it easier to move around the db or even the site. But beware of sqlite. Caution: Migrating from sqlite to postgresql might be a bit of a 'solvable' problem.

</comment><comment><USER6> Defining the right indexes is the key until you outgrow the RAM in the server. You can be crawling with one schema, define a few indexes, and suddenly be able to handle a hundred times more activity. What indexes are right depends on what queries you need to execute, not just what data's in the tables, so read up on how indexes are used by your RDBMS, not just how they're defined.

<comment><USER7> SHOW PROCESSLIST in mysql should show running queries. A useful way to see which queries are taking up time and where you need to add indexes.

</comment></comment><comment><USER8> Google for nginx, Cassandra, memcache, node.js, RabbitMQ, and visit highscalability.com. I'm sure folks will chime in with some other useful nouns and urls.

Highscalability.com has links to videos and articles of several major sites and their architecture.

The youtube video was quite informative.

On to the schema...without knowing your specifics, I would say to map your entities in a normalized form, but, you will most likely bust most of them out and denormalize as influenced by your display page (view) or particular portions of it.

Also play around with Amazon AWS. You can play around for several dollars an hour without having to invest in your own hardware.

Also, lurk around stackoverflow.com</comment>


Ask HN: accountant recommendation in (north) London? - <AUTHOR>

As a self-employed, I've been doing my taxes on my own for the past year;  however, recently contracting seems to be booming, so it would really make a difference to make this tax-efficient. Particular painpoints are evaluating whether on the basis of getting paid via dividends from a shell corp would be most tax-efficient if routed through an LTD to me, or via self-employment; for this, I need an accountant who's 1, generalist enough to know these trade-offs; and 2, will not try to auto-upsell me through incorporation costs for better commission.
So, here I turn to the nice community of HN: how would you find an honest accountant, preferably located in North London?
Personal recommendations are also welcome. <comment><USER2> I use an accountant in Cambridge. Virtually all our work is done via email with the occasional visit in person. I have found him to be efficient, clear, competent, and understanding.

Reply here if you want me to email his details to you.

<comment><AUTHOR> Thanks for the offer, but I'd really prefer London for the occasional visit -opportunity cost is a PITA, as they say, and half a day downtime for an hour of consultation is not acceptable.

<comment><USER2> Understood. I've not met many accountants who work as effectively almost entirely by email, but if you want more regular face-to-face then you need someone close by.

Good Luck! Will you report your findings/decision?

<comment><AUTHOR> Will do, thanks :)</comment></comment></comment></comment>


Tearing apart printf() - <AUTHOR> http://www.maizure.org/projects/printf/index.html <comment><USER3> This is a poorly written article that is convoluted and made unnecessarily complex. This is similar to writing an article titled 'tearing apart google search' and then dwelling on HTTP, TCP/IP, routers etc instead of actually talking about how google search works.

I was expecting the article to start off by 'tearing apart' the source code, then dig into the algorithms with which diverse formats are rendered, then compare a few popular implementations and finally provide valuable insights, something on the lines of what WalterBright mentioned and the brief discussion it started. If not all this, the minimum I expected was an abridged, annotated source code.

This article left me underwhelmed.

<comment><USER4> Could you point to a better explanation? I'd love to read that instead as I thought the same.

</comment></comment><comment><USER5> In the 1980s, Borland made up for much of the poor code generation of their C compiler by doing the runtime library all in hand-optimized assembler, including printf.

What I did (Datalight, Zortech) was make large disk I/O buffers. It gave huge boosts to speed, and very few people cottoned on to that :-)

It was a technique I learned from Shal Farley.

<comment><USER6> Can you say more? How did it give huge boosts to speed?

<comment><USER5> A typical buffer size for DOS was 512 bytes, the size of a floppy disk sector. I used 20K. Writing bigger chunks at a time enabled the operating system to optimize it for better throughput to the disk driver. (Fewer seeks, for example.)

Fewer round trips to the operating system almost always speeds things up, too, _especially_ if it involves a context switch.

Things got even better when the switch to hard disks was underway. Hard disks had bigger sector sizes, but the buffer size sometimes remained at 512. This meant the driver had to read the sector, fold in the 512, then write it back out. Oops!

Later on, demand paged virtual memory and memory caching also favored big buffers.

<comment><USER7> Hard disk sectors were 512 bytes and remained that way up until about 2010. ITYM the FAT cluster size?

<comment><USER5> If I recall correctly, disks emulated 512 byte sectors for compatibility, but actually had larger ones. But I don't have documentation on such pre-google things :-)

<comment><USER8> Disk sectors remained 512 for a very long time, only in recent years (2010 sounds right) did they make the 4k sectors with emulation for 512 or just native 4k drives.

It is true however that sequential access to hdds and floppies was always much faster than random access or even sequential in small buffers simply because the drive does not need to wait for the platter rotation to reach the right location again for each sector written but rather just write them all in one go.

</comment></comment></comment></comment></comment></comment><comment><USER9> _Possible trap: Some compilers may recognize the '1' literal used in printf1.c, fold it in to the string, and avoid printf() in both cases. If that happens to you, substitute an expression that must be evaluated._

Or more "robustly", an expression that comes from external input (such as getchar()). Compilers can be smart enough to evaluate expressions which are constant.

This reminds me, I briefly played around with JIT'ing printf() itself --- if you look at it the right way, it's basically a "bytecode" interpreter for the format string. I did get some pretty good performance gains, but it turned out simpler for the project it was intended to go in to just switch to a binary protocol instead of text for output.

I also think that writing a (subset of) printf() is a useful exercise for those beginning programming C in general; it's not too difficult (at least if you avoid the floating-point stuff...), but also not too easy either.

<comment><USER10> I recently came across a C++ logging library that parses format strings at compile time using template necromancy:

[https://blapid.github.io/cpp/2017/10/31/llcpp-a-quest-for- fa...](https://blapid.github.io/cpp/2017/10/31/llcpp-a-quest-for-faster- logging-part-2.html)

<comment><USER11> The cool kids are doing it with constexpr. See spdlog and/or fmt

<comment><USER10> fmt can check format strings at compile time, but does it generate code to do the formatting? Some quick experiments suggests it will re-parse the format string at runtime to do the formatting.

</comment></comment></comment></comment><comment><USER12> Back in the day, I found P.J. Plauger's "The Standard C Library" immensely instructive, as it contains a full implementation of the (then) standard library.

Admittedly, the book is more than 25 years old now, but I'm sure it would still make an interesting read:

[https://www.amazon.com/Standard-C-Library-P-J- Plauger/dp/013...](https://www.amazon.com/Standard-C-Library-P-J- Plauger/dp/0131315099/ref=la_B00IP4FPWQ_1_16?s=books&ie=UTF8&qid=1526871663&sr=1-16&refinements=p_82%3AB00IP4FPWQ)

<comment><USER13> Wasn't Microsofts STL based on that? I remember using strings on so many binaries and always wondering about who pj Plauger is

<comment><USER12> His libraries were licensed to a number of vendors. Specifically, the STL is covered by [https://www.amazon.com/C-Standard-Template- Library/dp/013437...](https://www.amazon.com/C-Standard-Template- Library/dp/0134376331/ref=sr_1_3?s=books&ie=UTF8&qid=1526922642&sr=1-3&keywords=plauger+library) and there is a third book covering the rest of the standard C++ library: [https://www.amazon.com/Draft-Standard-Library-P- Plauger/dp/0...](https://www.amazon.com/Draft-Standard-Library-P- Plauger/dp/0131170031/ref=sr_1_4?s=books&ie=UTF8&qid=1526922642&sr=1-4&keywords=plauger+library)

However, the "Draft Standard C++ Library" book was finished just before the standard was radically overhauled for the STL, and the STL itself and the language have evolved massively, so in my opinion, those two book have not aged as well as the C library book has.

</comment></comment></comment><comment><USER14> > %n - <USER2>

> %% - complete form

Wait, what? %n writes the current number of characters outputted to the int * you specify, while %% just prints a percent sign.

<comment><USER15> %n, also known as a terrible misfeature. It's useful in Xscanf because it lets you get the number of characters read, but it's useless and outright dangerous on the Xprintf functions - Xprintf already returns the number of characters written, and allowing %n in printf has enabled a whole class of terrible printf format string bugs that had no reason to exist.

<comment><USER14> Of course, most of the time the only reason why you have a %n in your format string is because you passed arbitrary, unsanitized user input to it. If you're doing something like that, scanf isn't going to work, either, because the any attacker can just scribble all over your stack. And it's not _totally_ useless: it can be used for aligning things because it writes the number of characters printed into a variable.

macOS, for one, has changed printf to SIGILL when passed a dynamic string that contains %n, though, which mitigates most of the issues present with format string attacks.

<comment><USER15> > And it's not totally useless: it can be used for aligning things because it > writes the number of characters printed into a variable.

If you're going to align anything, you will (probably) need to write some code to compute the right alignment. At that point, you will need to split your printf into pieces, so why not just use printf's return code, which tells you the number of characters written?

glibc on Linux started hardening printf by replacing calls to printf with calls to __printf_chk, which will abort if the format string contains %n and sits in a writable segment of memory. The implementation is somewhat horrific - printf opens /proc/self/maps and range-checks the format string's address, but it works and does provide the necessary security.

It's much less common to pass unsanitized input to scanf than to printf, in my experience, because the most common error case of printf(buf) (instead of printf("%s", buf)) is just not something that you can do with scanf.

\----

By the way, which version of macOS did they introduce the SIGILL hardening, and is it documented? I'm on 10.12.6, and the following program:

        #include <stdio.h>
        #include <string.h>

        int main() {
            char buf[] = "Hi %d Bye\n";
            strcpy(buf, "Hi %n Bye\n");
            int foo = 424242;
            printf(buf, &foo);
            printf("foo was set to %d\n", foo);
        }

runs without complaint (Apple LLVM version 9.0.0 (clang-900.0.39.2)).

<comment><USER14> > If you're going to align anything, you will (probably) need to write some > code to compute the right alignment. At that point, you will need to split > your printf into pieces, so why not just use printf's return code, which > tells you the number of characters written?

The child comment provides a use case for %n, so I won't go into this here.

> glibc on Linux started hardening printf by replacing calls to printf with > calls to __printf_chk

Only with -D_FORTIFY_SOURCE=2 set when compiling. Swapping printf calls with __printf_chk is off by default.

> The implementation is somewhat horrific - printf opens /proc/self/maps and > range-checks the format string's address, but it works and does provide the > necessary security

Luckily, macOS has a nicer Mach API for this, namely the vm_region/vm_region_64 family of functions: [https://opensource.apple.com/source/Libc/Libc-1244.30.3/stdi...](https://opensource.apple.com/source/Libc/Libc-1244.30.3/stdio/FreeBSD/vfprintf.c.auto.html) (search for __printf_is_memory_read_only).

> By the way, which version of macOS did they introduce the SIGILL hardening, > and is it documented? I'm on 10.12.6

You're off by a version; this was introduced in 10.13. Your program crashes nicely on with Apple LLVM version 9.1.0 (clang-902.0.39.2) on macOS High Sierra 10.13.5 (17F70a). Documented? Ha, I wish. It just ended up breaking a couple of programs that relied on this behavior, since it would just call os_crash with "%n used in a non-immutable format string".

</comment></comment></comment></comment></comment><comment><USER16> The most fascinating thing about this article for me was the copyright notice at the bottom of the page consisting primarily of asterisks and hash marks.

Can anyone explain this to me?

<comment><USER17> Probably brainfuck.

<comment><USER18> Not like, literally brainfuck, because brainfuck doesn't use #.

Anyone got thoughts on what it might be?

      ##*#**##****#*#**/\##*###*****#**#*#*#**#******#**#*#*####*#*##*

</comment></comment></comment><comment><USER19> Very, very interesting deep dive. I reminds me of the nand2tetris.org course, which does something very similar (albeit for a toy hardware/OS/language): explain what the heck is going on between a print command and something being written to the screen.

In nand2tetris, they work from a hardware simulation that represents memory where a block of that memory determines what the pixels on the screen are set to. Then you write code that can turn the pixels on or off, then a character OS library that converts binary ascii values into a combination of pixel settings that display a character.

Then you implement your OS's program loop (the "OS" is based around a one-shot "here a bunch of functions, run from an entry point" that you have to specify each time you turn it on) which has a specified entrypoint from which the rest is called.

Obviously, modern systems are a lot faster, but it was a great illustration of what has to happen in between, which this article is doing for real OSes.

</comment><comment><USER20> I hope the bitwise project helps me see these things a little more clearly. Implementing something from ground up always feels nice.

</comment><comment><USER21> How can compilers optimize a printf() call without format strings involved towards a simple puts() call? Sure it would be easy in C++, roughly like

      inline void printf(const char* const s) { puts(s); }
      void printf(const char* const s, ...); /* non-trivial implementation */

but that's not possible in C.

<comment><USER22> They treat it as a built-in function, instead of always linking it to system libraries. Built-in functions they can implement however they want. If you insist on using the library implementation (e.g. because you have your own), you have to tell the compiler not to use its internal one.

E.g. gcc docs on this: [https://gcc.gnu.org/onlinedocs/gcc/Other- Builtins.html](https://gcc.gnu.org/onlinedocs/gcc/Other-Builtins.html)

</comment></comment><comment><USER23> Newbie question: is there one context switch per line in the "printf() execution sequence" figure?

<comment><USER24> I think it's like this: Each line with "###" in bold is a system call, and the preceding non-bold lines show the corresponding backtrace (sequence of nested active function calls at the time of the system call).

A system call is expensive, but not as expensive as a context switch between two user processes.</comment></comment>


Researchers may have 'found' many of China's 30M missing girls - <AUTHOR> https://www.washingtonpost.com/news/worldviews/wp/2016/11/30/researchers-may-have-found-many-of-chinas-30-million-missing-girls/?tid=pm_world_pop&utm_term=.0b9d69013c87 <comment><USER2> It's well known that many Chinese are financially unable to register their second+ child. The unregistered children have no official identity, can't lead normal lives, can't go to school, etc. It's to be expected that some will choose not to register their first when it's a girl. Hopefully this will soon be a thing of the past as they are loosening the policies.

There are many other documentaries and articles on unregistered children such as this:

[http://www.cnn.com/2013/11/10/world/asia/china-second- child/](http://www.cnn.com/2013/11/10/world/asia/china-second-child/)

<comment><USER3> This is only partially true, with many exceptions.

But ya, many girls in the countryside are hukou-free, unregistered, off the grid, non-persons, etc...China is trying to change this, the central gov would prefer everyone was registered, but local governments make too much money on family planning fines to give it up.

</comment></comment><comment><USER4> In the United States we had the opposite problem. The 1986 Tax Reform mandated that the social security numbers of children be included in order to claim them as dependents to get a tax break. Seven million children 'disappeared' the next year.

[http://www.snopes.com/business/taxes/dependents.asp](http://www.snopes.com/business/taxes/dependents.asp)

<comment><USER5> If I remember correctly, a lot of it was traced to divorced parents claiming the children on both tax refunds which this law did away with, only the person with most/solo custody can claim the children now.

<comment><USER6> The snopes.com link above quotes this towards the bottom:

"The tax agency said about 20 percent of the vanished dependents were children who had been claimed as dependents by both parents after a divorce. Under the law, only one parent may claim the child as a deduction.

Most of the others probably never existed, John Szilagyi, an I.R.S. researcher, said. And some families apparently became quite greedy in creating dependents, each worth a $1,080 deduction in 1986, and $1,900 in 1987.

About 66,000 taxpayers who claimed four or more dependents in 1986 claimed none in 1987, after the Social Security identification rule went into effect. And more than 11,000 families claimed seven or more dependents in 1986, but none in 1987."

<comment><USER5> > And more than 11,000 families claimed seven or more dependents in 1986, but > none in 1987.

So, big lie, you mean. -> [https://en.wikipedia.org/wiki/Big_lie](https://en.wikipedia.org/wiki/Big_lie)

<comment><USER6> That doesn't seem relevant to this thread?

<comment><USER5> It is, it's a technique where the bigger the lie, the harder to dispute.

</comment></comment></comment></comment></comment></comment><comment><USER7> oh I see, the official policy was 1 child, but when multiple births happened or the 1st child was a girl, the local hospital type people just looked the other way and never put the birth into the system.

<comment><USER8> A lot of the people in china simply are not borned in hospital 20 ago.

Every family has at least two children from where I grown up, even the official of the village. More like the case of speeding. You are not allowed, but you can get away with it, if the police are not there or feel it is better for him to not give you a ticket.

even a lot of Chinese are surprised when I talk about this with them. So be careful about the media's report. (they report what they think it is true, but might not)

<comment><USER9> but you are allowed... one of the big myths is that there was a universal policy. in fact the policy applied to only city dwellers in big congested cities. villagers and ethnic minorities did not have the restriction. the policy applied to like only 30pc of households

</comment></comment></comment><comment><USER10> This is great news. I hosted a mutual friend from China for several weeks. At the time, the guest had a family relation in China who was pregnant with her second child. She choice to abort the baby because the associated financial penalties would be too high.

I hope more research is done to quantify the number of unregistered births. I personally find 25 million unregistered out of 30 to 60 million estimated to be a bit high of a ratio.

</comment><comment><USER11> So either the missing girls where aborted, killed, or once the family had a boy as the first child, they stopped having kids. Or people just ignored the policy altogether.

And central planning works how exactly?

<comment><USER12> What are you talking about? The article argues that the unaccounted girls were _not_ aborted or killed.

Anyway, to answer your question, the central planning works to reduce population growth.

<comment><USER13> I think this article casts some doubt on whether the one-child policy was actually successful at reducing population growth. It certainly reduced the birth rate in urban areas where enforcement was stronger. But it seems like rural families had just as many kids as they would otherwise.

<comment><USER14> The families who had male children as their first child were more likely to have less children.</comment></comment></comment></comment>


Looking for a sports watch? Never buy an Apple watch - <AUTHOR> https://medium.com/@sajithdilshan/looking-for-a-sports-watch-never-buy-an-apple-watch-d65008fcb6da <comment><USER2> I can't even imagine how you manage to hit your own wrist with the racquet you're holding.

<comment><AUTHOR> Actually, I was holding the racket in right hand and the watch was on my left hand :)</comment></comment>


Amazon employees put pressure on Jeff Bezos to release climate change plan - <AUTHOR> https://www.cnn.com/2019/04/10/tech/amazon-climate-change-letter/index.html <comment><USER2> Step 1) Use boxes that are an appropriate size</comment>


Apple blocks Java 7 Mac plugin in OS X - <AUTHOR> http://9to5mac.com/2013/01/11/apple-blocks-java-7-mac-plugin-in-os-x-following-discovered-security-vulnerability/ <comment><USER2> Seems like people on this thread are OK when Apple remotely fiddle with what they can and can't run on their own machine without a notice. Interesting times.

<comment><USER3> "Screw your rights and liberties to run what you want on OUR OS X!" -Apple

This is why I chose Ubuntu over Mac OS X. I have a Macbook and OS X 10.7 on it, I got tired of being restricted and locked out. Then I found that Ubuntu was more open and less restrictive. I replaced Windows 8 on my PC with Ubuntu 12.10 and my Acer laptop no longer runs Windows 7 but Ubuntu 12.10 (I won it at a church raffle) and my Macbook now gathers dust, I'll only use it when I get around to developing iOS apps or something. For everything else it is useless to me now.

<comment><USER4> You can run anything you want in OS X. This block for Java is part of a (easily deactivated) security system to prevent malware or critically vulnerable software from compromising your system.

<comment><USER3> Nope not when Apple has the ability to block anything on OS X remotely. You unblocked it, and then they do another check and block it again.

What is to stop Apple from blocking free and open source software in the same way? Say they want you to buy iWork, not use LibreOffice for free, so they put in a block for LibreOffice. Now let's say they don't want you using Firefox or Chrome and they want you to use Safari instead, so they block Firefox and Chrome. Citing that they are all 'security risks' because they are code Apple does not control. BTW LibreOffice and OpenOffice.Org are Java based, and this Java block would stop them from working in the web browser to display documents.

There will come a time with Mac OS X that Apple will lock it down like they did to iOS, and you'll have to jailbreak it to run what you want on it. This will be done for security reasons, of course, to protect the user.

<comment><USER4> Just turn off the auto update for the blacklist (IIRC, it's in the Security prefpane). "Problem" solved?

</comment></comment></comment></comment></comment><comment><USER5> Mozilla is blocking Java as well, keeping hundreds of millions of Firefox users safe.

Mozilla Security Blog: Protecting Users Against Java Vulnerability

[https://blog.mozilla.org/security/2013/01/11/protecting- user...](https://blog.mozilla.org/security/2013/01/11/protecting-users- against-java-vulnerability/)

<comment><USER6> It appears that Mozilla has changed Java applets to "Click to Play". On the other hand, Apple has completely blacklisted the current version of Java. This may affect corporate users where they need access to Java applets for internal intranet applications. In FF, they would still be able to use the applet if needed. I think the Mozilla method strikes the better balance between protecting the end users and allowing them to use the browser as intended.

<comment><USER7> Those same corporate apps nearly always require IE.

<comment><USER8> And, realistically, those corporate apps probably work perfectly fine with Apple's depreciated JVM. Oracle's JVM has been in the wild for about 5 months.

</comment></comment></comment></comment><comment><USER9> This link is awful. This [1] is a much better link, and the source of this news according to 9to5mac.

[1] [http://www.macrumors.com/2013/01/11/apple-blocks- java-7-on-o...](http://www.macrumors.com/2013/01/11/apple-blocks-java-7-on-os- x-to-address-widespread-security-threat/)

</comment><comment><USER10> Apple has blocked only Java applet browser plugin from Safari. Java can still be run on OS X.

<comment><USER11> That's little comfort for the hundreds of universities whose business logic and data is tied up in Banner, which is a horrible Oracle Forms mess on the client ("Internet Native Banner"), which requires a web browser with a working Java plug-in...

(Imagine your company held a contest to design the worst CRUD application that uses the Web somehow but isn't actually a web application. That's Internet Native Banner.)

</comment></comment><comment><USER12> So organisations that rely on Java applets (such as some online banks and others) can expect _a lot_ of support calls around now.

Difficult to know what to suggest in such a circumstance, do you give the customer instructions about how to override this and let them risk getting pwned by some random site?

Or do you just tell them they can't use the service anymore until they do a full rewrite?

<comment><USER9> I'm wondering what happens to corporate Macs where the users require Java in the browser to do their job. Is there any kind of trouble Apple could get into for removing this without warning when corporations have specifically installed what they need to work?

<comment><USER13> Yeah, my last employer did all their accounting in an Oracle ERP system that was built on Java Applets. They would be screwed right now if they were using Mac machines.

I could be wrong about this, but it sounds like if you go in and edit Xprotect.plist manually to remove the Java plugin from the blacklist, Apple will just update it again and blow out your changes within a day or so.

<comment><USER14> Safari (the only one getting the block) isn't even the most popular browser on OSX. Chrome + Firefox have 10x more users than Safari on Macs.

<comment><USER15> Thank you for the clarification. I was wondering how Apple blocks plugins from other browsers. Both articles I saw did not care to mention that only Safari plugins (and probably third party browsers that use the mac webview like Fluid.app) are blocked.

</comment></comment></comment></comment></comment><comment><USER16> Well well well! Great job at blocking Java, Apple. Stop those bastard virus writers from spreading their malicious code. On the other hand, I assume this happened silently since I didn't notice a thing. Would be good to show an extra forced popup message saying, look, we disabled Java for you because it's a total shitstorm outside at the moment. But if you really need it, do x y z to (temporarily) disable the block or to whitelist certain applications/sites. Now that'd be a sweet security system! Arggghh!

<comment><USER17> I'm not sure I agree that Apple should try to explain to the users what they did. It is really hard coming up with one message to communicate something to tens of millions of people. The end result is often confusion or panic--both of which I would not want to see in my users if I am Apple.

</comment></comment><comment><USER18> What if you need to enable access to Java 7 again on your Mac machine? Is there a setting you click that says, "I know the risks, let it run anyway."?

I find it hard to believe that a consumer desktop PC can be remotely controlled like that and leave NO input to the user.

</comment><comment><USER19> Overall: This is interesting, because of how huge of a Java/Tomcat house Apple is in-house.

In a browser: Java, like anything has it's bugs. Hopefully the stewards of Java for the browser keep it current.

<comment><USER20> The current vulnerability affects environments where untrusted code already executes. Since applets can be used to upload arbitrary code, it makes sense to block it.

This isn't a political move I don't think, just a common sense mitigatory move to protect people. Web apps running Java are safe from this vulnerability, unless they're accepting user-supplied code and running it.

<comment><USER19> That's a great clarification and fact that sadly may be lost in the dramatics of the headline, either done on purpose or someone didn't understand before submitting.

<comment><USER21> I thought the same thing too… I only read "Apple blocks Java 7…"

The "…Mac Plugin" part was completely lost in my skimming.

</comment></comment></comment></comment><comment><USER22> Sucks for people with VPNs that are java applet based.

<comment> bill-nordwall I was able to get my java-applet-based VPN working again by temporarily re- enabling Apple's Java SE 6 applet plugin: <http://support.apple.com/kb/HT5559>

</comment></comment><comment><USER13> Did they already push the blacklist file update to all Mac machines? Or is it bundled in a software update that OS X is going to ask me to install when I get home from work and wake my MacBook up?

<comment><USER23> This is not distributed via Software Update, but via Apple's XProtect malware protection system and should be updated silently in the background. You can check /System/Library/CoreServices/CoreTypes.bundle/Contents/Resources/XProtect.meta.plist to see if it's up to date. To force an update, run "sudo /usr/libexec/XProtectUpdater" or "sudo launchctl start com.apple.xprotectupdater".

</comment></comment><comment><USER24> Well, Java sucked, Apple blocked it.

If you pretend your technology to be secure, but constantly fail in that aspect, you'd expect this kind of result.

<comment><USER25> It also seems like a big failure of the OS/browser that it can't be sandboxed effectively.

<comment><USER26> Did you notice the part where this affects every OS and browser?

This is a flaw in Java, not any operating system or browser. Java, across all platforms, provides a way to execute native code if you have the correct permissions to do so. A way was found to exploit this by getting access to a raw classloader using MBeans. Once you have access to that classloader you can do whatever you want.

Please do not try and turn this into an OS war.

<comment><USER25> I wasn't making this an OS war, as I didn't recommend any alternative OS/browser. See my later comment, since I wasn't very detailed in the initial one.</comment></comment></comment></comment>


How many people are in space right now? - <AUTHOR> http://www.howmanypeopleareinspacerightnow.com/ <comment><USER2> This is my site! Nothing better than waking up to the front page of HN. And thanks for all the hilarious 503 error jokes. ;) Thanks for the submission.

Couple side notes:

+For those asking about using our data, go for it! We've got a json file you can tap into: [http://www.howmanypeopleareinspacerightnow.com/space.json](http://www.howmanypeopleareinspacerightnow.com/space.json)

+We are currently churning along on an iOS app that we are VERY excited about. Think: Notifications every time the number changes plus some cool social content integration.

Anyway, I'm a daily HN reader and honestly this has made my week. Thanks for all the posi vibes!

</comment><comment><USER3> Hah. 503 people in space. I must be the only one who finds that funny.

<comment><USER4> I want to laugh :( explain...

<comment><USER5> He is referring to an HTTP 503 error which is shown when a service is unavailable.

</comment></comment></comment><comment><USER6> I believe there are 2 Americans in space right now.

Speaking of space - in a restricted sense - there are around 2.3 million Americans in prison.

<comment><USER7> Correct. If you click the image or just scroll down you can see the names.

<comment><USER8> I have Ghostery, and I just get a big blank page with a "0" on it. I'm assuming the GP has the same.

<comment><USER9> I believe the current "0" is because the json file is having problems being served.

</comment></comment></comment></comment><comment><USER10> Down for me :(

I believe its circa 7 billion, if we only count those humans present on or around our own planet.

<comment><USER11> In one sense, we're "in space" more so than people on the space station — there are no walls between us and the stars, just a gas that tapers off to zero with us clinging to our rock by the merest force. It gives me vertigo when I try hard to comprehend that.

<comment><USER12> I think most of us are probably behind several layers of concrete, glass, wood, etc.

</comment></comment></comment><comment> hidden-markov [http://howmanyhedgehogsareinspacerightnow.com/](http://howmanyhedgehogsareinspacerightnow.com/)

<comment><USER13> Is there an API available for this data? Would be useful.

</comment></comment><comment><USER14> Dear website owners,

Please take the time to set up a service like CloudFlare[0]. It's free, and will prevent your site from going down during traffic spikes. There's really no downside.

Regards, Frustrated User

[0]: [https://www.cloudflare.com/](https://www.cloudflare.com/)

<comment><USER15> No need for a CDN for a site like this; the content should be completely static and regenerated whenever it changes.

<comment><USER16> The server can still tank from too many requests, static or not.

<comment><USER17> As it has.

<comment><USER18> How do you know the site is static?

</comment></comment></comment></comment></comment><comment><USER19> Ooh, I've been wanting to make an iOS app for something for a while now. This should be a nice easy thing to sink my teeth into.

<comment><USER19> Why the downvote? Having this but in an app would be cool :)

<comment><USER20> I didn't downvote, but I'm not sure why cloning this into a native IOS app is such a cool thing. As long as it works in the browser, it's not really that interactive or performance intensive so you wouldn't get any of the benefits of a native app. If you just need something to use to learn to make a native IOS app, this will work, but I don't see any reason to do it other than that.

<comment><USER19> Which is exactly what I'll be doing - learning. I've made Android applications (some are in the Play store), but iOS and Objective-C is something I want to learn now.

</comment></comment></comment></comment><comment><USER21> Expedition 37 with a crew of 6 are in space right now. 2 America, 3 Russian, 1 Italian. The last three launching Yesterday

"Expedition 37 Soyuz Commander Oleg Kotov, NASA Flight Engineer Michael Hopkins and Russian Flight Engineer Sergey Ryazanskiy to the International Space Station."

[http://www.nasa.gov/content/expedition-37-soyuz- launch/#.UkQ...](http://www.nasa.gov/content/expedition-37-soyuz- launch/#.UkQq82TzbOc)

Edit: CORRECTION this is the SECOND half of the Expedition 37 crew launching 25 September 2013, 20:58:50 UTC aboard the Soyuz TMA-10M. They are expected to return 12 March 2014. The other three were launched in may.

</comment><comment><USER22> This is just what the lamestream media wants you to think! Wake up sheeple!!!

</comment><comment><USER23> A few years ago when I was living in China I was told about this, but it never worked.

Then on a hunch I fired up my proxy and discovered that the Chinese government was actively censoring it.

WHY

<comment><USER2> Really?! That's crazy to hear especially since we list the Chinese astronauts when they fly just like everyone else!

I'd love to have a screenshot of what the site being blocked looks like.

</comment></comment><comment><USER24> Got an error 503. A refresh loaded the page fine the second time, as did subsequent refreshing. I couldn't repeat the error.

</comment><comment><USER25> Aha it has gone down. This proves most of site which come on front page of HN go down with ease due to heavy traffic !

</comment><comment><USER26> Arg, opening links in new windows by default! I can do that myself if I want to, thank you very much.

</comment><comment><USER27> Cool. Now give me a graph over time, so I can see the last date that there was nobody in space.

<comment><USER28> That would have to be a different URL, like www.howmanypeoplewereinspaceatanygiventimeinthepast.com (sorry, coldcode).

</comment></comment><comment><USER29> It was nice while it worked, now it switches from "Error 503" to "0".

</comment><comment><USER30> Very Sci-Fi. The fontsize will have to be reduced once we reach >999 people in space.

</comment><comment><USER31> Some people are gonna be really really happy they felt lucky.

Wow, now that I think about it for a moment, I realized no one ever feels lucky these days. As soon as the search bar on Google's homepage is filled, the form is auto submitted.

<comment><USER27> I think you posted to the wrong thread. (What thread were you trying to post to?)

<comment><USER20> He's referring to the fact that the URL is in spoken question form. So people going to Google and querying "How Many People Are In Space Right Now" and using the I'm Feeling Lucky search will be brought directly to the site.

</comment></comment></comment><comment><USER32> I'm seeing '0'. That can't be right.

<comment><USER33> It was showing me '0' until I refreshed a few times. Now it's '6'.

</comment></comment><comment><USER34> looked interesting ... too bad it doesnt work. I assume capacity issue .... HN must have brought it down

</comment><comment><USER35> Blank screen on an iPad. Oh wait, I have to scroll down to the bottom to see anything.

</comment><comment><USER36> Can it update quickly enough to support the suborbital Virgin Galactic flights?

</comment><comment><USER37> Apparently the people currently in space have been there for NaN days.

</comment><comment><USER38> www.whyarepeoplemakingdomainswithsuchridiculouslengthsthesedays.edu

<comment><USER39> All the short ones are taken.

</comment></comment><comment><USER40> For the record, it's 6 (today)

</comment><comment><USER41> www.howmanypeopleareonlinerightnow.com</comment>


Ask HN: Negative oil futures from last week. Did people take possession? - <AUTHOR> There was big news last week that Oil futures for May were negative. So, what happened to all the oil after that? Did people take possession of it? Did the suppliers stop producing more oil?<p>I have seen that oil containers are lined up outside Los Angeles but have no more insight into it. Will June production be less? <comment><USER2> Most of the oil traders are neither producers nor consumers (airlines, gas- powered electric utilities, etc). A few of these traders have experience in taking possession. Whoever doesn't have experience in that will just pay premium (that is, negative prices) to rid of their contracts.

June 2020 futures have been trading since 2018. Small oil producers, unlike Saudi and Russia, hedge their oil by selling calls or buying puts or a combination of them.

Where does this end? Just transfer that negative premium to oil producers to NOT send the oil. However, this won't happen, as negative prices tend to happen on the last two days of the front month. Unless we see negative for July futures right now (in April), oil producers just follow their contracts.

</comment><comment><USER3> If I understand it correctly, the oil traded in those futures was already on it's way to Cushing, Oklahoma when the price became negative.

What it meant was that future sellers had to pay for buyers to accept those futures. There was enough capacity to take that oil.</comment>


Introduction to Graph Theory: Finding The Shortest Path (Part 2) - <AUTHOR> http://maxburstein.com/blog/intro-to-graph-theory-finding-shortest-path-part2/ <comment><USER2> Why not Topcoder[1][2] tutorials? They are very inclusive, comprehensive and are not written in Ruby.

[1]: [http://community.topcoder.com/tc?module=Static&d1=tutori...](http://community.topcoder.com/tc?module=Static&d1=tutorials&d2=graphsDataStrucs2) [2]: [http://community.topcoder.com/tc?module=Static&d1=tutori...](http://community.topcoder.com/tc?module=Static&d1=tutorials&d2=graphsDataStrucs3)

<comment><USER3> Is there a particular problem with them being written in Ruby?

<comment><USER2> Probably not but I do not know anything in Ruby. I feel like C++ or Java is something everybody can read (a lot of people take them in University). My personal opinion.

</comment></comment></comment><comment><USER4> Why would you call a Grid a Graph? A Graph consists of vertices and edges.

That doesn't seem reasonable for something like "Introduction to Graph Theory".

<comment><USER5> And a grid consists also of vertices and edges ;)

So a grid is certainly a very special graph, with a lot of additional structure, but it is also a lot easier to visualize than some abstract Markov chain.

<comment><USER6> What would a heuristic function look like for a "regular" graph (I.e. graphs as the data structures used for learning bfs, dfs, &c) then? I understand A* in terms of the grid what with the x and y distance, but how would implementing distance work in a non-grid graph? I feel as though it would just be taking the weights of edges and/or nodes. And if that's the case, then it essentially regresses to being Dijkstra's.

<comment><USER4> Any real world application for these algorithms will have the graph embedded in some kind of coordinate system. Euclidean distance is a popular heuristic given how it maps to the real world idea of "distance".</comment></comment></comment></comment>


Humans slowly but surely losing intellectual & emotional abilities? - <AUTHOR> http://medicalxpress.com/news/2012-11-humans-slowly-surely-intellectual-emotional.html

<comment><USER2> I am going to commit the middlebrow dismissal sin here (and compound it by not reading the actual paper; but, the abstract doesn't make this appear to be a paper worth spending undue amount of time on).

Evolution is a process that occurs over vast amounts of time. Trying to draw conclusions about the fate of human evolution based on developments of the last hundred years would be remarkably foolhardy. You might as well try to plot a bee's course based on the last microsecond of its movements.

Sure, people with genetic weaknesses that might have been quickly selected against 10,000 years ago are now able to live long & full lives, naturally leading -- for now -- to the continued spread of those genetic variations. However, humans are also right now unique on the planet for our ability to alter our own genetics; I have no doubt that within the next hundred years, within the very next evolutionary microsecond, we will have the technological ability to choose the course of our own evolution.

And I doubt very seriously that there will be much room for serious disease in that future.

</comment><comment><USER3> Neuroskeptic has a good response to these articles at [http://neuroskeptic.blogspot.com/2012/11/were-probably- not-g...](http://neuroskeptic.blogspot.com/2012/11/were-probably-not-getting- dumber.html), essentially arguing against Crabtree's thesis for being too speculative.

</comment><comment><USER4> _which may have weakened the power of selection to weed out mutations leading to intellectual disabilities_

What the hell does it mean? Smart people aren't breeding? Intellectually disabled people are breeding?

<comment><USER5> It means that in developed countries there is almost no natural selection, and it's unethical to weed out weak genes synthetically because that's called a holocaust.

<comment><USER6> Actually weeding out "weak" genes is eugenics, it is increasingly done without genocide. This appears to be a larger ethical issue today (and certainly in the 60s and 70s) than during the holocaust.</comment></comment></comment>


Branson: Fortunes to be made in downturn - <AUTHOR> http://news.bbc.co.uk/1/hi/business/davos/7860333.stm <comment><USER2> This may seem like a trivial point, but if a link is going to run video or audio without warning, please can you put "(video)" in the title?

When I browse I open up to 30 or 40 tabs at a time, then go through them breadth first, opening more tabs, continuing in this vein for a while. There have been times when I've had 80 tabs open, moving through them systematically, letting the browser loads the next page while I'm reading this one.

Eventually the tree of pages/tabs closes down as links I opened speculatively have nothing of interest, and so I get my browsing donw efficiently and effectively.

Until some video starts up. Or worse, two. Now I have dozens of tabs to search through to find the one (or two) that are playing something at me without being asked, without giving me warning. It's really annoying.

I know I'm unusual in the way I browse, and maybe I just need to get used to it. But perhaps it would be useful to others as well.

Thanks for reading, sorry about the rant, I hope someone sympathises with me.

Oh, and I upmodded you. Just because the method of opening and lack of warning was irritating, that doesn't mean it was uninteresting. Thanks for the link.

<comment><USER3> I browse exactly in the same way as you do and have the same problem...

<comment><USER4> I do too, it's probably not as uncommon as you would think. I even have a theory that this is one of the major reasons firefox has managed to chip away at IE's market share since MS only recently implemented tabbed browsing.

I recently installed flashblock, which prevents flash from starting and puts a placeholder instead. You have to click the placeholder in order to start the flash file. This solved the auto-playing problem for me, and had the nice side effect of freeing up memory in firefox.

<comment><USER5> In IE, before firefox, I opened a new browser for each link, and used the taskbar as tabs (you can switch with alt-tab instead of ctrl-tab). Maybe firefox making it explicit increased awareness of this approach.

For me, the huge value for firefox is as a software platform: an incredible array of extensions, even including another platform: greasemonkey. I always preferred the bookmarking of NN to IE; but I think it was adblock that made me switch to firefox.

</comment></comment></comment></comment><comment><USER6> From the 'Hacker News Guidelines':

"If you submit a link to a video or pdf, please warn us by appending [video] or [pdf] to the title."

<http://ycombinator.com/newsguidelines.html>

</comment><comment><USER7> What a contrast between Branson's realistic-but-optimistic outlook and the dire tone of the interviewer. Many of the questions were focused on failure and pessimism:

      "How gloomy should British businesspeople be?"
      "How worried should the world's charities be..."
      "There is a tremendous amount of gloom here..."

I know they were good interview questions and the interviewer did his job well. Yet it's coming from a consciousness of scarcity and fear. I wanted to shake the fellow and say, "Hey, dummy! if you are always looking for bad things, that's what you're going to find! Your attitude in the present creates your future, so watch your thoughts carefully!"

It was not very long ago that my attitude would have been very similar. Now, when I look around, amid the carnage I see much opportunity and potential, especially for new businesses and startups - to create jobs, serve people and create wealth.

I take that attitude shift as a sign of personal progress.

</comment><comment><USER8> What I admire about Branson is his ability to plow into saturated markets with a fresh sense of innovation about the product and/or service, and really understands where stagnant companies have lost touch with their consumers.

And to top it off, one of the most charismatic people to listen to. I'll admit to having a man-crush. :)

</comment><comment><USER9> I'm a big fan of Richard Branson, and his books read fun with lots of insight. Losing My Virginity had lots of fun wisdom and anecdotes. One of his first rules of doing business is to make it fun, which works for obvious reasons.

He puts a lot of time into customer/client experience, and it really shows. I went to a Virgin Active gym in London for a month, and it's so exceptionally well built down to the little details. They have a sauna, steam room, swimming pool, and a more shallow pool of water that's a cross between Roman-style baths and a jacuzzi.

The detail that impressed me the most? In the shower by the sauna, there's a device that quickly fills a bucket with cold water, and then you can pull a rope for it to fall on your head to cool off. My friend was giddy to show me the pullrope cold water bucket, because it's very cool and you remember it, and want to show and tell other people. Also, a cafe with free wireless and lots of computers, with great quality food that's only about 10-20% more expensive than equivalent high end food outside the gym. Lots of people hang out in there after working out, and they eat food, and Virgin makes more money. Some people might even lean towards signing up for Virgin because of the computers, which means more membership fees.

Guy is brilliant, charismatic, and also seems a legitimately good dude. One of the few people that I never tire of reading or watching interviews with.

<comment><USER10> I agree. His books are a good read and very inspirational. When he started his business, all hippy-like with long hair you can imagine what the (at the time) stuffy establishment thought of him. If anyone on here wants an inspirational read, I'd recommend Losing My Virginity. Read some of the other books on him too to realise that whilst he is 'cool' he's also quite ruthless, which you probably need to be to get where he has

<comment><USER11> Agreed - one of the first businesses he started was effectively a pyramid scheme (he wrote a newspaper in college to sell to other students in bulk, who would then make money by selling the copies to individuals at a profit. Of course, the newspaper itself wasn't any good, and so it was hard to sell, which means that no-one but him made any money. I know of this story because one of my dad's college friends bought some of his newspapers, and predictably failed to sell any).

Also, his first 'real' business was Virgin Records, which made it big off the back of Mike Oldfield's 'Tubular Bells'. However, Branson made Oldfield sign an almost usurious contract (<http://www.synthtopia.com/content/2008/03/03/tubular-bells/>), and didn't pay him any of the royalties on the recording for several years as he built up the company (until Oldfield, who considered Branson a personal friend, sued).

A great business man he may be, but I don't think he's a genuinely nice guy.</comment></comment></comment>


The faster the Internet becomes, the slower it loads pages - <AUTHOR> http://www.economist.com/sciencetechnology/displayStory.cfm?story_id=15523761 Latencies introduced by Advertising, are substantial IMO as well. <comment><USER2> I don't want faster as in more throughput, I want faster as in lower latency. Imagine if we could actually develop software that could depend on the internet being lower the 1/60th of a second. All the logic we have to do in games hide latency would go away. We would then be able to just pass back and forth input streams and have our simulations sync by exchanging them back and forth. Perhaps 1/120th would be ideal so that both parties feel a sub 1/60th of a second response time.

<comment><USER3> Lovely dream. It is unfortunate that it takes 130ms (10x as long as your dream) for a pulse of light to circumnavigate the world. Even if it was point to point, without switching or network delays, it would take up to 60ms.

<http://en.wikipedia.org/wiki/Speed_of_light>

You can't remove the speed of light constraints, no matter how nice it would be.

<comment><USER4> There's a saying: bandwidth is money; latency is physics.

You can always get more bandwidth (more flow per second) through the pipes by just building more pipes. This isn't difficult, just expensive.

Reducing latency, however, is much harder. Eventually you still have to deal with a photon moving through fiber and an electron and a circuit.

</comment></comment></comment><comment><USER5> "The future is beckoning. Netflix has just announced an on-demand video- streaming service offering full high-definition picture quality (so-called 1080p, which has 1,080 lines in its picture) with 5.1-channel surround sound. Each stream being watched will require a megabyte a second of bandwidth and a latency of less than 60ms if it is to deliver crisp, pin-sharp video and pristine sound."

Latency doesn't matter with video, afaik. This seems inaccurate.

<comment><USER6> Also, Netflix clarified that they aren't doing 1080p this year: <http://mashable.com/2010/02/08/netflix-1080p/>

</comment></comment><comment><USER7> Pretty inaccurate article I'd say. The general premise of "broadband is faster, but there's more to download" is close to right, and I'll agree that 8 seconds was about how long it took to load web pages back when, but it's a very rare page (other than HN itself, ironically) that takes more than about 3 seconds to load on even middling DSL.

And I have no idea why streaming video requires 60ms latency.

<comment><USER8> On my middling DSL (320 kbps symmetric) there's a _lot_ of pages that take more than 3 seconds to load, especially if you're not using AdBlock. There are some Flash ads that take 5+ seconds to load just by themselves!

The typical for a large corporate site seems to be 4-6 sec for me. I just timed cnn.com and yahoo.com both at 5s total load time, and aol.com at 8s (all in Chrome on Linux).

edit: Found a new winner: foxnews.com consistently takes between 25 and 33 seconds to load.

<comment><AUTHOR> obviously its not a uniform experience, and there are problems with the article, but i do think it stands to reason that rich content, and in my mind especially Advertising, grind the experience which I recall was faster in many cases.

</comment></comment></comment><comment><USER9> People like this shouldn't be writing technical articles.

A 700ms ping would be indicative of severe network problems, especially at that distance. The author is probably experiencing packet loss. Realistic ping times across the country are usually 100ms or so. I can ping most major websites in under 20ms.

DNS can indeed be a bottleneck, but it usually isn't. It's a fairly basic service, and if it's really a problem it's simple stupid to switch to a free provider like google.

Streaming video is not dependent on latency, only throughput.

Dark fiber won't necessarily help. The bottleneck is more realistically in the switching equipment. A single fiber can carry massive amounts of data.

<comment><USER10> Not only that. It's really stupid to use IP addresses instead of domain names because, guess what, most sites share IPs these days.

</comment></comment><comment><USER11> Funny how the article is talking about slow page loads and the page itself has a little advertising popup.

<comment><USER12> I was going to say that. The web has become pretty fast once I disabled Javascript and uninstalled Flash. I don't miss anything on everyday browsing (= killing time or finding interesting things) nor on research. Highly recommended that you try it.</comment></comment>


Ask HN: How do software platforms ensure money is transferred to lender? - <AUTHOR> I was wondering how do these platforms that allow  businesses to sell their invoice/receivable on them ensure that the lender is paid back? What are the ways in which a software platform can ensure that money is redirected/transferred to the lender who purchased invoice/receivable? Is paper contract the only way to make it legally binding on the borrower to payback or is there some automatic way to redirect money to the lender? <comment><USER2> Going to need more specifics but it sounds like you're are describing a payment gateway.

[https://en.wikipedia.org/wiki/Payment_gateway](https://en.wikipedia.org/wiki/Payment_gateway)

<comment><AUTHOR> No, I am not describing payment gateway. I am talking about ensuring that a lender is paid by the borrower in future. The example I gave was of selling invoice/receivable. A borrower sells invoice to a lender. Once the invoice is paid by the customer of the borrower, then how does the software platform ensure that the money received from the customer goes to the lender and not to the borrower? Is it the responsibility of the borrower to transfer the money to the lender? What if the borrower does not transfer the money to the lender? Is the software platform responsible for that? In that case, how does the platform force the borrower to payback to the lender?</comment></comment>


Elastic acquires Opbeat (application performance monitoring company) - <AUTHOR> https://www.elastic.co/blog/welcome-opbeat-to-the-elastic-family <comment><USER2> It would be interesting to get the Opbeat's founders perspective on why they'd sell and close a product they've been working on since 2012. Just to soon do it again, but this time for someone else's company.

<comment><USER3> Thomas here (Node.js lead from Opbeat). Don't worry, we are not closing down Opbeat :) We'll continue to run the current version of Opbeat via opbeat.com until we can port users to the new Elastic APM product that we are currently developing

<comment><USER2> Hi Thomas, fellow Copenhagen developer here. I understand how you are transitioning the product to Elastic APM. I'm simply curious of the motives. Why would you want to do that instead of building your own product at your own company? Wasn't Opbeat profitable, yet?

<comment><USER3> No we never intended to be profitable at this point in our development. So that was never really a problem. We had actually just secured our next round of funding when Elastic approached us, so money was not an issue. We honestly believe that our chances of doing something great is bigger with Elastic than alone. It's true that we could have continued without joining with Elastic, but we felt it was the right thing to do :)

Personally I'm a huge believer of open source, and Elastic is an open source company. That's one of the reasons why I'm super exited about this. I think this move will benefit everyone :)

<comment><USER4> > Personally I'm a huge believer of open source

I'm curious then why Opbeat itself was never open source?</comment></comment></comment></comment></comment>


An Amazon Education - <AUTHOR> http://bits.blogs.nytimes.com/2012/07/23/an-amazon-education/ <comment><USER2> Unimpressive. $2,000/yr really isn't much, given the current cost of education. What they should do is offer full reimbursement for STEM training to employees who qualify. Now that would make me consider working for Amazon.

This only confirms my opinion of Amazon as a company that likes to be stingy with salaries and benefits.

<comment><USER3> It's $2000/yr bonus for minimum wage warehouse employees, not spoiled engineers.

<comment><USER2> Problem: this program isn't for spoiled engineers. Another problem for your non-argument: I'm a former Amazon warehouse associate. Even for warehouse employees, it's not a good deal. Have you read the Amazon warehouse employee blog posts here on HN recently? Education costs the same whether you're an "engineer" or a warehouse worker. As another high-karma commenter (e.g., not you) said about this same subject in another thread:

\--most people working in Amazon warehouses are employed by temporary staffing firms, not Amazon

\--most people working in Amazon warehouses don't come anywhere near 3 years of tenure before quitting or being fired

\--reimbursement is limited to $2,000/year for four years, while $5,000/year is pretty much the minimum direct cost to take such programs

\--the program is limited to full-time workers, so only those who can take classes while working full-time and mandatory-or-you-get-fired overtime can partake

</comment></comment></comment><comment><USER4> From the FAQ:

> What are the maximum benefits under the program? > Amazon will pay up to 95% > of the tuition, textbook and associated fees up to a maximum of $2,000 per > year for four years.

Tuition for an associates degree is usually upwards of $5000. I was impressed at first; now I'm deeply disappointed and see this as little more than a PR stunt.

<comment><USER5> I think it was targeted towards the people who work in the warehouses not necessarily highly paid technical staff aiming to do their MS or MBA. Still $2000 is paltry as compared to what Google and Microsoft, other major tech employers in the area, offer.

</comment></comment><comment><USER6> That's pretty bogus. Little more than a PR stunt. Honestly, I would have more respect for Amazon if they just didn't have such a program or made it basically secret rather than treating it as a call to action for other corps to "copy."</comment>


Everything you ever wanted to know about terminals (2018) - <AUTHOR> https://xn--rpa.cc/irl/term.html <comment><USER2> Previously:

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

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

</comment><comment><USER3> The lack of attention to (or, rather, the complete disregard of) proper capitalization is ridiculous. This is the second post I'm seeing in two days that feature this "style". Quite a disturbing trend, if you ask me.

<comment><USER4> What is ridiculous and disturbing about using lowercase letters at the beginning of your sentences? In a world where this trend continues your eye will become used to it and it will no longer be a distracting shock from what your eye is used to.

<comment><USER3> If this is your argument supporting this trend, then I'm speechless ...

<comment><USER5> If the author otherwise (that is, first word capitalization issue aside) writes grammatically better than >99% of other internet writers, I submit that you can grant them this one shred of self-expressive style. Goes pretty well with the terminal user theme, to boot.

It's pretty clear she pays mind to grammar and cares about its proper usage more than most.

<comment><USER3> I did not say anything about grammar or even punctuation (in general). I have voiced a specific concern of a complete disregard of a proper capitalization. If you call it a "self-expressive style", well, it is your opinion and, of course, you are as entitled to one as everyone else. However, I highly doubt that most people would agree with your characterization of this as a "style". I welcome diversity of self-expression, but I would expect it to be in the form of writing itself (content and/or writing style) and/or visual aids (images), but not in ignoring expected traditional punctuation. BTW, the issue here includes lack of capitalization not only for the first word in a sentence, but also for the pronoun "I".

<comment><USER5> Well, I find it to pretty obviously be a self-expressive style, given the rest of its "form of writing itself (content and/or writing style) and/or visual aids (images)."

I could be wrong. Oh, well.

You might not have brought them up, but I largely (if not only ever) make the criticism regarding capitalization within contexts concerning grammar/punctuation or conveyance. And, given everything else in the article, I think it conveys pretty all right :)

<comment><USER3> This issue is not about _conveyance_ , but rather about _readability_. As simple as that. So, let's agree to disagree. :-)

<comment><USER5> I'm of the opinion that there is much overlap between them. If I can have that (the opinion that is, not the concession on your part), then I accept.

<comment><USER3> I think that you and I are talking about different "readabilities". Yours implies a capability to effectively convey conceptual meaning, whereas mine (in this context) implies UX-focused - that is, purely visual - readability of the text at hand. I hope that this clarifies the source of our presumably different opinions.

<comment><USER5> I had considered both, as I think they considerably overlap (e: in this case, at least). In fact, if you want to want to completely isolate the two, I had mainly considered the UX-focused and visual aspect.

Contending over the ultimate conveyance of meaning in and of itself would have had me arguing for what we both already agree on.

Come onnnnn. It's not _that_ bad with the grammar/punctuation, capitalization of acronyms and proper nouns, backtick highlights, and codeblocks.

<comment><USER3> If you are OK with a text being not _that_ bad, hmm ... it is your choice. Readability is an extremely important UX concept, not to mention the accessibility in this case. For the current version of the text, people with less than great eyesight have to rely only on the (tiny) trailing dot to visually distinguish between sentences. Having proper capitalization within the context would enormously improve the text's accessibility.

As for _" grammar/punctuation, capitalization of acronyms and proper nouns, backtick highlights, and codeblocks"_, well ... if the text would lack that, it would have been a completely unreadable wall of text.

<comment><USER5> I'm speaking of the readability being not that bad.

Accessibility arguments you're pushing here and elsewhere should have been brought up much earlier. I'm responding mainly to the "ridiculous!" outburst. (e: OK, no exclamation, and a more charitable reading will have me withdraw "outburst.")

> if the text would lack that, it would have been a completely unreadable wall > of text.

Yet, in its form, it is more readable and coherent than most of what gets pushed out these days, even with proper capitalization. If anything, _that_ is ridiculous.

With this shifting, I would like to take my leave. Be well, and good night.

</comment></comment></comment></comment></comment></comment></comment></comment></comment></comment></comment></comment><comment><USER6> I recently rewrote my fork of cplay and got fed up with curses. Boy do I wish I had found this article earlier because it describes everything I painfully had to cobble together. This is great!

Just one nit: Doing stuff in a signal handler is usually a bad idea because it can interrupt your code at any time. The usual work around is a trick called "self-pipe". [https://ldpreload.com/blog/signalfd-is- useless](https://ldpreload.com/blog/signalfd-is-useless)

For anyone interested, I created a library in the process: [https://github.com/xi/boon](https://github.com/xi/boon) (It takes some inspiration from react but bare with me, I think it actually makes sense.)

</comment><comment><USER7> Oh man, they left out the part I was hoping to find out more about!

> it's good form to have a function called resize() or similar that you run on > program start and later when the terminal window is resized. while there is > a horrible way to do this with ANSI escapes, it's better to just bite the > bullet and learn how to use ioctls and termios.

I wanted to know about the horrible ANSI escape sequences to send that can query the window size. Afaict one has to read from the terminal to get the answer--but these are control sequences that could be inserted into the normal stream--when, where, how?

<comment><USER8> You can look at the programmer's guide for the VT100[1], which does a good job of explaining the different ANSI escape codes.

To put it simply, you can move the cursor down and to the right. For example, you'd move the cursor 999 lines down, then 999 columns to the right, and then query the cursor's position[2]. You can then read the output through STDOUT and parse it.

I'd recommend anyone who's interested in playing around with ANSI and learning how to write a pure terminal-based program to look into the Kilo text editor[3]. That's where I learnt the above instructions.

[1] [https://vt100.net/docs/vt100-ug/chapter3.html](https://vt100.net/docs/vt100-ug/chapter3.html)

[2] [https://vt100.net/docs/vt100-ug/chapter3.html#CPR](https://vt100.net/docs/vt100-ug/chapter3.html#CPR)

[3] [https://viewsourcecode.org/snaptoken/kilo/](https://viewsourcecode.org/snaptoken/kilo/)

</comment></comment><comment><USER9> Can barely read the content with that colorscheme.

</comment><comment><USER10> that site has great personal branding. recall seeing other articles from lexi halle on the feediverse some time ago and immediately recognized it.

great content too.

</comment><comment><USER11> What's this stuff about:

> also, i'm a) a nobody and b) a woman. nothing i wrote would ever gain any > traction; any project designed to supplant ncurses needs to come from > someone who's actually known to the FOSS community. and a maintainer who > isn't a cripple.

Did ncurses gain popularity because of the identity of its maintainer(s)?! I was of the impression that it's whoever gets there first.

</comment><comment><USER12> That's pretty nasty - this article is factually incorrect in probably the worst way: the code will work on author's computer, but not for other people [0]

Not to mention that it is missing "good citizen" features like turning off colors when stdout is not a tty.

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

<comment><USER13> > _"good citizen" features like turning off colors when stdout is not a tty._

Better solution: do not detect whether your output is a tty or not.

Let the user decide they want colors or not by using `--color=always` or `--color=never` or similar.

There's few things worse than writing a script and getting different output just because you're no longer running the program interactively.

<comment><USER14> Gah i got bit by this with 'jq'!

> $ echo "{}" | jq > {} > $ echo "{}" | jq > out.json > jq - commandline JSON > processor [version 1.5-1-a5b5cbe] ... etc ...

Turns out when stdout isn't a tty you _must_ specify a filter (in this case '.')

<comment><USER13> Yup! I had the same problem too. It was 'fixed' in jq 1.6, such that it now assumes `.` is the filter if no program arguments are provided [0].

It happens all the time with anything systemd or networkmanager too

[0]: [https://github.com/stedolan/jq/releases/tag/jq-1.6](https://github.com/stedolan/jq/releases/tag/jq-1.6)

</comment></comment></comment></comment><comment><USER15> ncurses is a lot more readable than just dropping raw control codes into your source code, and it _works_ , whereas raw control codes _might work_ and often don't.

</comment><comment><USER16> Interesting, but I wish it was less emotionally charged.

But very cool using macros to make an easy styling "language"!

</comment><comment><USER17> I was just reading up an ANSI escape sequences a few days ago, this is gold.

I adore the format and writing style too.</comment>


My mom is a programmer, raging against the machine - <AUTHOR> http://gadgets.boingboing.net/2009/05/08/i-had-no-idea-my-mom.html <comment><AUTHOR> Since mother's day is around the corner, just curious, how many of you have mothers who are/were programmers?

<comment><USER2> My mother is a programmer, quite frankly the best programmer I have ever met. But she doesn't like computers and says she longs for the old days when she would write out her program on a piece of paper, hand it to the technicians and get a print out of the results a day later.

<comment><USER3> I am curious: does she edit her programs on Windows or Mac? The reason I ask is that I felt the same way until recently.

<comment><USER2> Windows. Although I doubt using a Mac would change her mind, even if I could convince her to switch.

It's kind of ironic, but she is completely like the clueless mothers everybody else complains about when it comes to technology. She needs help installing anything and I had to even set up her iPod for her.

However, she is a phenomenal programmer because of her logical thought processes. She never planned on becoming a programmer, she wanted to be a mathematician and that is what her degree is in. When she graduated, there was a position for an "applied mathematician" and she was hired. Applied mathematics turned out to be programming and so that's what she became.

</comment></comment></comment></comment><comment><USER4> i've always been surprised how much like simple programming knitting and weaving and similar crafts are. most of my friends go WTF at my knitting because it's so incongruous with the rest of my interests, until i explain/show them how patterns read like loops and things :)

</comment><comment><USER5> I have often wondered if there are decent web sites for knitting patterns and stuff like that, or if it is all mostly print magazines.

<comment><USER4> ravelry.com is a fantastic social network that has a db of patterns. they don't keep most of them on the site itself - just the fact that the pattern exists and where to find it, what kind of yarns are recommended along with what kind of needles, projects of the same pattern done by other members with however much information they care to include - although some designers do sell their patterns on the site. See [http://img.skitch.com/20090509-fuy92fx7e5rykfgu377tgyg3wt.jp...](http://img.skitch.com/20090509-fuy92fx7e5rykfgu377tgyg3wt.jpg) for an example.

unfortunately, a lot of the nicer patterns are from print magazines, but there are some exceptions to the rule - knitty.com for one is all online. It's unfortunate more magazines don't sell their patterns online as well, because sometimes it becomes impossible to find the pattern when it's not been printed and you can't find anyone to sell it to you.

</comment></comment><comment><USER6> No but she is the one who bought me dos sesame street games and taught me how to use them, as well as email in the early 90s and I'm sure I never would have used a computer other than as word processor and for email without her early start</comment>