New Quantum Theory Separates Gravitational and Inertial Mass - <AUTHOR> http://www.technologyreview.com/blog/arxiv/25331/ <comment><USER2> err, so by initially assuming that something under the influence of a potential has a mass M, and calculating the Hamiltonian comes up with a proportionality constant of sqrt(M) means that the potential energy of the system is proportional to the sqrt of the mass of the bound object, all things being equal, not that the equivalence principle is broken.

okay typos above aside i just read their paper. it's good work.

they solved a few well known, relatively simple quantum mechanics problems, in college (from the griffiths intro to quantum mechanics book) these problems are usually solved by talking about an electron in an electric potential.

these fine scientists solved a simple quantum mechanics problem not using an electric potential, but using a gravitational potential. the solution ends up resulting in two dimensionless constants that define the particulars of the solution that are measurable. in solving the equation of a they kept separate the inertial mass and the gravitational mass, and the two measurable constants are expressed in such a way in the setup that they are considering such that by measuring these two constants the inertial mass and gravitational mass may both be solved for (two equations, two unknowns).

they are proposing that this is a way of investigating experimentally the distinction if any between these two quantities.

also the appendix was really complicated and it was very hard to follow

<comment><USER3> I think a quote from Feynman is apt. "I think it is safe to say that no one understands Quantum Mechanics." (Richard Feynman)

My understanding of the article is this, simple yet hopefully useful.

Einstein and many others in the past assumed and observed that the inertial mass is always equal to the gravitational mass because no measurement has or could tell them apart.

Like the break down of classical mechanics at small scales, so too does this assumption, or so this papers calculations predict. In fact the calculations suppose a situation in which you could measure, through "atomic spectroscopy", a difference in these masses.

One must remember this is in the QM world, the size scale of atoms and mass scale of electrons, not with "classical" sized things.

</comment></comment><comment><USER4> Here's an interesting implication:

Normally objects fall at the same speed no matter how heavy because while the attraction (force) is proportional to the [gravitational] mass, the acceleration is anti-proportional to the [inertial] mass, and the two cancel out.

But if the two are different then a heavier object would fall faster than a lighter one. (Or vis versa.)

I have a suspicion that this would violate conservation of either energy or momentum, but I'd have to think about it more.

Basically if you drop one big object and measure the speed, then compare it to dropping two object each half the size. The big one ends up at a faster final speed than the two half sized one, and that violates both conservation laws.

<comment><USER5> I don't think that's true. You can only observe that inertial mass is not equal to the gravitational mass if you have two objects of different material with different values for inertial mass/gravitational mass. If the big and the two half sized objects are made of the same material then a different inertial mass just corresponds to a different gravitational constant G.

        Mathematically let m_g be the gravitational mass and m_i be the inertial mass.
        We have F = m_i*a and F = G*m_g*M_g/r^2.
        So we have a = G*m_g/m_i*M_g/r^2.
        Now m_g/m_i is the same for the big object and for the half object.
        We can absorb it into the constant G and end up with a = G'*M_g/r^2.
        Conclusion: the big object and the half object have the same speed.

</comment></comment><comment><USER6> I hope this opens the door to E.E. "Doc" Smith-style "intertialess" drives. There would still be the weirdness of time dilation, but it would be possible for people to travel to distant stars and back again.

<comment><USER7> Just being able to have matter that has gravitational attraction and little or no inertia or vice versa doesn't open the door to inertialess drives. To do that, you'd need negative inertia to cancel out the inertia of payload and bits of spacecraft that have inertia. And I don't see anything in the article to suggest that there was any hope of that. In fact, I'm not sure how this would be useful unless you could turn gravitational attraction on and off. If you could do that, perhaps you could rob the mass energy of the one or both of the bodies to create energy? It would basically function as a mass energy converter. But we're a long way even from a theoretical framework for that.

<comment><USER6> One step at a time! Before this, I thought we weren't sure those two were even separable.

</comment></comment></comment><comment><USER8> correct me if i'm wrong... but in order for this to catch hold, we'd need to know why this distinction doesn't have a significant effect in the classical world? e.g. for relativity, we know that time dilation doesn't have a measurable effect because we move at very speeds.

anyone have an idea why this wouldn't show up?

<comment><USER9> with "very speeds" do you mean very low or very high? It kind of makes a difference here...

<comment><USER8> very low, sorry.</comment></comment></comment>


New York City mapped its trees and calculated each one's economic benefits - <AUTHOR> http://www.archdaily.com/800157/new-york-city-mapped-all-of-its-trees-and-calculated-the-economic-benefits-of-every-single-one <comment><USER2> I'm not sure I understand what it means to measure the "economic value of a tree". Yes, trees provide shade and reduce pollution, but does that really mean one can meaningfully attach a dollar value to a tree?

There are two statements that I think are meaningful: "this tree costs $X to plant and maintain", and "This tree provides benefits that would otherwise cost $X". But if you want to make the latter statement, are you _really_ sure you've captured all the benefits? Including aesthetic ones? Because I'm not really convinced that's possible.

<comment><USER3> Urban vegetation:

1\. Has high reflectance in the infrared, so they reflect sunlight back to the sky before it is converted to heat. Built surfaces would absorb this radiation and heat up.

2\. Reduce heat also by evaporating water.

3\. Reduce ground level heat by providing shadow.

4\. Remove pollution from air, such as sulfur oxide (SO2), nitrogen oxides (NOx), ozone (O3) and fine particles.

But yes, converting these to money is very indirect and involves a lot estimation.

<comment><USER4> Whats the contribution of 1. to climate change? Insignificant?

<comment><USER5> The contribution of trees and albedo in general to climate change is huge. But I doubt that urban trees, specifically, contribute a significant effect. They do greatly contribute to avoiding the also-problematic urban heat-island effect, though.

