Hopfield Networks in Go - <AUTHOR> http://mlexplore.org/2017/03/12/hopfield-networks-in-go/ <comment><USER2> I encountered Hopfield networks in LLVM [0]. I still do not understand how you would model Spill Code Placement as a Hopfield network.

[0] [https://github.com/alexjordan/LLVM- TMS320C64X/blob/master/li...](https://github.com/alexjordan/LLVM- TMS320C64X/blob/master/lib/CodeGen/SpillPlacement.cpp)

</comment><comment><USER3> The number of neurons Hopfield networks can use seems like a serious limitation. I think the max number in his graphs was 300? Does anyone know if this is a real problem or not?

On another note, what is the state of the art in "'memory networks". I'm thinking beyond LSTMs to a network that might be able to remember high dimensional features across a large span of time.

<comment><USER4> Usually if you properly use GPU the real limit is on the order of 20k. I think the graph in his post is old as crap, actually

(if you sparsify connections and do some tricks with sparsification sky's the limit, O(n * small multiplier over 1) with memory)

Hopfield nets don't do memory like LSTMs do. LSTM's already sparsify features and memorize them a long time. There's a medium size literature on adding more shit (NTM, Pointer net, attention) but nearly all of it is not that good (it gets tested on bullshit)

</comment></comment><comment><USER5> Golang: a language where you divide statements with `if err != nil`

<comment><USER6> A language where it's natural to think about and properly handle every error condition.

<comment><USER7> Someone who gets it.

In Go, this is one of the most difficult concepts of the language to wrap one's head around. Moreso, it's a concept that makes you bang your head against the wall at first; at least it did for me. After being so used to "getting away with" not thinking about this in other languages, being forced to think this way in Go can be maddening.

Then a light goes on.

...and then you look at your old code and go "eeesh"; in my case, I was coming from a PHP background at the time I was learning Go.

Don't get me wrong - I still like PHP and other languages, and I don't use Go much as it is, but once I wrapped my head around many of it's "strangeness" (compared to other languages), I really appreciated it (because I recognised that the whole point of the language was to help prevent common errors and in many cases force better programming practices to that end), and began to enjoy it.

<comment><USER8> I hate to be the one who brings Rust into a Go thread but if you find forced error handling to be a revelation then you'll find the borrow checker does the same thing for your program structure and architecture.

There's also a ton of really nice error handlers[1] that let you ergonomically deal with errors while still being forced to confront them.

[1] - [https://doc.rust-lang.org/book/error-handling.html](https://doc.rust- lang.org/book/error-handling.html)

<comment><USER9> > I hate to be the one who brings Rust into a Go thread

You shouldn't feel bad for this. The Go programmers are legitimately unaware that there's a better world out there.

<comment><USER10> Honestly, not at this point of HN. I don't think there was one thread that mentioned (or didn't mention) anything about Go which didn't have comments criticizing it.

Everyone knows its problems, and everyone knows about Rust.

It's just that some people don't need such extreme Real Time that they can't afford GC at the expense of the borrow-checker and lifetimes.

<comment><USER9> > Everyone knows its problems, and everyone knows about Rust.

I guess they've at least heard of it, yeah, but how many of them have actually tried Rust (or any other language with a modern type system)?

> It's just that some people don't need such extreme Real Time that they can't > afford GC at the expense of the borrow-checker and lifetimes.

They should probably be using Java, C#, Scala, ML, F#, Haskell, etc. then.

<comment><USER11> I have tried Rust, Go, Java, SML, Lisp, Javascript, and many other languages. I prefer Go in many situations where simplicity, speed of compilation, and portability are important. Rust is an interesting language with a lot of potential but the jury is still out on how wide the adoption will be. There is a steep learning curve, and the borrow checker has limitations.

One thing I don't appreciate is being lectured by pimply-faced nerds about how Go programmers should embrace Java/C++ generics into their heart as their personal saviors. I understand what Java and C++ are, I can choose to use them or not, and it's none of your business.</comment></comment></comment></comment></comment></comment></comment></comment>


Why Smart People Do Stupid Things - <AUTHOR> http://www.magazine.utoronto.ca/feature/why-people-are-irrational-kurt-kleiner/ <comment><USER2> I'm sure this will get down-voted mightily, but I believe there is a lot more to life than than rationality.

For example, human thought has a strong emotional component. At least mine does, and I believe it's true for everyone else (except maybe for psychotics). For a long time I believed this emotional part shouldn't affect my decisions and behavior, but as I've gotten older I think this is not correct. I think logic and rationality are great tools, but they certainly shouldn't be the only tools in the kit, so to speak.

I'm not saying that decisions should be entirely based on emotion, or anything else. I'm not saying that people should be stupid in how they approach life's problems, either. I am saying that knowing when to use logic and rationality sometimes takes a lot of skill and finesse. I also think it should be the "default option" for most problems, but not all of them.

I think the article puts in well with this: "In other words, you can be intelligent without being rational. And you can be a rational thinker without being especially intelligent."</comment>


Spanish woman claims ownership of the Sun - <AUTHOR> http://www.google.com/hostednews/afp/article/ALeqM5iabt-SAXY390wSpknpaI-EkWnCvA?docId=CNG.e80666177013e5bf887c610c599c5665.2a1

<comment><AUTHOR> And I thought software patent was dumb. I will remember to pay Ms Duran if I ever set foot on the Sun, or maybe I will sue her if there is an eclipse

<comment><USER2> My guess is that you could probably sue her if you get skin cancer. If you could prove in court that her property made you ill, you might get a nice, big load of money. Either that, or she'd have to give up her claim that she is the owner of the Sun.

<comment><USER3> This calms my fears that there will be a global tax on solar power tithed to this individual. :-)

</comment></comment></comment><comment><USER4> "I am not stupid, I know the law."

Those two things are not mutually exclusive, obviously.

<comment><USER5> I read this as someone trying out how far they can push a legal joke. Now if she actually believed that the letter of the law would trump practical concerns in such an extreme case as this, _that_ would be stupid.</comment></comment>


What Is an Individual? Biology Seeks Clues in Information Theory - <AUTHOR> https://www.quantamagazine.org/what-is-an-individual-biology-seeks-clues-in-information-theory-20200716/ <comment><USER2> I suspect the science isn't quite 'seeking the individual'.

Rather than trying to find fancier ways to define the lines, are there lines at all? Perhaps fuzzy grouping opens up more powerful models. What began as co-evolutionary theory is way more continuous.

I was at SFI in the 90s, before the big push mentioned in this article. I remember a conversation about it, discussing perhaps there isn't such a thing as an individual. It wasn't even said as if radical (e.g., by that point the Selfish Gene (1976) and The Extended Phenotype (1982) were well established, and way behind any 'cutting edge'). So I suspect it isn't quite 'finding the individual' that the article author keeps focussing on. But more 'models that abandon individuality'.

I generally suspect that a problem with large swathes of human thought are discretising continuous reality. That's definitely a core SFI view too. Or at least was in the 90s.

<comment><USER3> "Fuzzy X theory" are all crank theories. Why? Because they're trying to find a solution to the sorites paradox, and if it were as simple as some new system/mathematics/framework, then there would no longer be a sorites paradox and philosophers would say "whew, job done!" and cite the inventor alongside Aquinas or Aristotle as the three greatest philosophers who ever lived.

But despite the hundreds of fuzzy groupings/fuzzy set theory/whatever, that never happened, has it?

<comment><USER2> Weird.

> Because they're trying to find a solution to the sorites paradox,

Exactly and explicitly the opposite!

Why assume that dynamics are crisp if 'individual' isn't?

<comment><USER3> If someone has a fuzzy logic that definitively answers questions such as "what is the boundary between an individual and a system?" then he or she did the same thing Newton and Leibniz did with Xeno's paradoxes, and he or she would go down in history as both the greatest philosopher and a mathematician equal to Leibniz.

But that doesn't happen to these guys and gals who work on fuzzy logic, does it?

<comment><USER2> > If someone has a fuzzy logic that definitively answers questions such as > "what is the boundary between an individual and a system?"

Ah, I see. That was our disconnect. That's the opposite of the idea. The logic is just to abandon a discrete boundary (physics does this in many cases). I think my use of 'fuzzy' might have sparked a different debate.

Not one I find convincing (if Science then Philosophy, not Philosophy ∴ not Science ? um...) but I don't much rate 'fuzzy logic' for mathematical reasons. That's another rabbit hole! Thanks for clarifying.

</comment></comment></comment></comment></comment><comment><USER4> This reminds me of the problem of the many ([https://plato.stanford.edu/entries/problem-of- many/](https://plato.stanford.edu/entries/problem-of-many/)), which I have a feeling won't have a satisfying solution within my lifetime. I think these issues may have practical good-enough solutions, but may never be "solved" since it's so open-ended and fundamentally vague/ambiguous.

<comment><USER5> Yea and the sorties paradox [https://en.m.wikipedia.org/wiki/Sorites_paradox](https://en.m.wikipedia.org/wiki/Sorites_paradox)

I think the solution may be to drop Aristotelian categoricism and opt for fuzzy logics and fuzzy set theories.

Relatedly, causal continuity is also another solution philosophers often give for personal identity today re the transporter/cloning problem.

</comment></comment><comment> greyface- An individual is a boundary between self and not-self that acts to extract negentropy from not-self and incorporate it into self.

<comment><USER6> Doesn't that include humanity itself? And states, and corporations?

</comment></comment><comment><USER7> As a hard determinist that believes everything is just genetics, environmental factors and how the order of events/forces play out. I assume an individual is exactly the foregoing. We get patterns, we all share but also unique sequences and that separate what's common from individual status.

<comment><USER8> Because nobody can be in the same place at the same time (strictly speaking), everybody has a different circumstance, action radius and experience, even if all other things like genetics would be equal.

<comment><USER9> > Because nobody can be in the same place at the same time (strictly speaking)

I don't know that we can say this. We each look at the world through a particular perspective, but there's no necessity forcing us to say that we're the only one looking at the world through that perspective. I don't even think there's a necessity forcing us to identify with whoever was looking at the world from that perspective a moment ago, because memory is part of the body. We could be an infinite number of consciousnesses superimposed upon each other, blinking in and out in an instant. Consciousness could be a quality of every point in existence, but it only sees itself as a consciousness during the instant that stationary point is being passed through by a moving human body.

A current point-of-view doesn't require a lot of things you'd expect out of individuality. Not that I necessarily think that this must be how everything works, but if it isn't required in order to explain the subjective experience of self, why not use Occam's Razor?

</comment></comment></comment><comment><USER10> Fascinating read.

I suspected life could be thought as a self replicating and self improving algorithm like physical process. Very encouraging to see the information theory and biology are being used in this context.

</comment><comment><USER11> There are some core truths in the paper _The information theory of individuality_ [1] but it feels like some important ingredients have been discarded; maybe I just need to spend some more time with the ideas. From a software perspective, it is equivalent to a shift in focus on an object instance but discarding the concept of the class along the way.

I like focusing on the temporal aspects rather than snapshots in time. I like the concept of nesting since it nicely encompasses the role of mitochondria. I like the concept of continuous individuality as applied to cell colonies and eusocial insect colonies. Information theory certainly should be applied to DNA/RNA mechanisms.

It feels like the theorists are dancing around our inability to describe emergent systems properly. Perhaps an information theory centric approach should be applied to describing emergent systems. Such an approach may indirectly describe the strange edge cases in biology that are made up a multitude of emergent systems.

[1] [https://link.springer.com/article/10.1007/s12064-020-00313-7](https://link.springer.com/article/10.1007/s12064-020-00313-7)

</comment><comment><USER12> An individual in what context?</comment>


Vis-à-Wiki (Visual Knowledge Management) - <AUTHOR> http://marko-editor.com/vis-a-wiki/ <comment><AUTHOR> I have been looking around for offline wiki software and stumbled upon this one. I'm using now Joplin and it works great, especially with the excellent web clipper and internal linking capacity. But so far it is not possible to visualize the connected notes as mindmap. Vis-à-Wiki at least for me looks very interesting even it is discontinued (the author wanted to open source it). Do you know if there is any existing software that looks like this?</comment>


Ask HN: It can't be NRA lobbying, right? - <AUTHOR> Per this Washington Post article ( https://www.washingtonpost.com/graphics/national/nra-donations/) $3.5M has been donated to current congress members since 1998. I have no idea how much has gone to lobbyists and people who aren't in congress. Couldn't we just form a super-pac and raise funding with the sole goal of giving politicians a choice of who they take their donation from?
If it's not lobbying, is it votes? Is someone's vote really going to be swayed by their representative restricting assault rifles? Do these things really serve any other purpose then being toys or "safety" against a radical government? Could we come up with some sort of straw polling app to help politicians see that it might actually help their cause?
Sorry this post lacks any sort of statistics or depth. I just don't understand what the problem is. The NRA donation amount seems so small and media continues to talk about the NRA lobby having such a stronghold. <comment><USER2> >Is someone's vote really going to be swayed by their representative restricting assault rifles?

Yes. Because the Second Amendment states that the right to keep and bear arms is _necessary for a free state,_ any attempt by the government to restrict access to firearms for any reason is assumed by many gun owners to be part of an agenda to undermine American freedom - precisely what the 2nd Amendment says they should have guns on hand to oppose.

This assumption of bad faith on the part of gun control advocates and legislation prevails in American politics because of the NRA's success in shaping American gun culture around that premise, and the size and loyalty of their membership in the voting booth. It's their political power that matters.

</comment><comment><USER3> Sometimes I think the point of 'campaign finance reform' in the 1970s was to lower the price of buying off politicians. Certainly when there is a scandal here, people from overseas tend to be shocked about how little money was involved.

I know many people personally who seem to be obsessed with gun rights. Even many people who vote Democrat have a "live and let live" attitude. In the scheme of things, the geographical distribution of votes makes gun control as a litmus test a certain way for the Democrats to be a minority party for a long long time.</comment>


Startup Visas Around the World - <AUTHOR> https://futureworkpresent.com/startup-visas/ <comment><USER2> I have a European startup visa.

If you at all can, stay in the US. Your startup valuation will be reduced by 80-90% compared to what you may expect in the US.

And don't think European grant money will magically make up the difference. It's a pain to apply for, a pain to administrate and claim, and you'll be competing with a cottage industry of professional grant proposal writers.

The one case it may make sense is if you have a very obvious and boring business model, and your business somehow saves the planet while delivering clean drinking water to Africa. This will make you investable and ensure you check the boxes the grant proposal reviewers are looking for.

Also the startup ecosystem is no where near evolved. There's no SAFE notes, employee stock options are totally broken, acquires are unheard of, etc etc.

To end my story, I lost interest in my startup because we couldn't raise money at a decent valuation, and my 2020 was going to be spent chasing small checks from various EU funding schemes.

<comment><AUTHOR> Thanks for sharing this! So, you're now stopping to work on your startup? You won't move it to another jurisdiction?

</comment></comment><comment><USER3> OP: Perhaps make this list editable via Github pages?

I'd like to add one:

Location: Fukuoka, Japan

Name: Startup Visa

Type: Special startup visa for foreigners residing in Fukuoka who wish to start a business.

Duration: 1 year (Can be transitioned to Business Visa)

Website: [https://www.city.fukuoka.lg.jp/keizai/r-support/business/sta...](https://www.city.fukuoka.lg.jp/keizai/r-support/business/startupviza_2_2.html)

<comment><AUTHOR> Thank you, added! Quite unique for a typically closed off country like Japan to offer this.

</comment></comment><comment><USER4> Anything like this in US? Or any plans for a startup visa?

<comment><USER5> Sadly, no. The only thing was this: [https://www.inc.com/zoe-henry/us-startup- visa-delayed-fallin...](https://www.inc.com/zoe-henry/us-startup-visa-delayed- falling-by-the-wayside.html).</comment></comment>


A Better Browser - <AUTHOR> http://abetterbrowser.org/ A time has come for you to choose A Better Browser. For Security. For Compatibility. For Humanity. <comment><USER2> Cute: <!-- Ridiculous and unnecessary use of Spacer.gifs -->

More seriously, the image-based layout with incorrect alt text is incredibly inaccessible. And users of IE-based voice browsers are one groups who could really use upgrade guidance.

<comment><USER3> Alt text has been updated to more accurately reflect the images.</comment></comment>


The One Trend That Defines Our Generation, for Better or Worse - <AUTHOR> http://mytwoandahalfcents.com/trends-that-define-our-generation/

<comment><USER2> I disagree with this completely. Experiences we engage with are mostly novelty, and I suspect that most of what the author considers previous generations to have considered to be 'social validation' was also based on the experience. Owning a house, civic protests, journeys to the moon are also experiences (even if you're only watching those experiences on television, you are having an experience).

The trend in increased sharing of photos is a result of both the ability take and view photos instantly, and the ability to share them with large groups of people.

People used to go on trips, take as many photos as they dared, because they had to have the film and then get it developed, then they would make a slide presentation to share with friends and family.</comment>


Greenpeace vs Facebook: It's on. - <AUTHOR> http://www.crunchgear.com/2010/09/01/next-on-greenpeaces-enemies-list-facebook/

<comment><USER2> Crunchgear is pretty lame for a) publishing such an old story as if it was new and b) for not giving the other side of the story. Here's Facebook's response (from February of this year) [http://www.datacenterknowledge.com/archives/2010/02/20/faceb...](http://www.datacenterknowledge.com/archives/2010/02/20/facebooks- response-to-greenpeace/)</comment>


Show HN: A builder tool to help generate CSPs in a type-safe way - <AUTHOR> https://github.com/pgilad/csp-builder <comment><USER2> This looks good - it's great to see development in the CSP space since it's such as great yet not widely used feature.

I've also made something on the same lines as this, although not as a complete tool like yours. Essentially I have a default policy for my site, but I can manually override individual directives on a per-page basis. I called it 'CSP Extreme': [https://www.jamieweb.net/blog/taking-content-security- policy...](https://www.jamieweb.net/blog/taking-content-security-policy-to- the-extreme-policies-on-a-per-page-basis/)

<comment><AUTHOR> Thanks! I like your work on it. I have several ideas on how to generally improve the CSP development that I want to implement, and needed a good infrastructure for doing it: \- CSP optimizations, like removing redundant fields (like a minifier) \- CSP parsing \- CSP security warnings or rating (like for unsafe eval) \- CSP Presets, might be general presets, or extendable presets for various tools, like Google Analytics for example \- CSP deprecations and level supports

So far, I've created this tool to help me with it's usage (See [https://github.com/pgilad/www.giladpeleg.com/blob/master/scr...](https://github.com/pgilad/www.giladpeleg.com/blob/master/scripts/generate- csp.ts)), but the best feature is by far using Typescript (I considered using Java) for typed directives and sources.</comment></comment>


The best way to find, hire freelance journalist - <AUTHOR> https://www.paydesk.co/

<comment><USER2> Yes, good site. How did you find it?</comment>


Ask HN: What is the best way to protect your website from hackers? - <AUTHOR>

I have a website which was on godaddy servers and got hacked. A warning message used to show up whenever anyone visited the site. I moved the servers to mosso (forwarded from godaddy) and after about a month the website is hacked again and the same warning message has started showing up. I am willing to pay a minimal amount on monthly basis to deal with hacking permanently or do whatever is necessary. Any comments, suggestions, experience will be appreciated. Thanks <comment><USER2> Remove the following iframe from your homepage:

       <iframe src="http://bestwebfind.cn:8080/ts/in.cgi?pepsi11" width=2 height=4 style="visibility: hidden"></iframe>

<comment><AUTHOR> I have tried removing it, but it comes back again. The best way to deal with hackers, that most people are suggesting is to move on to linux based servers rather than windows based. So we are probably going to try that.

</comment></comment><comment><USER3> As asked, the question has no single answer. Security is a continual process, and a tradeoff with speed, usability, friendliness, bandwidth, etc.

The 100% secure website is one without an internet connection. The 99% secure website is one on a continually patched server, offering only static content, and accepting no user-supplied input other than the base url and clicks on links.

If you want to accept user input and serve dynamic content, it becomes a complicated process involving, at minimum, awareness of your own vulnerabilities and threats, and protection against the OWASP Top 10 and similar lists.

*1. <http://www.owasp.org/index.php/Top_10_2007>

<comment><AUTHOR> Thanks for the input. My website accepts user input (registration, feedback, forums, payment for buying products etc.) and serves dynamic content. I am not a developer myself but have hired someone for development. It seems I will need to hire/subscribe to a service which can provide me with the necessary expertise.

</comment></comment><comment><USER4> You might be having problems with your software, not the hosting. If you use a blog read about these security measures: [http://www.mytestbox.com/news/secure-wordpress-blog- prevent-...](http://www.mytestbox.com/news/secure-wordpress-blog-prevent- hacking-tips-tricks/)

</comment><comment><USER5> my day job is at McAfee, we sell the leading web security testing service (mcafeesecure.com). Its runs a daily scan on your full website infrastructure, finding the vulnerabilities hackers are exploiting to access your site and showing you how to fix them. It's a solid service, used my 75% of the webs top 500 retailers and thousands of business world wide. If you interested in the service contact me (email in profile).

</comment><comment><USER5> i clicked through to the site from ujjwalg's profile and my browser crashed immediately. Now I'm getting an endless stream of warning messages from my anti-virus regarding programs trying to access my computer, including a trojan. wow, pretty hectic.

the domain is watermelonexpress.com avoid it like the plague

</comment><comment><USER6> this suggests the security flaw is with your site code not the hosting provider :)

What tech/code does your site run on?</comment>


Why old ThinkPads are still terrific laptops in 2019 - <AUTHOR> https://maximevaillancourt.com/why-i-use-a-thinkpad-x220-in-2019 <comment><USER2> That's dedication to some seriously old hardware...

I bought a T450s as a travel laptop and put Ubuntu on it -- the detected touchpad driver is crap, so I had to tweak there, but everything else works.

It's a very nice laptop for the $260 I paid for it shipped. And if I somehow destroy it, I don't have to worry about it being a $2k expense out of pocket...

<comment><AUTHOR> > That's dedication to some seriously old hardware

If it ain't broke, don't fix it!

Glad you're enjoying the T450s.

</comment></comment><comment><USER3> The r/thinkpad subreddit is quite active for anyone interested in ThinkPads especially 2nd hand/ex-corporate/refurbished ones.

<comment><AUTHOR> Yes, and Craigslist and Kijiji are full of them, too.</comment></comment>


iPad Air catches fire - <AUTHOR> http://www.theregister.co.uk/2013/11/08/ipad_air_explodes_into_fireball_as_terrified_fanbois_flee_apple_store/

<comment><USER2> Wow, horrible article. It was more like an attack on people who like the iPad, and the iPad tablet market itself, rather than the issue (fire) at hand.

Dude starts out by insulting people (the term fanbois is not a term of endearment) who might actually like the product. Just because you like a product it doesn't mean you have been indoctrinated into a cult. Then blasting the iPad as being a piece of rubbish.

Oh, BTW, it lit on fire and nobody knows why. Perhaps they mounted it on the wall by placing a screw into the back of the iPad. We don't know.

I'm guessing whoever wrote this was recently "promoted" from "blogger" to "contributor" on that site. Journalistic excellence all around! /s

Next story.

</comment><comment><USER3> If I had to place a bet on why one might catch fire, it would probably be the combination of constant abuse demo models take, along with the presence of a defective battery, and finally a crapload of free apps piling on background processes that keep the CPU and chasis at an elevated temperature, stressing the problematic battery.

All this combined with the final, fatal recharge cycle which added additional heat to the battery, and poof!

</comment><comment><USER4> Is this article for real? The wording is so terrible it was cringy to read. Is The Register some sort of tabloid?

</comment><comment><AUTHOR> Changing the title was totally justified in this case.</comment>


DOJ tries to block return of data to MegaUpload user - <AUTHOR> http://news.cnet.com/8301-1023_3-57450153-93/doj-tries-to-block-return-of-data-to-megaupload-user/?tag=mncol;editorPicks <comment><USER2> _It's worth nothing that the government, in its brief, wrote Goodwin has another legal option to pursue if he believes his possessions weren't treated fairly. "Mr. Goodwin," the government's lawyers wrote, "can sue MegaUpload or Carpathia [Hosting, the company that hosted MegaUpload's servers] to recover his losses."_

So he can sue MU, which has had all of its assets frozen and has no access to the files (so no restitution can possibly occur), or sue Carpathia, where the only obligation they could even remotely be under is to return the files, except there's a court order telling them they cannot recover the files.

Carpathia is not responsible for the takedown. MU _might_ be responsible for the takedown, but they have no available assets to award recovery to affected users.

<comment><USER3> What hypocrites. They don't want to return the data, don't want to be sued at the same time, and even try to redirect the claim to those who can't return it. Are they just dumb, or utterly cynical to the point of mocking the public?

<comment><USER4> If recent events are any indication, I'd go with the second choice.

</comment></comment></comment><comment><USER5> This whole Megaupload case leaves a bad taste in my mouth.

On the one hand, do I think Megaupload's founders were happy to turn a blind eye to piracy? Probably. They may have even encouraged it. Given the current (stupid) laws there is certainly a case to be made by the government. Still, the case is far from clearcut [1].

That being said, the remedy sought by and received by the government is disproportionate to the alleged offense.

One problem is that the DoJ injunction to both shutdown the service and maintain the data is costing Megaupload and/or the ISP $9000/day to keep 25PB of data around [2]. How much of that data was infringing exactly?

This is the part that leaves a bad taste in my mouth: the DoJ's remedy is essentially punitive to the parties involved (for what is still an alleged infringement) to the point that they simply want to bankrupt alleged offenders. Whatever happened to due process?

All of this leads me to two conclusions:

1\. The Obama administration's track record on intellectual property is horrendous, from staffing the DoJ with RIAA/MPAA stooges [3] to secretly negotiating international treaties that treat copyright infringement with similar severity as counterfeiting or terrorism [4] (the original ACTA; not the one signed this year). This I think is so bad I think the administration needs to go (not that I think the alternative is much better); and

2\. The US government is reinforcing the view that if you want to store data in the cloud and you want it to remain there, store it outside of the US.

[1]: [http://www.techdirt.com/articles/20120120/00373617487/megaup...](http://www.techdirt.com/articles/20120120/00373617487/megaupload- details-raise-significant-concerns-about-what-doj-considers-evidence-criminal- behavior.shtml)

[2]: [http://arstechnica.com/tech-policy/2012/03/isp- storing-25-pe...](http://arstechnica.com/tech-policy/2012/03/isp- storing-25-petabytes-of-megaupload-data-costs-us-9000-a-day/)

[3]: [http://www.readwriteweb.com/archives/obamas_latest_pick_for_...](http://www.readwriteweb.com/archives/obamas_latest_pick_for_doj_is_riaa_lawyer.php)

[4]: <http://boingboing.net/2009/11/03/secret-copyright-tre.html>

</comment><comment><USER6> Was there really a need to put "legitimate" in quotes every single time?

More seriously, though, it shows that the legal system has put itself, perhaps unwittingly, in unexplored and potentially very volatile territory.

Most times, a warrant does not affect at lot of people in the grand scheme of things. Potentially inconveniencing an innocent household is, all things considered, not a big deal. But a warrant that affects quite literally millions of people, which cannot possible be all guilty - dangerous, that.

I wonder if this will force some changes in the way seizure of property is handled. I suppose it depends on how much of a "shitstorm" it continues to cause.

<comment><USER7> Yet another problem created by cloud storage. If instead of putting everything on a community storage service we took Eben Moglen's suggestion of storing everything in our homes (which would require better bandwidth and ISP AUPs, of course) our data would be in the best legally protected place in society. It won't happen. The cloud will win because it has bigger corporate backers, but this is another example of how technology solves one problem while simultaneously creating another.

<comment><USER8> Yet another example of a too powerful to care government agency which cares nothing for the collateral damage it causes, nor does it have too.

To be blunt, they should be required to release within a timely manner all non offending assets. They claim bad precedent which is more than annoying, its insulting. In other words, as long as they get who they are after they could care less who suffers in the process. Worse, those caught up in the crossfire are not entitled to any assistance whatsoever.

So the moral of the story is, do not keep your data anywhere but on systems you own. I wonder how much Apple and Google have to pay to keep the DOJ at bay? I would assume it is whatever the cost of lawyers are whose entire job is to convince the DOJ all things possible are always done.

<comment><USER9> I agree that keeping your own data on your own property is a worthwhile endeavor. I speculate though about how proficient most people are at keeping truly decent security for that data. If I build a small server rack at home and allow all of my mobile devices to connect to that server from out in the wide world, and if then lots and lots of other people do that as well, how does the nature of security change?

</comment></comment></comment></comment><comment><USER10> Quote from article: "Twenty-three years ago, the Supreme Court made clear that a criminal defendant does not have a right to use someone else's money to finance his defense."

Is this implying that the guy who wants his videos back is a criminal defendant?

<comment><USER11> I assumed that "criminal defendant" referred to MU/DotCom, but then I find myself unable to parse the sentence into something meaningful. Can anyone explain please?</comment></comment>


The OnePlus 2 pushes the boundaries of how cheap a flagship phone can be - <AUTHOR> http://www.theverge.com/2015/7/27/9051753/oneplus-2-smartphone-hands-on <comment><USER2> I'm completely disappointed with the way phone market evolves. I don't want a _cheap_ phone, I want a phone that works.

I want my phone to have enough memory and processing power to handle its operating system without hiccups. It is ridiculous that even a $700 phone can just start lagging on you. I want my phone to have it all - Bluetooth, WiFi, IrDA, accelerometer, thermometer, barometer, SD card, double SIM, removable battery; all sensors and standard protocols and features that companies use now to segment markets. I don't see a reason for a phone to not to have it all other than vendors trying to extract more money from people by forcing them to choose the least inferior option. But fuck it, I'll pay even $1000+, just create a phone that works.

And I want a tool, not a fitness toy for bored first-worlders. Double, no - triply so for wearables. People ask me why I just bought a Pebble instead of one of those shiny touch-screen "smart"watches. It's simple - I want a tool, not a glorified pedometer. While I think a touchscreen would be really welcome, still, Pebble seems to be the only wearables company that wants to make something useful instead of shiny. But I am yet to find such a comapny for phones themselves.

It's disheartening when you compare what we know we can do with what is actually done because of business reasons.

<comment><USER3> _It is ridiculous that even a $700 phone can just start lagging on you_

IMHO the blame for that lies with the software, not the hardware. Android is basically the realisation of the original Java OS, but on hardware fast enough that its performance has become "acceptable" \- most of the time.

As for the other features; Bluetooth, WiFi, accelerometer (and compass/magnetometer), SD, dual-SIM, and removable battery are pretty much standard on every generic Chinese phone now since they're based on reference designs that have all those components (they cost almost nothing - it would probably take more work to _remove_ them and customise the HW/SW - and it's yet another feature point they can list.)

I'd consider such a "full-featured" phone "flagship", but what the term appears to mean today is just a fast CPU, big screen, and pretty looks, with the other features appearing and disappearing seemingly randomly.

<comment><USER4> I don't want to start here any flame war or something, but that's the main reason why I've switched to Windows Phone OS - for 100$ - 150$ You've got the system that runs like a charm (I'm not smartphone power user so all apps I need are available in Windows Store)

<comment><USER5> I HAD a windows phone (Lumia 620) for about 6 months before I gave up trying to get used to it and went back to Android.

The animations are just too slow and annoying for me to get used to. There needs to be a way to turn them off. The phone wasn't laggy. It's just the animations that got on my nerves.

<comment><USER6> The animations in Windows Phone hide the loading times. The phone wouldn't be any faster without them.

</comment></comment></comment></comment></comment><comment><USER7> I'm really sad that it won't have CyanogenMod; that was the biggest reason that I purchased a One. It's a real shame that there was that whole fight over exclusivity in India (IIRC, it sounds like CM's fault, but I'm not 100% certain).

I'm interested to read details of how the fingerprint unlock works. Remember that a fingerprint reader is insufficient to be secure, as fingerprints are low-entropy and relatively public.

<comment><USER8> If they don't lock it down and is similar to the One, then it should be incredibly easy to switch to CM.

I'm running CM12.1 on my One at the moment and it's leaps and bounds better than the stock CM11S ROM that comes with the device.

<comment><USER9> I have been slightly paranoid to flash mine (came from China I think and not quite correctly installed as the OTA updates don't take with a signature mismatch). If you have the time - can you tell me

1\. Are they easy to brick? 2\. Is there a decent guide for updating?

Thanks!

<comment><USER10> Just back it up, fastboot unlock, and flash a recovery image. You'll thank yourself you did it. As per your questions:

1\. Not that easy to completely brick. If you try to flash the wrong recovery or boot, it will fail to start even in recovery mode (bricked?). I've done that to mine, but I was still able to boot it up while tethered (I have two phones and I inadvertently used the image for my other phone on my One Plus).

2\. Loads of guides on their forums or google in general. Also, Nexus 4 or 5 guides are the same procedure, just replacing with the relevant images and ROMs (the OnePlus One's codename is Bacon, in case you're looking at what roms to download).

</comment></comment></comment></comment><comment><USER11> Is anyone else in the "My perfect phone would be my current one but with a battery that easily lasts 3+ days" boat? I've currently got an iPhone 5S, and I can achieve this with those portable USB chargers. I've no need for any of the other features which new generations of smartphones are adding (multi- core\multi-ghz processors, huge amounts of RAM etc), though there's _perhaps_ a killer app round the corner which will advantage of this. Otherwise I cannot see myself replacing my 5S in the next couple of years (except for Apple dropping support, or me dropping it in my beer)

<comment><USER12> Depending on how heavy your use is, you should look at the Xiaomi Mi4i.

I picked it up as a Nexus 5 replacement solely for the ridiculously large battery (3100mAh or 72% more than the similarly sized iPhone 6 and still 6% more than the 6 Plus). It's slimmer and more solid (the N5 has a tendency to get dented), and arguably has better specs (it definitely deals with Skype, my only performance hog, much better). When I was in the market, there was nothing that came close in terms of battery life. IRL it has been alright, if I read a book and check emails most of the time it will die in about 32 hours but going into town for meetings (i.e. only using maps, email and the odd Kindle), I've found it only lost 30% battery/day.

Cost me around 205 USD including shipping and a 6 month warranty, but if it breaks I'll just buy another one. It's only 1/5th the cost of an iPhone...

The Xiaomi portable chargers are also pretty neat.

I don't know about US availability as it appears most things Xiaomi are directly ripped off Apple and there's probably copyright issues. Check out the Mi Note to see what I mean...

<comment><USER11> I'm in the EU so I suspect it maybe a little easier to pickup a Xiami phone. 3100mAh is pretty impressive by the sounds of things, so as long as the power consumption hasn't scaled similarly that could be an interesting option. I'll check it out!

<comment><USER12> Watch out not to get the Mi 4 by accident. The Mi4i was launched this year and was basically designed to be a "premium smartphone at emerging markets prices" whereas the Mi 4 is the "China flagship", whose design is a stretched iPhone 5S (you might like that though) just like the Samsung Alpha. It's a lot more expensive and as far as I'm concerned unjustifiably so. i stands for "international".

I don't think the power consumption is as smart as the N5; it def drains about the same in airplane mode as not in airplane mode, whilst the N5 basically became as good as switched off. On the upside power management seems much better when it comes to dealing with networks; maybe I was on the wrong frequency bands. The N5 battery was shockingly bad; after a year and a half I was getting barely 1.5 hours of use out of the thing. Great when you're stranded in Tokyo and relying on Google Maps and Translate...

FWIW my iPhone 4 from years ago is still the most durable phone I've owned. I still get a good 3 days battery out of it (it's our guest phone) and it can go weeks on airplane mode in the drawer. But when you've tasted a 5" screen and multitasking, it really is too little...

</comment></comment></comment></comment><comment><USER13> No NFC, which seems like an odd choice. Wonder how much that shaved off the manufacturing cost.

[http://www.androidpolice.com/2015/07/27/oneplus-says-it- drop...](http://www.androidpolice.com/2015/07/27/oneplus-says-it-dropped-nfc- from-the-oneplus-2-because-oneplus-one-owners-werent-using-it/)

<comment><USER14> I'm guessing it was more related to the 'feature' of having replaceable backplates.

</comment></comment><comment><USER15> Give me a 4.5-inch phone with slightly lower specs (a battery-saving 720p screen would be enough at that size) for less than $300, and I'm sold.

For the time being, though, I'm going to wait out the "my phone is bigger than your dick" game that everyone and their dog seems to be engaged in. 175 grams is way too heavy to carry around in a pocket, let alone hold with one hand for more than a few minutes. And yet everyone competes in the already overcrowded "flagship" market instead of trying to find a niche.

I hope at least some manufactorers will return to their senses before my 4.27-inch, 107-gram Galaxy S4 Mini begins to feel unbearably slow.

<comment><USER16> You could pick up the Nexus 5. I switched to OPO from Nexus 5 and it had the perfect dimensions. Lightweight and great for one-hand usage. The battery is a bummer though.

<comment><USER15> The maximum screen size I'm looking for is 4.5 inches, maybe 4.7 if the bezel is very thin. Maximum weight: around 120 grams.

The Nexus 5 is bigger and heavier than that, but I'm keeping it near the edge of my radar in case I have no other choice.

<rant> LG recently began to market the Gram, a series of high-end ultrabooks that weigh less than 1000 grams. Why on Earth is nobody trying to market medium-to-high-end phones that weigh less than 100 grams? </rant>

</comment></comment></comment><comment><USER17> I'm sorry but, 400 bucks is cheap now? It's a great phone for the price, don't get me wrong, but I think 400 bucks is a lot of money.

<comment><USER18> 'Cheap' is used in a specific context here. The headline says 'how cheap a _flagship_ phone can be'.

There are cheaper phones out there. Would you name them among 'flagship' devices?

<comment><USER19> What's the minimum spec to be considered "flagship?"

</comment></comment></comment><comment><USER20> I think Asus deserves some credit here as well for selling a 4GB RAM Intel Atom phone with dual SIM and SD card slot for comparable prices:

[https://en.wikipedia.org/wiki/Asus_ZenFone#ZenFone_2](https://en.wikipedia.org/wiki/Asus_ZenFone#ZenFone_2)

Of course, as usual, their own skin and who knows how long you get updates.

<comment><USER15> Forget updates, you can even run full-blown Windows 10 and Office on that beast. If only it came with Windows apps and drivers to use the phone-related features...

[http://www.greenbot.com/article/2946255/windows-7-running- on...](http://www.greenbot.com/article/2946255/windows-7-running-on-an-asus- zenfone-2-is-too-cool-not-to-share.html)

<comment><USER3> That's being done with KVM, so it's not really booting and running Win7 natively on the phone (the hardware is probably not close enough to a PC to be able to do this) but inside a VM.

You can find people running various other versions of Windows (and even MS- DOS) on an Android phone, again as a VM.

</comment></comment></comment><comment><USER3> It has a removable back, but no removable battery or expandable storage? I can sort of understand if the back wasn't removable... but on this one, it is. In this price range you can find many other Android phones which do have those features.

Here's one, for example:

[https://www.fastcardtech.com/Elephone-P7000-Android- Phone.ht...](https://www.fastcardtech.com/Elephone-P7000-Android-Phone.html)

</comment><comment> mike-cardwell No NFC? Guess I'll have to stick with my OnePlus One if I want to continue to use PGP safely on my phone - [https://grepular.com/An_NFC_PGP_SmartCard_For_Android](https://grepular.com/An_NFC_PGP_SmartCard_For_Android)

</comment><comment><USER21> The competitiveness of the Android handset market gets even more brutal. 4.7" to 5.5" is flooded with phones that are that are $199-$399.

This is not including models that are 12+ months old that are discounted but still have solid specs.

<comment><USER22> Heck, my Nexus 4 is still perfectly usable. The only real motivation for me to upgrade is LTE (which has finally rolled out to my city in the UK).

<comment><USER23> What's your experience with Lollipop? Mine had pretty large problems with 3G and Wi-Fi signals after upgrading.

<comment><USER22> I'm running Cyanogenmod 12.1 & everything has been fine so far. Haven't tried the official Android L releases.

</comment></comment></comment></comment><comment><USER24> In all of the comments, I see a lot of excitement about the "features" the company is able to pack for a "low" cost.

I would like to say this in simplest possible way

\-- One plus one support model and execution is poorest of all phone makers --

The emphasis and culture in the company is to grow fast without concern towards individuals paying still very high prices for their phones but not getting the worth. The half life of the phone is lower than market and people do face issues when the OS changes are pushed without a good amount of testing.

One plus one forums are inundated with people all over the world having hardware issues and the insufficient support they have been receiving. The founder Carl Pei has made commitments to improve support however the progress has fallen short on promises.

One Plus One ended up being a huge lesson for many customers. One plus two would just end up being another phone without company getting its act together.

<comment><USER25> Sounds like a Nexus by Google, so ...

</comment></comment><comment><USER26> _> For $300, you got a well-made, nice-looking phone with cutting-edge hardware and few compromises to be found_

I don't think it is nice-looking. It's not ugly. It's just normal. It looks very similar to some Android phones.

</comment><comment><USER27> OnePlusOne was interesting mainly because it had cyanogenmod. I can't wait to read reviews about OxygenOS. (but I have to say: cyanogen was much more interesting)

<comment><USER28> OxygenOS is being made by the Paranoid Android team. These guys definitely know what they're doing. Expect a more minimal experience with UX optimizations aimed at features users use daily.

</comment></comment><comment><USER29> Disappointed with the invite system again. Did the first version no sell well enough?

<comment><USER30> The opposite. To little supply for the demand. They used the invites to "throttle" the purchase rate to be able to keep up. They probably thought an invite system was a better aproach than a weekly free-for-all aka. SuiciDDOS against the webshop. Hopefully, this time supply will be significantly higher, meaning the invite system will be removed as soon as they know they can keep up with demand.

<comment><USER31> Even if that only takes six months the phones isn't going to be interesting by the time you can actively purchase it.

<comment><USER32> You buy phones for their "interesting" factor rather than actually wanting to use it as a phone? If so, you're probably an _extremely_ tiny minority in that regard...

<comment><USER31> By not interesting I mean a better version from some other company will be available.

</comment></comment></comment></comment></comment><comment><USER33> "features a 5.5-inch, 1080p screen"

I hope it's not the same screen as in the One... Other than that, it looks like a good improvement.

</comment><comment><USER34> If it's anything like the Oneplus One it's a buggy ill supported piece of crap.

<comment><USER35> I take it you own one and would like your objective opinion. What exactly was wrong with it?

<comment><USER34> I was in a bit of a mood with it when I commented, but for good reason. A couple of the problems I've had :-

When the battery drained, it refused to boot past the "cyanogen" boot screen. Twice. A common problem that required a factory reset. Would say it's charged to 100%, until the moment the USB was removed and it instantly went to 4%. Every time, no matter whether it had been drained, or charged when turned on/off. Again, factory reset fixed it. Wont vibrate more than once with the OnePlus official flip cover when calls are incoming on silent mode. WhatsApp vibrations cant be turned off since CM12 upgrade. Doesn't do 4G in Europe. There's probably a carrier whom it does work with, but from my last bit of research there isn't in the UK. Perhaps Three though.

I've used CM happily on other handsets, and encountered far fewer and far less frustrating. However if you're marketing a phone specifically to be used with CM, I'd expect a lot more QA to be put into it. If you're happy with a "hackable" phone and you're willing to put up with missing calls, disappearing notifications, private lock screen notifications showing message contents still, then it's not a bad way to waste £300, but I want a reliable phone I dont have to fight with, so I'm sacking it off very soon.</comment></comment></comment>


PyPy is faster than C, again: string formatting - <AUTHOR> http://morepypy.blogspot.com/2011/08/pypy-is-faster-than-c-again-string.html

<comment> old-gregg I love PyPy, those guys are amazing. However, every time I see "faster than C" almost always a bit of trickery/wordplay is involved.

The examples aren't comparable. The equivalent would be to have Python code invoke an external function which sits in a pre-compiled .so

Bulk of the work is happening inside of sprintf(), why handicap C by not letting it to compile the code?

The fair comparison would be to place the source of sprinf() nearby and see if C compiler inlines that call or/and unrolls the loop, otherwise it's just about packaging/linking, not really about code generation.

Edit: I see this became #1 on HN front page today. I want to take advantage of this and say that <http://mailgun.net>, the programmable email platform, is looking for an engineer who'd find this discussion interesting. See my profile. And we're users of PyPy too! :)

<comment><USER2> But the whole point of the post was to point out that PyPy can optimize in places that the traditional C model of shared libraries cannot - or, at least, have great difficulty doing so. This is an inherent advantage to optimizing the instructions at runtime.

<comment> old-gregg Shared libraries is an operating system feature and has nothing to do with C. C just happens to be the most popular systems programming language. "Traditional C model" is just a bunch of object files, and it's up to you and your linker to package it any way you want it: a shared library, a static library or an executable.

I'm not a GCC expert, but Microsoft C compilers could inline cross-module code since the beginning of time. His example may actually produce different results under msvc with /GL flag and with static linking enabled.

 _"...Inline a function in a module even when the function is defined in another module..."_ [http://msdn.microsoft.com/en- us/library/0zza0de8%28v=vs.80%2...](http://msdn.microsoft.com/en- us/library/0zza0de8%28v=vs.80%29.aspx)

<comment><USER3> Is anyone working on a JIT for object code? I'm thinking we could keep all our SO's how they are now since they are great for updating versions of libraries with bugs, but have a JIT that takes care of profiling and inlining functions from other modules.

<comment><USER4> LLVM is designed to be able to do this.

</comment></comment></comment></comment></comment><comment><USER5> Since we're comparing apples to oranges anyway, how fast _could_ it be if you really wanted to format "%d %d" into the stack 10 million times without a function call... Just for fun:

      int main() {
          static const char* digits = "0123456789";
          int i;
          for (i = 0; i < 10000000; i++) {
              char x[44], *p = x, tmp[20];

              /* sign */
              int j;
              if (i < 0) { *p++ = '-'; j = -i; } else { j = i; }

              /* number */
              int pos = 0, spos;
              do {
                  tmp[pos++] = digits[j % 10];
                  j /= 10;
              } while (j != 0 && pos <= 20);
              spos = pos;
              do { *p++ = tmp[--pos]; } while (pos > 0);

              /* space, sign, number again */
              *p++ = ' ';
              if (i < 0) *p++ = '-';
              do { *p++ = tmp[--spos]; } while (spos > 0);
              *p++ = '\0';
          }
      }

      $ gcc -O4 -o s s.c
      $ time ./s
      real    0m0.140s
      user    0m0.138s
      sys     0m0.001s

<comment><USER6> That runs in ~0.4s on my system (Xeon E5520, 2.27GHz), but replacing the 'digits' lookup table with simple arithmetic on the ASCII values ('0' + j%10) speeds it up to ~0.23s. Yes, L1 caches are pretty fast, but ALUs are still faster (for integer addition anyway).

Edit: This was with GCC 4.1.2, newer versions probably optimize differently, so who knows.

<comment><USER5> Interesting.. I guess I should have mentioned gcc 4.5.2 on a Xeon X5670, 2.93GHz, which is 12M cache. Changing it to ('0' + j % 10) has no change in overall speed for me.

<comment><USER6> OK, I just tested with gcc 4.6.0, and unless I've screwed something up, it looks like (at -O4) it actually optimizes these into the _exact_ same code. As in the generated ELFs are byte-for-byte identical. Impressive.

<comment><USER5> Since you showed interest, using this as the for loop tweaks it even a bit more :)

      /* temp number */
      char tmp[20];
      int pos = 0;
      int j = i > 0 ? i : -i;
      do {
        tmp[pos++] = '0' + j % 10;
        j /= 10;
      } while (j != 0 && pos <= 20);

      /* output both numbers simultaneously */
      char x[44], *p1 = x, *p2 = x + 1 + pos;
      if (i < 0) { *p1++ = '-'; *p2++ = '-'; }
      do {
        int tpos = --pos;
        *p1++ = tmp[tpos]; *p2++ = tmp[tpos];
      } while (pos > 0);
      *p1 = ' ';
      *p2 = '\0';

<comment><USER6> Well, if you _really_ want to go apples-to-oranges and specialize as much as possible for the sequentially increasing case we're dealing with here, you could just do your arithmetic directly on the ASCII string itself, complete with a little ripple-carry loop...I bet _that_ 'd be fast. If I'm remembering correctly, I think x86 actually has dedicated instructions for ASCII arithmetic (though they're probably so unoptimized in a modern microarchitecture it'd probably be faster to avoid them).

</comment></comment></comment></comment></comment></comment><comment><USER7>
        char x[44];
        sprintf(x, "%d %d", i, i);

_This is fine, except you can't even return x from this function, a more fair comparison might be:_

         char * x = malloc(44 * sizeof(char));
         sprintf(x, "%d %d", i, i);*

There is a standard (C99) way to do this: asprintf(3).

        char *x;
        asprintf(&x, "%d %d", i, i);
        return x;

<comment><USER8> There is no asprintf function in my copy of the C99 standard.

<comment><USER7> Sorry, you are correct; I mis-read the man page. It is however in at least glibc and Darwin/FreeBSD's libc.

</comment></comment></comment><comment><USER9> The pypy guys continue to do amazing work. This project is one of the reasons why I believe the python community is one of the best open source communities out there: Let's work on something incredibly difficult, challenging and something that not long ago was considered to be nearly impossible, and produce incredible results.

If you're not running pypy in production already, then you probably should be[1].

[1]: Yes, there are some obvious exceptions.

edit: formatting.

</comment><comment><USER10> Re:

> GCC is unable to inline or unroll the sprintf call, because it sits inside > of libc.

If I'm understanding [http://gcc.gnu.org/onlinedocs/gcc-4.5.3/gcc/Other- Builtins.h...](http://gcc.gnu.org/onlinedocs/gcc-4.5.3/gcc/Other- Builtins.html) correctly, sprintf should be handled as a built-in function, rather than linking the libc version, unless you explicitly specify -fno- builtin. In theory that should allow gcc to perform various optimizations; I've seen that happen with _printf_ at least, where e.g. printf-ing a constant string just gets compiled to _puts_.

<comment><USER11> Perhaps it is recognizing it, but it's not doing anything interesting with that knowledge, on my machine GCC emits a call to "__sprintf_chk"

<comment><USER12> There's nothing really stopping gcc from doing as well here, since it ought to be able to spot that the format string never changes & roll out a custom sprintf() that doesn't need to parse it every time. However, right now gcc doesn't do that, so it loses to a language implementation that does.

The really sad thing is that using an ostringstream in C++ is even worse, despite the fact that C++ has all the types available to it & doesn't need to parse any format strings at all: Not enough template metaprogramming clearly!

</comment></comment></comment><comment><USER13> I'm no python developer but this:

 _def main():

        for i in xrange(10000000):

            "%d %d" % (i, i)

main()_

Does't seem to be copying the result anywhere. Where as the C example is copying the result to memory .. which would explain why it is slower.

<comment><USER13> Oh and does anyone else think the malloc example in comparison to actual garbage collection is incredibly unfair?

<comment><USER11> I've long since lost track of what it means for a comparison between languages to be fair. To put that a different way, how should we have compared them? Should we have downloaded some GC library for C to implement it?

<comment><USER13> I guess the real problem is that the example serves no real world purpose and can very easily be biased. See my response to scott_s below.

</comment></comment></comment></comment><comment><USER14> Sounds like this would be the equivalent of some theoretical

        exp = CompileSprintfFormat("%d %d");
        for (i = 0; i < 10000000; i++) {
            RunCompiledSprintf(exp, i, i);
        }

All I'm really getting out of this is that PyPy now compiles sprintf formats for you and saves the results, and that there's no equivalent API in libc.

<comment><USER15> That's not really it. This, at least in my understanding, is a fully _generic_ optimization, of operations on constant strings.

<comment><USER14> From the article:

> In the case of PyPy, we specialize the assembler if we detect the left hand > string of the modulo operator to be constant.

So it's very much a targeted optimization at the modulo operator (which is Python's equivalent of sprintf).

<comment><USER11> I wouldn't say it's particularly targeted, let me show you the code that makes this happen: [https://bitbucket.org/pypy/pypy/src/unroll-if- alt/pypy/objsp...](https://bitbucket.org/pypy/pypy/src/unroll-if- alt/pypy/objspace/std/formatting.py#cl-288)

<comment><USER12> Yeah, the point is that by expressing the algorithm in Python, the JIT gets to go hog wild optimising tight loops like this one.

Which is great: why do all that work writing some kind of custom sprintf generating function when you can just let the JIT do it for you on the fly?

</comment></comment></comment></comment></comment><comment><USER16> Why don't you take an example from Mike Pall's LuaJIT relying on something more computationally expensive like scimark - he has lua version, and also few other benchmarks (from the alioth site).

If you really want fast sprintf( %s, "%d %d" ) - then you might aswell craft something specifically for converting text to decimal numbers.

sprintf( ) is convenience function, not performance.

<comment><USER17> I'm sure that's one of the larger goals of PyPy, to make idiomatic code that is convenient to write also perform well. They don't have to be mutually exclusive.

</comment></comment><comment><USER18> What the example shows is that specializing string operations for known inputs can be faster than not doing so. Surprise!

But going from this to "PyPy is faster than C" seems quite a stretch, no?

</comment><comment><USER19> > compiled with GCC 4.5.2 at -O4 (other optimization levels were tested, this > produced the best performance).

I was under the impression that any number greater than 3 had no effect?

</comment><comment><USER20> Why be so shy? Faster than Assembly language! Faster than Assembly language with cache size alignment and padding of data structures! ^_^

</comment><comment><USER21> If PyPy were really smart, it would notice the unused result and take 0.00s. :)

</comment><comment><USER22> How did they measure this? How would it compare to C#. I'm assuming they ignore the startup time of course.

</comment><comment><USER23> This title is misleading; instead of `C` it should use `CPython`.

<comment><USER24> Why would it use that title? CPython is a part of some of the numbers, but the comparison is C vs. PyPy.</comment></comment>


Riot's magical push notifications in iOS - <AUTHOR> https://karp.id.au/a/2016/12/11/riots-magical-push-notifications-in-ios/ <comment><AUTHOR> For open source chat applications like RocketChat and Mattermost it is a struggle to get push notifications for self hosted installations. It is cool to see that with Matrix you can use any compatible app and get them from your self hosted installation.</comment>


First release of dav1d, the AV1 decoder - <AUTHOR> http://www.jbkempf.com/blog/post/2018/First-release-of-dav1d <comment><USER2> I am thinking if H.264 AVC will be like Jpeg, where the worse is actually better. They are ubiquitous, and hardware decode in visually all Smartphone, and seems to be good enough for a lot of cases (non-4K usage).

But it is still nice to see AV1 coming along, especially coming from VLC (dav1d) and Xiph ( rav1e ) .

<comment><USER3> Agreed, but I'm very curious which codec (h265 or av1) will eventually "win" in the 4K+ and HDR space.

<comment><USER4> Perhaps AV1 will in the loooong term, but as of today h265 is what every 4K Blu-Ray uses and just about every modern device has a hardware decoder. So that's gotta count for something.

<comment><USER5> H.265 is a much worse patent minefield than h.264 ever was: the h.265 patents are owned by different patent pools with different licensing terms, some of which even without revenue cap.

The only way to relatively safely produce h.265 content is to be one of these companies in one of the patent pools.

AV1 in contrast is supposed to be free of patents and open for everybody to use. Of course there could still be some patent being violated and there's no legal entity to fight for you if you get sued, but given the mess around h.265, this might still be the better option.

AV1 is backed by multiple soft- and hardware manufacturers, so between that, the free licensing, and the legal murkiness of h.265, this might yet take off.

I certainly hope so. It would be the first time in decades that the best media codec is also patent free and useable by everybody.

<comment><USER2> >AV1 in contrast is supposed to be free of patents

It is not, it never was, and never will be. It is only Royalty Free.

<comment><USER6> "free of patents" is like atomic hydrogen; a very short lived state in practice.

<comment><USER7> Ummm...kinda the opposite? The terminal value is always "patent free" :-)

</comment></comment></comment></comment></comment></comment></comment><comment><USER8> Two recent discussions:

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

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

</comment><comment><USER9> how are the optimized encoders coming along? last i remember it was 1000x slower to encode than typical.

<comment><USER10> Last I saw, the official AV1 encoder had gone down to 16x slower than VP9, but that was a couple of months ago so things might have improved further.

Also there's rav1e which bodly claims to be the fastest (and safest) AV1 encoder, but it's still in early development so it probably doesn't make any sense in benchmarking it at this stage.

</comment></comment><comment><USER11> When is this coming to Firefox?

<comment><USER12> I tried it out in Firefox 65 beta. You can enable dav1d via about:config by setting "media.av1.use-dav1d" to true.

dav1d seems to perform worse than libaom for me on some videos I tried. I have a 2014 MacBook Pro with a 2.2ghz Haswell i7 (i.e. with AVX2).

Firefox using libaom struggles to play YouTube AV1 video at 1080p60 on my system. It gets to a point where it drops too many frames and the video becomes unwatchable. For example:

[https://www.youtube.com/watch?v=Fmdb- KmlzD8](https://www.youtube.com/watch?v=Fmdb-KmlzD8)

I hoped dav1d would perform better than libaom on that particular video at 1080p60, but if anything it performs worse.

I'm not clear if that video is 8-bit or 10-bit color. If it's 10-bit color then that would explain it because dav1d is not optimized for 10-bit video yet.

<comment><USER13> > dav1d seems to perform worse than libaom for me on some videos I tried.

As far as I know, the Firefox buildsystem does not compile dav1d with asm yet. So, that is expected, for now.

<comment><USER12> Ah, that explains it then. Thanks.

Hopefully they'll enable the asm code during Firefox 65 beta.

</comment></comment></comment></comment><comment><USER14> That typo in the first bullet of the "Release" section is really bothersome to me oddly. Less know ones... less know... know... blah

<comment><USER15> That's the trouble with spellcheck. It can't tell you that you are using the incorrect real word.

<comment><USER16> There are grammar checkers that can pick up on those errors. Microsoft Word has one built in (green underline versus red).</comment></comment></comment>


The Hilbert Hotel - <AUTHOR> http://opinionator.blogs.nytimes.com/2010/05/09/the-hilbert-hotel/

<comment><USER2> Well, since my baby left me/ I found a new place to dwell/ There's infinite capacity at Hilbert Hotel/ There's always room there, baby/ There's always room there/ There's always room there for one more...</comment>


Rust Ownership Explained with Python - <AUTHOR> https://paulkernfeld.com/2018/09/16/ownership-explained-with-python.html# <comment><USER2> Not that it really matters, but since he lamented that the second Python solution was "longer and less elegant", I'll point out that that algorithm can be written in a functional style that is both short and (IMO) somewhat elegant. However with reduce being removed as a built-in since Python 3, this is arguably not Pythonic.

        from functools import reduce

        squares = (x * x for x in range(10))

        min_and_max = lambda current, x: [min(current[0], x), max(current[1], x)]
        minimum, maximum = reduce(min_and_max, squares, [next(squares)]*2)

        print(minimum)
        print(maximum)

<comment><USER3>
        squares = [x * x for x in range(10)]
        print(min(squares))
        print(max(squares))

this one works and looks good.

<comment><USER4> range(10) doesn't properly demonstrate the material differences between generators and lists.

Like posted elsewhere, tee is an appropriate solution that preserves the generator's benefits over a list. It's too bad that the example is so synthetic.

<comment><USER2> One downside of both solutions is that they both traverse the list twice, which could be expensive when we're talking about real data and not toy problems.

</comment></comment></comment></comment><comment><USER5> The Python problem can be solved with `itertools.tee`[0]

        from itertools import tee
        squares_min, squares_max = tee(x * x for x in range(10))
        print(min(squares_min))
        print(max(squares_max))

[0] [https://docs.python.org/3/library/itertools.html#itertools.t...](https://docs.python.org/3/library/itertools.html#itertools.tee)

<comment><USER3>
        squares = [x * x for x in range(10)]
        print(min(squares))
        print(max(squares))

this one works and looks good.

<comment><USER6> It will have memory impact though with larger range.

A better approach might be:

        squares = lambda: (x * x for x in range(10))
        print(min(squares))
        print(max(squares()))

<comment><USER7> Yes, your solution is in the original post, under the heading 'Python solutions':

      def squares():
          return (x * x for x in range(10))

</comment></comment></comment></comment><comment><USER8> As a Rust beginner I am not quite sure why .min() is supposed to take ownership and change the sequence. I would assume it does nothing with the sequence except read it.

<comment><USER9> Sequences can be generated at runtime, and it may even be impossible to "regenerate" them (think for instance reading bytes from the network).

Therefore, just reading that sequence changes (consumes) it.

<comment><USER10> And of course for things that _can_ be iterated over multiple times, it's likely possible that you can (re)generate the iterator. E.g. this compiles fine:

        fn main() {
            let squares : Vec<u32> = (0..10).map(|x| x * x).collect();
            println!("{:?}", squares.iter().min()); // Some(0)
            println!("{:?}", squares.iter().max()); // Some(81)
        }

Edit: Or a smaller change to the original, you can add a single .clone():

        fn main() {
            let squares = (0..10).map(|x| x * x);
            println!("{:?}", squares.clone().min());
            println!("{:?}", squares.max());
        }

This clones the std::iter::Map<std::ops::Range<i32>>. Unlike the vec version, this will re-evaluate the |x|x*x sequence when .max() is called.

There's no technical reason Map<Range<i32>> couldn't be made to implement the Copy trait, which would make the extra .clone() here unnecessary - but Rust's standard library has chosen to force you to make an explicit choice instead.

<comment><USER11> Curiously, C# provides the behavior one would expect.

It does so by distinguishing IEnumerable<T> [1], and IEnumerator<T> [2]. The first would be the result of the map call (Select in C#'s LINQ), representing a sequence, that could be generated, and the later is the one, that actually generates it one by one, and has to be consumed.

I wonder why Rust did not take C#'s approach.

[1] [https://docs.microsoft.com/en- us/dotnet/api/system.collectio...](https://docs.microsoft.com/en- us/dotnet/api/system.collections.generic.ienumerable-1)

[2] [https://docs.microsoft.com/en- us/dotnet/api/system.collectio...](https://docs.microsoft.com/en- us/dotnet/api/system.collections.generic.ienumerator-1)

<comment><USER12> Can you be more specific about what behavior from the Rust code you find unexpected, in comparison with C#?

<comment><USER11> Exactly the consumption part. Perhaps I don't understand Rust library, and there's another stuff to do it right.

In C# Enumerable.Range and .Select (e.g. .map) internally create an immutable instance, that implements IEnumerable<T>, that describes what will have to be returned.

Then .Min internally takes IEnumerable<T>, calls its .GetEnumerator, that actually returns something, that can be consumed once and has a mutable state, and finds the minimum by actually consuming that iterator (all internally).

<comment><USER10> I'd say the distinction is that Rust's .min() is implemented on the equivalent of IEnumerator<T>, Iterator - instead of the equivalent of IEnumerable<T>, IntoIterator. This makes it slightly more flexible, since you can always get the former from the latter by calling GetEnumerator(), but not vicea versa (without filling a container with it first or something.)

If C# also implemented Min on IEnumerator<T>:

        var enumerator = collection.GetEnumerator();
        var min = enumerator.Min();
        var max = enumerator.Max(); // Runtime bug: Min() already the entire enumerator!  InvalidOperationException?

There's basically nothing useful you can do with 'enumerator' after the first call to this hypothetical Min. Rust's stdlib tries to catch this bug by having min take ownership of/consume 'enumerator', instead of merely borrowing it, so you can't use it again:

        let iter = collection.iter();
        let min = iter.min();
        let max = iter.max(); // Compile time error: iter used after move

In C#, basically everything that can be is an IEnumerable<T>, and the stdlib is built around that fact. Does System.IO.File.ReadLines hit disk every time you re-enumerate it? Or does it store to a container? Many of the stream based APIs have a .ReadLine() method but no .ReadLines() method, presumably because they'd have to allocate a container to store the result in case enumerable be re-evaluated multiple times, and that seems bad if you don't need it?

Rust seems to lean a lot more heavily on single-shot iterators.

        let lines = stdin.lock().lines();
        for line in lines { ... }
        for line in lines { ... } // Compile time error: lines moved.

        let lines = BufReader::new(File::open("input.tsv")?).lines();
        for line in lines { ... }
        for line in lines { ... } // Compile time error: lines moved.

"Does lines() hit disk/stdin every time you re-enumerate it?" is a trick question: You _can 't_ re-enumerate it.

You can resolve these errors by being explicit about storing the input in a container and iterating that multiple times, or by re-opening the input file, or by resetting the File position and constructing a new BufReader, depending on which behavior you wanted for re-enumeration.

</comment></comment></comment></comment></comment></comment></comment><comment><USER13> It's definitely _harder_ in the general case to run into these bugs, but the real trick, in my opinion, is building APIs where it's impossible.

The 'escape hatch' here is the .by_ref() but you could, if it's critical, write wrappers that don't provide those escape hatches.

If it were critical that the reuse never happened you can make it impossible, which is really cool. But, by default, for most APIs, it's just generally more difficult to mess up.

There are a bunch of articles on session types out there, where you represent each state in a state machine as a separate type, with transition methods that consume the previous state. If the correctness touted in this article sounds appealing, I highly recommend reading about session types.

</comment><comment><USER14> Isn't the property of the generator expression not that it is an iterator (like a range or list also are) but specifically that it is a generator and thus inherently has state that is permanently/mutably exhaustible across different scopes? I like the example, and this is the first time I've totally wrapped my head around Rust ownership, so thanks! I just think precise Python terminology might keep people from getting confused about different types of Python iterator objects. Iterators are anything that has a __next__() method: [https://www.python.org/dev/peps/pep-0234/](https://www.python.org/dev/peps/pep-0234/)

<comment><USER7> "it is an iterator (like a range or list also are)"

No, range is not an iterator. Try this in either python 2 or 3:

      a = range(10)
      a.next()

It will fail. Now try this:

      a = range(10)
      my_iterator = a.__iter__()
      my_iterator.next()

"Iterators are anything that has a __next__() method"

Right, and range(10) does not have a __next__() method, so it's not an iterator. It's an iterable, which is anything which has a __iter__() method that returns an iterable.

In python 3, range(10) returns a range object (not a list). Because it's an iterable and not an iterator, it doesn't get 'used up'. For example, try this (in Python 3 only):

      a = range(1000000000) # returns instantly, as it's not building a list
      a[3] # returns 3
      a[3] # returns 3 again

</comment></comment><comment><USER15> I remember seeing a visualization of the variables and values in a python program as it ran and how they get linked to one another and that really helped me understand python variables. Does such a visualization exists for Rust?

I'm gonna try to hunt the link for the Python one.

<comment><AUTHOR> Python tutor [http://www.pythontutor.com/visualize.html#mode=edit](http://www.pythontutor.com/visualize.html#mode=edit)?

<comment><USER15> Yes! thank you!

This helped a lot for understanding the behavior of list vs other values, for example:

[http://www.pythontutor.com/visualize.html#code=a%20%3D%204%0...](http://www.pythontutor.com/visualize.html#code=a%20%3D%204%0Ab%20%3D%20a%0Aa%20%3D%2010%0Aprint%28a,%20b%29%0A%0At%20%3D%20%5B1,2,3%5D%0As%20%3D%20t%0At.append%284%29%0Aprint%28t,%20s%29&cumulative=false&curInstr=0&heapPrimitives=nevernest&mode=display&origin=opt- frontend.js&py=3&rawInputLstJSON=%5B%5D&textReferences=false)

I think it would do wonders for ownership.

</comment></comment></comment><comment><USER16> I really enjoyed reading this, I thought the author made these very accessible.

Perhaps the author might consider writing posts on both traits and lifetimes?

Understanding ownership, traits and lifetimes seem to be the keys to understanding and using Rust effectively. Unfortunately these are also the things I've had the hardest time getting my head around. If anyone could suggest similarly accessible articles on traits and lifetimes I would greatly appreciate it. Cheers.

</comment><comment><USER17> I can't comment on the general case, but I disagree very strongly with the author's perspective about generator expressions here.

First, a generator is a precise type of data structure that can be exhausted. If you don't want that, don't use that structure. It's foolish to say that just because a data structure superficially satisfies some API (like being passable to min), that it "ought to have" some behavior that the author wants. That's backwards. If you want certain behavior, choose a data structure that supports it.

It would be no different from saying if I have a heap and I call sort() it is faster than if I have the same data in a list and call sort(). They both support sort() so why aren't they equally fast? It's obviously the wrong way to think about it. Instead, use the appropriate data structure.

And if you're really worried about the operation being safe, use the provided default argument, or the pattern for versions before 3.4, as in [0], or write a wrapper function that catches whatever exceptions and handles them.

This isn't even the biggest issue though. Generators generally are meant to function as coroutines and for complex generators, you can use send() to set the "returned value" of a yield statement inside the generator for when it resumes, and so a single generator could go through stages of being exhausted and empty, then having a value set again so that on resumption it's no longer empty, and could build back up a whole iterable of data that way.

So you absolutely do want min() or max() to throw errors when trying to consume from an empty generator, and you absolutely do want a generator's state to become modified by the way values are consumed or added, because it meaningfully represents the state of the generator. Suppose for a more complex generator, someone uses send() to feed it a value between your call to min() and your call to max().

Generator expressions that superficially look like list comprehensions are just one use case of the general data structure and in fact one of the "generators 101" pieces of advice you always see is that if you need to iterate the values multiple times, then populate a persistent data structure out of the generator, like by wrapping in list().

I bring this up because it frustrates me to see people acting like a type safety or borrow checking idea is somehow aadding something new or solving some type of problem that the dynamic typing approach doesn't or can't solve, but this is emphatically incorrect and a severely myopic way to look at it.

The dynamic typing approach solves all the same problems, it just facilitates the solution differently: use the default argument or other patterns for safety on functions that can fail on empty containers, and use custom wrappers with exception handling when you need to. Choose a persistent data structure if you need persistence.

Again, not saying this has anything to do with people's big picture reasons for liking static types or borrow checking... just this particular example strikes a chord to me highlighting the super annoying myopia about it.

[0]: < [https://stackoverflow.com/questions/36157995/a-safe-max- func...](https://stackoverflow.com/questions/36157995/a-safe-max-function-for- empty-lists) >

<comment><USER18> > It's foolish to say that just because a data structure superficially > satisfies some API (like being passable to min), that it "ought to have" > some behavior that the author wants.

I disagree. There is also a concept of "principle of least surprise". To take an extreme example, let's say you wrote a standard library where push!(array, item) actually takes the array and deletes it. Would it be foolish to say this is bad design because it shouldn't "ought" to have some behavior, it's up to the user to know what's going on under the hood?

<comment><USER17> That's a silly abuse of the idea of least surprise. Documented, long-lived built-in data structures like generators that support behavior like exhaustion and mutation in a time-tested way are _clearly_ not some kind of surprising and useless or pedantic quirk.

I mean, consider implicits in Scala. It's hard to think of a worse violation of least surprise, but because it's documented and time-tested and becomes a de facto standard in that language, the argument of least surprise becomes nothing but a preference debate.

The behavior where max raises an exception on an exhausted generator is not at all surprising, from the point of view of language documentation, ubiquitous and popular advice on that data structure, etc. etc.

And besides all that: if you did happen to find a serious design bug that created a surprise problem, there are tons of ways to solve that problem in a dynamically typed language that wouldn't require static typing or borrow checking or any explicit state management. It still would not be evidence that those things are a superior way to solve it.

</comment></comment></comment><comment><USER19> For me Rust ownership _clicked_ when I was reading a C++ book. More specifically the sections about references, move and copy.</comment>


Wanna find out how your elevator pitch sounds like? - <AUTHOR> https://www.despeak.com/mirror <comment><AUTHOR> You can directly record from your phone.</comment>


Raytracing a menger sponge in 512 bytes of HTML5 - <AUTHOR> http://www.p01.org/releases/512b_jspongy/jspongy.htm

<comment><USER2> Very impressive demo. I'd really like to see a non-obfuscated version though; I feel like the utility of a good HTML5 example is higher than the utility of seeing how small it can be made.

<comment><USER3> Here; I un-obfuscated it and commented the HTML5 parts for you. I leave the hardcore maths for you to unravel, 'coz maths on this level aren't my thing :-)

There isn't really anything "HTML5" about this demo - it only uses the Canvas feature to output the rendered image on the screen, which can also be done in other non-HTML5 ways (although not as fast):

      <html>
      <head>
      <script type="text/javascript">

      // we need to output the canvas tag here, in order to make the js engine
      // instantly aware of the "R" id so that the canvas can be addressed at once
      document.write( '<canvas id="R" width="64" height="64" style="width: 4in; height: 4in; background: #ffffff;">' );

      // array N and object K now exposes an API for interacting with the canvas
      var N = [ K = R.getContext('2d') ];

      // pulls image data from x/y 0,0 w/h 64,q of canvas K into ImageData object I
      for( t = B = 127, I = K.getImageData(0, 0, q = 64, q); t--; $ = Math.cos )
      {
          N[t] = t / 43 & 1;
      }

      function sponge()
      {
          t++;
          for( i = y = -1; y < 1; y += A )
          {
              for( x = -1; x < 1; x += A = 1/32, I.data[i += 4] = h + h )
              {
                  for( m = C = $(a = t / 86),
                       S = $(a + 8),
                       c = $(b = t / B),
                       s = $(b + 8),
                       u = x * C + S,
                       v = y * c - u * s,
                       u = u * c + y * s,
                       w = C - x * S,
                       X = q + 9 * $(a + b),
                       Y = q + 9 * $(b - a),
                       Z = t,
                       h = B; --h && m < q; X += u, Y += v, Z+= w )
                  {
                      for( m = 1; N[X * m & B] + N[Y * m & B] + N[Z * m & B] < 2 && m < q; m *= 3);
                  }
              }
          }
          // render ImageData object I onto canvas K, at x/y position 0,0
          K.putImageData( I, 0, 0);
      }

      // try to run the frame renderer, sponge(), once every 20 milliseconds
      setInterval( 'sponge();', 20 );

      </script>
      </head>

      <body bgcolor="#000000" text="#ffffff">
      </body>
      </html>

<comment><USER4> I'd replace setInterval( 'sponge();', 20 ); with setInterval( sponge, 20 );

Eliminates the overhead of eval().

</comment></comment></comment><comment><USER5> Wow! That pegged my CPU. The fan increased speed three times!

<comment><USER6> Your computer would have exploded if it had been in Flash then :)

<comment><USER7> stop spreading that nonsense. flash isnt slow. although the mac version is shit - i'll give you that.

<comment><USER8> Every computer and browser combination I've ever had slows way down whenever Flash is involved, except for my gaming rig. I shouldn't need a quad-core processor to watch videos.

<comment><USER9> What does Flash playing video have to do with raytracing in AS3? The AVM has nothing to do with the video decoding in Flash.

<comment><USER9> Well, as it happens, this does indeed run incredibly badly in Flash. I didn't try to optimize it at all (I probably couldn't anyway) and it ran at about 8fps, whereas the JS runs at about 12-15 in Chrome.

</comment></comment></comment></comment></comment></comment><comment><USER10> wow, i love this. actually, i always found it amazing what people can do in 512b/4kb/32kb, it's awesome!</comment>


Ask HN: Best tool to collect performance metrics - <AUTHOR>

What are the state-of-the art tools to collect software performance metrics such as API response times, upstream latency, etc.? I'm looking for something that's easy to integrate (e.g. SNMP, syslog or some other type of queue).<p>We've been using Cacti in the past but prior to deploying that again I wanted to check if anybody has experience running something else. <comment><USER2> To really give you a good answer I would need to know the size of your network. If you have a small network cacti might be your best bet, but as soon as you get to large deployments you have a better shot at justifying a comercial product which will offer more features tehn cacti.

For small networks

Cacti Cube ( <http://square.github.com/cube/> ) Graphite ( <http://graphite.wikidot.com/> )

For large networks I am going to be biased towards SevOne ( I work there )

SevOne ( <http://sevone.com> ) SolarWinds ( <http://solarwinds.com> ) OpenNMS (<http://opennms.org> )

<comment><AUTHOR> Thanks - our network is fairly small with not more than 10 boxes. Graphite looks good, I'll check the documentation.</comment></comment>