Faster than C? Parsing binary data in JavaScript. - <AUTHOR> https://github.com/felixge/faster-than-c <comment><USER2> I am _extremely_ doubtful that optimized C is going to be equally performant as optimized JavaScript. There is innate overhead when using an interpreted language, no matter how advanced the interpreter. JavaScript is also garbage collected, while C is not, adding an additional level of overhead.

At no point in this article are we shown the code of this new parser. We are also told that is incomplete. So we have a parser which we can't see and which is not finished, but apparently dominates its C counterpart in performance. This leads to me to believe one of two things:

1\. The parser isn't complete, and its unimplemented functionality is going to be more expensive in terms of performance than the author anticipated, thus rendering his preliminary results void.

2\. The implementation of the C extension he is comparing against is not very well optimized. As said above, I find it _very_ hard to believe that well optimized C is going to be beaten by well optimized JavaScript.

<comment><USER3> It feels likely that the fundamental problem facing JS programs competing with the entire solution space available to C programs --- apart from the nerd who will implement an equivalently fast JIT compiler to run the JS on just to make a point --- is that C code has much better control over the layout of data in memory. You can work around the GC issues and modern compilers work around the interpretation overhead, but a C program is going to tend to have the easiest time ensuring that its working set fits into cache.

Of course, the real problem here is that he's comparing his JS code to a random blob of C code that just happens to be part of the MySQL package. Is the MySQL client library famously performant?

<comment><USER4> I agree with you. If getting every bit of performance out of your hardware is important to you, C (possibly with inlined assembly) is the way to go.

I am _so_ happy that I've never had to do that in my career.

<comment><USER5> That being said, Fortran is being used equally often, if not more often, in HPC applications. The reason being that modern Fortran both gives you bare bone access to the memory structures and offers array slicing notation as well as good multidimensional arrays for HPC. (C multidimensional arrays usually don't offer optimal performance, leading to the pointer arithmetic notation).

It's still an ugly language though. I've yet to find a C language extension that gives you the higher level features of Fortran however - and even then it would have to be an industry standard to be supported by the wealth of HPC compilers out there - remember it's not only x86, you also have GPUs, Itanium, PPC.. Looking forward to a world where LLVM actually gives the performance people need in that field, because architecture wise this could turn out to be a silver bullet.

<comment><USER6> Fortran is not exactly a general purpose language though, it's specifically designed for the sorts of problems that scientific and HPC tends to deal with, and it's probably rare especially nowadays to see it used anywhere else. I'm guessing there aren't any web frameworks written in Fortran (though I'm sure someone will now point one out....)

<comment><USER5> Web development with Fortran. _Shudder_. (String handling is abysmal in Fortran so I wouldn't wish that to my worst enemy).

No, but my parent was talking about deep code optimizations being almost exclusively being done in C. I'd say HPC is a significant market for code optimization, so I wanted to point out that Fortran is kind of the industry standard there.

<comment><USER7> If I'm trapped on a desert island with (somehow) my MacBook and a solar charger, this will definitely be the first project I take one...

</comment></comment></comment></comment></comment></comment></comment><comment><USER8> I love the "eval is awesome" section.

It's taken my _years_ of study, but I finally "get" Lisp. Let me summarize pg's On Lisp:

"Lisp is a language for writing _programs fast_ "

1) Write a function

2) Write a function that does something similar to #1

3) Begin to write a function that does something similar to #1 and #2

4) Abstract out the commonalities between #1 through #3

5) Encounter all kinds of new use cases for your abstraction in #4

6) Wait for #5 to become unwieldy

7) Abstract #4 even further, until you have something that resembles an interpreter

8) Wait for #7 to become a performance bottleneck

9) Write a compiler that takes inputs to #7 and turns them into #1 through #5

"Lisp is a language for writing _fast programs_ "

<comment><USER9> Doesn't it cause a "Javascript eval injection" vulnerability?

I don't know Javascript so I may be wrong here, but:

* Suppose someone uses this library to create a "MariaSQL Explorer App", where you give the app connection credentials and it connects to the database and shows you the data etc.

* A malicious attacker tells a user "have a look at my database" and the user goes to the attacker's database.

* The attacker's database (or spoof of one) has a column called 'dummy": MALICIOUS_CODE(), "colname'. notice the '"' chars inside column name.

* The MALICIOUS_CODE() runs in the user's node.js app. Perhaps it sends the attacker the passwords to other databases from the app's keychain or something..

* Profit

<comment><USER10> Which is why you sanitize input. Which _every_ sql-communicating system must eventually do somewhere - this is no different.

Besides, that's just an example snippet.

<comment><USER11> If you sanitize input, it implies you're inserting the input into an execution environment. If possible, it's better to treat data as data.

In the Javascript eval case, it's definitely possible; just access the data through a variable instead of inserting it into the eval'ed code.

</comment></comment></comment></comment><comment><USER12> For me myself it is often very motivating (sometimes demotivating) if somebody comes up and implements the same thing I want to do - but they accomplish 10x faster performance (even better if it is written in a cleaner style). The author seems also to rather enjoy those challenges ;)

In my interpretation the question "Faster than C?" is relevant because it is very easy to think that certain problems (like parsing binary data) are just not a good fit for language Y and thus the performance can't be good. Even if C performance is not attainable sometimes one cat get closer than one would think.

My last question is regarding his optmization example.I don't program javascript and thus have difficulties understanding how the optimized variant could every be faster than the original one. String concatenation and evaluation should not be faster (from my laymans perspective) than setting an indexed value to an array? (Ok actually it probably is not an array but a hash map, but are those so inefficient in java script? Or is it rather behaving like a sorted list where every value is inserted via binarcy search?).I would be very happy to get some insight.

<comment><USER13> Regarding your last question: the string concatenation/evaluation happens once while creating the parseRow function and from then parseRow is a compiled/JIT'd function object, no string handling happening. The problem with the original is not the hash map creation, but the fact that it requires all sorts of extra loops, and array & property look-ups.

Also, I think that is possibly some missing information there, since in the second version the column names are fixed (so the columns argument to parseRow is ignored), while in the first they are not.

<comment><USER12> Ah ok so this is probably the parser equivalent to precompiled queries. Given a fixed query, a specific parse row function is created once and than reused. Thanks!

While I think code generation is certainly the right approach in some examples, I see one problem in this example: As the parser is basically pregenerated using a certain column definition, why does the generated function has an parameter columns? It is simply discarded. So I would say it should rather be:

      var parseRow = new Function('parser', code);

<comment><USER13> I agree, and I don't know. (I even looked through the source to try to find if parseRow is a function from node-mysql. It's not, as far as I could tell.)

</comment></comment></comment></comment><comment><USER14> The excessive use of "fuck" and "shit" throughout the entire article really takes away from its message. It just seems very immature. It's hard for me to take it seriously when it sounds like it was written by an angsty teenager who's trying to look tough in front of his friends, or something like that.

<comment><USER15> I would hardly call that excessive profanity. In a 2000+ word article there are what, 10 instances of 'profanity'?

Honestly I think it speaks more to your maturity that you would find that _so_ bothering that it could detract from the _content_ of the article.

<comment><USER14> I don't take offense to the words that were used. It's more akin to articles that use absurd fonts or blatantly poor color schemes. Such things are unnecessary, and make it more awkward to absorb the actual content.

When I see authors doing things that obviously make their work harder to read, it does make me question their judgment, which in turn makes me question the validity of what is being expressed.

<comment><USER16> I pretty much agree with you, though it certainly depends on the context (I'm more likely to not be bothered by it in a post on a mailing list). But for a technical writeup? You want to be treated like a professional, write like one.

</comment></comment></comment></comment><comment><USER17> This is an outstanding overview of how to build fast programs in JavaScript. I really appreciate the fact that Felix took the time to write it. I learned a lot, and will definitely integrate this into my work whenever performance- critical code is involved. Particularly since I enjoy dataviz so much.

I'm a little surprised that someone so into JavaScript is using R and ggplot2 to visualize his data, and not d3 along with CoffeeScript for munging data (or Python if you can't stand CoffeeScript). Don't get me wrong, R is a powerful tool, but with d3 you can skip the whole ImageMagick/Skitch step since you're making visualizations directly for the web. Plus, once you've grasped d3's declarative approach (took me a while), it's so easy to quickly make powerful visualizations with it. In fact, it was partially inspired by ggplot2, if I'm not mistaken.

And to quickly munge/clean data, I've found CoffeeScript does very well here, similar to how easy it is to use Python for this task. I wouldn't want to write out JavaScript when rapidly trying to get data in the right format for visualizations, but with CoffeeScript and a functionally-oriented library like underscore, it's pretty easy.

That said, I'm sure once you've mastered such an intricate tool as R, it's hard to give up that power. But if you're a node devotee and you're looking for a good tool in JavaScript to visualize data, you can't get much better than d3. I know a lot of dataviz folks are learning JavaScript just so they can have access to d3.

<comment><USER18> Really the nice thing about ggplot2 is that each of those figures were probably like 1 line of code. Having a DSL designed for your data analysis is awesome.

</comment></comment><comment><USER19> > But, life is never this easy. Your code may not be very profilable. This was > the case with my mysql 0.9.6 library. My parser was basically one big > function with a huge switch statement. I thought this was a good idea > because this is how Ryan's http parser for node looks like and being a user > of node, I have a strong track record for joining cargo cults. Anyway, the > big switch statement meant that the profiler output was useless for me, > "Parser#parse" was all it told me about : (.

FWIW this is also a case of "get better tools". Line profilers exist, and they can handle that kind of cases (though the instrumentation costs go up likewise).

<comment><USER20> For Node and V8? I'm sure you're right, but when I was poking around I didn't see much more than suggestions to use "node --prof".

Which tools have you found useful?

<comment><USER19> > For Node and V8?

I don't know, I use neither. I'm just saying, there are profiling tools which handle the "One Big Function" pattern.

</comment></comment></comment><comment><USER21> I write code primarily to analyze data from my experiments, and I do it primarily in Python. I have been told (and have read) repeatedly, that optimizing is to be done right at the end and only to optimize the inner most loop etc.

From my reading, this guy is advocating the exact opposte: optimize as you code. It sounds sensible, but what to other people who have to optimize for a living have to say?

<comment><USER22> I think the difference here is that the problem is completely understood from the start: there's a MySQL protocol (which the author has already implemented in the past) and his project needs to be able to handle that exact protocol as quickly as possible.

