Government Builds Free Cloud-Based Backup for an Ungrateful Nation - <AUTHOR> https://medium.com/surveillance-state/a6e0e5fca935 <comment><USER3> Medium, a better place to read things…that show up in the bathroom stalls at the Onion? And, on the HN frontpage, apparently.

<comment><USER4> Awe, dude... I thought it was funny.

<comment><USER3> Somewhat amusing, maybe. Front page amusing? 74 points amusing? Goodness no, not when e.g. [http://this-plt-life.tumblr.com](http://this-plt- life.tumblr.com) has only ever gotten 4.

</comment></comment></comment><comment><USER5> Cute, yes. I'm honestly confused on why some others are complaining about the satirical nature of the piece. Seems just what some people might need at this point...

</comment><comment><USER6> I've been wondering why hard drive prices haven't gone down to pre-flood prices.

Apparently the NSA has been buying every platter available via unlimited taxpayer dollars.

Sounds like a joke but think about it...

<comment><USER7> When I look at the multi-billion dollar NSA datacenter in Utah... I can't help but realize that the annual IT budget at Google or one of the big financial companies dwarfs that number, and does so every year.

<comment><USER8> Sorry, bit confused - are you saying that NSA is spending more than Google / CitiBank or the other way round?

<comment><USER7> Sorry, my point is that Google and Goldman Sachs et al spend several times the NSA's big multi-year project every single year.

As in, that datacenter ran the NSA ~$2 billion to build, but those companies are spending several times that every year on IT alone.

I'm reminded of the SEC whose yearly budget is several times smaller than even a single large banks IT budget.

I guess the NSA could have as astronomical black budget and is creating such an enormous amount of hidden demand that the market is that effected... but where's the datacenters holding that market-shifting amount of harddrives?

Even the one being built isn't as impressive as some of the Google/Facebook datacenters popping up, so it seems ridiculous to me that the US Gov is affecting HDD prices when Google/Facebook/Banks et al are not.

<comment><USER8> Good point - thank you. I suspect you are right in orders of magnitude - <USER2> will not really know the exact figures, but I suspect that Intel suddenly building a new plant to cope with demand that no-one can explain would get noticed by the financial analysts (well, the good ones anyway)

</comment></comment></comment></comment></comment><comment><USER9> I've been using this service for a while now, but haven't been able to get a restore to work. My data comes back with large parts of it blacked out -- no idea why. Has anyone else been able to do a successful restore?

</comment><comment><USER10> > "safely stores all American's phone and email contacts so that they can be > retrieved at any time in the future"

Right. I know it's a joke, but this type of joke is starting to get on my nerves, considering how far from reality it is.

[http://www.dailykos.com/story/2013/07/06/1221694/-NSA- Reject...](http://www.dailykos.com/story/2013/07/06/1221694/-NSA-Rejecting- Every-FOIA-Request-Made-by-U-S-Citizens)

</comment><comment><USER11> Not that I condone the NSA's practices in any way but it's interesting to think of how some of this data might serve as a historical record of our daily lives in the future.

Never before have there been such detailed records of public and private communications, websites, photos and who knows what else the NSA has flagged for "permanent storage." Archive.org could only dream of having so much ephemeral data and the capacity to store it.

<comment><USER12> _Archive.org could only dream of having so much ephemeral data and the capacity to store it._

Jason Scott must have the most awkward boner right now...

</comment></comment><comment><USER13> >> A few thousand Americans are currently enrolled in a beta phase version of the program that would successfully backup all of their data.

That beta program went live in 2006. [http://www.wired.com/threatlevel/2007/05/mark_klein_docu/](http://www.wired.com/threatlevel/2007/05/mark_klein_docu/)

</comment><comment><USER14> Interesting example of how not having the title in the url hurts share-ability (even though that was originally done for seo). I pasted this link to friends, but had to provide a followup paste of the title.

</comment><comment><USER15> Thanks Obama!

</comment><comment><USER16> a lot of my friends knew nothing about the NSA illegalities going on. if they read this, they probably wouldn't get that it's a joke. They'd start searching for the sign up page online... i need new friends

</comment><comment><USER17> * Nations

</comment><comment><USER18> Medium offering up satire?

What's next? "Obama Goes 'All the Way' to Prove to Americans Just How Wrong the Bush Administration's War on Terror Is: NSA Scandal a Lesson in Absurdity".

<comment><USER19> True satire is very welcome, especially considering the sad state of public opinion.

<comment><USER18> I enjoy satire that strikes my subjective determinants of _good satire_. But what exactly is _true satire_? Do you mean satire that actually exposes and criticizes people's stupidity in the context of contemporary politics and culture? Cos if so, this post misses that mark.

I was unaware, before this post, that Medium even had the 'Pulling Pranks' section. This piece, however, strikes as less good than what I'd read in _The Onion_ \--and even that is more comedy than satire, most times.

</comment></comment></comment><comment><USER20> Cute.</comment>


Ask HN: Where can I find a list of *all* libraries/technologies? - <AUTHOR> Hi -
I'm looking for a list of libraries/technologies like Node.js, nginx, Apache, ElasticSearch etc.
Has anyone compiled such a list already? Thanks a lot! <comment><USER2> [https://libraries.io/](https://libraries.io/) \- "Libraries.io monitors 1,057,223 open source libraries across 29 different package managers. You can discover new libraries to use in your software projects as well as be notified of new releases to keep your applications secure and up to date. "

</comment><comment><AUTHOR> Thanks a bunch. Wasn't aware of the awesome-* repositories.

</comment><comment><USER3> search awesome <<whatever>> in github

<comment><USER4> Yes, [https://google.com/search?q=github+awesome+-font](https://google.com/search?q=github+awesome+-font)

<comment><USER5> Yep, or just browse through some curated lists here if you'd rather (scroll down and read through the readme):

[https://github.com/sindresorhus/awesome](https://github.com/sindresorhus/awesome)</comment></comment></comment>


Programming Is Like Sex - <AUTHOR> http://codesnipers.com/?q=node/440

<comment><USER2> Wow. Add a few puns and one C-C-C-C-Combo Breaker, this could be a comment thread on reddit. That ain't a good thing.

<comment><USER3> Yeah, this is worrying. A crap link and a crap thread, and it's number 2.

The fundamental problem on any site like this is that it's so easy to upvote lightweight stuff. When a link sounds like it's going to take a while to read, people say "maybe I'll read it later," and never do. And since they haven't read it, they don't upvote it. Whereas e.g. a cartoon people know will only take a few seconds, so they click on it. And if they like it, they upvote it. Sounds harmless enough, right? And yet repeat and the result is a disaster.

What is the solution? The Right Thing would be to somehow scale votes by how easy/hard it is to vote on something. Or I could add a downarrow on stories for users over a certain karma threshold.

<comment><USER2> The downarrow is a good idea, until you start to consider the cabal of greasmonkey jerks auto-downvoting everything on the new page that wasn't submitted by one of their cretin brethren. Perhaps there could be some kind of difficulty weight a user inputs when they submit a story. More demanding stories get a 10. Cartoons get a 1. Then give more weight to upvotes on the more complex stories. Obviously, this has the potential for abuse with folks misrepresenting the complexity of their article. But that wouldn't be hard to spot.

<comment><USER3> Another variant would be to have the weight be voted on. Weights only matter for a fraction of submissions, so I wouldn't want to complicate submission by making everyone (especially new users) come up with a weight for what they're submitting.

Maybe it would even be a good idea to have the votes on weights be public, so no one would be tempted to use that as a way of censoring stories.

<comment><USER4> Maybe have the HN software go pull the page that is submitted, and assign it a weight based on number of tokens on the page. Obviously you'd remove stop words and HTML tags.

This would assign lower weights to shorter fluff, and lower weights to articles that are split up over a lot of pages (which in my experience tend to be fluff too, with a 4:1 ad to content ratio). It'd be kind of like Bayesian filtering for post importance.

This was actually one of my ideas for submitting to YC, but I rather like HN, so maybe you could experiment with it here.

</comment></comment></comment></comment></comment><comment><USER5> No, it's not.

</comment><comment><USER6> you wouldn't show your mom your latest trick

</comment><comment><USER7> It's hard to find a good partner outside the bay area

<comment><USER7> The results are messy

<comment><USER7> You're usually not sure which language to use

<comment><USER7> You'd guess Danica McKellar is good at it

<comment><USER8> Although this thread is ridiculous, You get 1 point for a Danica McKellar reference.

</comment></comment></comment></comment></comment><comment><USER7> It gives you hand cramps

</comment><comment><USER7> It's procedural knowledge

</comment><comment><USER9> It's what the internet was created for.

</comment><comment><USER7> I'll take your word for it.

</comment><comment><USER10> Not a perfect analogy though.

For example, I really do prefer to program alone . . .</comment>


Should CS students be graded on performance? - <AUTHOR> http://sbcoded.com/2011/03/should-students-be-graded-on-performance/

<comment><USER2> It depends on the context of the problem:

* If it's being framed as being applied to a small number of items on one machine, I'd mark down for premature optimization. Normally such assignments have a specific point, and going off the deep end with efficiency measuring often misses it.

* If it's being framed as being applied to huge data sets, asymptotic complexity is the metric to go off of.

* If it's being framed as a latency-dependent (UI, servers) then actual timing is the metric to grade off of.

I'd say that if you have an algo that is faster for small numbers, it usually doesn't really matter that it's faster. Small numbers go fast no matter what. Unless it's latency dependent, it's encouraging students to work on things that don't matter at all.

EDIT: spacing EDIT2: spelling

<comment><AUTHOR> When you were in class, where you ever even introduced to the concept that sometimes it might be possible that O() notation might not tell the whole truth? I understand that for the most part you shouldn't have to worry about it, but shouldn't we still warn students about this?

<comment><USER3> Could you explain what you mean a bit more by big O notation not telling the whole truth? Are you referring to the fact that algorithms that look the same in big O notation might have drastically different constants, which can affect real-world performance?

<comment><USER4> It can be worse. A O(n log n) algorithm might be slower than a O(n^2) algorithm for all practical values of n.

Also, one should be careful what to count. Sorting strings, for example, is not quite O(n log n); average string length/expected offset of first difference/whatever should also be in that O().

Along the same line, for many algorithms, cache-locality is more important than number of CPU cycles. So, counting cache misses rather tha cycles can be the better way to judge an algorithm.

</comment></comment></comment></comment><comment><USER5> Aside from teaching big O notation, I would be skeptical of grading for performance. Teaching people that the performance code they write to solve a toy problem _matters_ might lead them to go into industry and then perform microoptimizations on code to solve performance problems when they are _virtually universally_ caused by the interaction of many moving parts.

If you're doing web apps, application code is close to the last place I'd reasonably expect there to be severe performance issues. You're far, far more likely to either blow something architecturally ("We call a foreign API in the request/response cycle.") or flub settings where simple best practices produce repeatable results ("It is 2011 -- do you know where your gzip is?")

</comment><comment><USER6> First, find a better color scheme for something you intend people to read. That was painful.

Second, when I was a CS student I expected to be graded on my response to a particular problem. If you wanted me to roll my own sort, I expect that to be specified. If you want me to explain in comments why I chose certain algorithms say something in class. I'm not going to waste time implementing an efficient sorting algorithm for a 100 element list (or 1000 even) just to provide a TA with a nerdgasm.

I feel this article is asking if students should be graded on an arbitrarily deep rubric. I had enough to worry about as an undergrad without caring if a bored TA was going to dock me 10 points for calling Arrays.sort.

<comment><USER7> _First, find a better color scheme for something you intend people to read. That was painful._

<http://rdd.me/3ltgecrd>

<comment><USER8> On my iPhone safari, readability killed all the big Os, makes the article very hard to follow.

</comment></comment></comment><comment><USER9> YES. My Data Structures and Algorithms class was graded by benchmark (ECS 60, Sean Davis, UC Davis). Being graded this way was one of the most valuable collegiate experiences I've had (I'm a fourth year on the way out).

Sean gives his students two "challenge programs" a quarter. The first program is usually ultimately a matter of picking/optimizing the right data structure. We do graph algorithms by the 2nd half and so the later challenge problem is inevitably some graph algorithm.

The challenges are close to real world problems. For ex., our 2nd challenge program was to determine the maximum # of donations Obama could receive at any one time given a capacitance graph of his website's network topology (I took the class around the '08 election). We had to design, implement, and test everything by ourselves.

I don't agree with the naysayers who suggest that grading this way doesn't teach the really important software engineering tasks. You really had to feel out the problem domain in order to get the best optimization, and it the book answer wasn't always the best answer. Optimization is about a lot more than simply picking the right data structure or algorithm.

Partnering with the crazy russian genius with an 8086 instruction set in his head that quarter made me the C programmer I am today.

TL;DR Grading by benchmark makes students better programmers.

</comment><comment><USER10> The ACM contest has it right: specify the size of the input and the running time available. The program must be able to run an input up to that size in the given runtime. That's it: no more, no less.

At Harvey Mudd College, we have a class based on the ACM which works similarly, though with relaxed runtime constraints: 42 minutes per problem. In practice, you rarely need more than a few seconds, but the 42 minute cutoff (combined with large problem sizes) is a great way to prevent people from using brute-force approaches when there's a smarter option available.

<comment><USER11> 42 minutes? I recall more than one ACM problem that could be bruteforced _just_ within the running time (in C). Actually, I did really badly in one contest because I applied serious mathematics to one such problem (which gave a much faster program, but writing it took a lot of time and fast enough is fast enough.)

<comment><USER10> Sure, some can be bruteforced, but typically it's intentional.

A good example of what I mentioned was an assignment this week. Last week, the input size was constrained to a thousand or so, and Floyd-Warshall was able to solve the problem. This week, it's the same problem, but with inputs up to ~50,000 in size. The old program, run on the new test cases, doesn't finish in a day.

</comment></comment></comment><comment><USER12> No, they should not. Unless performance was one of the assignment requirements.

Performance is rarely on the most important requirement in software development.

If you don't believe me, watch Prof. Leiserson make this point.

[http://ocw.mit.edu/courses/electrical-engineering-and- comput...](http://ocw.mit.edu/courses/electrical-engineering-and-computer- science/6-046j-introduction-to-algorithms-sma-5503-fall-2005/video- lectures/lecture-1-administrivia-introduction-analysis-of-algorithms- insertion-sort-mergesort/)

</comment><comment><USER13> Define performance. The question is ill formed since there is nothing specified to measure. The example wonders who should get the better grade based upon design decisions each of which are defensible in some context. And it's the asymptotic and/or typical behavior that is touted, not the implementation.

At a most elemental level, a program written by a CS student should work, that is, do what it is supposed to do for all legal inputs and provide meaningful diagnostics when it fails. That's hard, but that is the nature of programming.

Finding and choosing algorithms to accomplish a task (well defined or not) is also computer science. That is algorithmics and design. Doing a good job here is harder to measure and depends both a deep understanding of the available building blocks and the problem at hand. Moreover, trade-offs are involved and need to be resolved even though there is little real data to guide decisions. Seeing and exploiting invariant properties of the problem often enables better performance in some dimension; insight there is often called cleverness.

Equally important is the ability to see complex things in a simplified way by introducing abstractions. That's the only way to solve difficult, complex problems, and it is exceptionally difficult to codify.

</comment><comment><USER14> I had a CS Professor who was convinced that he had cheaters in the class(1), so he decided we should all be graded on performance of our programs. This resulted in a lot of stress for a lot of students (C code only, most students taught only Pascal/Modula-2) and some seriously nasty things done in the programs. I rate it a big fail for what we were doing.

I can actually kind of see this for embedded / small device programming. Embedded systems that can't meet their performance goals are useless and buying faster hardware is very costly option.

(1) he also believed not one of us submitted a C program to print "Hello, World!" that worked. It was a 8AM class and I had just driven 120miles (home visiting) through a blizzard to make it to class when he announced this fact in a dramatic fashion. I required calming down.

<comment><USER15> How would grading on performance discourage cheating?

</comment></comment><comment><USER16> Generally, performance isn't interesting in cases where asymptotic running time isn't dominant. You could sort 3 items with a couple of `if` statements, which would compile to a handful of microprocessor instructions. That's not interesting. Surely, in any data structure or algorithms course offered as part of a CS degree, the sorting assignments are for the "general sorting" problem. This implies relatively large data sets (and unpredictable, since you don't expect to be able to use a faster non-comparison sorting algorithm).

</comment><comment><USER17> No. Stuff like this only comes with experience and it's more important to teach students about the fundamental and overarching themes of computer science than to pester them with optimization issues.</comment>


Ask HN: Macbook Pro and Windows XP? - <AUTHOR>

To any existing MB Pro owners: I'm about to buy the MB pro and was wondering if there are any caveats I should be aware of regarding performance and component compatibility when dual booting Win XP and/or Ubuntu on the machine.
Do the trackpad along with things like the mic/camera perform as they are supposed to or is some stuff locked in to OS X?
I tried looking this stuff up but the blogspam is just ridiculous.
Any clarifications are welcome. Thanks. <comment><USER2> The only thing missing in windows that effects me is you can't use the track pad to do things like two fingers to scroll and two fingers and click for right click. So you basically need a external mouse for windows to be useable. I haven't updated my boot camp drivers in awhile though and never use the windows any more so that might have changed since the release of the official boot camp with leopard

</comment><comment><USER3> My only problem with Windows is that my fans go nuts when I'm using it rather than scaling properly like they're supposed to in OS X. However, my Macbook Pro is a version from back in 2007.

I can two-finger scroll and two-finger right click just fine in Windows... but I don't boot Windows often. Maybe it's in the bootcamp settings?

</comment><comment><USER4> I have had success with my clients using BootCamp, Parallels, and a VMware flavor I can't currently remember the name of. Apple does a fairly decent job of creating a "drivers CD" for Windows to use the MB's hardware.

<comment><USER5> prob'ly VMware fusion 2.05 (I don't have my mac with me). Works pretty well as long as you start with 4G physical RAM on the host. Putting Ubuntu desktop or XP in a VM with 1G RAM is pretty slugg-o. The only thing is that right-click with the Apple hockey pucks is hit or miss (mine are a couple years old, I think, maybe they're betternow)</comment></comment>


What is a real programming language? - <AUTHOR> http://stackoverflow.com/questions/3222316/what-is-a-real-programming-language

<comment><USER3> The only real programming language is punching cards and praying. Everything else is safety net for the weaklings.

Real programming language is anything with which you could convince, beg, scare, extort, and abuse a computer system to do what you want it to do - <USER2> will be surprised how much more well behaved some dev kits and prototyping boards are when you have 2kg hammer in the room.

And there are the real real programming languages that make your chest hair and beard grow to a point where Stallman comes to you, taps you on the shoulder and says - "Dude you need to learn a few thing about grooming". They are usually assembly languages.</comment>


What is Ultimate Software and why is it worth $11B? - <AUTHOR> https://www.sun-sentinel.com/business/fl-bz-cb-ultimate-software-qa-20190204-story.html <comment><AUTHOR> Summary: $11B software acquisition occurred today ([https://www.businesswire.com/news/home/20190204005338/en/](https://www.businesswire.com/news/home/20190204005338/en/) for the press release) and there is no mention of it here or many other regular sources of industry news. They compete with ADP and Workday. Acquirer is [https://hf.com/portfolio/](https://hf.com/portfolio/) (who also acquired Genesys - that most recently acquired Interactive Intelligence for > $1B - <USER2> Kronos)

edit: would love to know how whoever downvoted this comment managed to justify it to themselves.</comment>


Micro Scisky: A 32-bit Open-Source Brushed Flight Controller - <AUTHOR> https://dronegarageblog.wordpress.com/2016/09/25/micro-scisky-the-32bits-open-source-brushed-flight-controller/ <comment><USER2> This article is very outdated. Small brushless quadcopters are readily available now. Such as the Hoverbot Nano [1] mentioned in another commment, or a Eachine Lizard [2], and lots more.

And you can go even smaller, such as a pepperfish [3]

This is a small brushless quad with 0703 motors with a 1 cell battery. [https://i.imgur.com/EdFFfsc.png](https://i.imgur.com/EdFFfsc.png) / [http://rotaro.no](http://rotaro.no) 54mm in diameter

[1] [https://hoverbot.io/](https://hoverbot.io/) [2] [https://www.banggood.com/Eachine-Lizard95-95mm-F3-FPV- Racer-...](https://www.banggood.com/Eachine-Lizard95-95mm-F3-FPV-Racer- BNF-4-in-1-10A-ESC-OSD-5_8G-48CH-25MW100MW-VTX-600TVL- Camera-3S-p-1141589.html) [3] [http://fishpepper.de/projects/pepperf1sh/](http://fishpepper.de/projects/pepperf1sh/)

<comment><USER3> And there are Tiny Whoops with BetaFlight compatible FCs.

</comment></comment><comment><USER4> The brushed designs have been completely outclassed by the new breed of micro brushless quads. The Hoverbot Nano is one of the best examples of lightweight brushless design.

[https://hoverbot.io](https://hoverbot.io) [https://www.rcgroups.com/forums/showthread.php?2806620-Hover...](https://www.rcgroups.com/forums/showthread.php?2806620-HoverBot- Nano-40g-Brushless-90mm-Quadcopter)

<comment><USER5> Cheers, that looks very interesting. I'm just wondering what are the main advantages of brushless vs brushed motors for quads. Do brushless let you control the speed of the propellers more easily?

<comment><USER6> Brushed motors are around 75% efficient, brushless are around 90% efficient. This has two effects: obviously, you get more flight time from your battery with a more efficient motor, but that's not the main effect. The big one is that power output is limited by the combination of how much heat you can remove (which is roughly the same, perhaps 20W) and how efficient your motor is. With a 90% motor, your 20W of heat max means you can have 180W of thrust, while on a 75% motor the same 20W of heat only corresponds to 60W of thrust!

Brushless motors need some high-speed switching electronics to control the motor, swapping from one set of coils to the next at just the right frequency. Brushed motors are stupid easy - just connect two wires, and the voltage corresponds to torque (and thus speed). Any hobbyist could build a brushed controller in their sleep, but it takes a lot of dedication and engineering to design a brushless controller. Typically, this complexity is abstracted away from the end user in a prepackaged Electronic Speed Controller, but most micro quads integrate the ESCs on the control boards.

Brushless motors are more expensive than brushed motors. They're arguably less complex, but we've had many years to figure out how to build super cheap brushed motors, and can make them very small and very cheap.

In general, brushless motors are so much superior that you shouldn't even consider brushed motors in a quad (unless you need to hit a $19.99 price point), but do recall the cube-square law: Length squared is area, length cubed is volume. Area corresponds to propeller swept area or wing area and thus lift, while volume times density is equal to the weight. This is why a hummingbird or sparrow can dart around, while a swan requires a running start and a turkey needs to sprint and buffet (yum) the air with its wings just to get airborne for a few seconds and roost in a tree overnight. And it's why a $19.99 plastic micro quad with brushed motors will fly just fine, but to lift a DSLR you'll need brushless motors and carbon fiber.

<comment><USER5> Cheers, that's very interesting! I didn't realise there would be a difference in efficiency of that much.

</comment></comment></comment></comment><comment><USER7> with the recommended parts, minus the camera/vtx combo ($20), your total is roughly $70. for $60 you could get an eachine qx90 which is almost identical.

or you could even get much, much better quality/control out of a brushless build with the babyhawk, which goes for around $100

if you're new to flying drones, i wouldn't recommend this at all

</comment><comment><USER8> When seeing the components the first thing that came to my mind was "outdated", afterwards I saw the article is from 2016. If someone is interested in a more sophisticated approach he might want to check out the RotorX Atom: [https://rotorxracing.com/products/rx122diypr-atom-diy-kit- wi...](https://rotorxracing.com/products/rx122diypr-atom-diy-kit-with- rx1306-motors)

<comment> lloyd-christmas This article is about a $70 DIY open source project, and you compare it to buying a $400 snap and fly drone with proprietary software?

</comment></comment><comment><USER9> How does this compare to the Crazyflie 2.0? (See: [https://www.bitcraze.io/crazyflie-2/](https://www.bitcraze.io/crazyflie-2/)).

<comment><USER10> In terms of hardware it is practically the same. However Crazyflie has its own development while these cheap controllers can work with any standard open source flight software such as Cleanflight, Betaflight, etc. They are also cheaper than Crazyflie, you can have a drone for half the money.

</comment></comment><comment><USER11> Sure looks like the little bugger from the Slaughterbots video to me.

</comment><comment><USER12> Does anyone know what kind of battery life can you expect for the suggested components - it seems the linked battery is 380mAh

</comment><comment><USER13> Looks like a fun project, be interesting to see a video of how well it flies.

</comment><comment><USER14> They are doing a lot of similar things over at Noisebridge in SF right now.</comment>


Type Safety, ORM and Dependency Injection with Node.js - <AUTHOR> http://paulosuzart.github.io/blog/2017/10/04/type-safety-orm-and-dependency-injection-node/ <comment><USER2> The syntax for the ORM definition and the relationships between the columns makes the api absolutely beautiful!</comment>


With cryptocurrency, Facebook sets path toward becoming an independent nation - <AUTHOR> https://theconversation.com/with-cryptocurrency-launch-facebook-sets-its-path-toward-becoming-an-independent-nation-118987 <comment><USER2> They keep saying this is a "stablecoin" but there is no way it can be stable. First, the basket of currencies in the reserve is chosen by Facebook and will fluctuate against the value of the Libra as Facebook (or the verifier nodes, other tech giants) decide.

Secondly, it's a _fractional reserve_ with only 10% of the floating Libra expected to be held in reserve currencies. That amount could also change anytime and definitely will change as this concept is the basis of modern banking.

Third, not all of the reserve has to be in fiat. FB will have some of it in other financial instruments and these, too, will vary over time, so says the documentation. This is another staple of the banking industry.

In other words, your Libra is only worth what FB says it is worth today in trade for some other currency. Those exchange amounts can and will change from country to country, from user to user (never possible before; the ultimate in demand pricing), and fiat to fiat. This gives FB an unprecedented role as an arbiter of global exchange rates and an arbitrageur who profits from a spread that they themselves create.

FB doesn't care about being a nation because, as one of the Rockefellers supposedly said, it matters not who makes the laws if you can control the supply of money. FB's policy documents already divulge that they will control the supply and value of Libra.</comment>


Why you should learn at least a little bit of Awk - <AUTHOR> http://gregable.com/2010/09/why-you-should-know-just-little-awk.html <comment><USER3> Back in the 80s I wrote a 500-line program analysis tool in Awk. One day the woman I was going out with handed me a printout I had left at her place, saying something along the lines of "here's your awk code". She wasn't a programmer so I was stunned that she knew it was Awk, and very impressed too.

Years later I ran into Brian Kernighan at a conference and told him the story, ending it with "and that's when I knew she was the woman for me." He looked at me like I was nuts.

<comment><USER4> Great story, but don't leave us hanging. Just how _did_ she know it was awk code?

<comment><USER3> one of the women she worked with used awk a lot for munging data and simple reports from their pre-SQL database ... it's pretty recognizable :-)

</comment></comment></comment><comment><USER5> Awk is a great and oft-forgotten tool. Not only is it useful, the awk way of thinking about stream processing generalizes nicely to a bunch of other areas. You have a block that runs before anything else happens, a block run just before the program exits, and a block run for every piece of input. In awk, the input is a line of text, but nothing stops you from generalizing this to say a frame from a video (split into channels in various colorspaces, fed through a processing pipeline, returning another, processed image), a sound frame, a sensor measurement...

<comment><USER6> _"nothing stops you from generalizing this to say a frame from a video"_

This is 100% true. A coworker of mine implemented an elevation-bitmap- to-3d-model conversion tool in 160 lines of Awk. It ran faster than our "good" Matlab tool by a factor of 10.

Awk (or Perl) doubles the usefulness of Unix. Most of the common commands in Unix are query commands. When you need to start manipulating queried data, Awk is where the rubber meets the road. Piping data through the shell stops being read-only, and becomes interactive.

<comment><USER7> > It ran faster than our "good" Matlab tool by a factor of 10.

Could you give a bit more details there? I don't have any experience with matlab, but I tend to think of awk as fast to write code in (and start up), though not particularly fast in execution. (Roughly on par with Python, i.e., usually good enough.)

<comment><USER8> You might want to rethink that a bit: [http://anyall.org/blog/2009/09/dont- mawk-awk-the-fastest-and...](http://anyall.org/blog/2009/09/dont-mawk-awk-the- fastest-and-most-elegant-big-data-munging-language/)

<comment><USER7> That's mawk. I'm talking about the implementation that post calls "nawk", and either way, I mean orders of magnitude - I care about a 10-100+x difference in speed, not a 1.1-5x one. Awk and Python fall in roughly the same performance tier for that kind of code.

Also: "I have since found large datasets where mawk is buggy and gives the wrong result. nawk seems safe." makes me uneasy, as does the fact that it was unmaintained for a while.

<comment><USER9> Afaict, mawk's maintenance seems to be a bit up in the air--- the original maintainer basically disappeared years ago and hasn't blessed any successor, so the Debian-patched version became the de-facto current version, since at least it staved off bitrot. Recently someone (Thomas Dickey) picked up maintenance of a new upstream version unilaterally, starting from the Debian- patched version, but he hasn't managed to convince the Debian mawk maintainer to accept his new version as a new upstream (somewhat testy thread here: <http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=554167>). I'm personally a little more comfortable with something actively maintained like gawk, despite the speed differences.

<comment><USER7> Right. I usually use (n)awk because it's the default on OpenBSD, but have to admit gawk's artificial-filesystem-based networking support is pretty cool.

</comment></comment></comment></comment></comment></comment></comment><comment><USER10> I can't recommend the Sed & Awk book enough.

Regular expressions are my favourite secret weapon; So many problems are made simple by regular expressions and so few people (outside of IT) know of them.

<comment><USER11> After I recommended the Sed & Awk book here a few months ago, silentbicycle countered[1] that _The Awk Programming Language_ [2] (by Aho, Kernighan and Weinberger) was much better.

I was curious enough that I bought and read it just at the end of summer. It really is excellent. Highly, highly recommended.

[1] <http://news.ycombinator.com/item?id=1403376>

[2] <http://cm.bell-labs.com/cm/cs/awkbook/>

<comment><USER12> from what i remember, "the unix programming environment" by pike et al is also pretty good, and contains a basic introduction to most of the unix utilities.

<comment><USER7> You can't go wrong with any programming books Brian Kernighan co-wrote, really. I have _The ANSI C Programming Language_ ("K&R"), _The Practice of Programming_, _The AWK Programming Language_, and _The Unix Programming Environment_, and they're all great. Concise, with a lot of depth that reveals itself on repeat reading.

Ieursalimschy's _Programming in Lua_ ("PiL") was written in a similar style. I recommend it quite highly, too. Great language, great programming book.

Also, the PSD, SMM, and USD books (_4.4BSD Programmer's Supplementary Documents_, etc.) are dry, but also have excellent introductions to several classic Unix tools. They're included as documentation in some BSD installations, and should be easy to find otherwise. The intros to lex and yacc are particularly good.

<comment><USER11> I'm glad you saw this thread. It's always nice to find out somebody actually paid attention to (and appreciated) some advice you put out on the interwebs.

<comment><USER7> :) Awk threads always seem to get my attention.

</comment></comment></comment></comment></comment></comment><comment><USER7> Many people consider Perl to be the next evolution of awk, but I prefer to think of awk as (just) the essentials of Perl. Perl has CPAN, etc., but for quick string hackery, everything you need fits in one tiny awk reference. Its design hasn't sprawled the way Perl's has. (Except for gawk. The FSF does bloat better than anyone.)

It's incredibly handy, yet the language is small enough that you can learn most of it in an evening, with just a bit longer if you don't know regular expressions.

<comment><USER9> I definitely prefer awk versus perl for one-liners, with some sed thrown in. Perl does have some command-line switches to ease certain kinds of one-liners, but it just feels more verbose for that kind of interactive use (feels more oriented towards writing scripts).

I do tend to use Perl for things where speed matters, though, especially with large amounts of data going through a regex--- Perl's regex engine seems considerably faster than any awk (or especially sed) I've tested, at least on a few examples I've ported in the past. I was surprised once to get an 8x speedup by porting a 3-line sed script to a 3-line perl script (it was basically doing s/ABC/A\nC/g on a multigigabyte file). I've heard mawk can be speed-competitive with Perl, though.

<comment><USER7> Same here, but I prefer Lua to Perl, and Lua's LPEG (<http://www.inf.puc- rio.br/~roberto/lpeg/lpeg.html>) compares very favorably to common regexp implementations. (There are benchmarks in the paper.)

It's based on PEGs, a different formalism than regular expressions. PEGs are more expressive - they're able to handle balanced, recursive structures, for example. LPEG is a nice middle ground between regular expressions and a full LALR(1) parser.

<comment><USER13> I'm not sure if "middle ground" is quite right; PEGs and CFGs can express a different set of languages, and each has their own advantages. Probably the most important tradeoff is that with PEGs you gain infinite lookahead and negation, but you lose left recursion and the ability to express ambiguity.

<comment><USER7> I meant "middle ground" in a practical sense, rather than the linguistic one - REs are good for simple string hackery, but not sufficient for nested structures. Using an actual parser generator (the yacc clone in your language of choice) can really be overkill for simple things, though. LPEG is a bit more expressive than just REs, but still easy to casually drop in during quick scripting.

</comment></comment></comment></comment></comment><comment><USER14> Note that the first code he writes on the page

 _awk "{print $0}"_

does not work. Awk programs need single quotes to prevent bash expansion.

<comment><USER15> Depends on the shell one uses, i think. On the other hand, who doesn't use bash these days.

<comment><USER7> See: <http://news.ycombinator.com/item?id=1669409> (Pet peeve of mine.)

</comment></comment></comment><comment><USER16> It's been a while since I've touched awk, but I've certainly got a lot of use from it when ripping data out of logfiles and using it elsewhere on the command-line.

I can recommend this text file of awk one-liners:

<http://www.pement.org/awk/awk1line.txt>

And for completeness, here's one for sed:

<http://sed.sourceforge.net/sed1line.txt>

</comment><comment><USER17> I can understand the usefulness of awk if say only C, C++, Java/C# existed, but given that it's just easy and fast as Awk to code something useful and powerful using something modern like either Ruby and Python; I just fail to see the point.

O yeah and let's not forget Perl.

<comment> loup-vaillant Awk is so small that you can be productive in half an hour. It's so concise that most useful programs are easy little one-liners. It's so fast that you can trust it with massive data crunching.

In other words, awk is unbeatable for stream crunching. (That's the point of being domain specific, by the way.)

<comment><USER17> "Awk is so small that you can be productive in half an hour. It's so concise that most useful programs are easy little one-liners."

I can say the same for ruby and python (and perl).

From personal experience, as an awk script/program becomes more important - <USER2> will evolve with more requirements and it will start to be clunky. It just isn't practical to stick with it since you'll eventually need the features/libraries that the other languages have. Given the choices we have today, why even start with awk?

On the performance side, you can always just use Lua if that's really important.

<comment><USER7> The major benefit with awk is that it runs as a pattern recognizing/processing filter _by default_ , so it handles certain common problems in very little code, and fits particularly well in Unix shell pipelines. I'm also a big fan of structuring code in terms of pattern-matching. (I wrote an Erlang-style pattern matching library for Lua, btw: <http://github.com/silentbicycle/tamale/> )

I write a lot of little awk scripts, but if they grow past ~5 lines, they usually get rewritten in Lua. (Perhaps eventually with inner loops in C.) Still, Awk is simple and useful enough that it's still worth knowing.

<comment><USER17> "The major benefit with awk is that it runs as a pattern recognizing/processing filter by default"

Doesn't every language have regular expressions built in now? Again I still fail to see the point of writing it in Awk when you can write something small and fast in a more powerful and modern language.

<comment><USER7> I mean something different than regular expressions: I'm talking about how the whole program is structured around "pattern -> action; other pattern -> other action; ...", with special event patterns for BEGIN, END, etc. That pattern- based dispatch is the _top level_ of the language, rather than function definitions. (Those came later.) As the man page says, it's "pattern- directed".

It's a higher-level approach than typical scripting languages, and that's why it can be so concise - the model makes a lot of unpacking and looping implicit. It's a DSL for stream-processing problems which are easy phrased as "count these", "transform this into that", etc.

Are you familiar with Prolog? It uses a similar approach, but can match on whole trees (and other complex, nested data structures), not just a list of $N string/numeric tokens. Also, it supports backtracking - at any point, if it reaches a dead end, it can back up arbitrarily and try a different approach. Sometimes slow, but very handy for prototyping.

I agree that using another language than awk makes sense after a few lines, but it's still a sweet spot for 1-5ish line programs. Since awk itself is small enough that a two page cheat sheet is sufficient, it's worth keeping around. Perl (for example) has many nooks and crannies I forget about if I don't use it frequently.

<comment><USER13> Anyone who hasn't tried a general purpose language with pattern-based dispatch (usually referred to in practice as "pattern matching") should really do themselves a favor and try one; it's one of the most useful language features around. Now that I've become used to it, it's a bit unpleasant for me to use languages that don't have it. It's a very convenient way to structure code.

The parent post mentions Prolog, which is a good example, but there are several others worth trying that frequently come up on HN; Scala, Haskell, F#, and Ocaml spring to mind.

<comment><USER7> Yes! Anybody who knows me in person is probably tired of hearing about how good pattern matching is by now. :) I definitely know what you mean about missing it in languages without it, that's why I've been working on tamale.

I can't speak for Scala, but the PM in Haskell and OCaml is a bit different since it's informed by the static typing. When patterns have variant types (i.e., x is either Foo, Bar, or Baz * int), it also checks for complete coverage. Same general concept, different flavor. Also very useful.

I mentioned Prolog in particular because its emphasis on unification and backtracking make it the most pattern-matching-centric programming language I've seen. Where other languages _have_ pattern matching, it almost _is_ pattern matching.

Also, there are well-known ways to compile pattern specifications into efficient decision trees, so while it's a very expressive abstraction, it's not necessarily an expensive one. If they're being constructed at runtime (as they are in my Lua library), you can generally get a big improvement by just indexing on the patterns' first fields and doing linear search thereafter.

</comment></comment></comment></comment></comment></comment></comment></comment><comment><USER18> I had great fun writing the traditional "Cloak of Darkness" exercise for Interactive Fiction in pure AWK:

<http://zork.net/~nick/loyhargil/if/if.awk>

For comparison, here are all the published examples of this exercise in a variety of systems:

<http://www.firthworks.com/roger/cloak/>

I won't say it's the best tool for this job, but I feel that the awkishness provides a certain elegance to some aspects.

</comment><comment><USER19> I went through the article and tried the stuff on the log files on my web- server. Useful stuff.

</comment><comment><USER20> I know this goes against what is said here but I _hate_ awk. The syntax is so convoluted that it seems parts were picked with whatever was reasonable at the time. It's like I'm banging on rocks in a cave somewhere every time I have to work with bash, awk and related tools. In fact I did a quick bash script of pattern matching some files, moving them, resizing and compressing then uploading and it took three days to read man pages, parsing, etc till I got fed up, used ruby and had it done in under an hour.

</comment><comment><USER21> Awk can also be faster than (naively written) C++. [http://anyall.org/blog/2009/09/dont-mawk-awk-the-fastest- and...](http://anyall.org/blog/2009/09/dont-mawk-awk-the-fastest-and-most- elegant-big-data-munging-language/)

<comment><USER7> That's not news, though. Better algorithms trump constant factors, and what is "naively written C++" if not a murder of bad algorithm choices?

I'd bet that people _get shit done_ 10x+ times faster in awk/lua/python/ruby/lisp/whatever until having to work with nasty C++-specific libraries dominates, though. (C is friendlier that way.)

</comment></comment><comment><USER22> That and most places with a clue that are hiring competent sys admins will expect at least some knowledge of sed and awk.

<comment><USER23> That may have been true prior to 1987, however since then Perl has largely superseded sed and awk.

<comment><USER24> Or Python at Google.

</comment></comment></comment><comment><USER25> Since I was introduced to AWK I didn't look back, 80% I have to do on the command line end up using AWK for it.</comment>


Ask HN: Give me ideas for Startup2.com - <AUTHOR>

I've got the domain startup2.com which I considered selling, but now I'm thinking of developing it - what would YOU do with this domain? <comment><USER2> an editorial site for people at their second startup experience, on the line of the setup? It would actually be interesting I guess :)

Otherwise: a browser based game in which you have to find the second male sheep and mark it with a star?</comment>


Haystack: A small utility helping to protect your searches - <AUTHOR> https://github.com/norova/haystack

<comment><USER2> I prefer GoogleSharing.

<http://www.googlesharing.net/>

"With Google's introduction of SSL support for search requests (encrypted.google.com):

The result is that Google knows what is being searched for, but doesn't know where the requests are coming from. The GoogleSharing proxy can tell where requests are coming from, but can't tell what the content of the requests is. And the user can avail themselves of Google services without having to trust either Google or GoogleSharing."

</comment><comment><USER3> Not to knock your efforts, but this looks like a naive and wasteful approach to privacy. It seems like it would be pretty easy to separate the needle from the haystack when dealing fake searches (are any links clicked from fake searches? are cookies used? javascript? useragents? what about google's realtime search? are you searching for nonsense terms?).

Also I'm not confident this thing isn't going to randomly pick embarrassing search terms.

<comment><AUTHOR> This is why I shared it. In the unlikely event that someone find it the least bit useful, they might want to expand on what already exists (which admittedly isn't much) and improve it. All of your points make complete sense, and as I've said in the github notes, the project was just something I cooked up quickly a few years ago. Small ideas can grow into big things; figured it was worth the bandwidth to publish.

</comment></comment><comment><USER4> (You should be aware that Haystack's also the name of a failed and cringeworthy attempt at creating privacy software.)

I think it's pretty irresponsible to publish privacy tools that you know don't actually give adequate privacy. It's easy for _me_ to see the holes in this technique, but not everyone is technical. If someone's reading this and considering deploying this tool, please just use tor + torbutton instead..

<comment><AUTHOR> God forbid I put myself out there in an attempt to share something with the world (which is _admittedly_ naive) and maybe let someone else improve upon an idea. I'm so terribly irresponsible.

<comment><USER5> You did nothing wrong and should carry on learning, coding and sharing. Thanks for sharing your project with HN.

</comment></comment></comment><comment><USER6> Haystack? You mean the MIT project? <http://en.wikipedia.org/wiki/Haystack_(MIT_project)>, the search tool <http://haystacksearch.org/>, the horribly-implemented privacy tool <http://en.wikipedia.org/wiki/Haystack_(software)> or...

<comment><USER7> ... the Facebook object store? <http://www.facebook.com/note.php?note_id=76191543919> or ...

</comment></comment><comment><USER8> Why not just use scroogle (<http://scroogle.org/>)?

Even if it randomly searches for stuff, the searches are still linked to you, and I would be concerned over what terms it was searching for if my search history were ever subpoenaed. I could images several cases where this could get you into trouble.

</comment><comment><USER9> Why not just use DuckDuckGo.com as your search engine? They don't save any of your personal information, and they return less content-farm spam than Google does. (My second choice would be scroogle.org, which somebody else already mentioned -- an anonymous Google proxy, and doesn't require a browser add-on like googlesharing.net does.)

</comment><comment><AUTHOR> Just a little note. I just pushed this to Github recently after discovering the code on my machine. I wrote this little utility a few years ago and didn't do much with it. Thought I would share the code and see if anyone else finds it useful! Thanks for taking a look.

</comment><comment><USER10> Would be nice to have a Linux utility like this that was browser-agnosic and os-agnostic (ie. configurable to mask as any browser/os).

Another useful feature would be to have the utility follow some of the "next page" links on some of the searches, to make them look even more like regular human searches.

<comment><AUTHOR> The "next page"-type behavior and more human-like searches was something I originally intended on adding but never got 'round to it. After re-discovering the code on my machine though, I'm finding myself a bit re-motivated.

</comment></comment><comment><USER11> Excellent, God forbid Google ever use your search queries to improve its ranking algorithms and give more relevant results.

 _This comment sponsored by Experts-Exchange and ehow_</comment>


Microsoft develops shape-shifting touchscreen - <AUTHOR> http://www.newscientist.com/article/dn19776-microsoft-develops-shapeshifting-touchscreen.html <comment><USER2> Shouldn't they at least produce a working prototype before they can patent it? There's a long way from idea to actually putting it in practice.</comment>


Ask HN: Which is best React or Angular? - <AUTHOR> Hi HN,
We are going to migrate our vanilla js application to either React or Angular world. Given that our application is an CRUD based application, we need to know which one is good/best.
I know React is not "MVC" pattern in itself, but with Flux it is comparable to Angular ( correct me if I'm wrong here). I have seen Angular 2 is coming up which is going to remove the existing feature that are in Angular 1.x versions. So we fear whether angular is right choice "now" for us! Because our UI is already an complex, we don't want to change our code-base when Angular 2 comes up. We don't want to do that at all.
And interestingly we yet to "learn" Angular / React given the choice; So learning curve also going to be an matter for us.
Given these facts, which framework HN will be suggesting for us and why?
Thanks a lot for all your reply. <comment><USER2> I only work with angular but I wouldn't recommend to chose Angular for any new projects, especially if you have no knowledge in it.

It is already "dead". Of course the existing projects will remain, but create one on a framework you know will not evolve ever again soon doesn't sound like a right move.

Granted given the speed of change in front end whatever you chose will probably disappear in a few years. :/

<comment><AUTHOR> Thanks for your response. So Angular 2 going to break almost everything in angular 1.x versions?

<comment><USER2> Unless it changed, you have to think about Angular 2 as a complete new framework that has nothing to do with Angular 1. It sounds like it's just an update but it will really be 2 different thing (just like angular with react or ember, now you can add angular 2 as a new one), I don't know why they kept the name.

<comment><AUTHOR> Thanks for your insights.

</comment></comment></comment></comment><comment><USER3> "We are going to migrate our vanilla js application to either React or Angular world"

Does "to migrate" mean "gradually refactor and gradually pack code in React/Angular components". Or does it mean "to rewrite from scratch"?

How big is the application?

Does it have clear architecture and clean code or is it big ball of mud with ugly looking code?

<comment><AUTHOR> It means "gradually refactor and gradually pack code in React/Angular components".

>> How big is the application? Yeah its pretty big. Has at least 7-8 different pages and workflows.

>>Does it have clear architecture and clean code or is it big ball of mud with ugly looking code?

The code is in "somewhat" good state. Few components we have followed MVC using vanilla js; where as few components still remain the same ( as ugly looking code )

</comment></comment><comment><USER4> React makes you a better javascript developer, no doubt. The problem I have with other frameworks (Angular, Ember) is that they use a templating language, instead of Just Javascript™. After using React, I never want to touch a templating language ever again. I don't want to learn a DSL to do simple things like loops + filters and conditionals, which I already know with Javascript. I don't want to learn their special scoping rules, something which Javascript has already defined. And I seriously doubt debugging templates is easy.

<comment><AUTHOR> @kentor: Looks like learning React is far more easier. But learning Flux looks a bit involved process. Not great samples and books available out there. Any idea, where to get started?

<comment><USER4> I would recommend Redux for data management. I've been using that at work and it's been great. Their docs are also pretty good.

Maybe a good place to start is with one of those boilerplate repos that have React + build tools already set up: [https://github.com/gaearon/react- transform-boilerplate..](https://github.com/gaearon/react-transform- boilerplate..). Then you just add the stack that you want, like redux and react-redux with npm install.

<comment><AUTHOR> Redux looks stunning. Thanks a lot for suggesting it.

</comment></comment></comment></comment><comment><USER5> Though I don't have experience with a large rewrite like this. I am really liking what I see in React.

React + Redux for the Flux pattern seems to be the best combination available right now. Watch this talk by Jessica Kerr - Functional Principles In React [https://www.youtube.com/watch?v=1uRC3hmKQnM](https://www.youtube.com/watch?v=1uRC3hmKQnM) about why Functional / Declarative approach is good for front end development. Also Dan Abramov (Redux Author) Talk - Live React: Hot Reloading with Time Travel [https://www.youtube.com/watch?v=xsSnOQynTHs](https://www.youtube.com/watch?v=xsSnOQynTHs) introducing Redux is great.

Watch this awesome talk by Ryan Florence - Don't Rewrite, React! [https://www.youtube.com/watch?v=BF58ZJ1ZQxY](https://www.youtube.com/watch?v=BF58ZJ1ZQxY) on how to approach rewrites bottom up and he rewrites a part of the TodoMVC written in Backbone.js.

<comment><AUTHOR> Thanks for your insights. Looks like Redux is far more easier than other flux implementation out there. Is redux is mature enough to be used?

</comment></comment><comment><USER6> I don't think there's a single right answer to choosing a framework/library for JS development, except that Angular is not the right answer.

<comment><AUTHOR> So your saying angular is not the right answer from the perspective of Angular 2 or from your experience in Angular?

<comment><USER6> Both.

<comment><AUTHOR> Since you said 'both', can you elaborate on another point ( apart from the fact angular 2 gonna change angular 1 versions )? That might be helpful for us.

<comment><USER6> It's very hard to do things 90% Angular. Integrating Angular functionality with JavaScript is difficult.

<comment><AUTHOR> Interesting to see that 90% of angular is tough! Thanks for your thoughts.

<comment><USER6> Not quite what I meant.

If you do 100% of your UI in Angular, you will be fine, but as you use more custom JS in the UI, it becomes more and more difficult to manage the separation if Angular and the UI.

</comment></comment></comment></comment></comment></comment></comment><comment><USER7> I would say it depends on if your app is more consumery (react) or enterprisey (angular).

React will give you better performance and server side rendering. It mixes the view in the javascript which can be a little off to some.

Angular will give you a larger framework with two way data binding and likely faster dev cycles. There is a roadmap to 2, but until then no server side rendering and issues with performance if you aren't careful.

<comment><AUTHOR> Thanks for your input. One quick question, learning curve for angular and react will be?

<comment><USER3> Angular - Hello World is super easy but as you go deeper in Angular you become overhelmed by its complexity (mostly accidental) and limited by it. You will constantly think "how do I do this in Angular way" and after searching Stack Overflow you often end up doing some creative hacks to overcome Angular limitations. And debugging in Angular is hard, even error messages are super cryptic.

React - Hello World is also super easy but it's good to know about ES6, Gulp/Grunt and Babel (it's not necessary though. You will have just more syntax sugar). As you go deeper in React you'll have to get familiar with recommended architecture and principles for React (flux architecture, unidirectional data flow, immutability etc.) and because React is only view/rendering part, you probably will be wiring React with something else (e.g. Redux or other library for keeping state and dispatch actions).

In other words: using Angular you'll have to deal with complexity of framework API but app architecture will be determined and forced by Angular. So probably you don't have to be good at programming to do Angular.

Using React you'll have to understand its architecture and functional(immutable/without side effects) programming, but API itself is super simple. And there are super helpful error messages if you mess up something.

<comment><AUTHOR> Thats an very good comparison. Thanks for it!

</comment></comment></comment></comment><comment><USER8> Take a look at Ember.js. Seriously. Performance is now on par with React (I think the core developers are secretly in love with React and try to bring all good ideas into Ember). By using it you get the whole front-end package by default (ES6 (modules!), CSS preprocessor, promise based data store, awesome debugging tools, generators, everything perfect out of the box. It follows conventions so every Ember app is structured in the same way. Upgrade cycles are a breeze and they follow SemVer.

<comment><AUTHOR> So your suggesting, Ember has almost all React's feature? And almost same performance?

Guess the learning curve of Ember is also easy.

<comment><USER8> Basic ideas yeah, like dom diffing and unidirectional, immutable data flow. I'm also sure the learning curve is far nicer than it used to be back in the old days when it was an immature framework.

</comment></comment></comment><comment><USER9> I hope you haven't made your decision yet because the comments in this thread are extremely misleading.

First of all, please remember that _nothing_ is faster than a properly written vanilla js application. Every layer of abstraction you add will necessarily slow your app down. You gain convenience at the cost of performance.

So unless you're dealing with major issues in terms of complexity and understandability, I would ask yourself why you need to have a shiny new framework in the first place?

But let's assume you do. You're in the same boat that a lot of companies and developers are in these days - what the hell framework do I choose when a new one seems to pop up every day? Spoiler: there's no right answer. I assume you want your app to be future proof, which is a fools errand, but supposing you're a fool like the rest of us then my humble advice to you would be to read up on web components and choose the framework that embraces them the best.

That would narrow your choices down to Angular 2, Polymer, Aurelia, and probably some other less mainstream frameworks I haven't heard about. Angular 2 would be a fine choice but it's going to be a pretty radical shift to the way people do things, but it will come with a reward of up to 10-15 times the performance of angular 1.+ and react. Oh, and it's not ready yet.

Aurelia takes a lot of its queues from Angular 2 but it's basically production ready today and far simpler in terms of its complexity and API. It's all-in on web components and has a very enthusiastic and helpful community surrounding it.

Polymer is Google's _big_ bet on the future of web development. It's at 1.1 and production ready, and will be extremely well funded for years to come. It's basically sugar for creating web components. It's similar to React in that they encourage you to build your application out of nested components. It's different from React in that it embraces the web components spec and the DOM. React has explicitly stated multiple times that they have no interest in web components.

Polymer isn't quite as simple to get up and running with as React and Google needs to address that, but it's getting better. But the big thing the polymer team has going for them is that they literally share desks with the Chrome dev team, and as such they have their finger on the pulse of cutting edge web browser technology. The React core team doesn't have that luxury, so they've taken the radical approach of trying to abstract away the DOM completely. It's an intriguing approach but in my humble opinion it's hostile to the open web. Make no mistake that Facebook is doing what's best for Facebook. Google is doing what's best for Google, too, but that happens to align with the goals of the open web.

Anyways, I hope you don't just jump onto the React bandwagon before giving your research a little more time. HN is an echo-chamber and the word "React" is just the latest echo you see bouncing around.

</comment><comment><USER10> ember/ember-cli...</comment>


Advice for a recent grad looking to get into software sales? - <AUTHOR> Hey all, long time lurker. Found this page from Reddit (of course).
Dunno if this is proper protocol, but I'll ask anyway. How do I get into software sales? I sell IT hardware now but with every spare second I get I'm browsing Arstechnica, Wired, Ycombinator News, etc. Hardware is just so simple compared to software and I'd prefer to deal with larger more complex solutions.
Got a Bachelor's in management, but I've always been tech savvy. I remember one night trying to fix a bootloader from a failed Linux dual boot installation. Good times.
My question is, what skill sets do I need and what states in the US should I be looking at? I'd prefer marketing automation or something like that if it matters.
Thanks all! <comment><USER2> IT hardware? Specifically what? notebooks or multi-million dollar servers? Hardware with the associated systems engineering gets complex very fast. Anyway, onto your question ...

If you are attracted to selling complex solutions then you are most likely looking to the enterprise software space. If you have any enterprise hardware sales experience then that will help get interviews. The sales cycles are long, 3 months (rare) to 3 years (not that uncommon).

Marketing automation? Are you thinking of SalesForce, Siebel or other big ticket CRM? These are often sold by "consulting firms" who add on their consulting, training, support services.

Quite seriously you would be better off lurking the various job boards for sales positions. That way you will get a better idea of where the action is and in what areas.

</comment><comment><USER3> check out angel.co jobs section. 2417 full-time jobs under sales.</comment>


Ask HN: Systems whose concepts spring from programming languages/paradigms? - <AUTHOR> The canonical example is that of MapReduce/Hadoop which borrows from Functional Programming and LISP. Are there any others? <comment><USER2> The general idea that an existing module or component can be changed by _injecting_ additional behavior has been originally developed within _aspect- oriented programming_ (AOP). And then this idea has been implemented in various frameworks like Spring (yet, not in its original form).

<comment><AUTHOR> Cool. Another example could be of IPC in distributed operating systems borrowing from message-passing in CSP or the Actor model although, it could be also be the other way around?</comment></comment>


Ask HN: New device, webapp and API to track your stuff, input appreciated - <AUTHOR>

I've been working the last few months to create a easy to use low cost device for personal tracking called StowAware (https://stowaware.com) and just started shipping orders.  The basic idea is a black box that you put in your car, scooter, shipment, backpack, or anywhere else you can make it fit and track its location for a year without recharging.  I tried to build something that I would want to use and added features that seemed obvious like API/webhook access (with actual documentation at http://code.stowaware.com), controllable public sharing, on-demand lookups, https only access, turbo mode and an easy to use interface. <comment><AUTHOR> Also if you're interested in seeing more pictures of the device and some active public shares currently live visit [https://plus.google.com/+Stowaware_public](https://plus.google.com/+Stowaware_public)</comment>


GNU Parallel - <AUTHOR> https://www.gnu.org/software/parallel/ <comment><USER2> As always gets brought up when GNU parallel is mentioned: xargs does most of the use cases you'd need for parallel.

xargs -n1 -P4

Would be at most one arg from the arg list run with 4 jobs. [http://stackoverflow.com/questions/28357997/running- programs...](http://stackoverflow.com/questions/28357997/running-programs-in- parallel-using-xargs)

<comment><USER3> I have a small cluster of machines that I run experiments on. GNU parallel makes the dispatch of jobs on remote machines very easy.

In addition, I often use it to search for sequences by running grep in parallel. For example

$ parallel 'grep {1} -f haystack.txt' :::: many_needles.txt

Where {1} is a single line in many_needles.txt

<comment><USER4> If you find yourself searching lots of haystacks, and your needles are just text and not a regex, a better approach is to stuff all the needles into some kind of index, then chop up the haystack into overlapping tiles (of variable width from the smallest needle to the largest), then search each tile against the index of needles. This effectively searches all the needles at once and turns the operation from O(n) where n is the number of needles to O(m) where m is the number of tiles in haystack.txt.

It may seem to be a trivial difference, but then you can search multiple haystacks at once fairly easily, and this approach scales to hundreds of millions of needles at once. The code for it isn't very difficult either, heck you can just use an in memory SQLite dB to get a searchable, temporary, index and rely on using some of the most tested software in history.

<comment><USER5> This also works for sorting as well and is typically called Radix Sort or Bucket Sort.

Basically using unique attributes of the data you then divide and conquer on those attributes (e.g. for Radix you make buckets based on the digits).

</comment></comment></comment></comment><comment><USER6> GNU Parallel - an amazing tool with the most user unfriendly brick-wall-in- your-face documentation imaginable. Shame really - it's great.

<comment><USER7> To be honest the same can be told about many GNU tools. At least myself I still experience this moment of being totally lost infront of the man screen from time to time. Parallel has a nice tutorial [https://www.gnu.org/software/parallel/parallel_tutorial.html](https://www.gnu.org/software/parallel/parallel_tutorial.html) Have you seen it?

<comment><USER8> I always get the feeling that most man pages are written for people who already know how to use the commands, rather than people new to them. For example, if I already understand how tar works and have a general idea of how to use it, man tar is great to drill down and find specific options and switches that I need or don't remember, but if I have no idea what tar files are or why would I want them, the man page really doesn't help much in explaining things.

I guess you could argue this is supposed to be so and man pages are doing their job, since they are documentation and not tutorials, but still.

<comment><USER9> Info pages are better for that.

<comment><USER10> Info pages should be banished from the face of the earth.

[https://xkcd.com/912/](https://xkcd.com/912/)

<comment><USER9> I don't get it. The info pages usually have way more information available, and are proper software manuals with plenty of worked out examples, voluminous descriptive text, and hyperlinks to related resources. Try `info sed` and compare that with the bare breakdown of command line options and basic syntax of `man sed`.

I'm not sure what that comic has to do with anything.

<comment><USER10> Man pages are (in my experience) almost always viewed on a text console or terminal. Info pages work poorly there, and it's just frustrating to be looking for some information in a man page and have to start up some other program with a different UX to complete the task.

Man page standards have places for "See also" and "Examples" and that is good enough.

</comment></comment></comment></comment></comment></comment></comment><comment><USER11> There is also an in-development GNU Parallel clone/alternative written in Rust. [https://github.com/mmstick/parallel](https://github.com/mmstick/parallel)

<comment><USER12> Being written in Rust is not its main feature (and I think you're being down- voted because people don't like fanboys).

This project is cool because it has a really low overhead, which is really cool if you want to parallelize tasks that are not really CPU intensive (but mostly useless if the CPU usage of each task is high).

<comment><USER13> Rust-parallel _is_ fast, and there is clearly a niche here, that GNU Parallel is unlikely to fill: By design GNU Parallel will never require a compiler; this is so you can use GNU Parallel on old systems with no compilers (Think an old, dusty AIX-box that people have forgotten the root password to). This design decision limits how fast GNU Parallel can be compared to compiled alternatives.

But the main problem with rust-parallel is that it is not compatible with GNU Parallel (and according to the author, it probably never will be 100% compatible). If you use rust-parallel to walk through GNU Parallel's tutorial (man parallel_tutorial) you will see it fails very quickly.

(Full disclosure: I am the author of GNU Parallel. I fully support building other parallelizing tools, but to avoid user confusion, I would recommend calling them something other than 'parallel' if they are not actually compatible with GNU Parallel. History has shown that using the same name will lead to a lot of unnecessary grief: e.g. GNU Parallel vs. Parallel from moreutils).

</comment></comment></comment><comment><USER14> Does anyone else remember Slashdot and the endless threads about Beowulf clusters? That was back when "parallel computing" was overly complicated and rather opaque. And most of us had no idea how to take advantage of multiple machines.

<comment><USER13> Sure do. Makes you feel that the future is now!

</comment></comment><comment><USER15> I use parallel for pretty much all batching these days. It's useful even when you don't need parallelisation – here's a simple transcoding example:

      parallel -j1 'ffmpeg -i {2} -c:v libx264 -tune film -preset veryslow -crf 18 -vf scale={1} -c:a libfdk_aac -vbr 5 conv/{2.}-{1}.mp4' ::: hd480 hd720 hd1080 ::: *.mp4

Obviously in the real world you would want to take some extra steps to avoid making upscaled versions, but this is just a rough example.

</comment><comment><USER16> I use it daily for parallel build process and I love it. Easy to set up, easy to deal with. Documentation was tough though.

<comment><USER17> That's interesting. Make is parallelizable too, although I occasionally run into projects that won't build correctly if you use the feature.

</comment></comment><comment><USER18> prll [https://github.com/exzombie/prll](https://github.com/exzombie/prll) is a very pleasant and approachable alternative that I've used in preference to GNU Parallel.

<comment><USER13> Just be aware that Stderr will contain stuff you did not ask for: [https://www.gnu.org/software/parallel/man.html#DIFFERENCES-B...](https://www.gnu.org/software/parallel/man.html#DIFFERENCES- BETWEEN-prll-AND-GNU-Parallel)

The syntax difference is small for simple tasks.

</comment></comment><comment><USER19> parallel is nice, in the past I would run a small script like [https://gist.github.com/CMAD/3077918](https://gist.github.com/CMAD/3077918) because I had to migrate email accounts from a list and it was all very old servers with the package manager broken, good old times, now I will have to run some super convoluted orchestration

</comment><comment><USER20> cat 100GB_data_file_with_DUPLICATE_lines | parallel --pipe awk \'\\!a[\$0]++\' > data_file_with_UNIQUE_lines

is BETTER since it uses less computer resources than

gawk '!a[$0]++' 100GB_data_file_with_DUPLICATE_lines > data_file_with_UNIQUE_lines

<comment><USER21> That's a classic misuse of cat.

Just use '<'.

<comment> kamijo-k Yeah, but to me, this "misuse" actually makes the input and output clearer than using "<" and ">" together. After all, it places input on the left side of the command, and output on the right side.

</comment></comment></comment><comment><USER7> GNU Parallel rules! I made $100K with just a few lines of code involving Parallel.

<comment><USER22> Tell the story!

<comment><USER7> thery simple really, but so is UNIX :-)

parallel -j 1000 -a urls.txt {wget --recursive {}|lynx --dump|(other unix shell power tools) > url.txt}

gets you a powerfull web scraper that maxes out your internet connection.

Throw some machine learning on top of it and you can do a lot with that. Can't tell you what exactly I did with the ML that being trade secret about to get a patent, but the rest doesn't involve the parallel anyway.

<comment><USER23> OK, forget technical details; how's the money made?

<comment><USER7> better sales targeting

</comment></comment></comment></comment></comment><comment><USER24> Am I the only person who finds GNU parallel way too complicated? I tried to perform a very easy parallel task with it and spent hours reading the documentation and various tutorials. If a person with Unix command-line skills can't easily pick it up, what's the point of having it?

<comment><USER25> There do seem to be some very complex use cases. On the other hand, their example of parallel gzip of files seems straightforward:

find . -name '*.html' | parallel gzip --best

Generally, using it in places where you would normally use xargs seems uncomplicated.

<comment><USER26> Probably a stupid question, but how do the remote machines translate the pathnames to local pathnames? And what happens if they fail?

<comment><USER25> The example above is just running in parallel locally.

</comment></comment></comment></comment><comment><USER27> GNU Parallel sucks. Use xargs when possible and paexec when needing fancy features. BTW, paexec even supports piping next to process invocation.

<comment><USER13> Do you have an example of "piping next to process invocation"? It sounds interesting.</comment></comment>