</comment></comment></comment></comment><comment><USER6> This is also getting available for the complete Netherlands (also information like benches, trash bin's, drainage etc) on [http://pdokviewer.pdok.nl/](http://pdokviewer.pdok.nl/)

A screenshot of some of this data: [http://imgur.com/Pgvzfnf](http://imgur.com/Pgvzfnf)

<comment><USER6> I just found out that boomregister.nl actually has even more data. It has literaly almost every tree in the country. Even tree's in forests and private tree's

More screenshots: [http://imgur.com/a/ctLGx](http://imgur.com/a/ctLGx)

</comment></comment><comment><USER7> Melbourne has been doing a similar thing for some time now: [http://melbourneurbanforestvisual.com.au/](http://melbourneurbanforestvisual.com.au/)

<comment><USER8> Always loved the presence of trees in the CBD.

<comment><USER9> _" loved the presence of trees in the CBD."_

As a kid coming from semi-rural area going to Uni, for months I'd trek from RMIT to the closest gardens to eat lunch under a canopy of trees at the Exhibition gardens. [0]

Melbourne's northern clime trees and some native vegetation is at risk of premature death. [1] Something like 20% or 375 different species. Lot of planning going into inner-city deforestation.

[0] Like this [https://en.wikipedia.org/wiki/File:English_Elm_avenue.jpg](https://en.wikipedia.org/wiki/File:English_Elm_avenue.jpg)

[1] Birdie Smith, _" Tree change for Melbourne, as the city plans for a warmer world"_ [http://www.smh.com.au/environment/tree-change-for- melbourne-...](http://www.smh.com.au/environment/tree-change-for-melbourne-as- the-city-plans-for-a-warmer-world-20161115-gsq9zd.html) 2016 Nov 17.

</comment></comment></comment><comment><USER10> I think they have some data integrity problems: [https://tree- map.nycgovparks.org/#treeinfo-3752098](https://tree- map.nycgovparks.org/#treeinfo-3752098) Trunk Diameter: 424 inches

Riiiiight...

<comment><USER11> I feel like... from some spot checking, these are all circumferences, not diameters.

<comment><USER12> That'd still be an 11 foot dia. trunk.

<comment><USER11> Not saying that some data points aren't also simply wrong. But many more become plausible if you divide them by pi ;)

</comment></comment></comment></comment><comment><USER13> Just to clarify, it's not all of NYC trees. The map doesn't include trees in parks or on private land. It is only sidewalk trees. Still a wonderful project.

<comment><USER14> Yep! You can see that here: [https://tree- map.nycgovparks.org/#treeinfo-3758005](https://tree- map.nycgovparks.org/#treeinfo-3758005)

Trees in background not catalogued

</comment></comment><comment><USER15> Indianapolis has a group called Keep Indianapolis Beautiful (KIB) that works to beautify the city and help decrease long term maintenance costs to the city. To that end, every year they plant thousands of trees, often removing entire plots of land from the maintenance rotation because trees don't require mowing. They have a database that tracks source nurseries, species, locations, etcetera that I'm sure would be a delight to dig through.

</comment><comment><USER16> Washington DC did this [http://dcgis.maps.arcgis.com/home/webmap/viewer.html?webmap=...](http://dcgis.maps.arcgis.com/home/webmap/viewer.html?webmap=fea6079cf9bc4310a8b6c94f8c2bf1da)

</comment><comment><USER17> What a fantastic site this and the others people have posted on here are. Making this kind of information available to people is a great way to change their opinion of something that otherwise they probably think doesn't do anything for them, or that has a cost, not a benefit to the local economy and environment, and is the kind of information we need to give our kids access to so it becomes de rigeur to understand how important trees are. With all the bad news in the world at the moment, this has been a ray of sunshine, thanks.

</comment><comment><USER18> Zürich has it too [https://www.stadt- zuerich.ch/ted/de/index/gsz/planung_u_bau/...](https://www.stadt- zuerich.ch/ted/de/index/gsz/planung_u_bau/inventare_und_grundlagen/baumkataster.html)

</comment><comment><USER19> Paris :

\- street trees ("alignement")

[https://opendata.paris.fr/explore/dataset/arbresalignementpa...](https://opendata.paris.fr/explore/dataset/arbresalignementparis2010/map/?location=18,48.86212,2.36627)

\- park trees

[https://opendata.paris.fr/explore/dataset/les- arbres/map/?lo...](https://opendata.paris.fr/explore/dataset/les- arbres/map/?location=19,48.84257,2.38825)

</comment><comment><USER20> Frankfurt also did this: [https://www.frankfurt.de/sixcms/detail.php?id=3051&_ffmpar%5...](https://www.frankfurt.de/sixcms/detail.php?id=3051&_ffmpar%5B_id_inhalt%5D=24228872)

</comment><comment><USER21> My city Edmonton, Canada also has a map of all the trees they maintain: [https://data.edmonton.ca/Environmental-Services/Trees- Specie...](https://data.edmonton.ca/Environmental-Services/Trees-Species-Map- View-/cggb-hzzm/data)

</comment><comment><USER22> Might be interesting to read but a popup blocks the content and the X doesn't close it.

<comment><USER23> Try reloading the page? But, yeah, the social media hooks on this adver^H^H^H^Hsite are _extremely_ aggressive and annoying. It starts with popup, then if you close that it opens a sidebar, then if you ignore that opens a footer. All demanding that you like archdaily on Facebook.

</comment></comment><comment><USER24> San Francisco, CA - I helped develop a super basic Android app called Treedat, we didn't publish on the Play Store since it was just to play around with the SF dataset and we were just curious what kind of species we were looking at when we're walking around SF: bit.ly/treedat

</comment><comment><USER25> Estimated value of $500 a tree, especially for a large tree, seems off to me, even if it is the value per year.

<comment><USER26> Tracing the references, you wind up at [http://www.itreetools.org/](http://www.itreetools.org/) which describes the approach the Forestry service took to model out the value of a tree, with some detail at [http://www.itreetools.org/resources/archives.php](http://www.itreetools.org/resources/archives.php)

</comment></comment><comment><USER27> Is this already imported into OSM?

<comment><USER28> Probably not, it is not in the NYC data portal (a 1995 tree census is). Edit: Oops, that's wrong, it's here [https://data.cityofnewyork.us/Environment/2015-Street- Tree-C...](https://data.cityofnewyork.us/Environment/2015-Street-Tree-Census- Tree-Data/pi5s-9p35) )

It's anyway kind of pointless to jam such data into OSM. Most rendering tools are happy to use multiple data sources, so someone interested in such specialized information can just get it from New York City.

That doesn't mean that it absolutely shouldn't be added to OSM, but there should be some clear motivations and benefits, not just helping (hypothetical) lazy people (that might be interested in the data) avoid a JOIN (which is hyperbole, for this data you don't even have to match anything up, just use it together with a base map).

<comment><USER29> Well, but how many joins would you need to show all those data in multiple countries?

There are a lot of trees added to OSM in European countries for example, not everyone needs to know that e.g. Berlin has tree data in this DB and Frankfurt in another one.

<comment><USER28> That's what I meant by hypothetical though. How many people are scrambling to build global tree viewers that would only include the sparse data you would get by importing all the publicly available data sets?

The interest in such data is going to tend to be local or be forced to take into account the nature of the data collection (and thus benefit from directly accessing the curated source data). An example of the latter would be an academic analysis; to pull data from OSM, it would need to start by determining geographic areas with good coverage, or the results would be utterly meaningless.

<comment><USER27> I like to think of OSM as striving be as complete and as accurate as possible. So I believe every correct piece of data should be added.

<comment><USER28> Sure, but a hasty import of large amounts of data that no one is around to maintain it is at odds with accuracy.

<comment><USER30> Which is why we should be encouraging government agencies to use OSM as the canonical reference.

<comment><USER28> It's probably going to take more than encouragement.

Namely, changes to open records laws to make it okay to work on data sets that are not strictly public domain.

<comment><USER30> Is not all map data in the US not in the public domain, being works by the government?

<comment><USER28> The point is that a public employee subject to open records laws can't edit OSM because OSM isn't public domain.

Here's an example. The National Park Service can't treat OSM as their canonical data store:

[https://www.nps.gov/npmap/blog/nps-plus-osm-equals-places- of...](https://www.nps.gov/npmap/blog/nps-plus-osm-equals-places-of- interest.html)

People play blame-the-ODBL, but there's not really any epically strong arguments against adjusting the public records laws to be a little more flexible.

<comment><USER30> Thank you for sharing this!

</comment></comment></comment></comment></comment></comment></comment></comment></comment></comment></comment><comment><USER31> Is there a way to search ones own comments? I was in a discussion about the yearly price of urban trees a while back on HN, and I thought the numbers would be relevant to this story, but I can't find an easy way to dig up the post.

<comment><USER32> This one? [https://news.ycombinator.com/item?id=12054786](https://news.ycombinator.com/item?id=12054786)

[https://hn.algolia.com/?query=by:wodenokoto%20tree&sort=byPo...](https://hn.algolia.com/?query=by:wodenokoto%20tree&sort=byPopularity&prefix&page=0&dateRange=all&type=comment)

</comment></comment><comment><USER33> Attempts to compute the economic benefits of objects that are not economic are usually meaningless exercises for the bored mind.

<comment><USER28> The idea that there are objects that are not economic is nonsense.

Even things with direct utility like food have weird economic values, not objective values tied only to their utility.

</comment></comment><comment><USER34> Why are we means-testing trees? This is ridiculous.

</comment><comment><USER35> Trees are nice, but holy cow...people with too much time and money on their hands making stuff up to justify whatever.

<comment><USER36> What are they making up to justify what?

<comment><USER37> My guess:

Got X budget this year. Used 1/2 of X budget for useful things.

Requirement: Use all of X budget or receive only 1/2 of X budget next year.

Solution: Use the budget to map all the trees.

</comment></comment></comment><comment><USER38> so, is there a consulting question in here somewhere... If there are X trees in NYC/SF, and each tree can stay alive if only peed on by 100 dogs per week, how many dogs are in those cities?

</comment><comment><USER39> Because clearly the only thing important when it comes to trees is their economic value/s

Still a nice project.

<comment><USER40> No one claimed that their economic value is the only thing important.

</comment></comment><comment><USER41> Do you think it's strange that cities need to map nature to prove its economic value?

I've never understood the appeal of cities (other than a quick 1-2 day visit).

Cities are more inefficient[1], have more pollution[2], have less nature[3], stink like shit[4], have less happiness[5], have more noise[6], require subways and mass transit just to get around, are more expensive[7], etc. (the list almost doesn't end).

1\. [https://www.hks.harvard.edu/content/download/70101/1253214/v...](https://www.hks.harvard.edu/content/download/70101/1253214/version/1/file/inefficientcities_final.pdf)

2\. [http://www.health.com/health/gallery/0,,20490855,00.html](http://www.health.com/health/gallery/0,,20490855,00.html)

3\. I don't think I need a citation for this one

4\. [http://www.businessinsider.com/why-new-york-city-smells- in-t...](http://www.businessinsider.com/why-new-york-city-smells-in-the- summer-2016-6)

5\. [http://www.citylab.com/housing/2016/06/the-price-of- happines...](http://www.citylab.com/housing/2016/06/the-price-of-happiness-in- cities/487823/)

6\. [http://earthjournalism.net/resources/noise-pollution- managin...](http://earthjournalism.net/resources/noise-pollution-managing-the- challenge-of-urban-sounds)

7\. [http://www.bls.gov/opub/btn/volume-2/expenditures-of- urban-a...](http://www.bls.gov/opub/btn/volume-2/expenditures-of-urban-and- rural-households-in-2011.htm)

<comment><USER42> > Cities are more inefficient[1]

That's not what your source says at all.

What it says is that there is a point where further increases in density will provide less positive economic effects than negative. It does not say what that point is, nor does it say that there aren't means that can move the interesection point further up. The point where a city becomes less efficient than a rural area is also much further up the density scale, because to get there you first need the inefficiencies to outweight all the benefits, not merely rise faster than the benefits.

The paper doesn't even _try_ to quantify which cities might have reached or exceeded the threshold where further density would be detrimental. All it does is try to establish office rents as an indicator of the efficiency of land use policies.

The paper itself also points out a lot of caveats even for their very limited goals.</comment></comment>


New Stealth Start-Up: Udentity - <AUTHOR> http://www.udentity.com/l1d147f

<comment><USER2> Sorry to ask but what is it and what does it do? A small paragraph of what Udentity is would be great !! I understand that this is a stealth startup but a screen with two textboxes is too 'cryptic' :)

</comment><comment><USER3> harvests your email presumably?</comment>


Valleywag Misses the Mark on Y Combinator - <AUTHOR> http://onwebapps.com/valleywag-misses-the-mark-on-y-combinator/ <comment><USER2> Why? Y Combinator funded companies don't build real businesses.

<comment><AUTHOR> What about listing some specific reasons why YC companies aren't real businesses, so we can get a thoughtful discussion going here?

<comment><USER3> They don't generate revenues, and more likely than not, have no plan to generate revenues.

They're made to be acquisition targets.

<comment><AUTHOR> _They don't generate revenues, and more likely than not, have no plan to generate revenues._

Source? I think that's based on anecdotal evidence.

There are a number of startups generating revenues (reddit, loopt, TextPayMe, Inkling).

And a number of others that have a reasonable way to get revenue: (justin.tv - sell video service to celebrities; scribd - contextual advertising; shoutfit - sell trends to fashion houses; thinkature - sell collab software to businesses; octopart - sell product advertising; wufoo - sell upgraded forms that can be embedded into your website).

Come to think of it, I have a hard time pointing out specific YC companies that don't have any revenue model. Maybe there's a few - but the fast majority of them do have the potential to be self sufficient.</comment></comment></comment></comment>


Show HN: Volleyy – Responsive newsletters that increase user engagement - <AUTHOR> https://volleyy.com <comment><USER2> Hi! We built Volleyy because we wanted our newsletters to look great across all devices and email clients (even outlook), and handle simple things like social post & video embeds. We would love any feedback from you all</comment>


Pythagoras and the Mystery of Numbers (2011) - <AUTHOR> http://jwilson.coe.uga.edu/EMAT6680Fa06/Hobgood/Pythagoras.html <comment><USER2> If you enjoyed reading about how you can form most other fundamental shapes (a triangle, a square etc) from circles, check out the game Euclidea.

It's kind of brilliant at letting you rediscover many of these concepts, and also just a great sandbox for demonstrating these ideas. Nice tool to have on your phone.

Android: [https://play.google.com/store/apps/details?id=com.hil_hk.euc...](https://play.google.com/store/apps/details?id=com.hil_hk.euclidea)

iOS: [https://apps.apple.com/us/app/euclidea/id927914361](https://apps.apple.com/us/app/euclidea/id927914361)</comment>


Some Criticisms of RISC-V - <AUTHOR> https://gist.github.com/erincandescent/8a10eeeea1918ee4f9d9982f7618ef68 <comment><USER2> To these I would add: lack of a rotate instruction in the base ISA, and unix standard extension groups. This makes symmetric key encryption and most hash functions much slower. The Bitmanip extension has a rotate instruction, but it should have been in the base ISA.

I'd also emphasise the lack of indexed load/store instructions again. It is a disaster for any sort of array indexing where you're addressing >1 array using the same index. I found this in the context of multi-precision arithmetic for crypto, but examples come from all over.

On the author's point about multiply and divide in the same extension: crypto is another good example. Lots of crypto really benefits from multiply, but doesn't need divide.

The most important thing about RISC-V is the idea behind it's openness as a standard and the ecosystem around that standard. The engineering of the ISA itself is not what makes it remarkable, and actually leaves a lot to be desired.

<comment><USER3> I see the word "crypto" in each of your objections. While crypto is important, it's not the whole world and not everyone needs the absolute fastest crypto possible. If you do, then use a processor with crypto instruction extensions. If not, you can get by just fine with the operators C gives you.

Most software doesn't use rotate operations. When you do need one, it takes three instructions to synthesize it if the shift count is a constant, or four otherwise. Unless you're doing nothing but rotates you're not going to notice it. If you're doing any memory loads that miss in the L1 cache to get the data you're rotating then you're also not going to notice it.

The same goes for the indexed loads and stores. Measure it, don't just go on your feels.

The main problem with the the original post is that the author criticizes things based on his sense of aesthetics, and what he's used to, not on any kind of actual scientific experimentation and measurement of different options.

The whole premise of H&P's "Computer Architecture: A Quantitative Approach" is that you should base decisions about what to put into your hardware and what to leave out based on actual data, not on what seems prettier or more orthogonal to you.

</comment></comment><comment><USER4> Alibaba crafts world's 'fastest' 'open-source' RISC-V processor yet: 16 cores, 64-bit, 2.5GHz, 12nm, out-of-order exec

[https://www.theregister.co.uk/2019/07/27/alibaba_risc_v_chip...](https://www.theregister.co.uk/2019/07/27/alibaba_risc_v_chip/)

"The aforementioned RV64GCV designation means the Xuantie 910 implements the base 64-bit RISC-V ISA (RV64G), supports compact 16-bit-wide instructions (C) as well as the usual 32-bit-wide instructions, and supports still-in- development vector math operations (V). Interestingly enough, though, it is also said to include 50 non-official instructions for assisting and accelerating various tasks, from memory management and CPU core wrangling to storage access."

</comment><comment><USER5> It does neglect that one overarching design goal was to not be encumbered by any IP. That means you have to pick your solutions exclusively from expired patents and, no, you don't get to be clever and come up with new things along the way because, again, you risk one of the behemoths raining hellfire down on you.

</comment><comment><USER6> Having one instruction that can be a branch, call, or return seems super weird, what's the reasoning for it?

<comment><USER7> I'm guessing some misguided attempt at unifying: "They're all a kind of branch". The instruction here is JALR rd,rs1,offs.

It takes three arguments: rd, the destination register to put the return address in (it should always be the ABI-defined link register, e.g. t1), rs1, the source register that jump should be relative to (it should always be the link register for a return, and 0 for a call/branch). To a software guy, there's elegance in unifying the three cases, but there's really no such principle in hardware. It just makes the implementation more complex, since branch/call/return all greatly differ for prediction, prefetching, etc.

<comment><USER8> I would argue that it's not that elegant in software either. By unifying the instruction, you lose semantic information about what the program is trying to do.

</comment></comment></comment><comment><USER9> It is unfortunate that they are locking down choices so early, before anybody has enough experience to know if they are right; and we know some are wrong.

I was astonished that they didn't consider bitwise anything -- including rotate and popcount -- worth bothering about. It is sad they settled on 1, not ~0 for their bool true value, in the ABI. Do they even have short load- immediate -1, 0, and 1 instructions?

Micro-op fusion is great, but only if you can keep your instruction decoder sated.

</comment><comment><USER10> The RISK instruction set was made based on the idea that the compiler could do most of the work, so make the hardware instructions simple. But was coming from a time when processor bus speed and memory speed were the same, and microcode was fairly simple. The assumptions didn't pan out.

<comment><USER11> I forget, what does ARM stand for again? :)

<comment><USER12> > I forget, what does ARM stand for again? :)

What do you believe is the reason that ARM does no market this acronym anymore? ;-)

<comment><USER13> "Acorn" not being relevant? :D

</comment></comment></comment></comment><comment><USER14> Obligatory Dilbert: [https://dilbert.com/strip/1994-07-11](https://dilbert.com/strip/1994-07-11)

(Obviously not saying OP is an uninformed pundit — topic just sparked a funny memory)</comment>


Python has two GILs - <AUTHOR> http://reticulatingsplines.posterous.com/python-has-two-gils

<comment><USER2> I'm not an expert in CPython's internals either, but _import_ lock does not need to equal _global interpreter_ lock. I do agree though, that this behavior isn't intuitive at all.

<comment><USER3> GIL stands for both Global Interpreter Lock and Global Import Lock.

</comment></comment><comment><USER4> So why can't importing a module block until the import lock can be acquired, rather than throwing an exception?

<comment><AUTHOR> I don't completely understand that either. This comment from the ticket that originated the behavior ( <http://bugs.python.org/issue1567> ) comes with the following explanation:

      It fixes several issues related to dead locks when a thread uses a
      function that imports a module but another thread holds the lock. It
      doesn't require static caching of modules.

The idea that deadlocks were a problem makes me think that this import lock isn't exactly 'global', per-se.

<comment><USER5> The thing about Python is that it is a scripting language. Importing a Python module involves executing arbitrary code.

Here is a quick rundown of how a deadlock can occur:

1\. The main module runs in Thread #1, which imports module "foo".

2\. Module "foo" has code at the top level that starts a new thread (Thread #2), and then blocks waiting for it to do something.

3\. In Thread #2, someone calls datetime.strptime(). This deadlocks because now Thread #2 needs to import "_strptime" but Thread #1 holds the Global Import Lock because it is importing "foo".

<comment><USER6> This is exactly the use case for Recursive Mutexes.

<comment><USER4> I don't think so. It sounds like this is about one thread trying to acquire the lock while another holds it, not the same thread trying to acquire the same lock twice.</comment></comment></comment></comment></comment>


Is Amazon Unstoppable? - <AUTHOR> https://www.newyorker.com/magazine/2019/10/21/is-amazon-unstoppable <comment><USER2> > Amazon pays all U.S.-based employees at least fifteen dollars an hour—more > than the minimum wage in many places—and full-time warehouse workers have > access to the same health and retirement plans as executives.

FWIW, all U.S. employers are required by law to provide the same health and retirement benefits to full-time workers as they do executives.</comment>


Falling out of love with robots - <AUTHOR> http://news.bbc.co.uk/1/hi/technology/7348460.stm <comment><USER2> "Real intelligence

Just as we assign personalities to domestic pets despite their lack of consciousness, so we can attribute these qualities to the increasingly sophisticated robots that will soon be available in work and home settings."

eh domestic pet == a real dog?

they dont have consiousness?

</comment><comment><USER3> Here's a webcomic where a guy turns an Apple computer into a blue haired cybernetic hottie. (The concept is stupid, but the execution is good.)

<http://www.applegeeks.com/></comment>


What is it like to be a machine learning engineer in 2018? - <AUTHOR> https://www.quora.com/What-is-it-like-to-be-a-machine-learning-engineer-in-2018/answer/Joe-Isaacson-1?share=1 <comment><USER2> Some of the pros

\- good pay

\- exciting time to be alive

\- work often spans broad business departments, involves genuinely interesting engineering trade-off problems between accuracy, scale, budget, and interpretability

Some of the cons:

\- You have to be wary to avoid companies in which machine learning is just a name for data engineering / devops / business analytics, or where it is hype or aspiration and no substance

\- No matter what your job will mostly be the unsexy stuff to get a system working. Only maybe 10-20% is going to be the actual model development or experimental side

\- Companies not yet well versed in machine learning can have huge sticker shock at what a competitive compensation package is like, and waste a lot of your time on interviews and end up way off the mark on compensation.</comment>


Edushi: Beautiful, isometric city maps for China - <AUTHOR> http://hongkong.edushi.com/?L=en

<comment><USER2> These are pretty, but they are not accurate. These are not just inaccuracies due to omission, either; there are innumerable added elements that don't actually exist.

The inaccuracies are actually very interesting since I can't fathom why the creators think it's OK. The high level of detail on a map suggests accuracy, which is deceptive. It's one thing to add obvious design elements outside of the context of the information, but in this case they've actually decided to be creative with the information itself.

</comment><comment><USER3> I spent some time in Hangzhou (near Shanghai) last year, and remember asking around about online maps -- none of the usual suspects like Google had anything for China at the time. Everyone pointed me at the edushi.com (which means "e-city" in Mandarin) and it truly amazed me the first time I saw it! It reminded me of the Sim City scenarios that were based around real cities.. All of the buildings are modeled quite accurately, even individual trees and small landscaping details are represented. I guess that's what happens when labour is cheap and there are lots of aspiring art students without many good job prospects. :)

(The company behind the maps, Aladdin Information Technology, is based in Hangzhou. I can't wait until they expand to non-Chinese cities around the world!)

</comment><comment><USER4> _Build spaceport: You do not have enough points to do that._

It is very impressive, although I would have liked to be able to rotate around the compass - but presumably they are using the fake 3d to keep load times down, especially given the potential for traffic spikes on the Chinese internet. Obviously there is some potential for painting over any underisarable information (no half-finished buildings here, everything is neat and shiny!), but there is also utility in the 'cartooned' abstraction. I wonder to what extent it was generated vs. hand-textured.

Also a good excuse to repost this: <http://www.c3technologies.com/> (warning, noisy video autostart). Astounding working demo under 'Reference' menu.

</comment><comment><USER5> Pretty, but of questionable utility.</comment>


Physicist Solves 2k-Year Old Problem That'll Lead to Cheaper, Sharper Lenses - <AUTHOR> https://fstoppers.com/news/mexican-physicist-solves-2000-year-old-problem-will-lead-cheaper-and-sharper-396628 <comment><USER2> There was a huge discussion about this a month ago:

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

You can't comment there any more, so new comments can go here, but it's potentially useful to read the previous discussion.

There are a few extra comments here:

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


Ask HN: Beautiful GUI vs. Total control? - <AUTHOR>

Yea you're mostly all developers of some sort - so are you all Total Control linux types? Are there any of you out there that really long for beautiful GUI over Absolute Power? <comment><USER2> For me (and AFAIK for many people here), it is not about either.

We want to get the work done, and run the businesses. We want to solve people's problems. We are prefer tools that helps us solve these problems in the easiest and most efficient way.

If an application/OS/tool has a user friendly and intuitive interface, great! If it gives more power to the developer, great!

But in the end, neither of these factors make us go blind and make us hide behind the tools rather than getting the work done in the best possible way, with or without using any given tool.

</comment><comment><USER3> If you think linux equals total control, try Gnome :) (not a jab, I love gnome particularly because it doesn't have the settings-everywhere model)

My gut instinct says "beautiful GUI", but that comes with the big IF it satisfies all I want to do with it.

</comment><comment><USER4> I'm more of a "Beautiful GUI" type of guy</comment>


Ask HN: How did you make your first $10,000? - <AUTHOR> Or even $1,000, if you're yet to make $10,000.<p>From an entrepreneurial or self-initiated venture. <comment><USER3> For Buffer, the first $10k came from approximately our first 1,000 paying customers. That said, we've changed our pricing a few times so the number may not be exact.

The great part about getting $10k from recurring payments is that it can grow beyond $10k pretty quickly (now $100k+/mo).

As for the real "how", I think the key is to first find out something you can solve which is truly a problem for some number of people, and then to provide it and market to people the fact it exists.

</comment><comment><USER4> I wrote an ERP system for SMBs. (Enterprise Resource Planning, Small/Midsize Businesses). My first sale was to a 20 person automobile aftermarket wheel manufacturer for $20,000. I remember sleeping with the check that night.

<comment><USER5> Can I see? How long did it take you to write it? How long did it take you to sell it? Is it still alive today?

</comment></comment><comment><USER6> Haven't made $10,000 yet, but my first 1,000 was by selling a calendar I designed and magnet pens I make by hand and sell here: <http://dayonepp.com/>. Way back in 2008 I came up with a square-less calendar design that combined the tradition layout with a todo list: [http://www.chrisnorstrom.com/2010/12/invention-calendar- layo...](http://www.chrisnorstrom.com/2010/12/invention-calendar-layout-that- actually-has-space-for-notes-reminder/). Things got delayed, years later I tried a kickstarter for the calendar but it failed miserably. My goal was too high and my video sucked.

Over a year later I just said "screw it" I'm going for it. And threw in $2,000 to purchase my first 250 calendars & boxes & shipping supplies. I didn't know how I was going to sell them, it was already December so I was late, but somehow they sold. In a little over a month I sold a whole bunch on FAB.com and my own Wordpress e-commerce site I threw together. I sold out in 2 months and ordered another $6,000 worth of inventory mostly for next year. Upgraded their design so they were more premium and could be rolled up. Taking the packaging weight down to just 1 pound instead of 2.3 pounds. With the new design my packaging uses only 6 ounces of cardboard instead of 1.2 pounds like before. And redesigned my site.

The magnet pens I make by painstakingly by hand by boiling each and every cap in hot water so the plastic softens just enough to quickly insert a magnet into before the plastic cools. I searched all over the internet and Alibaba for magnet pens and just couldn't find anything economical or high quality enough. All the magnet pens out there were just weak or impractical. Plus with mine you can recycle the magnetic cap on other pens. I've been selling a bunch on ebay since last year. It took almost a year to become cash flow positive with the magnet pens and about 2 months to become cash flow positive with the calendars. I'm really bad at sales btw, it's my first time. But it's been totally worth it. The learning experience alone is worth more than collage classes.

Here's my store I opened up with my products: <http://dayonepp.com/> I've got more original products on the way as well.

Just for you guys, use promotion code "hn" to get $1 off your order.

</comment><comment><USER7> I shoplifted copies of Adobe software from a bookstore and sold them on Ebay. Eventually I felt bad about this and turned myself into the bookstore owner and paid them back. This was high school. Does that count as entrepreneurial or just plain stupid? I'll leaning toward the latter.

<comment><USER8> I don't think you slept as good as edw519 with his check that night.

</comment></comment><comment><USER9> While at university I managed to get a contract to temporarily install covert CCTV recording equipment to catch staff stealing from a chain of UK retailers.

I wasn't making much money until I discovered I could park outside a local swimming baths, sleep in the car, and then wake up for a swim and a shower in the morning. Sadly as soon as I locked the car, the alarm was set. If I turned over during the night, the car alarm would go off.

<comment><USER10> Couldn't you just lock the car by using the internal lock mechanism (e.g. individual locks on the doors)?

</comment></comment><comment><USER11> Answered a tweet asking for help setting up an open source web service, ended up landing monthly $1K fee for "maintenance". Worked a total of four hours in one year for $12K, then the contract ended. I quit my real job soon after

</comment><comment><USER12> Saved my lunch money from junior to college plus everything from birthdays and celebrations. Every cent was put away.

Worked surprisingly well as a strategy. Recommended, and gives a great start in life.

<comment><USER13> How did you eat?

</comment></comment><comment><USER14> This takes me back to my brief stint with consulting. I knew someone who had a VBScript web application that kept crashing. I'd never done a lick of VBScript, but I had cut my teeth on QBasic, so I figured that I could get up to speed on the language in a week and probably get the bug fixed in another two. I was straight out of school and only wanted $20 an hour, so we said $2500.

With all of that out of the way, I finally got a look at the source code. Fifteen minutes later, the bug was fixed (it was just a missing quote in an SQL call).

Of course, while they could justify hiring a consultant for $20 an hour for a three week job, management wasn't happy with the idea of paying a fresh college grad $10k an hour to fix a one character bug. Thus, I wound up writing another app that they had wanted, also in VBScript.

If there's a Hell, I'm going there for the SQL injection vulnerabilities in that program.

</comment><comment><USER15> Consulting pays well (very well) but of course it doesn't scale. I made my first $10k doing that.

<comment><USER16> What makes you say that? There are plenty of gigantic professional services firms.

<comment><USER17> Trading time for money doesn't scale.

<comment><USER16> Tell that to Skadden Arps.

<comment><USER18> It's scalable for the partners at Skadden (and similar service firms) to trade time for money because the time they trade is that of other people (viz., associates, and/or analysts at investment banks) who put in prodigious hours in the hope of becoming partners themselves someday in the distant future.

<comment><USER16> Sure. That's how you scale a professional services organization.

 _Later_

You fleshed this comment out, which is great, but I want to be careful to say I'm not endorsing the business model of wringing hours out of people's speculative hope that they'll reach the top of the pyramid. We don't have "work 60 hours a week and make partner" model, for instance.

But the general principle of developing and refining skills to the point where they enable you to ramp up new people and deploy all your people more effectively is a good one that works in a variety of different cases.

Tech is myopic (extremely) about professional services; many of the largest firms in our economy are effectively scaled-up professional services companies.

<comment><USER19> Agree that tech is myopic... or perhaps it's just a segment of tech - <USER2> are a lot of tech people working happily for those large PS firms you mention.

</comment></comment></comment></comment></comment></comment></comment><comment><USER20> My first $100 was baking and selling apple pies locally. It was successful, but the margins were just not there due to the price of apples and the time spent.

My first $10,000 ever made was playing video games. It was all made in one weekend at a Quake 3 tournament. It was my first tournament ever, so it was fueled solely on excitement, fun, and sheer determination. I completed 2nd place, took home a giant check, trophy, and was at that moment in time the #1 U.S. player.

</comment><comment><USER21> 1\. I made money high school doing web sites and tech support for individuals and small businesses around my neighborhood. Most of this work either came through friends & family or people I'd met while working in a student job helping people use the computers at the local library branch.

2\. I made more in college by making up a paid job with the student affairs department (one that did need to be done, not make-work), related to my role with the student government, and then doing it. Is that entrepreneurial?

3\. After I dropped out of college I worked doing odd jobs / handyman work, and as a contractors apprentice, doing home renovations. Once I learned the ropes, I went out on my own and worked for myself doing that.

4\. After I finished college I went back to doing freelance web development, again working for myself.

While I learned things at all of these, any of them could have been my first $10k if none of the previous had happened.

In between, I worked non-entrepreneurially at a series of non-profits / not- for-profits -- a summer camp, my university, a hiking club. I now work for a growth stage company, and it definitely has its advantages in stability and ability to focus on the parts of the job you like. No doubt I will work for myself, and for other non-profits, again in the future.

</comment><comment><USER22> AllAdvantage: <https://en.wikipedia.org/wiki/AllAdvantage>

Back when I was in middle school (on AOL)

<comment><USER23> Someone actually made money from AllAdvantage? How?!

I think I earned $100 or so but was never paid.

<comment><USER22> About.com paid out $800, a few small companies paid $100, but Northrop Grumman took the prize for paying out $9300

Although not explicitly stated, I think there was a minimum requirement of $100 to get a payout from a given company. Checks were issued from each company individually, so you literally had to make $100 from a given company to get that payout.

</comment></comment></comment><comment><USER24> My first company (a sales force automation product, back in 2002) made 10k in its second month of existence by selling integration services to two customers. We were only able to make 10k of RECURRING revenue (by selling product licenses) YEARS later, however (and the consulting/integration side, although lucrative, doesn't scale that well and was VERY time-consuming).

As for a "consumer" product, myguestmap.org (2005 - about to go defunct in a couple of weeks due to changes on google maps' licensing) made 10k in donation revenue in its first year (it paid VERY handsomely for a product that took me _a day_ to make, both in donations and in ads). It never generated enough revenue to sustain itself, though, but was a very fun ride (most donations came along with a great story on why they were using the service - and that included all sorts of groups, from cancer patients to sheep farmers trying to connect with fellow strangers).

</comment><comment><USER25> It was in 2006, I needed some cash to pay my student loans.

At the time I was all about C++, wasn't very good at it and couldn't find any part time job to continue my CS degree.

One of my contacts proposed me a freelance gig to rewrite the intranet of a big french corp. It was written in ASP.net 1.0 and only worked on IE. I didn't want to take the job but when they offered me 5,000$ I said yes without knowing what I was doing.

After some consulting with friends I went with PHP5, smarty and prototypejs. It took me a month of days and nights instead of the 15 days initially planned but it was a blast! PHP, javascript, HTML ... found all this new world way more funny and productive than C++,boost and wxWidgets/GTK.

Since then, I learned to plan things more carefully (especially when I don't know the tech) and never stopped coding and working for the web.

</comment><comment><USER26> I've been working for around 11 months now as a marketing guy and I now touched my $10000 mark. In India $10000 is annual average salary of a fresh graduate. I'm into my 11 month of my first job and I touched it even though I started with below average salary. And the feeling is inexplicable.

</comment><comment><USER27> Was asked at university who would like to write code for the summer (no other details). I said yes as i had nothing else to do. It turned out to be a project working for a large company which paid the equivalent of $900 a week for 16 weeks. Went a nice way towards our mortgage deposit.

</comment><comment><USER28> Paper route. I went through a couple rear axles on my bicycle because the papers were so heavy. At one point it just snapped right in the middle. I guess I'm dating myself now, you kids don't remember what an actual newspaper looks like.

<comment><USER29> My son does a paper round on his bike. :) The tradition is very much alive.

The weight of his papers is quite staggering. I sometimes think it weighs more than he does. :)

</comment></comment><comment><USER30> The first $10k I made were from ads on websites (pay per view, pay per click, affiliate marketing). In the meantime I sold one of them and then moved to domain names (catching dropped domain names and then parking/reselling them; still own most of them). Then I've built the biggest tattoo community in Poland with over 500k fans on Facebook (currently only making revenue through ads; next month we'll release our first t-shirt). Now I'm concentrating on building an easier and more secure authentication solution for the web (using mobile phone based cryptography instead of passwords).

</comment><comment><USER31> I made a library application for Epic Games. Looking back, I think I severely undersold myself (closer to $1k than $10k). Then sold it to another studio. I'm thinking about converting it to a SaaS app, but I don't know how I'd gauge further interest (I made a barebones landing page but apparently google won't let you advertise those).

The one lesson that is extremely clear: _networking is paramount_. I only got the job initially because my name was thrown around by a friend and was only able to sell to the other studio because of a connection I made while doing the project.

</comment><comment><USER32> A customer read about what we were doing in the newspaper after the governor threatened to shut us down, and then wrote us a very large check without even asking the price.

It was never that easy again.

</comment><comment><USER33> I made my first $1000 by doing a project for someone while in college which was a javascript based Basketball scoreboard back in 2003. No fancy jquery. Plain old boilerplate javascript and DOM manipulations. It was fun. The guy sold it to high schools for thousands more while my cut was $1000. It was intense and took a while to get it right but it taught me a lot. Since then, haven't done anything like that and just a consultant now!!

</comment><comment><USER34> Running bots for poker, backgammon, blackjack: <https://github.com/alexhanh/Botting-Library>

<comment><USER35> This is actually something I've been toying with for some time. I have a pretty decent poker bot I've built from scratch, but I need a way of interacting with "real" poker clients, and configuring screen scrapers is BORING.

Do you recommend any other methods besides scraping? I've heard of people injecting DLLs into the process of the casino app, but I have no idea how to go about doing that.

<comment><USER34> I haven't been following the scene for a few years now, so can't tell if DLL injection and similar methods are detected by casino clients more easily and thus being riskier todo.

I know what you mean. We did DLL injection, network protocol analysis, reverse engineering, etc. and almost always went with screen scraping in the end due to its easiness and universality.

If you are lucky tho, the client might produce logs real-time and you can get events simply by polling the log file.

</comment></comment></comment><comment><USER36> Lost my job. Updated my resume. Got on the phone. And pinged all my contacts via LinkedIn.

And instead of taking the next F/T gig, I went to work for myself. 5 years and counting.

<comment><USER37> Doing what?

<comment><USER36> First as an independent consultant, moving to establish my own firm and bring on additional consultants.

</comment></comment></comment><comment><USER38> First $10k was made almost 14+ yrs ago when we were asked to build a website for a music artist. We had never built a web site before nor had we any knowledge on the backend. But we spoke well and seemed to know what we were doing. We spent the first 2 weeks learning how to make it and luckily it turned out decent. That led to about 5 years of consistent work from the same client and launched our new web dev business.

</comment><comment><USER39> A content farm. A large scale database of information on businesses in the US / Canada. It did well, took a few weeks to build up (from various data sources). This was the early days of Google Ad Sense, and long before they concerned themselves much with content farms.

I used it to fund the development of larger, more ambitious projects (kept me from starving, paid my bills, and paid for multiple servers).

<comment><USER12> What do you do now? something related?

</comment></comment><comment><USER40> I grew up in a small farming community in Indiana and from 8th grade on I worked summers and after school on a Dairy farm.

I think I got paid $9/hour or something like that, but I worked so many hours that I had a decent amount saved up after a while.

The work was really hard, and that's what made me decide to go to college for Computer Science. I respect people who can do that work their whole life, but it is rough.

</comment><comment><USER41> By performing approximately 105 hours in basic computer repair, from which I pivoted to...

Nearly doubling that rate for "consultation" for larger companies, from which I pivoted to...

Dumping about $15k of savings (made possible by a dramatic increase in income tied with a continued frugal lifestyle) in to an "enterprise" startup, which made well over $10k in the first sale (took about three months).

</comment><comment><USER42> Developing an iOS app for someone, just over £1k when it's all finished. Prior to that, bits and pieces here and there, I made a reasonable bit of money licensing a photo to a UK newspaper after they'd used it without consent.

£10k would be a big chunk, don't think I'll hit it any time in the next 18 months. Never say never though.

<comment><USER43> How did you manage to find someone willing to pay £1k for an iOS app? I'm an iOS dev myself and am looking into possible freelance ventures such as this to bring in some cash over the summer / university period.

</comment></comment><comment><USER44> A one time thing a while ago. Consultation job that evolved into a developer gig (when he quit) and that turned into a designer gig (he quit too) and I ended up doing all three.

But I have no complaints though. That company hired some very talented and loyal people who're still together to this day long after I left.

</comment><comment><USER45> Made my first real 1k€ came from developing a few LabVIEW interfaces to be used in my university's physics courses. Back in the day, in middle school, I used to host counter strike servers at home but couldn't scale it to make good money.

</comment><comment><USER46> A rather long internship with a certain prominent North American Enterprise Linux vendor. It was actually rather nice: I learned a lot, I was being paid to do something I consider fun, and having money is nice when you are in college.

</comment><comment><USER47> Regular full-time job as a service desk employee. Not the best achievement associated with it, that's why I'm pursuing a research-oriented education in university now. I was young though, I hit the mark 1 year ago (I was 21)…

</comment><comment><USER48> I simply asked for the sale. Whatever you are selling, make sure to do just that.

</comment><comment><USER49> My first 10k were made in a year or so as junior PHP developer (Italy - 2006)

</comment><comment><USER50> I made a CD (yes, like a music one) and discovered that social media (myspace at the time) was a powerful marketing tool.

Didn't make it to $10k, but did have a net profit of a few thousand which wasn't bad for high school.

</comment><comment><USER51> I made a 3D animation using 3D Studio for the Thomas J Watson Research Center. I was subcontracted - and very young, and I'm pretty sure the people that sub- contracted me made a LOT more than I did.

</comment><comment><USER52> High School student here. Made my first 10k the summer after my Junior year as a software development intern at a startup that had recently been acquired by a larger tech company.

</comment><comment><USER53> Combination of summer internship as a web app designer in Austin, TX, and graphic design work for my college's alumni office and my professor in Pittsburgh, PA -- all in 2000.

</comment><comment><USER54> I started a small 2 person "multi media" company using Macromedia Director. Had a few cool clients who did some Quicktime3D accelerator cards... That was around 1994

</comment><comment><USER55> I made a porn site.

</comment><comment><USER56> Cutting greens and tees and watering fairways.

</comment><comment><USER57> Made open source software to scratch an itch in my free time. Later got paid to develop on this for a contract.

</comment><comment><USER58> i hacked a certain (now deceased) startup right after their first round of capital and then negotiated a signing bonus when they offered me a job. It was a very simple xss but i was able to do enough with it to impress the founder and make some money.

</comment><comment><USER59> By selling imported dreamcasts...

</comment><comment><USER60> My first £1,000 (about 8 years ago) from a small PC repair shop I opened with a friend.

</comment><comment><USER61> I made my first $5000 writing open source code during Google Summer of Code.

</comment><comment><USER62> TBD

</comment><comment><USER10> Is this referring to $10,000 in one payment? (A large sale etc.)

</comment><comment><USER63> Buying a domain and selling it for £1,200 a few months later.

<comment><USER64> Out of curiosity, what was the domain?

<comment><USER65> Would love to know too.

</comment></comment></comment><comment><USER66> I did client work. I don't even remember for which client :(

</comment><comment><USER67> online poker, starting with $50 and slowly building up

</comment><comment><USER68> Freelance PHP dev work while I was in college.

</comment><comment><USER69> Building and selling browser exploit packs.

</comment><comment><USER70> with a blog that covered iOS jailbreaking

</comment><comment><USER71> Selling software licenses.

</comment><comment><USER72> Playing poker in college.

</comment><comment><USER73> First $1,000 Admob Ads.

</comment><comment><USER74> Stock-market investment

</comment><comment><USER75> Selling a domain name.

</comment><comment><USER76> building decks. wooden decks. also fences.</comment>


Giving Mars a Magnetosphere - <AUTHOR> https://medium.com/our-space/an-artificial-martian-magnetosphere-fd3803ea600c <comment><USER2> [https://en.wikipedia.org/wiki/Atmospheric_escape#Mars](https://en.wikipedia.org/wiki/Atmospheric_escape#Mars)

>The MAVEN mission has also explored the current rate of atmospheric escape of Mars. Jeans escape plays an important role in the continued escape of hydrogen on Mars, contributing to a loss rate that varies between 160 - 1800 g/s. Oxygen loss is dominated by suprathermal methods: photochemical (~ 1300 g/s), charge exchange (~ 130 g/s), and sputtering (~ 80 g/s) escape combine for a total loss rate of ~ 1500 g/s. Other heavy atoms, such as carbon and nitrogen, are primarily lost due to photochemical reactions and interactions with the solar wind.

So, unfortunately, the solar wind sputtering is not the main driver of atmospheric loss on Mars. It's shortwave light from the sun.</comment>


The PlayStation 5 - <AUTHOR> https://www.theverge.com/2020/6/11/21212989/ps5-playstation-5-console-announcement-design-hardware-specs-sony <comment><USER2> I'm surprised with full 60fps 4k support. PS4 doesn't even have fixed 1080p 60fps support for all games... Really like the controller design, seeing it besides the new console, it looks even better. I found the console design a little strange and bold at first. But I kinda like it now.

For the games, looking forward to Spider-Man: Miles Morales, Ratchet & Clank: Rift Apart, Sackboy: a Big Adventure, Oddworld: Soulstorm, Ghostwire: Tokyo, Godfall, Demon Souls and Horizon: Forbidden West. But that cat game got me intrigued, lol.

</comment><comment><USER3> If you only watch one new game trailer, let it be Annapurna Interactive's Stray. Like a lovechild of Wes Anderson and Spike Jonez, born into a world conceived by Ridley Scott:

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

<comment><USER4> Easy in the top 2 trailers I saw that stream (with the other one being the teaser with the astronaut and the little girl)

</comment></comment><comment><USER5> Support for 8K HDMI out tells me it's most likely rendering the games at 4K. There's no way that something with that hardware spec could render at 8K with any kind of usable frame rate. With $5500 and a credit card right now I could just barely build an x86-64 desktop capable of rendering games at 8K, poorly, at 20fps.

It'll be much the same way that an Xbox One S renders games at 1080p, but supports 2160p60 output, with a 1:4 upscaled output. The upscaler is not a difficult piece of silicon.

<comment><USER6> Are you maybe overstating that? 8k should be worst case 25% the speed of 4k, so a single 2080 Ti should get you there in eg the new Modern Warfare.

<comment><USER5> benchmarks I've seen for the 2080 ti and a really high end cpu + motherboard combo ($799 cpu + $399 motherboard), plus a ton of RAM, show FPS dropping to 21fps, 25fps, in a number of major games at 8k. Not what i'd call playable, even if the average fps might be 35-40fps.

<comment><USER6> But your post said $5500 to get to 20fps. I think that budget would get you to 60 pretty easily.

You shouldn't need anything high end except the GPU, for the rest of the components it would be like hitting 60fps in 1080p.

<comment><USER7> > But your post said $5500 to get to 20fps. I think that budget would get you > to 60 pretty easily.

The 2080ti is the fastest gaming GPU on the market right now. Period. It does not matter what your budget is, you cannot buy a faster GPU that that. Even if you buy a $10,000 quadro, you won't more than 5% extra performance in a best case scenario over the 2080ti.

<comment><USER6> Er, have you ever heard of NVLink? Presumably a $5500 PC chasing 8k wouldn't just have a single graphics card...

RTX 2080 Ti SLI (NVLink) Battlefield 4 [8K 60FPS]: [https://www.youtube.com/watch?v=GBqjy7bCoBE](https://www.youtube.com/watch?v=GBqjy7bCoBE)

Call of Duty: Modern Warfare (2019) - 8k 60FPS [RTX ON] 2x RTX 2080 Ti Max Settings: [https://www.youtube.com/watch?v=qMVWRrOmSCQ](https://www.youtube.com/watch?v=qMVWRrOmSCQ)

</comment></comment></comment></comment></comment></comment><comment><USER8> I thought this was one of the most engaging presentations I've seen in a while. I was in the edge of my seat and could feel my heart racing when they were about to reveal the PS5 console. I love the new industrial and futuristic design. It'll blow the competition out of the water.

</comment><comment><USER9> Reveal is at ~2:08:40 for those looking for it.

</comment><comment><USER10> Oof. _That 's_ the design they're going with?

<comment><USER11> What's so bad about it?

<comment><USER12> It's too loud. Consider how other equipment you might place near your tv looks.

<comment><USER13> When compared to modern "Gaming" PCs, PS5 is less RGB LEDs so less louder.

<comment><USER12> Yeah, but very few people would place such monstrosities in their living room.</comment></comment></comment></comment></comment>


Show HN: Wireworld written in Nim - <AUTHOR> https://github.com/JHonaker/wireworld-nim <comment><AUTHOR> Author here, I spent this weekend making an implementation of a lesser known (to me at least) cellular automaton, Wireworld.

It was my first non-trivial project in Nim. I had a lot of fun. It uses SDL 2 as the graphics engine. Let me know if you have any little suggestions for it, or any questions about the development.

<comment><USER2> 284 lines! I'm impressed by the brevity. Were the SDL bindings as straightforward to use as they appear?

<comment><USER3> I've worked with Nim's sdl2 interface too, it is indeed pretty straightforward, and it was easy for me to tell vim to know how to jump to the nim wrapper's source. The main pain points for me were 1) sdl2 is harder than sdl1 and 2) I thought some type conversion behavior (or lack thereof) was odd, especially when working with 'cints' (which is what the wrapper api expects everywhere).

For a more flushed out example there's: [https://hookrace.net/blog/writing-a-2d-platform-game-in- nim-...](https://hookrace.net/blog/writing-a-2d-platform-game-in-nim-with- sdl2/)

<comment><AUTHOR> I actually used a few snippets of this tutorial to figure out how to use the SDL bindings. I'd never used SDL before.

</comment></comment></comment></comment><comment><USER4> It's cool to see Nim getting more visibility. It's a cutting-edge language that gets overshadowed just because it doesn't have MegaTechCo's name behind it.

<comment><USER5> It's really nice for the small hobby projects I do. Small native executables is great.

<comment><USER6> To me it seems just the right choice for embedded systems: fast, small, easy to understand and translates to C.

</comment></comment></comment><comment><USER7> This is really well written, thank you for taking the time to post it to HN to give Nim a bit of visibility. Have you considered using Nim's JS back end to make it work in the browser?

<comment><AUTHOR> > This was really well written

That means a lot to me!

> Have you considered using Nim's JS backend to make it work in the browser?

I was thinking about it after seeing someone else's GoL in this thread. I'm guess I would need to write another display layer though.

</comment></comment><comment><USER8> Nim is probably the most easiest language I've picked up. It's a delight to program in Nim and the performance is stellar (beats hand coded C in many cases). It's a rare feat really.

<comment><USER9> Be very careful about stating that GC'ed languages beat C - jblow might appear suddenly to correct you... with pure common sense.

<comment><USER8> Coming from C++ (with C experience too), I too was hesitant about Nim because of GC. But I can turn it off completely or even better "\--gc=stack" which makes it behave like C++ (dealloc when going out of scope). The compiler is also good at telling you what calls use GC'ed memory, so you can work around them if necessary.

But even with GC on, Nim is super fast. I use it in real time rendering and I honestly didn't see any significant performance loss. In fact, it made some routines much faster because the Nim compiler produced much better C code than I ever did.

<comment><USER10> > But even with GC on, Nim is super fast....

This is what I experienced with GC enabled systems programming languages (Oberon family of languages) back in the late 90's, just with C++ as comparison on my case.

The main problem is the culture of micro-optimizing code without profiling it, that is so prevalent in those communities.

</comment></comment></comment></comment><comment><USER11> Here are the commands I ran to get this running on FreeBSD:

        pkg install nim nimble sdl2
        git clone https://github.com/JHonaker/wireworld-nim.git
        cd wireworld-nim
        nimble install sdl2
        nim c display.nim
        ./display

<comment><AUTHOR> Ah yea, I should probably add the nimble install line to the instructions.

</comment></comment><comment><USER5> I always enjoy seeing these little Nim projects.</comment>


Ask HN: Did the Codespaces story ever come out fully? - <AUTHOR>

A while ago there was a rather horrible thing done to codespaces.com, their data and backups were deleted from amazon.com. There were promises of a full-disclosure post mortem but I've never seen any and the website has gone completely silent other than pointing to two former competitors of codespaces (svn lab and bitbucket, strangely enough github is missing).
Did the full story ever appear? I was left with the impression that there was quite a bit more to the whole thing and at the time and I'd really like to know if there ever was a follow up to what was written on the homepage of codespaces at the time.
In particular, one part read:
" In summary, most of our data, backups, machine configurations and offsite backups were either partially or completely deleted.
This took place over a 12 hour period which I have condensed into this very brief explanation, which I will elaborate on more once we have managed our customers needs."
But I do not recall ever seeing that elaboration anywhere. <comment><USER2> Here's one, not sure if it has more details than you already know: [http://searchaws.techtarget.com/news/2240223024/Code- Spaces-...](http://searchaws.techtarget.com/news/2240223024/Code-Spaces-goes- dark-after-AWS-cloud-security-hack)

<comment><AUTHOR> No, that's still the early days stuff.

The thing that I'm really curious about is if they ever managed to positively rule out the inside job angle and what if anything came out of law enforcement involvement. I assume they filed a criminal case and let law enforcement + amazon take over and what came out of that investigation would make for some very interesting reading.</comment></comment>


Americans giving up friends, sex for Web life - <AUTHOR> http://www.reuters.com/article/internetNews/idUSKUA00315920070920?feedType=RSS&feedName=internetNews&rpc=22&sp=true I see this as a huge business opportunity as increase in web-customers !! <comment><USER2> Or cars for that matter. I wonder if newspapers took the same poll when cars first came out and got popular for suburbanites.

"People told us how anxious, isolated and bored they felt when they are forced to walk."

or maybe

"They felt disconnected from the world, from their friends and family, [when forced to walk]"

</comment><comment><USER3> I didn't like the end of this quote:

"We are calling them 'digitivity denizens,' those who see their cell phones as an extension of themselves, whose online and offline lives are co-mingled and who would chose a Wi-Fi connection over TV any day," said Mack.

Why is it better for a person to choose TV over the internet?

<comment><USER4> given the context, i don't think they meant it as a slight. they were talking about this group of people in terms of how you'd advertise to them, so in that case, tv would be right out.

</comment></comment><comment><USER5> Eh, most of them have plenty of friends and sex on the web...

<comment><USER6> i am sure even with the 20% less as the research sais, now thanks to the Web they have more than they did before using it

</comment></comment><comment><AUTHOR> With IPTV days are not far away whether every source of infotainment is on the web - any ideas related to infotainment on net/mobile/IPTV platform will be big hit ... Net is where we will live (no boundaries, no war) ?!</comment>


Medoo 0.9.6 is released - <AUTHOR> https://github.com/catfan/Medoo/releases/tag/v0.9.6

<comment><AUTHOR> Add support for multi-order

Add support for advanced LIKE matching

Add support for negative LIKE

Add support for using SQL functions

Bugs fix and some improvement</comment>


Simone de Beauvoir, The Art of Fiction No. 35 (1965) - <AUTHOR> https://www.theparisreview.org/interviews/4444/simone-de-beauvoir-the-art-of-fiction-no-35-simone-de-beauvoir <comment><USER2> "In Plato, art is mystification because there is the heaven of Ideas; but in the earthly domain all glorification of the earth is true as soon as it is realized. Let men attach value to words, forms, colors, mathematical theorems, physical laws, and athletic prowess; let them accord value to one another in love and friendship, and the objects, the events, and the men immediately have this value; they have it absolutely. It is possible that a man may refuse to love anything on earth; he will prove this refusal and he will carry it out by suicide. If he lives, the reason is that, whatever he may say, there still remains in him some attachment to existence; his life will be commensurate with this attachment; it will justify itself to the extent that it genuinely justifies the world."

Excerpt From: Simone de Beauvoir. "The Ethics of Ambiguity.

<comment><USER3> Listened to the Philosophize This podcast [1] on The Ethics Of Ambiguity recently. Sounds very helpful. Looking forward to reading.

[1] [https://open.spotify.com/episode/2U4NLsvSKkJmtbxvguAoHY](https://open.spotify.com/episode/2U4NLsvSKkJmtbxvguAoHY)

<comment><USER4> My favorite podcast! I just might be fangirling, but I love how Stephen West builds up every episode masterfully and, at the end of each episode, you feel the bubble burst and are thrust back to reality where you get to ponder with the new lens with which you now see the world through.

Anyhow, here's a link to the site's episode (if you don't use Spotify) [1].

And here's a link to his patreon page, in case anyone wants to support him as well [2].

[1] [http://philosophizethis.org/simone-de-beauvoir- ethics/](http://philosophizethis.org/simone-de-beauvoir-ethics/)

[2] [https://www.patreon.com/philosophizethis](https://www.patreon.com/philosophizethis)

</comment></comment></comment><comment><USER5> Another word for Beauvoir's "swindle" is simply "dis-illusionment", isn't it? Life as we experience it is based on "stories" we read and hear and expect that at some point we would live like in a story and thus feel some deep significance to our life. But it never is like that. For some the story might be Beauvoir and she is honest enough to tell us that. Nothing special here. My (her) situation is like yours. But isn't that really the great unifier? We are all special, or none of us is.

The ending of a book makes the book timeless. The story is over but the story still exists and perhaps we long for that kind of existence? But reality is reality? No, the limits of our language are the limits of the world. (Wittgenstein I think).

<comment><USER5> I'm not sure I understand the difference between "being" and "existence"

<comment><USER6> I'm not entirely sure either, but maybe it's meant to be interpreted in light of the 'existence precedes essence' concept of existentialism. 'Being' might then mean leading a life where one choses their destiny, in contrast to mere 'existence'. Maybe the translation from French is not perfect?

"The paradox of human life is precisely that one tries to be and, in the long run, merely exists." I think what she means is: if you have your life ahead of you, you can still choose your destiny (you can be something). However, having lived that life and looking back at it, history is fixed and there is nothing to choose when it comes to the past (it merely exists).

<comment><USER7> From the article: "A woman psychoanalyst wrote me a very intelligent letter in which she said that "in the last analysis, desires always go far beyond the object of desire." The fact is that I've had everything I desired, but the "far beyond" which is included in the desire itself is not attained when the desire has been fulfilled."

I took "being" to include being somehow immersed in the "far beyond" once the desired lifestyle is met. Like realising you're in a dream without eventually waking up.

</comment></comment></comment></comment><comment><USER8> > Shelves are crammed with surprisingly uninteresting books. "The best ones," > she told me, "are in the hands of my friends and never come back."

I love her attitude. I do the same. If I have a really good book, I try to pass it on as quickly as possible. That also increases the chances of finding someone to debate the contents, which is usually where the real fun starts.

Works much better with physical books actually. You'd think it'd be easier with epub or such, but nope. Somehow the physical artifact really makes people want to read it much more, being given a physical book seems to convey much more that you're receiving something of value, something worth investing some (or many!) hours into.

</comment><comment><USER9> [http://archive.is/7HC6e](http://archive.is/7HC6e)

</comment><comment><USER10> [https://en.wikipedia.org/wiki/French_petition_against_age_of...](https://en.wikipedia.org/wiki/French_petition_against_age_of_consent_laws)</comment>


Construct-JS – A library for creating byte level data structures - <AUTHOR> https://github.com/francisrstokes/construct-js <comment><USER3> DataView [0] itself already has pretty useful methods to work with binary data. To encode/decode strings, use TextEncoder [1]

Both implementations are very optimized and fast. Also DataView offers working with 64-bit values using the new BigInt type [2].

Here [3] a short example on how you can quickly build C-like structures in JavaScript

[0] DataView: [https://developer.mozilla.org/en- US/docs/Web/JavaScript/Refe...](https://developer.mozilla.org/en- US/docs/Web/JavaScript/Reference/Global_Objects/DataView)

[1] TextEncoder: [https://developer.mozilla.org/en- US/docs/Web/API/TextEncoder](https://developer.mozilla.org/en- US/docs/Web/API/TextEncoder)

[2] BigInt: [https://developer.mozilla.org/en- US/docs/Web/JavaScript/Refe...](https://developer.mozilla.org/en- US/docs/Web/JavaScript/Reference/Global_Objects/BigInt)

[3] C-like Structures: [https://jsfiddle.net/5tz0hsjq/](https://jsfiddle.net/5tz0hsjq/)

<comment><AUTHOR> construct-js uses DataView under the hood. I wrote construct-js to ease working with binary data by allowing you to name and reference sections, and handle things like endianess easily in one place. With a DataView, I still need to calculate offsets into a structure manually, whereas construct-js has .getOffset(name) and .getDeepOffset(path). If performance is key however, use the lowest level of course.

</comment></comment><comment><USER4> First off, great to see interest in binary data in JS :)

We looked into this problem years ago as part of our spreadsheet parser/writer library (open source version [https://github.com/sheetjs/js- xlsx](https://github.com/sheetjs/js-xlsx)) and ultimately opted for lower- level functions that act on Buffers/ArrayBuffers/Arrays. Performance-wise, creating a new ArrayBuffer / Buffer for each field (which you are currently doing in [https://github.com/francisrstokes/construct- js/blob/master/s...](https://github.com/francisrstokes/construct- js/blob/master/src/index.js#L20)) is incredibly expensive. When we did performance tests years ago, allocating in 2KB blocks and manually orchestrating writes was nearly 10x faster than individual field-level allocations and concatenations both in the browser and in NodeJS.

Ironically, the ZIP file example referenced in the README alludes to another pitfall in the approach: the actual DEFLATE algorithm used in compression actually requires unaligned bit writes. See section 5.5 of the current APPNOTE.TXT for more details: [https://pkware.cachefly.net/webdocs/casestudies/APPNOTE.TXT](https://pkware.cachefly.net/webdocs/casestudies/APPNOTE.TXT)

<comment><AUTHOR> Thanks! When it comes to performance I can understand choosing a more low level approach. construct-js trades performance for declarativeness (though I suspsect that I can do a lot of optimising under the hood).

As for DEFLATE, I'm working on an automatic bit level structure at the moment which would allow for unaligned structures. Should be in the lib in a couple of days.

<comment><USER5> IIRC, when I last checked this (admittedly this was years ago) a single TypedArray object had 200 bytes of overhead - not counting the backing buffer for the array itself - due to the complexity of the one backing buffer being potentially used by multiple arrays and so on. By comparison regular object had about a dozen bytes of overhead. Because of this, tiny typed arrays are almost always _worse_ in terms of performance than objects or plain arrays. Especially if we are talking about "type stable" objects, that is: prototypical objects with a hidden class that does not change.

Things have probably improved in Buffer/DataView/TypedArray land thanks to the push for WASM, but the allocation overhead still will be a lot higher and involve a lot more work to allocate them.

</comment></comment></comment><comment><USER6> What's the point of such a "declarative" API?

      const localHeader = Struct('localHeader')
        .field('header', DoubleWord(0x04034b50))
        .field('sharedHeaderInfo', sharedHeaderInfo)
        .field('filename', filename);

There's already a construct for key-value pairs in JS, it's called _an object_ :

      const localHeader = Struct('localHeader', {
        'header': DoubleWord(0x04034b50),
        'sharedHeaderInfo': sharedHeaderInfo,
        'filename': filename
      });

<comment><USER7> Although this is only a handful of lines [0] it's nice to design things well.

\- By providing a 'builder' you add a clear API to the struct object's constructor. It doesn't make any more or fewer claims of capibility than it needs to. By exposing the internal storage you break that level of abstraction.

\- Even assuming that the JS object type _is_ ordered, the ADT of the Struct type may be subtly different to the ADT of the object. By coupling the two you may prevent future flexibility.

\- To that point, the 'field' method _does_ do something with each invocation (forceEndianess) as it adds it to the internal storage. If you passed in a map object it would still need to traverse each key to do that work, which (knowing JS objects) might make it more complicated.

[0] [https://github.com/francisrstokes/construct- js/blob/master/s...](https://github.com/francisrstokes/construct- js/blob/master/src/index.js#L148)

<comment><USER8> You seem to assume that the passed-in object should also be used as the resulting object. This is false, as they can be decoupled.

In other words, it's still possible to pass in a separate js object instance containing the configuration.

Yet I'm not sure about the whole of your arguments, so I can't tell if it would actually make sense to wrap the default js builder pattern implementation (the javascript object initializer syntax aaaaaaaaaaab refers to).

However, I do method builders often overused in API's where a simple singular builder method combined with builder classes suffice and simplify.

<comment><USER7> Agreed to an extent. But what if you want to extend the API to include the same field twice (for example). The semantics of the input object would prevent that.

I'm reluctant to spend too much time arguing over a fine point. It could be done one way or the other. I was just addressing aaaaaaaaaaab's question.

</comment></comment></comment></comment><comment><USER9> Please don't use "word" to mean 16 bits. In an era when machine words are generally 64 bits, we're not talking about an anachronism from the previous generation, but the one before that - in a language that is completely insulated from the actual machine architecture.

One thing I love about Rust is that it uses u16, u32, u64 etc for unsigned and i16, i32, i64 etc for signed, which is about perfect - clear, concise and future-proof. That would be perfect for this library.

[https://en.wikipedia.org/wiki/Word_(computer_architecture)](https://en.wikipedia.org/wiki/Word_\(computer_architecture\))

<comment><USER10> >> One thing I love about Rust is that it uses u16, u32, u64 etc for unsigned and i16, i32, i64 etc for signed, which is about perfect

Yes, even good old C has uint16_t and int16_t for this. I use these exclusively for embedded work because we care about the size of everything. Also agree that Rust gets it right by using a single character with the size: u16, i16.

It's funny because C opted to leave the number of bits machine dependent in the name of portability, but that turns out to have the opposite effect.

<comment><USER11> > _good old C has uint16_t_

Firstly, no, good old C doesn't. These things are a rather new addition (C99). In 1999 there was decades of good old C already which didn't have _int16_t_.

It is implementation-defined whether there is an _int16_t_ ; so C doesn't really have _int16_t_ in the sense that it has _int_.

> _It 's funny because C opted to leave the number of bits machine dependent > in the name of portability, but that turns out to have the opposite effect._

Is that so? This code will work nicely on an ancient Unix box with 16 bit _int_ , or on a machine with _32_ or even _64_ bit int:

      #include <stdio.h>
      int main(void)
      {
        int i;
        char a[] = "abc";
        for (i = 0; i < sizeof a; i++)
          putchar(a[i]);
        putchar('\n');
        return 0;
      }

Write a convincing argument that we should change both _int_ s here to _int32_t_ or whatever for improved portability.

<comment><USER10> >> Firstly, no, good old C doesn't.

Yes, it does. The C99 standard has been around for 20 years. I started giving up on compilers that don't support it 10 years ago. I consider it a given for C.

>> It is implementation-defined whether there is an int16_t

No, it's not. That type is part of the C99 standard.

>> Is that so? This code will work nicely on an ancient Unix box with 16 bit int, or on a machine with 32 or even 64 bit int:

That's cool, your example only needs to count to 3. Any size integer will do. The problems arise when you go to 100,000 and that old 16bit machine rolls over at 65536 but the newer ones don't. Other times someone (me) may want things to roll over at the 16 bit boundary and we need to specify the size as int16_t rather than figure out if int or short or char is that size for each architecture. (and yes I know rollover is undefined behavior)

>> Write a convincing argument that we should change both ints here to int32_t or whatever for improved portability.

In your example it doesn't matter. I'd argue that at least giving the size of your integers some thought every time is a good habit to get into so you don't write non-portable code in the cases where it does matter. You are free to argue that it's too much effort or something, but I'd invite you to argue that "i16" is more effort to type than "int".

<comment><USER11> > _The problems arise when you go to 100,000 and that old 16bit machine rolls > over at 65536 but the newer ones don 't_

There, we are running into the question of: on that system, can we define that array at all, if it has 100,000 characters.

> _That type is part of the C99 standard._

Unfortunately, the standard isn't what translates and executes your code; that would be the implementation. The standard allows implementations not to provide _int16_t_ , if they have no type for which it can be a _typedef_ name. A maximally program can use _int16_t_ only if it has detected that it's present. If an _int16_t_ typedef name is provided then <stdint.h> will also define the macro _INT16_MAX_. We can thus have code conditional on the existence of _int16_t_ via _#ifdef_. (Since we know it has to be nonzero if provided, we can use _#if_ also).

> _Other times someone (me) may want things to roll over at the 16 bit > boundary and we need to specify the size as int16_t rather than figure out > if int or short or char is that size for each architecture. (and yes I know > rollover is undefined behavior)_

Someone who knows C knows that _unsigned short_ is 16 bits wide or wider, as is _unsigned int_. A maximally portable wrap-around of a 16 bit counter, using either of thise types, is achieved using: _cntr = (cntr + 1) & 0xFFFF_. That will work on a machine that has no 16 bit word, and whose compiler doesn't simulate the existence of one.

We can do it less portably if we rely on there being a _uint16_t_ ; then we can drop the _& 0xFFFF_. (It isn't undefined behavior if we use the unsigned type.) The existence of _uint16_t_ in the standard is encouraging programmers to write less portable; they reach for that instead of the portable code with the _& 0xFFFF_. Code relying on _uint16_t_ , ironically, is not portable to the PDP-7 machines that Thompson and Ritchie originally worked with on Unix; those machines have 18 bit words.

</comment></comment></comment></comment></comment><comment><USER12> If you can live with compiling a declarative yaml description and only need to read the data then there is also kaitai-struct. [0] One of the compilation targets is javascript. Their web ide (feels kind of like a simple sweetscapes 010 editor) which is quite nice uses the js target. [1] Other targets are c++, java, php, python, ruby and more.

I used it in the past to read a proprietary file format and it worked well, but they also have quite a few predefined formats in their gallery. [2]

[0] [http://kaitai.io/](http://kaitai.io/)

[1] [https://ide.kaitai.io/](https://ide.kaitai.io/)

[2] [http://formats.kaitai.io/](http://formats.kaitai.io/)

<comment><USER13> What's the difference between something like this and tools like protobuf?

Edit: this provides a good explanation [http://doc.kaitai.io/faq.html#_google_protocol_buffers_asn_1...](http://doc.kaitai.io/faq.html#_google_protocol_buffers_asn_1_apache_thrift_apache_avro_bson_etc)

</comment></comment><comment><USER14> Does this not have any relationship to Construct, the python library for doing the same thing? [https://construct.readthedocs.io/](https://construct.readthedocs.io/)

Seems weird that it's not even mentioned. I thought it would be a port.

</comment><comment><USER15> I believe I have the same thing in structurae [1]. I have a RecordArray[2] class for exactly this: you can define a struct (or record) and use ArrayBuffer to hold a specified number of structs. Although I went with extending DataView to do it all instead of creating a "wrapping" class. I wrote about it in the article introducing structurae[3].

[1] [https://github.com/zandaqo/structurae](https://github.com/zandaqo/structurae)

[2] [https://github.com/zandaqo/structurae#RecordArray](https://github.com/zandaqo/structurae#RecordArray)

[3] [https://blog.usejournal.com/structurae-data-structures- for-h...](https://blog.usejournal.com/structurae-data-structures-for-high- performance-javascript-9b7da4c73f8#e87e)

</comment><comment><USER16> I was just thinking about some of the barriers crypto implementations, for example, face when thinking of doing a JavaScript implementation. A library like this, especially for pedagogical code, eliminates a very important barrier, so, bravo!

The idea is a good one for another reason, because you can use this API to define a data-structure which can be 'rendered' in different ways - <USER2> could be useful for porting data-structures between node, DOM and WASM.

Bravo!

<comment><AUTHOR> Thanks!

</comment></comment><comment><USER17> Might be good to clarify use cases in the README. It sounds like this is useful for reading and writing binary file formats. My initial thought was that this was intended for careful memory management for performance reasons, like a packed array of structs like you see in lower-level languages. But seems like there's probably no way to do that in pure JS without slowing things down significantly, which mostly would ruin the point.

<comment><USER18> Indeed.

Mnemonist [1] is a library which looks more like what you're looking for. There are some performance benchmarks here and there on the web, comparing the performance of their data structures with other....

[1]: [https://yomguithereal.github.io/mnemonist/](https://yomguithereal.github.io/mnemonist/)

</comment></comment><comment><USER19> Talking about binary - What's the situation like today if you want to look under the hood of a webasm program? I haven't tried it myself but I guess it's a lot harder to figure out what's going on compared to even minified javascript?

<comment><USER20> If you are the original developer, there is source maps support at least in Firefox so you can step through the source code like with any normal debugger.

If you are not the original developer, most likely source maps are not available to you. Then, wasm can be studied with already existing reverse engineering tools, like IDA Pro, binary ninja or radare2/cutter. Last one is even FLOSS.

</comment></comment><comment><USER21> I wrote a similar project many years ago: jParser. [https://github.com/vjeux/jParser](https://github.com/vjeux/jParser)

</comment><comment><USER22> Reminds me of a similar project varstruct ([https://github.com/varstruct/varstruct](https://github.com/varstruct/varstruct)). Also maybe you could consider the abstract-encoding interface specification ([https://github.com/mafintosh/abstract- encoding](https://github.com/mafintosh/abstract-encoding)), although it has a few flaws of it's own.

</comment><comment><USER23> Nice, and needed. Curious if you also considered a sprintf-ish template based approach like Perl's pack() or Python's struct.pack().

</comment><comment><USER24> This is way outside of my expertise, but I have an honest question: why do we need a separate .getDeep() when .get() could be written do the same for any dot-delimited path?

<comment><USER25> Not the author but I assume it's to save the overhead of string parsing when you know you don't need it.

</comment></comment><comment><USER10> Doesn't JS have an inability to call C code? Might this be a step on the way to enabling that?

<comment><USER26> Not really, because C is a compiled language instead of interpreted. So you would have to distribute binaries. This library does not help with that.

</comment></comment><comment><USER27> isnt this already available?

[https://developer.mozilla.org/Web/JavaScript/Reference/Globa...](https://developer.mozilla.org/Web/JavaScript/Reference/Global_Objects/Uint8Array)

</comment><comment><USER28> Parse binary structs... with a language that only has doubles.

<comment><AUTHOR> I'm guessing you haven't seen the new data types?

\- [https://developer.mozilla.org/en- US/docs/Web/JavaScript/Refe...](https://developer.mozilla.org/en- US/docs/Web/JavaScript/Reference/Global_Objects/ArrayBuffer) \- [https://developer.mozilla.org/en- US/docs/Web/JavaScript/Refe...](https://developer.mozilla.org/en- US/docs/Web/JavaScript/Reference/Global_Objects/Int8Array) \- [https://developer.mozilla.org/en- US/docs/Web/JavaScript/Refe...](https://developer.mozilla.org/en- US/docs/Web/JavaScript/Reference/Global_Objects/Uint8Array) \- [https://developer.mozilla.org/en- US/docs/Web/JavaScript/Refe...](https://developer.mozilla.org/en- US/docs/Web/JavaScript/Reference/Global_Objects/Uint8ClampedArray) \- [https://developer.mozilla.org/en- US/docs/Web/JavaScript/Refe...](https://developer.mozilla.org/en- US/docs/Web/JavaScript/Reference/Global_Objects/Int16Array) \- [https://developer.mozilla.org/en- US/docs/Web/JavaScript/Refe...](https://developer.mozilla.org/en- US/docs/Web/JavaScript/Reference/Global_Objects/Uint16Array) \- [https://developer.mozilla.org/en- US/docs/Web/JavaScript/Refe...](https://developer.mozilla.org/en- US/docs/Web/JavaScript/Reference/Global_Objects/Int32Array) \- [https://developer.mozilla.org/en- US/docs/Web/JavaScript/Refe...](https://developer.mozilla.org/en- US/docs/Web/JavaScript/Reference/Global_Objects/Uint32Array) \- [https://developer.mozilla.org/en- US/docs/Web/JavaScript/Refe...](https://developer.mozilla.org/en- US/docs/Web/JavaScript/Reference/Global_Objects/Float32Array) \- [https://developer.mozilla.org/en- US/docs/Web/JavaScript/Refe...](https://developer.mozilla.org/en- US/docs/Web/JavaScript/Reference/Global_Objects/Float64Array)

</comment></comment><comment><USER29> As a frontend developer, do I need this? And why?

Or is this more for the heavy lifting and backend uses of JS?

</comment><comment><USER30> The irony is that "byte-level binary data structures" is all that WASM is good for right now! So what's the problem with just using WASM?</comment>


Show HN: Turn your phone into a U2F Authenticator - <AUTHOR> https://krypt.co/?u2f <comment><AUTHOR> Hi HN!

We've made it possible to use your phone as a U2F authenticator. Just download the Krypton app and browser extension, then pair your phone to your browser by scanning the QR code. Our goal is to make unphishable 2-factor authentication more accessible, especially to users that don't want to purchase and carry around a separate hardware fob.

Looking forward to your questions and feedback!

</comment><comment><USER2> Can you use this with AWS MFA authentication? I'm not sure from the documentation from Krypt.co and AWS if it's possible.

Also I can use this to SSH from my terminal, but can I load private keys that I own? Or how would I add a Private/Public key pair to AWS or another cloud provider?

I should mention, that this looks really cool. Congrats for launching!

<comment><AUTHOR> AWS doesn't yet support U2F, but once they add it Krypton would work as well.

We don't currently support importing SSH private keys but are considering it in the future. You can upload your public key to AWS IAM (they only support RSA) and other cloud providers through the normal methods. `kr me` prints out your public key and it can be pasted in anywhere a local SSH public key would be added.</comment></comment>