<comment><USER12> This. Also the applicability of the optimization rule depends a lot on the context. It is typically stated for a complete project. Writing a library is different from that.

Depending on the kind of library you write, it could be that it is called in a hot inner loop of an outer project. So yes in that case it would make fully sense to optimize the heck out of the complete library (like e.g. a mysql client).

Another point is to see the reasoning behind the optimization rule. Optimization always is associated with cost (cost of programming, additionaly complexity in the code, maintance). This cost has to be recovered from the effects of the optimization. As the number of users for a piece of code grows, the benefit of optimization rises, but the costs should be more constant. Thus at scale it also makes sense to look a smaller optimization potentials.

But this does probably apply to not even 1% of the typical projects.

</comment></comment></comment><comment><USER23> I really like the style of this writing. Thanks, I learned a bit. I just wish the presenter dug deeper into the final mystery to round out the entire presentation.

</comment><comment><USER24> I think that the drivers can do a lot more to improve DB performance. [http://williamedwardscoder.tumblr.com/post/16516763725/how-i...](http://williamedwardscoder.tumblr.com/post/16516763725/how- i-got-massively-faster-db-with-async-batching)

At low load, the DB worker is idle when a request arrives and it can be dispatched immediately. But under load, the DB worker is busy when requests arrive and they build up as a backlog.

When a backlog builds, the DB worker can examine the pending requests and combine those that it can to reduce the total number of requests.

Not all requests are combinable and there can be subtle rules and side- effects. It is likely that a driver with just a modicum of combining ability would be very conservative e.g. simply combining single-key selects that are queued adjacently or such.

Even still, the gains can be massive and performance never worse.

(Oh, equally applicable to NoSQL too.)

</comment><comment><USER25> No way. Even with equal-efficient code, there is an additional point that is often ignored: Data structures are way more simple in C, with less overhead, and with higher cache-hit ratio, because more data fits in CPU data cache.

As example, gcj is as fast as g++ for code generation (both generating machine code, without virtual machine involved), however, in benchmarking appears to be slower, just because the data structures. If you tweak the Java code for use simpler data structures, e.g. integer or byte arrays, data overhead gets reduced, so memory cache hit increases, thus keeping similar performance to C/C++.

Other cases, like Java bytecode running on a VM, even with great JIT like HotSpot, suffers also _a lot_ because of data structures, so even when generated code is quite decent (runtime profiling, etc.), penalty is there, so code will suffer great penalty unless running with huge L3 cache (e.g. 32-48MB), being noticeable anyway no matter how much cache you add when having to do many memory indirections more.

And of course, when comparing, you have to compare equivalent things, e.g. Java <-> C/C++ ports, and not completely different software with different implementation (e.g. optimized built-in string handling vs non-optimized C string handling -e.g. ASCIIz string handling is slow, because of stupid C string function implementation, not because the C language itself, being the reason of C strings not being used for high performance code, even when writting in C-).

</comment><comment><USER10> _Excellent_ read. Written well, convincing examples of why it's good advice, and doesn't waste space in making its point.

</comment><comment><USER26> I guess the hope of high-level languages is that you can build a more interesting vocabulary from complex concepts.

[http://www.pvk.ca/Blog/2012/08/27/tabasco-sort-super- optimal...](http://www.pvk.ca/Blog/2012/08/27/tabasco-sort-super-optimal- merge-sort/)

It seems that there's a lot of effort going into making languages, "faster than C." Perhaps we would all be better off working with languages that just give us better abstractions -- user vocabularies. Layers on layers.

Don't get me wrong, C is the right language and a good tool for many situations. It's just that if you're going to extend the vocabulary then why do you have to change the implementation? If you want to optimize why optimize the compiler at such a low level?

Either way I just want to say that it's an interesting conversation and I'm looking forward to seeing more.

</comment><comment><USER27> My only problem with this article was that it didn't once mention parsing binary data, except in the title.

</comment><comment><USER28> Very worthwhile and well-designed writeup! I do wish that he had expanded the last argument to show what/how he fixed the performance problem. Also, does anyone know _why_ eval is faster than just defining the function? I mean wtf, why doesn't v8 make this optimization?

<comment><USER29> >Also, does anyone know why eval is faster than just defining the function? I mean wtf, why doesn't v8 make this optimization?

There are three optimizations I see in the eval example:

1\. The object is created as a literal rather than by property assignment (see <http://jsperf.com/object-literals-vs-object-properties>).

2\. The for loop loop is unrolled.

3\. The column names are cached in the function and do not have to be retrieved each time.

The reason these can't be done by v8 on its own is that they make assumptions that v8 can't guarantee. For the first two, you have to guarantee that the columns array is always the same length. For the first and last, you have to guarantee that the columns will always have the same names.

So even though you take a big hit on the initial eval of the function, you'll likely make up for it by having a better-optimized function.

<comment><USER30> I noticed a possible issue with the code generation, which may cause the issues with excessive heap allocation that were reported:

      var code = 'return {\n';
      columns.forEach(function(column) {
        code += '"' + column.name + '":' + 'parser.readColumnValue(),\n';
      });
      code += '};\n';
      var parseRow = new Function('columns', 'parser', code);

Instead of performing so many appends to a single string, I would try using map() and then join() the resulting strings:

      var code = ['return {\n',
        columns.map(function(column) {
          return '"' + column.name + '":' + 'parser.readColumnValue(),\n';
        }).join(''),
        '};\n'].join('');

      var parseRow = new Function('columns', 'parser', code);

Of course, this depends on how often the parseRow function is created...

<comment><USER29> That might be an improvement, but you probably wouldn't want to use Array.map, which generally has pretty terrible performance. See <http://jsperf.com/map- vs-native-for-loop/5>

<comment><USER30> Yes; the only reason for using Array.map() here is conciseness and similarity to the original code.

</comment></comment></comment></comment></comment><comment><USER31> I'll just leave this here: <http://c2.com/cgi/wiki?FasterThanCee>

</comment><comment><USER32> This is only part of the picture. This version of the driver is much slower than the driver based on libmysqclient. See the benchmarks at the bottom. It's a more real world test combining both reads and writes.

<https://github.com/mgutz/mapper>

</comment><comment><USER33> "Faster than C" seems to imply that the author is not seeing the true value of C. It is more than just speed.

You can only build so much with Javascript.

With C, the possibilities are limitless.

For a specific task like parsing, use whatever language you want. But please do not believe that by knowing Javascript you can both dismiss C as an optimal language and that you can build anything. You can't, as to either. As it stands, by relying on Javsacsript you're restricted to a browser or Node.js and whoever controls the browser and Node.js effectively has final control over your opportunitities. What's the browser written in? Javascript? What is Node.js written in?

Who cares if your parser is faster than C? If it's "fast enough", that's all that matters. Users of big, complex, graphical browsers or mySQL databases are well accustomed to slow speeds. They have learned how to wait.

<comment><USER34> Technically, you can write anything in JavaScript, for the simple reason you can manipulate bytes arbitrarily (using Typed Arrays), and platforms like NodeJS and Rhino let you write those bytes to a file and execute it, so you could (in theory) write a x86 compiler in JavaScript and run the result without ever dropping to C.

As an existing example, PyPy -a Python JIT compilter- is itself written in a subset of Python.

In the browser case, it's true that your JavaScript is restricted, but C is even more restricted: it doesn't run at all! (NaCl excluded)

<comment><USER33> Does Javascript run outside the browser and outside of a platform like Node.js? I want stuff that can run on bare metal as well as on top of other code (software platform).

Personally, I don't care about browsers. One application of a gazillion possible applications. They are an afterthought. I care about sockets and the ability to connect a machine to other machines over a network.

I care about code that can boot a computer, code that can be used to write drivers to control hardware (maybe some new hardware that just hits the market), and code that let's us build on top of that. With this code we should be able to build a kernel and userspace utilities and thereby manage to operate the hardware. Once everything is up and running, then we can install any scripting language we want. We don't have to use the same language we used to build the system to do any work after that, but we could. Indeed many higher level things are written in C, e.g., the interpreters for languages like JavaScript and the web browsers they are a part of. Maybe there's a reason for that?

If the best code for building from the ground up on any given piece of hardware is Javascript, it's news to me. Any examples? I have a new piece of hardware. Can I boot it using JavaScript? Can I control the hardware with JavaScript?

I believe the OP just wanted to do parsing in userspace. Personally I use C for that (generated from flex), but there are countless languages that can do parsing. Why he chose to attack C I have no idea. Like I said, once the computer is up and running (thanks to C), we can use any language we like. We can run "web browsers", and software platforms. And JavaScript. So, have fun with your JavaScript. But I'm pretty sure C isn't going away anytime soon.

<comment><USER34> Nobody attacked C, not me, not the author. If you disagree, please be so kind to indicate the excerpt where he attacks it.

Interpreters and kernels are written in C because C is a great, and probably the best language for the job. That doesn't mean, and this was my only point, that it's the only possible language that can ever do that; it isn't.

 _If the best code for building from the ground up on any given piece of hardware is Javascript_

Where did _anyone_ say that? I didn't say that. The author didn't say that.

As far as I'm concerned, JavaScript is not the best code for anything except pushing code to the browser.

The only thing I said was that _technically_ , you can write JS to do it. That's all.

 _Can I boot it using JavaScript? Can I control the hardware with JavaScript?_

The only thing that can control the hardware is machine code. You can control the hardware with anything that can generate that. JavaScript can, therefore _in theory_ you can control the hardware with it. Doesn't mean it's a good idea. Doesn't mean it's better than C. Nobody ever claimed that.

 _But I'm pretty sure C isn't going away anytime soon._

No, it must certainly won't, and thank $DEITY for that.

<comment><USER33> ice: "Nobody attacked C, not me, not the author. If you disagree, please be so kind to indicate the excerpt where he attacks it."

author: "So fuck - maybe it's time to finally give up and accept that I cannot compete with a well engineered C binding. C must be faster after all.

Well - fuck this! This is unacceptable. Fuck this "C is the only choice if you want the best performance" type of thinking. I want JavaScript to win this. Not because I like JavaScript, oh it can be terrible. I want JavaScript to win this because I want to be able to use a higher level language without worrying about performance."

ice: "As far as I'm concerned, JavaScript is not the best code for anything except pushing code to the browser."

We are in 100% agreement then.

Sure, technically (i.e. by creating a language using a lexer+aprser and some primitives in asm), any language could be used for any purpose. The reason I said what I said about JavaScript being limited is that it was not designed that way, i.e. to do anything. It was as you state, designed to run in a web browser. I would love to use JavaScript from, e.g. the command prompt, outside of a browser, but it has never been easy to do that without pretending you are running a web browser (learning DOM an so forth). The language is designed for a browser. Is that a limitation? To me, yes.

C does not have that sort of limitation. That's all I'm saying. And C works for many purposes right now - my OS has a vast library of C functions to do all manner of things low and high level. And that's without even looking at other huge repositories on the web. Compare this with mere "theoretical" capabilities, e.g. ideas like "low level JavaScript".

I told you why I like C and why I see JavaScript as limited. Not to contradict anything you said, but to explain where I'm coming from. Maybe I would like JavaScript even more than C, if I explored it more fully, but there's no way I'll like it more when it is so limited in what it can do (practically, not theoretically). I approach computer languages from a practical standpoint. I ask myself what can I do if I learn this language? I concluded that for me, C opens more doors, many more doors, than JavaScript. Some people know both. But I'm not that smart. I have to choose.

If I was smart, I'd learn many languages. But I have to work with a smaller set of knowledge.

Given that I have to choose, truthfully, if I had my preference, I'd choose FORTH and devote all my effort to learning and writing in FORTH. Technically anything is possible using FORTH. So what? By focusing only on FORTH I would be losing all the leverage that people's work with C can offer. There is only so much I, with my limited smarts, could accomplish.

Certainly you can understand my position a little, can't you? Why do so many people love Perl and Python? If we took away all the libaries (=enablement, empowerment) would they still love them as much? For what I want to do (i.e. potentially anything, from booting to browsing), C gives me ample enablement and empowerment. Self-hosting JavaScript doesn't. And if someone writes a BIOS for ARM scriptable in JavaScript, but they write some part of it in C, well, I'm still going to want to learn C before JavaScript. That's just how I think.

<comment><USER34> I don't think those excerpts show any attack on C, he just doesn't like that he can't use higher level languages without sacrificing performance. Which is a position that you may disagree with, but I don't think it's an attack on C.

 _would love to use JavaScript from, e.g. the command prompt, outside of a browser, but it has never been easy to do that without pretending you are running a web browser (learning DOM an so forth). The language is designed for a browser._

I don't think there's anything in the language itself that is designed for the browser; it's just the standard library that is lacking.

The Rhino shell, for example, comes with functions like readFile/2 and runCommand/N which are much more adequate for that kind of programming.

But it's certainly not as useful as C, and I certainly don't use. Though I tend to use Python, not C either (ctypes is _awesome_ ).

 _C does not have that sort of limitation. That's all I'm saying. And C works for many purposes right now - my OS has a vast library of C functions to do all manner of things low and high level. And that's without even looking at other huge repositories on the web. Compare this with mere "theoretical" capabilities, e.g. ideas like "low level JavaScript"._

Sure; I don't think anyone denies that.

That said, it's not true that those functions are closed to you if you use JavaScript; check out node-ffi: <https://github.com/rbranson/node-ffi>

Running JS on bare metal is, at the moment, a pipe dream, though.

 _Certainly you can understand my position a little, can't you? Why do so many people love Perl and Python? If we took away all the libaries (=enablement, empowerment) would they still love them as much? For what I want to do (i.e. potentially anything, from booting to browsing), C gives me ample enablement and empowerment. Self-hosting JavaScript doesn't. And if someone writes a BIOS for ARM scriptable in JavaScript, but they write some part of it in C, well, I'm still going to want to learn C before JavaScript. That's just how I think._

Sure, I can understand your position perfectly. I just don't think your portrayal of the article was fair to the author, that's all.

</comment></comment></comment></comment></comment></comment><comment><USER35> An equivalent claim: Faster than Assembly? Parsing binary data in JavaScript. Pah.

</comment><comment><USER36> Check the code : <https://github.com/felixge/node-mysql>

Note: it uses node_buffer.cc which is some C++ code in node. So it is not exactly pure Javascript.

</comment><comment><USER37> Why does everyone keep saying Doing X in Language Y is faster than X in Language Z?

Really they are comparing compilers, not languages. Everyone seems to just keep making potshots at Language Z.

</comment><comment><USER38> Please stop with the X higher level language can be faster than C unless you can challenge the limitations imposed by the laws of physics. Not which compiler is better. I can always find a better or worse C or JS compiler/JITter so that proves nothing.

Doing more (Which all more highly abstracted languages currently do) in less time with all else being the same is not possible as we understand quantum physics today.

This title is clearly linkbait...

<comment><USER39> > Please stop with the X higher level language can be faster than C unless you > can challenge the limitations imposed by the laws of physics. Not which > compiler is better. I can always find a better or worse C or JS > compiler/JITter so that proves nothing.

Turing equivalence and not even turing equivalence but 2 pieces of code with roughly the same functionality does not dictate the speed between them. You seem to be under some sort of misconception that two pieces of code have to be implemented in the same. For a long time tcl led the computer language shootout regex test because it has a wicked fast regex library(written in c I think). Nowadays the c version of that test uses the tcl regex library and is beaten by v8(chrome) javascript's even faster regex library(written in c++).

It is hard to beat c in speed and it is rare when something implemented in a different language does it. When it does it is frequently do to the algorithm/way it was implemented. The reason that this is so is that few people care enough about beating c with c++ being the only real contender. if you are careful you can beat c code with c++(almost all c++'s slower features do not slow it down if not used) add that to some cool compile time tricks with template metahackery and c++'s better inlining and you can do it.

The other part about beating c is complexity. Certain things are complex to implement in c. There is a reason we use so little assembly anymore, it's possible for smart people to beat optimizing compilers for certain cases but the general case isn't so pretty for it. Also with the rise of more/cheaper memory for gc to work well(and when it does it goes like hell on wheels) and parallel computers(parallelism being much easier in some languages then c) we may see it more soon. People have been saying that for a while but still.

<comment><USER38> _> Turing equivalence and not even turing equivalence but 2 pieces of code with roughly the same functionality does not dictate the speed between them. You seem to be under some sort of misconception that two pieces of code have to be implemented in the same_

I am merely pointing out that there is overhead with every VM. This is especially true with every current JITted JavaScript in use today (more so than with the JVM and CLR). So how could it possibly be faster if both implementations use an equal amount of optimization otherwise.

How is this even ever an argument?

<comment><USER39> > So how could it possibly be faster if both implementations use an equal > amount of optimization otherwise.

Who says they are?

<comment><USER38> Anyone who says that JS or X other VM dependent language can be faster than C must say this to have a leg to stand on.

They cannot say this??? Thus my point...

</comment></comment></comment></comment></comment><comment><USER40> INFLAMMATORY headline for self-branding and publicity , doesnt go much further. Yes javascript can be fast but in the end , having to write evals to gain performances demonstrate that there is something really wrong with that langage...

<comment><USER41> I disagree!! Being able to use evals to dynamically generate code for unrolled loops (and other similarly specialized procedures) sounds like a pretty amazing tool, and I can't not consider having it readily available an advantage of Javascript compared to C.

</comment></comment><comment><USER38> Um every fast and decent JS engine IS WRITTEN IN C!!!

I refuse to click on anything as ridiculous sounding as "Faster than C? Parsing binary data in JavaScript".

 _JavaScript will NEVER be faster than C._ If you personally test it and it is - all that you have really proven is that the C compiler you are using was horribly written and is probably 20+ years old. The level of ignorance that programmers have about low level languages and the performance cost of abstractions amazes me sometimes.

<comment><USER3> This is a very silly point of view. What you think you're arguing is that Javascript can't conceivably be faster than native code, and you're conflating C with native code. But C isn't machine code either; like Javascript, it's transformed into machine code by a compiler.

I don't generally think that Javascript runtimes are going to routinely beat C compilers for most performant execution of basic programs any time soon, but I'd happily bet that some high level language JIT is going to give C a real run for its money sometime soon. That JIT will inevitably be expressible in C, but when your recourse as a C programmer is "implement the important parts of the JIT for language X, then proceed to solve your real problem", you're not making much of a case for C.

<comment><USER38> I am not even close to conflating C with native code (although it is the lowest level language next to Assembly). C is the lowest level structured language and JS is among the highest. The fact that they are both ultimately compiled to a processor level binary means very little.

Since it seems so simple and plausible that a high level JITted language can be on par with C, why did you not explain how?

You cannot because you clearly don't understand language compilation and the laws that exist between performance and abstractions - so I am confused by your argument.

Let me put it simply, take any two languages - both ultimately compile to machine code, one has the overhead of bounds checking, run-time type resolution and garbage collection (there is actually much more that I could mention but for brevity...) and the other does not. Now please explain to me how the one WITH all this overhead could possibly be faster?

There is only one way - If the C compiler were egregiously under-optimized.

This will be the case till the end of time. All other things being equal, the executable code with more overhead to slow it down will lose. This seems a very simple concept to me - I cannot understand how it is so hard to grasp. Perhaps it is because along side learning Java, HTML and JavaScript - I also learned Assembly Language, C, C++ and hardware architectures.

<comment><USER3> "C is the lowest level structured language and JS is among the highest."

What does this even mean?

Ten message board style points for assuming that anyone who disagrees with you must not know C.

<comment><USER38> If you or anyone does not know what a high/low level or structured language means - that is fine.

But WHY would you attempt to make arguments that require basic understanding of such things.

<comment><USER42> How about you stop calling "C" a low level language?

<comment><USER38> That you for the valuable response - BTW I only claimed that it was the lowest level structured language.

<comment><USER3> Which is also a silly claim.

</comment></comment></comment></comment></comment></comment></comment></comment><comment><USER42> And not a single word about DTrace?

</comment><comment><USER43> Thousands of words about optimizing the reinvention of a wheel.

I thought we were hackers? We use libmysqlclient and stfu because we don't give a shit what language a client library is in because it WORKS and isn't unacceptably slow and LETS US SHIP.

I really dislike this whole crowd and attitude.

<comment><USER44> Reinventing the wheel is a good thing when what you get is a better wheel, or even just one better suited to your purpose.

Ever notice we're not driving cars on ox cart wheels?

<comment><USER45> As someone once brilliantly (I thought) put it on HN: has anything ever needed more reinventing than the wheel?</comment></comment></comment>


TextMate 2 + rmate = Awesome - <AUTHOR> http://erniemiller.org/2011/12/12/textmate-2-rmate-awesome/ <comment><USER2> If you find yourself sshing into the same machine all the time, or a set of machines with the same properties (i.e. *.example.com), then you can set up an SSH config file with the following contents to do the port forwarding for you, so you don't have to type out a long SSH command every time.

Host remote.example.com RemoteForward 52698:localhost:52698</comment>


Directory for Crypto People - <AUTHOR> We launched CryptoCrowd.co, a directory for Crypto People. It is still in early stage. We looking for ideas to enhance it. https://cryptocrowd.co/ <comment><USER2> Am I the only one who found it amusing that "Researchers" wasn't a category here?</comment>


Show HN: PJON v8.2 is out - <AUTHOR> https://github.com/gioblu/PJON/releases/tag/8.2 <comment><AUTHOR> It was quite a work :) what do you think about it?</comment>


Everything Always Returns 0: Adventures in Adding "Volkswagen Mode" to FreeBSD - <AUTHOR> https://spun.io/2019/04/30/everything-always-returns-0-adventures-in-adding-volkswagen-mode-to-freebsd/ <comment><USER2> Having done a lot of cross platform work, this is pretty neat. I'm still laughing about calling it "Volkswagen Mode" though.</comment>


UC Irvine Machine Learning Repository - <AUTHOR> http://archive.ics.uci.edu/ml

<comment><AUTHOR> Jacques Mattheij (hn:jacquesm) has a nice listing of free datasets that was posted here years ago.

[http://jacquesmattheij.com/Free+Public+Data+Sets](http://jacquesmattheij.com/Free+Public+Data+Sets)

If you know of any others, please post them.

<comment><USER2> Kaggle => [http://www.kaggle.com/](http://www.kaggle.com/)

List of data sets => [http://www.datawrangling.com/some-datasets-available-on- the-...](http://www.datawrangling.com/some-datasets-available-on-the-web)

Another list of data sets => [http://blog.mortardata.com/post/67652898761/6-dataset- lists-...](http://blog.mortardata.com/post/67652898761/6-dataset-lists- curated-by-data-scientists)

List of data sets on Quora => [http://www.quora.com/Where-can-I-find-large- datasets-open-to...](http://www.quora.com/Where-can-I-find-large-datasets- open-to-the-public)

Sub-reddit for data sets => [http://www.reddit.com/r/datasets](http://www.reddit.com/r/datasets)

</comment></comment><comment><USER3> Anyone know of a dataset of people, like front facing photos of people's upper bodies with no clothes on. I've been meaning to work on a cv method for bodyfat % estimation, given a series of progression photos of a person. I have a rough idea of how to do it, but I need a training set.

<comment><USER2> Per my other comment on the page, you should also ask here => Sub-reddit for data sets => [http://www.reddit.com/r/datasets](http://www.reddit.com/r/datasets)

</comment></comment><comment><USER4> I was viva'd in 1998 an yea! verily, I used Iris and Abalone (and 10 others) in my thesis. But why, young padawan? why?

Coz they worked.

16 years of industrial machine learning research later...

The world is not like the UCI repository

Getting the data into the form that the analysis algorithm can parse, asking the question... that is the work. Ok, also dealing with the answer - that too.

<comment><USER5> Data munging may be time consuming, but it is hardly difficult. The real challenge in ml is still the algorithms and theory.

<comment><USER4> No, I disagree.

Algorithms can be selected, it's not hard to learn which technique is suited to which situation.

What theory are you talking about? What do we have - Kearn's contributions on COLT and the descendant's there of (Michael Kearns is a great fella btw, and COLT is super - but so 1990's), or Vapnik and Structural Risk Minimisation?

It's not really physics is it?

<comment><USER5> All the data munging in the world will not make progress of any sort in improving the state of ML/AI. All advances come from better algorithms and understanding of associated mathematics.

Applying techniques to new problems involves data munging, and that is an important and useful task, but it is not difficult in the same way that doing new algorithmic work is, nor does it advance the state of the art.

<comment><USER4> I still think you are wrong.

There is no harm in developing a new algorithm, or coming up with new stories as to how it works, but to say that "data munging" will not advance the state of the art is to exclude the art! It's like saying that unless someone comes up with new physics it's impossible to build better spaceships.

And if Nasa were to build a better spaceship would that advance the state of the art in spaceship building?

</comment></comment></comment></comment></comment><comment><USER6> As a student @ UC Irvine I can tell you top notch talent leads most of their coursework

<comment><USER7> As a student @ UC San Diego with the ability to take a few courses at Irvine, are there any specific courses or prof. you recommend looking into?

<comment><USER8> I'm no longer a student there, but Shannon Alfaro was great at anything parser/language design related, and Gopi Meenakshisundaram was great for graphics. Eric Mjolsness is probably brilliant but everything I took from him was very dense.</comment></comment></comment>


Elance Flappy Bird jobs - <AUTHOR> https://www.elance.com/r/jobs/q-flappy%20bird/ <comment><USER2> I think I'm going to just release a game called "Push the Button". There's a big red button in the middle of the goddamned screen and the objective is to push it as many times as you can. As long as I don't kill a guy in Guam, I think I'll be set for life; I base this assumption on the H.L. Mencken conjecture.

<comment><USER3> The goal needs to be _not_ pushing the button. You leave the app open, it makes light and noise. High score the longer you leave the app running _without_ pushing the button

<comment><USER4> Bonus points for adding Ren & Stimpy audio quotes.

        Narrator: How can he possibly resist the maddening urge to erradicate history at the mere push of a single button? The beautiful, shiny button? The jolly, candy-like button? Will he hold out, folks? Can he hold out?

<comment><USER5> [http://www.youtube.com/watch?v=NITBfc1EOBo](http://www.youtube.com/watch?v=NITBfc1EOBo)

</comment></comment></comment></comment><comment><USER6> If you look at the iOS App Store, all of these "clones" are in the top 15:

1\. Ironpants

2\. Fly Birdie

5\. Flappy Bee

15\. Flappy Plane

I'm sure more will come, but it's still crazy to me that there are 4 apps that all have essentially the same mechanics. It also makes me wonder how long the app store will ride out helicopter style games.

I jokingly said to my roommates tonight, "we should just make a mini putt clone for iOS." Seems like I never have any idea anymore of which old arcade or flash based hit will pop up on my phone with a fresh look as the #1 app.

<comment><USER7> Are you not aware that flappy birds is a clone of a game of nearly 10 years old???

And even that is a clone of older games?

<comment><USER6> yeah, as ChrisClark mentioned, it was late and I decided to call them "helicopter style games", since I think the first one I ever played in this style was the helicopter one (I think on addicting games or something). Does anyone know the official name for this style of press / tap to play game?

<comment><USER8> I always thought it was Jetpack but maybe even that was influenced by something earlier...

</comment></comment></comment></comment><comment><USER9> It's sad to see the number of proposals on each of these. Who are these "programmers" who can code an app but are incapable of submitting it to an app store and keep any proceeds themselves?

<comment><USER10> Realistically, as a programmer, you know the market is about to be SUPER saturated. In my opinion these people know they are being scammy, so the only appropriate response is to scam them back: build one Flappy Bird clone, sell this one clone to each of the hundreds of people trying to get rich off of you, and cackle to yourself while the world burns with countless Flappy Bird clones.

<comment><USER11> Just another variant on the classic advice that the best place to be in a gold rush is to be the person selling the shovels.

I wouldn't waste my time building my own clone, because aside from being completely unfulfilling, it's also likely to make no money for me by the time I get it done. But I'd happily charge my standard consulting rate to build one for somebody else, and let them eat the probable loss.

</comment></comment></comment><comment><USER12> This should come as 0 surprise, as people try to take advantage of the "void" created by the developer's announcement that the game will be removed.

That being said, there are still requests for older games such as:

\- candy crush: [https://www.elance.com/r/jobs/q-candy%20crush](https://www.elance.com/r/jobs/q-candy%20crush)

\- temple run: [https://www.elance.com/r/jobs/q-temple%20run](https://www.elance.com/r/jobs/q-temple%20run)

<comment><USER13> Flappy candy bird crush run:

You tap the screen to make a candy-colored bird jump over, or dodge under, obstacles of a jungle theme. Anyone is free to build this out but I'd like .01% of the profits for the idea, and I'd like to be credited as the inventor :-)

<comment><USER14> I would make it Angry Flappy candy bird crush run.

<comment><USER15> Launch the flappy bird and then tap furiously on the screen to extend the range of the shot.

</comment></comment></comment></comment><comment><USER16> Ahh, now I see the point why Nguyen removed Flappy Birds from app store. The plan obviously was to sell the game (the real one, instead of bad copy) to all these guys on elance.

<comment><USER17> I think its near impossible he will be making as much selling the source on elance compared to the ad revenue he was pulling in.

<comment><USER18> Not to disagree with you, but worth pointing out that 'was' is past-tense - he'll still be creating ad revenue from the established userbase. He's just forced it to tail off quicker.

<comment><USER16> \-- 'was' is past-tense

you are right, thanks

</comment></comment></comment></comment><comment><USER19> In related news, HN front page filled with open source FlappyBird clones.

<comment><USER20> Well, this is obvious isn't it?

Git clone open-flappy-bird

change title screen

sell on elance.

</comment></comment><comment><USER21> I'm looking forward to a First-Person Flapper.

Or a Massively Multiplayer Online Bird-Flapping Game.

<comment><USER22> Someone already did first one: [http://www.alphabetagamer.com/first-person- flappy-bird-alpha...](http://www.alphabetagamer.com/first-person-flappy-bird- alpha-download/)

"Run in Crowd" is stupid enough already. "Flap in Crowd" ?

</comment></comment><comment><USER23> Playing devils advocate, how long would a clone take to build? You are recreating graphics and game mechanics.

Could this stuff be easily built using game salad or another drag and drop game Dev app?

<comment><USER24> I think I could do it in 2 days tops, to the same level of polish, using only my personal iOS game library. I've been a game developer for more than 20 years, though.

<comment><USER25> 2 days sounds about right - thus why all of those jobs are for $500 or less.

<comment><USER5> More likely it's because those jobs are submitted by a bunch of clueless wannabe tech millionaires who've never worked with a programmer in real life and have no clue about what is involved—all they know is it's a pretty simple game.

</comment></comment></comment></comment><comment><USER26> Crap... saw this on there here:

"Looking for someone to help with app rankings long term and also add lots of reviews to the app without getting caught. Please advise your methods and how we will not get caught. "

Example below [obscured] /blog/flappy-birds-smoke-mirrors-scamming-app-store/

[https://www.elance.com/j/apple-store-rankings-optimiser- revi...](https://www.elance.com/j/apple-store-rankings-optimiser- reviews/52833925/)

<comment><USER27> Yeah - I looked at the reviews for his other games and it really could be that there are _really_ good markov chains going on.

The frequency of completely unrelated stories about ruined lives etc.. is "odd"

The quality of the language however is pretty good.

So it's either really good markov - or it's possible that a "three wolf moon" joke review phenomenon has happened for this game.

Note the number of instagram pictures of flappy bird scores. It's very possible that a social media that adults aren't on has gone viral.

Still - foul play is also an interesting theory - but sour grapes might be the cause of all the foul play theories.

Still! Interesting phenomenon.

</comment></comment><comment><USER28> This is an interesting development.

Lesson for contract developers looking for work:

Pay attention to apps that gain hype, and build clones for people on e-lance.

</comment><comment><USER29> Humanity is entertaining. I wrote the beginnings of the game[1] in a few hours Today. I should have sold it... I still can sell it!

[1] - [https://github.com/joeblau/FlappyBlock](https://github.com/joeblau/FlappyBlock)

</comment><comment><USER13> Great artists steal.

<comment><USER30> Poor artists outsource.

<comment><USER31> Haha. Midnox brothers are my favorite of the YCW2012 class.

</comment></comment></comment><comment><USER32> [http://ellisonleao.github.io/clumsy- bird](http://ellisonleao.github.io/clumsy-bird) ★★★☆☆

</comment><comment><USER33> It is real for someone make the app in 2 days for 5k in ios and android as this guy asks: [https://www.elance.com/j/app-game- developed/52848809/](https://www.elance.com/j/app-game-developed/52848809/) (there are at least 11 guys that say that is possible)

<comment><USER34> Well, there will be something in 2 days but it probably won't work. Of course an easy way to make money with this is use the html5 version with phonegap.

</comment></comment><comment><USER35> It would be pretty interesting to be able to see a handful of projects go from start to finish in some easy to follow way. For these guys offering $149, how many end up with an app?

[https://www.elance.com/r/jobs/q-clone/](https://www.elance.com/r/jobs/q-clone/)

<comment><USER36> It's kind of sould deadening to see jobs like "Port small IOS / Android Game to Windows Phone 8 - tight deadline" going for $150...but maybe they'll get what they pay for, and perhaps learn from the experience.

</comment></comment><comment><USER37> To be honest flappy bird, is a clone. Karma in action. Also it's such a simplistic game, that the easiness of "cloning" it attracts the copiers. Imagine if it was an innovative, highly technological app.... Much harder to clone.

</comment><comment><USER38> Vultures.

<comment><USER13> Flappy vultures?

<comment> dav- Thank you! I've been trying to come up with a name for my Flappy Bird clone.

<comment><USER13> NP. .05% of profits is all I ask.

</comment></comment></comment></comment><comment><USER39> How is it possible to make a game so fast for so little money? I am 2 weeks away from releasing my IOS game that has taken me 9 months (with life intrusions) and I know C++/OpenGL, etc.

<comment><USER40> These games don't actually use C++ or OpenGL. They use libraries like SpriteKit for iOS. I was able to code a similar game this weekend with very little Objective C experience. Its a lot of fun too!

</comment></comment><comment><USER41> It's sad to see how much 'game reskinning' is going on.

<comment><USER42> There's even a course that shows you all the steps involved in creating your own flappy bird clone. It comes with the source code. dong!

[https://www.udemy.com/publish-your-flappy-bird-clone- iphone-...](https://www.udemy.com/publish-your-flappy-bird-clone-iphone-game- ez-no-coding/)

</comment></comment><comment><USER43> If I were one of the people listed on this link, I'm not sure how I could look myself in the mirror without throwing up in my throat just a little.

</comment><comment><USER44> What is the point of diverting so much talent, money and energy towards such an aimless pursuit? Entertainment has value, but only to a certain limit.

</comment><comment><USER45> Games and IAP have destroyed innovation on mobile. :(

</comment><comment><USER46> I'll probably build a game that has the player enter the following number sequence 4, 8, 15, 16, 23 and 42 before a timer runs out.

</comment><comment><USER14> Here comes the birds that can't fly!

</comment><comment><USER47> shameless plug here, but anyone that wants a Flappy Birds clone, please feel free to fork my project

[https://github.com/nicksoto/MarioLand](https://github.com/nicksoto/MarioLand)

save yourself a few thousand dollars. just switch the avatar and you got yourself flappy birds...

</comment><comment><USER48> It is possible to create one game and then sell it 10x times with different name/images.

<comment><USER49> yes, it's possible. [http://stackoverflow.com/questions/11216587/how-to- rebrand-a...](http://stackoverflow.com/questions/11216587/how-to-rebrand-and- redistribute-ios-ipad-application)

</comment></comment><comment><USER50> I'm just going to leave this here: www.dogetek.co/game/

</comment><comment><USER51> Write this once and sell it to all those people. Shovelware the cloners

</comment><comment><USER49> A Flappy Narayan (cat) would be cool

</comment><comment><USER52> Just as an aside about Flappy Bird, pulling in Bitcoin given it's another hot topic -- on Android he used the AndEngine project ([http://www.andengine.org/](http://www.andengine.org/)). It's interesting to see that the project has received absolutely no donations/tips at all.</comment>


FDA Warns People with Diabetes Against the Use of Unapproved (DIY) Devices - <AUTHOR> https://www.fda.gov/medical-devices/safety-communications/fda-warns-people-diabetes-and-health-care-providers-against-use-devices-diabetes-management-not <comment><AUTHOR> For context:

[http://seemycgm.com/2019/05/20/fda-warning-against-diy- syste...](http://seemycgm.com/2019/05/20/fda-warning-against-diy-systems/)

[https://www.jdrf.org/press-releases/jdrf-statement-on-fda- sa...](https://www.jdrf.org/press-releases/jdrf-statement-on-fda-safety- warning-for-diy-systems/)</comment>


The Rise of the New Global Elite - <AUTHOR> http://www.theatlantic.com/magazine/archive/2011/01/the-rise-of-the-new-global-elite/8343/1/ <comment><AUTHOR> print only version: [http://www.theatlantic.com/magazine/print/2011/01/the- rise-o...](http://www.theatlantic.com/magazine/print/2011/01/the-rise-of-the- new-global-elite/8343/)</comment>


How Artificial Intelligence Could Help Diagnose Mental Disorders - <AUTHOR> http://www.theatlantic.com/health/archive/2016/08/could-artificial-intelligence-improve-psychiatry/496964/?single_page=true <comment><USER2> The problem with Psychiatry is that it treats symptoms, not causes. The hope represented by this article is that by catching symptoms earlier, or by better pinpointing linguistic markers, vulnerable patients can be treated earlier with more-appropriate medications.

I think that it is much more important to find causes behind "mental disorders" than to describe them better.

From the article:

> According to Schwoebel, it took over 10 primary-care appointments before his > brother was referred to a psychiatrist and eventually received a diagnosis. > After that, he was put on one medication that didn't work for him, and then > another. In the years it took to get Schwoebel's brother diagnosed and on an > effective regimen, he experienced three psychotic breaks. For cases that > call for medication, this led Schwoebel to wonder how to get a person on the > right prescription, and at the right dose, faster.

What are the conditions that led this person to have a psychotic break? They didn't care, and just put Mr. Schwoebel's brother on maintenance medication for life. I suspect that such patients are usually 'exhausted' [1].

[1] [https://news.ycombinator.com/item?id=12331317](https://news.ycombinator.com/item?id=12331317) (my comment from this past weekend)

"How Psychiatry Lost Its Way: Identifying new mental disorders and their "curse" had become a productive industry; it is also bad medicine" [2], by Paul McHugh M.D., is very helpful for giving context to the mental health industry's status quo.

[2] [https://www.commentarymagazine.com/articles/how- psychiatry-l...](https://www.commentarymagazine.com/articles/how-psychiatry- lost-its-way/)

"The Doctor Isn't In" (same author) is also quite helpful: [https://news.ycombinator.com/item?id=10315705](https://news.ycombinator.com/item?id=10315705)

<comment><USER3> > The problem with Psychiatry is that it treats symptoms, not causes.

No, the problem is that we know a lot more about symptoms than causes, so we diagnose by and treat symptoms, which may or may not be treating causes (though many treatments are chosen because they treat something that there is at least a plausible hypothesis is the cause of the symptoms, and the fact that they have efficacy in treating the symptoms is at least suggestive evidence that both the hypothesized cause is correct and that it is being treated.)

This is also far _less_ different than lots of other areas of medicine that critics of psychiatry try to make it out to be.

<comment><USER2> Robert Whitaker [1] has looked into the "mental health" industry, and proposes that today's patients do worse on their medications than their unmedicated predecessors. It used to be that people had "episodes", now they have chronic diseases from which they never recover (unless they stop taking their pills).

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

<comment><USER4> Thank you for this link. this seems right up my alley - I'm trying to avoid being an uninformed critic. i've had bad experiences in my life with psychiatry, been in and out of the system since i was 12 and witnessed a LOT of ... let's say bad practices. do you have any other suggested reading / sites for someone in my position?

<comment><USER2> > Thank you for this link. this seems right up my alley - I'm trying to avoid > being an uninformed critic.

You're welcome, thanks for responding.

> i've had bad experiences in my life with psychiatry, been in and out of the > system since i was 12 and witnessed a LOT of ... let's say bad practices.

Having seen the inside of this world (as a visitor), I can sort-of imagine what you've been through. People do have problems; the system knows not that it does not always help.

> do you have any other suggested reading / sites for someone in my position?

depends on what you're interested in. I switch to this account whenever I have something to say about mental health, so there might be some other links there. (I just surveyed my comments, there aren't too many. I post the link to Robert Whitaker's work fairly regularly, but there are a bunch of others. They depend on the context...)

[https://news.ycombinator.com/item?id=11974769](https://news.ycombinator.com/item?id=11974769) \- this has a link about the monopolists' approach to medicine. I posted that comment from my phone, and didn't feel like fishing out the full link. But the article is quite helpful for illuminating the source of bias in the "Medical" world.

[https://news.ycombinator.com/item?id=10974230](https://news.ycombinator.com/item?id=10974230) \- I responded to this person's comment to thank them for their link about "SSRI's"

What are you interested in? anti-psychiatry? self-hacking mental health? The history of Medical Monopoly?

</comment></comment></comment></comment></comment><comment><USER5> One worry here is that AI only classifies as well as the labeled datasets that it trains on. And my concern would be the way humans apply labels to other humans. Diagnosing mental illness is notoriously messy. DSM-IV descriptions of various illnesses including borderline personality disorder are disputed, not settled. If we can catch psychosis early, great -- but what's psychosis?

</comment><comment><USER6> I was going to write something about how ominous it is to defer to the judgment of a machine for a person's sanity, but the machine of psychiatry to which we defer is no more or less subject to the weaknesses of that kind of deference.

<comment><USER7> You've identified that a group of humans will make mistakes, possibly as much as machines, and that's not incorrect.

The real hazard, on the other hand, is the unrestrained laziness humans might adopt, once the norm of machine assessment matures. Always trusting the machine answer. Never (or rarely ever) contemplating the judged person. Optical sorting. Rubber stamps.

No longer simple stigma. But endemic callousness, as people stop trying to help anyone, because machines now adjudicate who to simply avoid, until those untouchables rectify their unit tests.

The isolation induced by a machine-endorsed judgement could be far more rigid, than times when people would have had to get to know you, feel you out. And this process could have been theraputic for at least one side of the conversation. Maybe that goes away now.

</comment></comment><comment><USER8> And we're just feeding our devices all of this information, permitting its new owners to freely build psychological profiles about us.

</comment><comment><USER9> In a recent Harvard study about how Instagram could predict depression with trained algos, they shared some very high depression rate figures regarding Mechanical Turk workers. We should be doing more to investigate this issue, as the decisions made on MT fuel much current work.

Expanded thoughts here: [https://medium.com/@dbreunig/do-algorithms-find- depression-o...](https://medium.com/@dbreunig/do-algorithms-find-depression- or-cause-depression-2e047ef84cda#.n01ls254a)

</comment><comment><USER10> Yes. Our startup ran into these problems. Even worse, you don't even know if the labels of your truth table are meaningless</comment>


The Lesson For Startups in Paul Graham's Blunder - <AUTHOR> http://genderup.com/startups/2014/01/01/the-lesson-in-paul-grahams-blunder.html

<comment><USER2> Another takeaway might be to avoid talking to people who have been shown to twist your words for money or attention.</comment>


The Hitchhiker's Guide to Concurrency - <AUTHOR> http://learnyousomeerlang.com/the-hitchhikers-guide-to-concurrency <comment><USER2> Hello, I'm the author of Learn You Some Erlang. Let me know if you have any comments or questions :)</comment>


A Quick and Easy Guide to Tmux (2015) - <AUTHOR> https://www.hamvocke.com/blog/a-quick-and-easy-guide-to-tmux/ <comment><USER2> I used to enjoy Tmux, then noticed I didn't need its core persistence/session feature; I mostly used it for windowing & tiling, which are okay but come with _lots_ of warts you need to avoid, and before you know it your tmux.conf is 150 lines of stuff copy-pastaed from StackOverflow and the Arch wiki, mouse & copying keep being janky, and you're in for long sessions of configuration whack-a-mole where each fix somewhere breaks something somewhere else. Also, the client/server architecture is great if you need it, but for everyday development I don't, so I'd rather avoid the extra layer.

Not blaming the authors/maintainers at all, they're responsive and Tmux is extremely reliable. But in the end, it feels like they're battling to implement features at the wrong layer, and UX suffers.

In the end, I realized I just wanted a good terminal emulator that is {fast, featureful, scriptable, keyboard-friendly}.

If that sounds familiar, give Kitty a try: [https://sw.kovidgoyal.net/kitty/](https://sw.kovidgoyal.net/kitty/) (and run [https://fishshell.com/](https://fishshell.com/) in it, but that's another discussion :)

<comment><USER3> > I mostly used it for windowing & tiling [...] it feels like they're battling > to implement features at the wrong layer [...] In the end, I realized I just > wanted a good terminal emulator

If you just wanted the windowing and tiling, wouldn't a tiling window manager be better? It's kind of weird that you concluded the right layer for _window tiling_ was the terminal emulator.

Personally, I only use the window tiling features of tmux when I'm not already working inside a window manager (like when I'm on a /dev/tty*).

<comment><USER2> > If you just wanted the windowing and tiling, wouldn't a tiling window > manager be better? It's kind of weird that you concluded the right layer for > _window tiling_ was the terminal emulator.

I tried a tiling window manager (not sure which) a long time ago and didn't like it, it felt too heavy-handed and unnatural to me. My daily driver is:

\- GNOME Shell ...

\- ... with the occasional Super+{Left/Right} for basic half-screen splits (e.g. term on the left and editor on the right)...

\- ... and I use a little helper script ( [https://github.com/ronjouch/marathon](https://github.com/ronjouch/marathon) ) to run-or-focus apps.

With these three things, I meet my "simple tiling" needs and keep the flexibility I like from non-tiling WMs.

But Sway looks cool, I'll definitely try it one of these days :) , maybe I'll change my mind.

</comment></comment></comment><comment><USER4> > sudo apt-get install tmux (Ubuntu and derivatives)

I believe you just insulted the entire Debian community.

Jokes aside, tmux reminds me of emacs (similar esthetics & key bindings), the same way screen reminds me of vim (how do I get out of this thing?)

<comment><USER3> They both have both types of keybindings.

</comment></comment><comment><USER5> Having being a `screen` user for over two decades, migrating to tmux has been a pain. A week ago, however I discovered a wrapper called `byobu` (1) which really helps, and controls both screen and tmux depending on which one you have on your system. It basically wraps Function keys and more to tmux, but has plenty of other features. Time will tell if it was worth installing, but I do believe it's simpler for me to use it as a transition from screen.

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

<comment><USER6> I've been a screen user for decades as well, and don't feel compelled to use tmux (and also tmux has one too many concepts for me, I don't need sessions). Did you find some compelling reason to switch?

<comment><USER7> Screen has sessions too... unless I'm missing something and this means something else

</comment></comment></comment><comment><USER8> While on the subject, I'd like to share a solution I came up with for nested sessions:

[https://github.com/xelxebar/tmux- addons/tree/master/nesting](https://github.com/xelxebar/tmux- addons/tree/master/nesting)

Essentially, it defines some keys that let you "focus" on a particular nesting level. I've had some instances of needing four levels of nesting and found this to be quite nice.

The configuration is a tad idiosyncratic due to the way tmux handles variables, but it should be pretty well document in the readme.

Hopefully, someone else finds it useful. I've had to deal with sessions four levels deep and found this relatively ergonomic.

</comment><comment><USER9> Holy cow tmux has changed my life.

No longer do I have to worry about losing all of my process when I accidentally close iTerm. This, coupled with the fact that you can Ctrl-B Ctrl-B and control your tmux within tmux... It's even fairly easy to script and make awesome workflows. Take for instance this script which shows a diff in a left pane and a commit editor in the right pane: [https://gist.github.com/nvahalik/36108d4b892b6f66982537235f9...](https://gist.github.com/nvahalik/36108d4b892b6f66982537235f9cf462)

<comment><USER10> I am sure you may know this already but iTerm has a prefenrece setting called "Confirm Quit iTerm2 ... command"

Checking it on has saved me quite a bit of trouble.

<comment><USER9> Yes. But even with that, I've accidentally killed it before via Activity Monitor... still a great tip, though.

</comment></comment></comment><comment><USER11> I spent a while trying to file down some of the rough edges around different versions of tmux and compatibility with shells / colors / vim / scrolling / weird keycodes / etc. and have some commented dotfiles here:

[https://github.com/ohazi/dotfiles](https://github.com/ohazi/dotfiles)

It still has warts, but hopefully this is a useful reference to someone... I still haven't found a single source that covers all of these things well. Tmux config is surprisingly unintuitive.

<comment><USER12> > Tmux config is surprisingly unintuitive.

And sometimes you get some stray tmux process running in the background that somehow blocks it from updating the configuration until you find and kill every running tmux process. Really annoying.

<comment><USER13> Isn't that a simple matter of

      ps aux | grep tmux
      kill -9 12345

    ?

<comment><USER14> I prefer the nuclear option, which also gives you a bit of a gamble depending on your search string

        pgrep tmux | xargs kill -9

<comment><USER15> `pkill -9 tmux` (or `pkill -9 [t]mux` if you're doing it over ssh)

</comment></comment></comment></comment></comment><comment><USER16> >>> I'll proceed to give them a two minute tour about what you can do with tmux. After that they're either hooked and want to try it themselves or they tell me to go away with my ancient neckbeard tools and just use iTerm2.

FYI, iTerm2 actually has a tmux integration. Allows you to get the best of native paneling and persistent sessions.

[https://www.iterm2.com/documentation-tmux- integration.html](https://www.iterm2.com/documentation-tmux-integration.html)

</comment><comment><USER17> To me, tmux only makes sense for remote servers. Why would I want to use it for local terminal sessions? Why not just have multiple terminal windows open? And multiple desktops instead of "sessions", etc?

I use tmux with iTerm integration when SSH'd into remote machines, so that my tabs/window layout are preserved on the remote server when I reboot/reconnect.

But why would I need that locally? iTerm _already_ saves my windows and tabs/layout/etc... because I _don 't close them_.

Using tmux locally just seems like extra steps... when should I "actually" close a window, and when should I just detach it? Why is the distinction even important? If I don't want to see a window I can just minimize it, and if I want to actually close it, I can just... do that. Maybe because tmux has nice keyboard combos for doing window arrangement? But couldn't I just set up my window manager to do the same?

Remote servers though, totally makes sense. Sometimes you have to disconnect your SSH session, so that you can reboot your local machine while leaving the session open. tmux is a necessary thing in that regard. But on a local machine, rebooting means I'm clearing all my state anyway, so what would it really mean to "resume" a tmux session?

Maybe I just don't get it?

<comment><USER18> I saw my manager masterfully move his cursor across his terminal, select some text, and copy it, all without using his mouse, inside tmux. I thought it was cool

<comment><USER17> Isn't a mouse generally better at that?

I mean I generally consider my self pretty good at vim (people who watch me are generally pretty impressed at least), and I get the draw to using the keyboard for things, but the actual act of highlighting arbitrary text, vim is not particularly good at. And I can't imagine how tmux would be either.

<comment><USER19> > Isn't a mouse generally better at that?

I won't comment on which is better, but tmux lets you navigate the screen (and history buffer) by searching and vi(1)-like movements which serve me well. To say nothing of being in a situation where there essentially _is no_ mouse...

</comment></comment></comment></comment><comment><USER20> If you're a Linux user, a logical extension of this idea is to use a tiling window manager, and then you get the paneled window management for everything, not just your terminal.

Being able to detach and re-attach to sessions is still really useful, but I never find myself wanting to use tmux for splitting up a terminal window when I'm already using a tiling window manager.

<comment><USER21> I never got into those, because I have two modes of working. When I'm writing code, my hands are on the keyboard and I have several splits open and a vim session. When I'm doing anything else, I like to use a mouse because it gives me random access to windows.

</comment></comment><comment><USER22> I spend most of my day in terminals. If you are mostly just after tiling windows then I prefer, Tilix on Linux or iTerm on Mac OS. The only time I use tmux is if I am worried about losing my ssh connection and don't want my process to die.

<comment><USER23> Is your connection unstable? Then try Mosh ( [https://mosh.org/](https://mosh.org/) )

</comment></comment><comment><USER24> Usually the title of my terminal window displays some useful informations (e.g. the directory I'm currently in, or if I am installing some packages and their dependencies with "emerge somepackage" then I see what I'm currently emerging, etc...).

Does anybody know how to display the exact same informations in Tmux' bottom green bar? I just want it to display the same stuff that I would otherwise see in the window title of my terminal emulator.

I tried to search for it but I'm probably not using the correct terms so I didn't find anything that is relevant to this.

<comment><USER25> [http://man7.org/linux/man- pages/man1/tmux.1.html#NAMES_AND_T...](http://man7.org/linux/man- pages/man1/tmux.1.html#NAMES_AND_TITLES)

        case $TERM in
        xterm*)
            echo -e '\033]0;INSERT TITLE HERE\007';;
        screen*)
            echo -e '\033kINSERT TITLE HERE\033\\';;
        esac

Based on what I do, but not in front of a computer to test exactly what I typed above.

</comment></comment><comment><USER26> Can anybody tell me how to scroll up in a tmux session? Whether I use mouse scroll wheel or keyboard, on scrolling up all I get is

^[[A^[[A^[[A^[[A^[[A^[[A^[[A^[[A^[[A^[[A^[[A^[[A^[[A^[[A^[[A^[[A^[[A^[[A^[[A^[[A^[[A^[[A^[[A

<comment><USER21>
        set -g mouse on

in your ~/.tmux.conf should do the trick.

<comment><USER27> FYI - after you do this on Mac OS you can't copy to the system clipboard from the buffer using mouse unless you push `fn` before you click on the pane.

I think there are workarounds to get from the tmux copy buffer onto the system clipboard but I usually just `Ctrl-b z` to zoom the pane to full-screen, hold down `fn` button to select text, then `Ctrl-C` like normal.

<comment><USER28> IIRC, this was fixed in the last few releases- it had to do with OS X's weird user-session/permissions management. At the very least, I was able to comment out the following workaround:

        bind-key -T copy-mode-vi Enter send-keys -X copy-pipe-and-cancel "pbcopy"
        bind-key -T copy-mode-vi C-j send-keys -X copy-pipe-and-cancel "pbcopy"
        bind-key -T copy-mode-vi MouseDragEnd1Pane send-keys -X copy-pipe-and-cancel "pbcopy"
        bind-key -T copy-mode-vi A send-keys -X append-pipe-and-cancel "pbcopy"

</comment></comment></comment></comment><comment><USER29> I spend about 70+% of my day in tmux. I usually have 15-16 windows (which I work _hard_ to keep pared down), and some key windows with 6 panes (that I have muscle memory regarding what they are precisely doing). I've got a fairly tight 242 line .tmux.conf that I git sync between my various workstations, with affordance for Linux/macOS/WSL to handle things like the clipboard.

In addition to just keeping all my states managed cleanly, a couple of the many key features that I love about tmux:

o No need for a mouse - this has been a life saver in the past when I was working on a customer site, and they had me locked down on a terminal environment where there wasn't any mouse pass-through for things like copy paste.

o tmux restore/resurrect are a godsend. I can do weekly kernel updates on windows-fast ring/lose power, and get all of my sessions and scrollback history

o A side benefit of the restore/resurrect capability, is that I can tar-ball my session state and have all my scroll back and commands on a separate system.

One of nice tweaks that has made a difference for me is creating new-windows and _requiring_ they be named -

       bind-key u command-prompt -p "WinName: " "neww -n %1"

that Ensures all my windows have a name that makes sense.

Love tmux, though, you can go down a rabbit-hole tweaking out your .tmux.conf.

</comment><comment><USER30> Is there a way to copy the whole tmux window buffer over ssh connection to a Linux or Windows system? So far I only saw iterm2 tmux control mode supporting this on osx. I saw lots of terminals have feature requests open for this functionality but none of them have traction on getting this feature implemented due to the lack of tmux control mode documentation. Terminator has a fork release supporting it but it did work well when I tried it.

<comment><USER29> Tmux supports your local clients clipboard, so if you are in a tmux-session from your local client, you can copy your scrollback history (or window), into the clipboard, and just paste it locally. I do precisely that dozens of times a day.

</comment></comment><comment><USER31> One more interest feature which was not clearly described: you can attach two or more ssh connections (belonging to the same system user) to the same tmux session. Each displays the same thing in real time and has full control.

We use this all the time for these two use cases:

1\. Semi-permanent connections to the same tmux session on the server from multiple locations e.g. work and home. Come home and find things exactly the way you left them at work, and vice versa.

2\. A sort of collaborative environment. We have something like "demo" user running tmux session, and multiple people from different remote locations login as "demo" and attach to the same tmux session. Again, everyone has full control and we can see each other's actions as we also talk on the voice call in parallel. Usually much better experience vs. some sort of screen+control sharing solution, especially when some participants are on low-quality connections.

</comment><comment><USER32> Suggestion for your bash_login or equivalent, to automatically get back your session based on the IP you connect from (6to4 safe):

REMOTEIP=`echo $SSH_CONNECTION |sed -e 's/::ffff://g' -e 's/ .*//g'`

if [ -z "$SSH_CONNECTION" ]; then if [ "$TERM" != "tmux" ]; then tmux attach -t $REMOTEIP || tmux new -s $REMOTEIP ; fi ; fi

I have static IPs and I like to come back to a server the way I left it the day before, from home or work.

For pratical reasons (everything in one window), I often have tmux running inside GNU screen, with one GNU screen per remote server.

</comment><comment><USER33> I don't go too crazy with tmux stuff, I am a very minimal user

This is how I tend to start/restore a session:

        alias foo='tmux a -dt foo || tmux new -s foo'

</comment><comment><USER34> I wouldn't personally say that tmux is superior to something like iTerm2, but on WSL (Windows Subsystem for Linux) there doesn't seem to be a superior alternative since I haven't found a decent terminal on this OS that supports tiling.

</comment><comment><USER35> You can also run tmux within Emacs. Start a term via <ESC>x then enter term and press return. You can now run tmux. Use Ctrl-C Ctrl J and Ctrl-C Ctrl K to switch between modes.

</comment><comment><USER36> I have used tmux non-stop since discovering and love it

</comment><comment><USER37> Does tmux have anything like screen -R?

<comment><USER38> Nothing like -R, but attaching tmux lets you swap the client between different sessions with `<your prefix> L` for last, `s` for an interactive list or `(`, `)` for next/previous, and some others I forget.

If you want to list sessions before attaching then there's `tmux ls` :)

</comment></comment><comment><USER39> The list of benefits is missing the main one: you don't have to touch your mouse again.

</comment><comment><USER40> tmux could really do with a 'vim-sensible' common sensible default configuration.

Mirroring typical linux mouse copy-behaviour is perticularly painful (esp. in a multi-pane setup).</comment>


Chinese hi-tech researchers 'told not to travel to US unless it's essential' - <AUTHOR> https://www.scmp.com/news/china/diplomacy/article/2177703/chinese-hi-tech-researchers-told-not-travel-us-unless-its <comment><USER2> It's essential. From my reading of the news it seems the Chinese want access to US universities, tech and financial service companies for a variety of reasons. I'd imagine that access to these resources is impossible without coming to the US.

</comment><comment><USER3> I've taken similar advice from HN -- not to travel to the US unless it's essential -- and I've heeded that quite closely. It's unsurprising that people significantly more important than me are being advised the same in more formal situations.

<comment><USER4> The US has had travel advisories for specific people against China in effect since Jan 2018:

[https://travel.state.gov/content/travel/en/traveladvisories/...](https://travel.state.gov/content/travel/en/traveladvisories/traveladvisories/china- travel-advisory.html)

I've worked for years at companies that had corporate policy to either wash or destroy phones/computers taken into China.

That is to say, it's unsurprising that _any_ 2 countries engaged in a trade war (hot or cold) would take these precautions against each other.

</comment></comment><comment><USER5> Surprising amount of support for IP theft here today.

The US got away with it because countries like the UK couldn't police it during the industrial revolution. Whoops.

The Chinese got away with it because the US couldn't police it on the global stage. Whoops.

\---

But the US might've found a way to police it effectively now... soooo why would we not? Why would we permit it because others historically got away with it? Without civility, you only own what you can defend.

<comment><USER6> A lot of us don't really think intellectual property is actually property and thar the notion of IP is, well, bullshit.

<comment><USER7> If that is the case, then how do you propose that any private organization (especially small ones) should operate?

<comment><USER8> There's still trade secrets. That's what you do when you can't patent something or don't think it provides sufficient protection.

That naturally asks how to keep trade secrets better? Manufacture domestically, air gapped servers, better pentesting etc. etc.

</comment></comment></comment></comment><comment><USER9> USA's main exports are IP and Dollars. They have engaged in petrodollar warfare and international treaties to protect the demand for their export and intimidate those (like Kim Dotcom) who threaten it in other countries. Just like Russia has done for natural gas, for instance.

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

[https://ustr.gov/trade-agreements/free-trade- agreements/tran...](https://ustr.gov/trade-agreements/free-trade- agreements/transatlantic-trade-and-investment-partnership-t-tip/t-tip-10)

<comment><USER10> > _There 's only four things we [Americans] do better than anyone else: music, > movies, microcode (software), and high speed pizza delivery_

Neal Stephenson, Snow Crash

</comment></comment><comment><USER11> It's like a cold war on technology advancement here... wait. that's just the cold war, except this time more politics, fewer submarines.

<comment><USER12> Kind of opposite of the Cold War, where despite (geo)political differences, we tried to cooperate in the sciences, where possible/prudent...

<comment><USER13> And unlike the Cold War, both sides' economies are completely tied to trade with the other.

Before anyone feels too complacent about that fact - trade doesn't have a great track record of preventing actual wars. WWI was considered unthinkable, because of how tightly the two sides were entangled in trade.

<comment><USER14> It's also why several of the countries had issues feeding their populations during the war(s). I think it's fair to say, that what exasperated WWI was the secret (and not so secret), alliances everyone had made. Such that when Austria decided to invade Serbia, France had to declare war on the Ottoman Empire... (traditionally an enemy of Austria)

</comment></comment></comment></comment><comment><USER15> This is a thing not just in China based organizations. A lot of hi-tech companies around the world have clause in a contract that does not allow any employees to traves to US while carrying anything containing IP of a company or discourage employees from traveling to US altogether.

</comment><comment><USER16> The cold war experience of tit-for-tat has two lessons:

Firstly, somebody has to make a move either at parity which is respected or below, and the "you blinked first" message has to be ignored.

Secondly, there are always collateral damages. You can't afford to expel Russian diplomatic staff so you expel east Germans. You don't want to risk core staff so you send friendly nations into harm's way.

Canada was thrown into harm's way to avoid a bigger problem. The question is: who is willing to de scale the tit-for-tat response first?

<comment><USER17> Can't fight a trade war like a cold war. I actually think Trump is doing it right. I mean, if you're going to fight a trade war, you have to do the kinds of things he's doing. Now the problem is... economic reality. If the other guy just has the bigger market long term, especially if they can grow their market without you, you're just at a disadvantage. I think we can get some short term wins, but in the long term, we would have to prosecute this trade war _flawlessly_ to come out on top.

That's just the reality of large markets looking to de-link themselves from global carbon energy resources. Long term, if we're all intent on ending the age of oil and coal, there's just nothing to keep everyone cooperating with each other.

<comment><USER16> This trade war is not being prosecuted flawlessly, and as Ike or somebody like him said, no plan survives first engagement with the enemy.

Trump does not have a unified national intent behind him. I don't agree with him or his policies, in this or any other regard but trying to think dispassionately, I think appointing Bolton to signal strength of will demands having somebody more flexible to negotiate the real outcome.

For example, Trump is probably going to lose the trade war over Iran. They need Boeing spares but if he continues to blackball Iranian trade the future air fleet will be Airbus with loans from Germany and France.

Trump is going to lose a trade war in China because China holds far more US debt than Americans hold Chinese debt and China has far more market reach into emerging markets in Africa since the decision to decouple trade and local politics was made clear: you can trade with China and continue to repress your own people or trade with America and have to clean up your act.

<comment><USER18> > Trump is probably going to lose the trade war over Iran

Who cares what "Trump" loses? This is about the USA and Trump will be long gone before any of these situations are measured. The USA is not starting a trade war with Iran (first time I've ever heard sanctions called a trade war), the US is enacting sanctions to hurt Iran without scaring allies like Saudi Arabia.

> China holds far more US debt than Americans hold Chinese debt

That's intentional and good for the US. If you don't understand this, I really think you need to understand why we sell it to foreign powers at all.

> China has far more market reach into emerging markets in Africa

That's a real problem which the USA is losing out on potentially. It won't be apparent for some time, since people who are industrialized enough to get out of self-oppressive warlord control will not handle foreign occupation very well either. The US answer is always to enable the counter-revolutionaries anyway until the US has someone they want to deal with.

<comment><USER16> _The USA is not starting a trade war with Iran (first time I 've ever heard sanctions called a trade war), the US is enacting sanctions to hurt Iran without scaring allies like Saudi Arabia_

The trade war is with the EU and Russia. Iran is a huge potential future market, alongside the rest of the non saudi aligned Middle East. After Iraq the contracts for rebuild and repair went to classic US interested parties in trade retaliation for prior diplomatic posture in the m.e. by France and Germany.

Please explain to me what I don't understand about china holding US debt,and what it means tactically regarding the trade war.

</comment></comment></comment></comment></comment><comment><USER19> I kind feel the same about the US. The majority of the horror stories about people being forced to spit out password and getting devices taken away for copying...straight out of the country that spends all its time exporting "freedom".

Pretty happy in Europe. China, Russia and America all seem dodgy AF lately. Overtly so...I shudder to think what happens behind the scenes.

<comment><USER20> You might be right, but perhaps countries with something to lose might be better places to live because of opportunity. I understand you give up some rights in exchange for 'freedom' but the opportunities are better. Sometimes you just have to live blissfully aware.

</comment></comment><comment><USER21> Good advice that we should all take into consideration. Were it not that New York is part of the United States. Whose idea was...oh wait

[https://en.m.wikipedia.org/wiki/Treaty_of_Breda_(1667)](https://en.m.wikipedia.org/wiki/Treaty_of_Breda_\(1667\))

Mea culpa.

</comment><comment><USER22> After Meng's case, I think not only Chinese Hi-Tech company would avoid US, so would Chinese entrepreneurs. I guess one of the side effect would be less VCs in China in 2019 - Until the trade war is sorted out.

</comment><comment><USER23> Remember that this is not an accident or byproduct, but a goal of nationalists in the U.S. government (and probably in China too). They seek division and a breakdown of international relations and activities.

</comment><comment><USER24> Smart thinking. Similarly, I would not travel to China if I am big into research or am C-level. In case they want to respond in kind.

</comment><comment><USER25> Because they are likely working for institutions that are committing IP theft, in this case it's better to keep them honest, they don't have a culture that respects the rules and customs of other cultures (common law, contract law).

<comment><USER26> Which is also what the U.S. did for its first century or so.

A lot of us think U.S. IP law has seriously overextended itself these days. I'm not sure I entirely blame China for not going along with it.

<comment><USER27> Ah yes, because Samuel Slater smuggled cotton spinner trade secrets out of England in 1789, China is justified committing IP theft today.

Sound logic

<comment><USER28> The logic is "if you've used it to become the richest nation on earth don't knock out others using it to become rich".

And those that still benefit from the heads-tart due to their country/ancestors having done so, shouldn't play it holier than thou either.

Not to mention the whole hypocrisy, since the US has used corporate espionage and actual spying on supposed "allies" corporations since forever and still does, plus using their military and diplomatic might to ensure cheap resources, control of trade routes, use of its currently, and bending "banana republics" to its will and installing friendly lackeys to the detriment of their peoples. Case in point, this vintage gem posted today:

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

<comment><USER29> >The logic is "if you've used it to become the richest nation on earth don't knock out others using it to become rich".

Cool, so you have no issues with China, India, Africa accelerating their use of fossil fuels.

<comment><USER28> No, I don't. Especially since those pointing the finger still have the most carbon- and materials-expensive lifestyle, and have refused to sign environmental agreements for decades...</comment></comment></comment></comment></comment></comment>


We have a winner (startup choosing RoR) - <AUTHOR> http://blog.pretheory.com/arch/000527.php <comment><USER2> You guys are lucky. I had a torturous time playing with RoR. I had a week to learn it in and just couldn't get a hang of all the automatic things it did being a guy who likes to know exactly why some thing works. Not surprising considering RoR is not just a different language but also a different way of describing what you are building. I resorted to Perl and had better luck.

<comment><AUTHOR> I haven't used Rails yet in a real project, but I'm a bit worried about the same thing. I've actually shied away from using Django (I'm a Python guy mostly) since they have a bit more magic involved. TurboGears/Pylons/Web.py makes me happiest so far.

<comment><USER3> The nice thing about these web frameworks is that it makes rapid prototyping easy, and in doing so, it does things which may seem "magical". I would recommend that one should gain a certain level of understanding of what's going on behind the scenes. In doing so, it won't be as "magical" after all.

<comment><USER4> _'... would recommend that one should gain a certain level of understanding of what's going on behind the scenes ...'_

The upside of this is you work less & do things faster because there is a lot of functionality pre-built. Solutions become a lot simpler because you are utilising more of the framework, less custom code leaving more time to solve the real problems.

<comment><USER5> Not to mention, less custom code = less bugs. Although I can only speak for RoR, most of these frameworks have probably done a good share of testing.

</comment></comment></comment></comment></comment><comment><USER6> I've tried a couple frameworks and for everything they make easier, they make something else harder. There's a learning curve, so your first stab with any framework is actually likely to be _slower_ than using something simple.</comment>


Schrödinger's Startup - <AUTHOR> https://medium.com/@fabianstelzer/schroedinger-s-startup-7950a673391e#.jyciag2tw <comment><USER2> This metaphor might also work for delaying actual revenue because until the box is opened - that is we start charging real money for this software/service the state is unknown. That unknown is then subject to interpretation and forecasting and one may indeed find VCs with very optimistic interpretations. However, as soon as the revenue box is opened revenue becomes a tracked metric and the answer starts collapsing toward some reality.

If that reality doesn't measure up you cannot raise more capital and you have killed off the cat of optimism that was still possible before opening the box.</comment>


How's My SSL? - <AUTHOR> https://www.howsmyssl.com/ <comment><USER2> It seems odd to say my SSL client is "bad" because it supports ciphers that are bad along with ciphers that are better. That will only be an issue if that's all the server supports, and they can't actually think that downgrading to plaintext in that situation would be "better", can they? (Then again maybe they can -- exim used to downgrade to plaintext if it didn't trust the cert...)

<comment><AUTHOR> Agreed. The onus is not only on the user to respond to threat landscapes, but also on the site owners. Shunting all the responsibility to the site owner typically does not work in your favor.

<comment><USER2> And if the site owners are malicious or incompetent than even perfectly good TLS doesn't really do much for you...</comment></comment></comment>