Netflix Plans to Spend $7B on Content in 2018 - <AUTHOR> https://www.streamingobserver.com/netflix-plans-to-spend-7-billion-on-original-content-in-2018/ <comment><USER2> It feels like we're pretty far past the point where there could be a "Spotify of movies" or TV.

Instead we have streaming companies getting into media and media companies getting into streaming. Multiple platforms each with their exclusive media content, each with their exclusive software and streaming protocols. Not exactly what I had in mind...

<comment><USER3> It was only a matter of time before large scale streaming tech got commoditized. That was Netflix's moat early on and now it will have to be their content library. They clearly saw the writing on the wall long ago.

The golden age of streaming is over IMO, now content will be increasingly divided into their own streaming services. I wish that streaming video were regulated like radio, with a flat rate per minute that gets paid back to the license owner. I can dream...

<comment><USER4> What possible justification is there for that? With radio there was at least the colorable reason that public goods (limited radio spectrum) were involved. Here's it's private content streaming from private servers over private wires.

<comment><USER5> Well, in the US, copyright exists "To promote the progress of science and useful arts" I can argue that being able to be able to get movies in one place is certainly useful. Or that it seems reasonable that in exchange for the unnatural monopoly of copyright, strings can be attached.

<comment><USER4> All property rights are "unnatural" (animals don't recognize property rights, only possession). In my view, copyrights are the least unnatural. We grant property rights in land with few restrictions, yet real property rights are a greater restriction on freedom than copyrights. A copyrightable work, unlike a piece of land, is the fruit of someone's labor. Land, in contrast, pre-exists the owner. And whereas land is a scarce natural resources, the universe of copyrightable works is unlimited. There is no good reason to attach more strings to copyright than to real property.

</comment></comment></comment></comment></comment><comment><USER6> Staggering costs like these are exactly why Disney is actually in a great position to start its own streaming service. It is already one of the biggest media companies in the world, and has ownership of tons of IP beloved worldwide.

I'm all for competition so I hope both companies succeed, but its pretty evident that Netflix needed Disney more than Disney needed Netflix.

I'm also all for the democratization of great content thats happening on YouTube et al.

<comment><AUTHOR> I can't imagine the world where Netflix, Amazon, Disney, and HBO all coexist.

<comment><USER7> HBO includes Warner Brothers, DC, and a huge catalog. So, I think they probably have a pretty good shot on their own.

Amazon and Netflix are the wildcards given their smaller original content.

<comment><USER8> Netflix is certainly building up it's library. Amazon may decide they don't care.

</comment></comment></comment></comment><comment><USER9> It's amusing watching people complain about how we're headed to a world where the streaming services are no better than cable TV. Netflix is $10 / month. Pile on a half dozen services like that, and you're still only around 50-60% of what the average cable bill in the US is (just over $100 / month). Did you really think that all these media companies were going to magically shed 90% of their revenue?

The user experience does kinda suck, but I think Apple TV, Roku, and other meta-streaming-platforms will solve most of that in the long run. They'll be the new cable companies, essentially. But I bet you'll get less bundling than cable has now. Although I constantly see people saying that they _want_ bundling. "I'd love to just pay $100 / month for every tv show, movie, song, etc. out there..." That's the ultimate bundling :)

Also, for the people who keep saying they want to just pay for a single show, can't you do that on iTunes and Amazon? Buy a season pass for a show? I haven't really done this much, so maybe it's outlandishly expensive, or they have poor coverage of shows people want.

<comment><USER10> > Did you really think that all these media companies were going to magically > shed 90% of their revenue?

This is exactly what happened with print media. Why is film media immune from the internet revolution?

<comment><USER4> The two situations are completely different. With print media, the Internet showed that the public was willing to forgo an expensive, high-quality product ( _e.g._ the NYT) for a much cheaper, low-quality product ( _e.g._ Buzzfeed).

That hasn't happened in television and film. To the contrary, peoples' expectations have only gone up. The production value (and production costs!) of television shows these days is up there with that of movies 10-15 years ago. Netflix's pivot to original content shows that consumers want high- budget, high-production-quality original content more than ever.

<comment><USER11> But then, people feel the need to consume news.

I can easily forego watching a TV series. There are only a couple of "must watch" TV shows at any given time.

I already have a huge backlog of shows to watch/finish. I honestly don't care if I never watch a new TV show again

<comment><USER9> I don't think this is universal. I bet many people feel a lot more attached to their favorite shows than to watching the news.

</comment></comment></comment></comment></comment><comment><USER12> Contrast this to HBO's budget which is ~2B$ I believe and they generally cost 15$+\month. Netflix is just getting started in ripping up the old order.

<comment><USER13> > Netflix is just getting started in ripping up the old order.

Not sure I like the direction the new order is taking, really look more and more like the old order to me. Before you need to pay for cable packages to get a random set of channels. The new order is that you pay various providers offering a random set of exclusive shows. It is still cheaper at the moment though.

What I'm hoping to see is big streaming network starting to use exclusive content as currency between themselves to share their catalogs. However, I'm not sure what would be their differentiator. Netflix is superior to DVD and the channel delivery mode of cable. However, Netflix vs Hulu vs HBO vs ... there is not much more to fight than price. Keeping their content exclusive on the other hand is very easy to sell.

<comment><USER14> At least with the new order, you can choose to not purchase Netflix or Hulu or Disney's option. With the old order, it was all or nothing.

<comment><USER15> >With the old order, it was all or nothing.

Not really, HBO was always an add-on. In the new order, Internet access = basic cable, streaming services = premium channels.

</comment></comment></comment></comment><comment><USER16> At what point is Netflix no longer considered a technology company? Streaming the amount of video that they do is definitely a monumental technical challenge, but if content is the key to their future, it seems like they are an entertainment company.

<comment><USER17> This trope of establishing businesses as either "a tech company" or $INDUSTRY needs to end. You either provide a product or service in a particular $INDUSTRY and are technology lead, enabled or not. Netflix, Facebook, etc are "technology lead" businesses. Tech is _not_ an industry, it's a medium in which a value proposition is delivered.

<comment><USER18> This came up in a thread about banks. Some finance institutions, or at least their employees, nowadays explicitly talk about themselves as technology companies that do finance. I had an interviewer at Morgan Stanley say this to me just last year. I used to work on the Quartz platform at Bank of America. It's a fantastic technology stack including dev and release tooling, authentication and security layers, configuration defined infrastructure, custom GUI and web front end libraries and tons of other really cool state of the art tech. All the big banks employ many thousands of developers.

A lot of companies are realising that for technology to be a competitive advantage it has to be more than just off the shelf. Banks are pushed this way partly due to regulatory pressure - they can't simply outsource their legal obligations or therefore the technology that implements them. But that's just an additional pressure pushing them that way. It's certainly not the only one. Nowadays lots of service companies are going this way.

<comment><USER19> There also companies (like the one I moved to recently) that are old, established SME (small/medium enterprises - more medium in my case) who are in niches that just aren't large enough for off the shelf to work but not small enough to do without.

I was talking to my boss the other day and he said that I was pretty modest compared to some of the programmers he'd dealt with at out sourcing firms over the years (they tried that first, it didn't end well), I think my response tickled him "I'm just a negative plumber with a keyboard, if I do my job right at this end shit doesn't come out the other".

I think the hubris of "We must do world changing things/disrupt everything" to provide tangible value is a by-product of the hype around the startup scene and 'entrepreneurs' (that is people who set out to be an entrepreneur first and figure out at what later).

I've never wanted that, I've only ever wanted to be compensated decently and work at a job where I can see measurable _value_ in what I do, in my case that's writing production/factory management software that saves more money than it costs and makes the life of the end users more pleasant, it's also not particularly stressful and I go in at 9 and leave at 5 _every day_ with complete technical freedom and time for that rarest of rare things, documentation.

After spending the last 5 years in high pressure, insane demand environments I'm never going back, I'll go do something else before I go back to that, it's simply not worth it (to me).

</comment></comment></comment></comment><comment><USER20> Netflix has almost 100 Million users. That means they are spending approximately $70 per user on new Content in 2018.

Netflix costs between $7-$12 per month. Many of those subscribers will not last the whole year. It is awesome they are spending basically 100% of their revenue on new content, but this model is not sustainable.

<comment><USER21> Most of the content has a shelf life much longer than one year, so I'm sure that factors into the equation.

<comment><USER22> Plus good content invites new customers. Netflix has expanded to pretty much entire world now (China is the only major market with no Netflix). From my experience in India, they are investing heavily on local content. Existing, original or licensed, content is not enough for these markets.

</comment></comment></comment><comment><USER23> I'd love to believe that the vast majority of that money will go to the artists, actors, directors, muscians, and other creatives actually making this content, but I have a bad feeling it'll just wind up in the pockets of executives, board members, and stockholders.

</comment><comment><USER24> With this kind of spending, they must be planning to monetize beyond the subscription fees.

Get ready for the ads. Cable was ad-free in the early days too.

<comment><USER25> I don't know why people think that one can earn billions in online ads so easily. In my calculation, Netflix can't earn anywhere close to $10 per month on ads that people are willing to watch.

</comment></comment><comment><USER26> I'd like to see a DRM-free Netflix Original content only streaming plan. I'd sign back up and they could really set a good example.

<comment><USER27> Not only this, but could they at least enable Netflix original content through VPN/proxies? (as they've started blocking all access via proxy now).

</comment></comment><comment><USER28> Great we can look forward another half dozen remakes of the life and times of Pablo Escobar

</comment><comment> le-mark Anyone have any thoughts in how to get in on the content production game? Go get a film degree? Because this is really where the future is headed it seems.

<comment><AUTHOR> Start hustling and pushing content on YouTube, Snap, etc. Find a niche that interests you and just push out massive quantities of content.

What's your goal and what kind of content do you want to make?

</comment></comment><comment><USER29> 7B?? Where is it coming from?? If average monthly fee is $19 then you need 333,000,000 paying customers. Or 33,000,000 annul.

<comment><USER30> Netflix has 100M+ subscribers, so this doesn't seem like a problem.

<comment><USER25> It's not a problem if entire revenue is profit, which cannot be farther from the truth. It's annual profit is lesser than a billion dollar per year and remain below it for a long time.

</comment></comment></comment><comment><USER31> buying passes to all 5 top streaming/content services costs $53 which is less than any cable package costs and give you access to so much content across all your devices and absutely no ads. amazon $8.25/mo netflix $7.99/mo youtube $12.99/mo hulu $7.99/mo hbo go $14.99/mo

</comment><comment><USER32> That's really not that much money, ESPN spends $1.9B on just one show--Monday Night Football.

<comment><USER33> Sure, and it's starting to look like that is not sustainable. ESPN just cut tons of expensive on-air talent. Cord cutting is killing ESPN as they are getting a very large portion of everyones cable bill.

<comment><USER34> ESPN is a big reason that non-sports watchers cut the cord - why subsidize costly sports channels for everyone else? If the demographic data is right, non-sports watchers are a larger proportion of younger demographics.

</comment></comment></comment><comment><USER35> Aren't they funding The Witcher series?

</comment><comment><USER11> They'll do far better to spend a bit of that money on improving the content experience.

I unsubscribed because there is far too much content and I never know what to watch

<comment><USER36> This is really very hard to fix the problem. So you have unsubscribed because there are too much media to digest available? You must be an extreme minority with a problem like that.

</comment></comment><comment><USER37> $7B... let's see, with the astronomical amount of money Netflix dumps into individual projects, that's what, 10 or 12 shows? :)

<comment><USER38> With the quality of content they produce, that's more than enough. They are headed towards HBO level of production.

<comment><USER39> Agreed.

To the younger generation I am sure they already are considered equal to or better than HBO, they are less likely to factor in any legacy content.</comment></comment></comment>


Find an integer not among four billion given ones - Stack Overflow - <AUTHOR> http://stackoverflow.com/questions/7153659/find-an-integer-not-among-four-billion-given-ones <comment><USER2> This is a good example of why programming puzzles do a poor job of testing an applicant's problem solving ability.

These programming puzzles are like the old fashion puzzles <http://www.lehmans.com/store/Toys___Iron_Puzzles>.

* If you know the "trick", they are trivial and don't test your skill at all.

* If you don't know the "trick", they are extremely frustrating and don't test your skill at all.

* Once you know the "trick", you will look like a "genius" every time.

* The "tricks" are widely available on the internet.

Besides the "trick" issue, the "integer not in four billion" suffers from having "domain knowledge bias", which is pretty common with programming puzzle problems. This is one of the reasons programmers only hire programmers like themselves - they cannot see outside their bias box.

For someone with a bit-twiddling C/assembly background, the obvious assumption behind the puzzle is that "four billion" and "integer not among" and 1GByte implies you are given the unsigned integers 0..2^32-1 with one of them missing and you are to make a bit-map of the integers.

For someone without a bit-twiddling C background, they quite likely will both produce a perfectly valid answer and will fail the interview. For instance, finding the highest value _n_ and returning _n+1_ is both _correct_ and _better_ than the implicitly "correct" answer in that it will take _much_ less memory than the implicit algorithm and run much faster.

In fact, if you are allowed to take advantage of the puzzle author's bias box, the answer 2^32 will be correct every time and will be impossibly fast compared to the "correct" answer or even the _n+1_ answer. In fact, the _n+1_ answer will always be 2^32, given the bias box - the puzzle author cannot conceive of an integer larger than 2^32-1.

<comment><USER3> Someone complains about every possible interview question. This isn't the best, but it's not the worst, either, at least not if the interviewer expects a conversation rather than a "perfect" answer.

If you fail the interview because you assumed "integer" meant the wrong thing, then maybe you deserved to fail. You should have asked what the interviewer meant. They could have meant mathematical integers (possibly only positive ones), 32-bit ints, 16-bit ints, "bignum"-style integers, etc. If you fail to ask for clarification, then at best you deserve to have the interviewer choose a different definition and then reveal that after you've wasted time assuming 32-bit ints. Ask for clarification and don't simply assume when there are multiple possibilities.

And you're neither correct nor especially clever for answering 2^32 if the interviewer tells you the question is about 32-bit unsigned ints. 2^32 is not a valid unsigned 32-bit int. This answer is either nonsensical or incorrect, depending on how we interpret it.

</comment></comment><comment><USER4> First, find total number of digits of the 3 999 999 999 smallest integers.

Let's assume 0 doesn't count. The first 9 numbers have 1 digit each. The next 90 numbers have 2 digits each. The next 900 have 3, etcetera. That's 38 888 888 889 digits. Assume one byte per digit. Add a delimiter between every two numbers, plus one delimiter between the 3 999 999 999th and 4 000 000 000th number. That gives us 42 888 888 888 bytes.

Subtract that number from the total file size to get the number of digits in the final number. Say the file is 40 GiB. 40 GiB is 42 949 672 960 bytes. That leaves 60 784 072 bytes (or digits) for the 4 000 000 000th number.

Add 1 to that number to make sure it's bigger than any of the numbers that can possibly be in the file. Now construct a number of 60 784 073 digits by whatever method you wish.

</comment><comment><USER5> I have to be honest: I would cheat. Cantor's diagonal argument can construct such a number quite easily.</comment>


Linux Benchmark Scripts and Tools - <AUTHOR> https://github.com/haydenjames/bench-scripts <comment><USER2> This includes known-to-be-misleading microbenchmark tools.

<comment><USER3> Hi Brendan,

I see you maintain a list of tools for Linux on your blog [0]. Many thanks for that.

[0] [http://www.brendangregg.com/linuxperf.html](http://www.brendangregg.com/linuxperf.html)

</comment></comment><comment><USER4> [https://serverscope.io/](https://serverscope.io/) has a similar compilation of tests it runs. Would be interested to hesr commentary on how their choices compare.

</comment><comment><USER5> Neat list, thanks!</comment>


Show HN: A nice Robot Reviews website \{•̃_•̃}/ - <AUTHOR> https://www.personalrobots.biz/?robotics <comment><USER2> Amazing!

Feedback: Site is pretty good. Information is easy to search. I would like to see how they are made. (what hardware and software used in the process of making them)

Thanks!

</comment><comment><AUTHOR> please add your feedback here !</comment>


Cryptocurrency: The Good, the Bad, and the Ugly - <AUTHOR> https://medium.com/p/cryptocurrency-the-good-the-bad-the-ugly-27fc7a2cbc88 <comment><USER2> The bitcoin fees required for confirmation in the next block are currently above $20 for a typical transaction size[1]. This could be attributed to the block size limit, but recently the fees on Ethereum (which has no fixed block size limit) have exploded and are also well above $1 now[2].

So is the effect of deflation on spending even relevant at this point? We're learning that current blockchain designs don't scale, so widespread use of them as currency is impossible anyway!

Yes, there is R&D being done to try to address this, but it isn't clear to me that the problem can be solved while keeping the salient properties of cryptocurrencies.

[1] [https://bitinfocharts.com/comparison/bitcoin- transactionfees...](https://bitinfocharts.com/comparison/bitcoin- transactionfees.html)

[2] [https://bitinfocharts.com/comparison/ethereum- transactionfee...](https://bitinfocharts.com/comparison/ethereum- transactionfees.html)

</comment><comment><USER3> I think this article makes a good point. What incentive do bitcoin holders have to use it as a 'currency'? I bought $80 worth of parts for my Raspberry Pi kit (which was essentially free to me due to the increase in BTC value) and I now "deeply regret" it as the author mentions in his article. A friend of mine has 15BTC that he is lothe to spend due to the increasing value of the cryptocurrency market. When will we see stability? Even if prices did stabilize, would we ever see widespread adoption of btc, or any other cryptocurrency for that matter, as a medium of exchange?</comment>


AWS ignoring customer complains to update extension for ElastiCache - <AUTHOR> https://github.com/awslabs/aws-elasticache-cluster-client-memcached-for-php/issues/1 <comment><USER2> A single guy that obviously works on this and nothing else and who selectively responds who to respond to! Removed static compilation because he couldn't make it work and so on! I brought the attention of Jeff Barr to this issue via Twitter, but he didn't do anything either. I mean, come on, PHP 7 has been out for a while and it's been in development for so long and they way so long after the release, already announced that they support PHP 7, when they really don't! I'm so disappointed! No to mention they completely ignored the HHVM support as well!</comment>


Android 2.2 FroYo Offers Huge Performance Gains: Dell Streak Tests - <AUTHOR> http://hothardware.com/Reviews/Android-22-FroYo-Breathes-New-Life-Into-Dell-Streak/

<comment><USER2> 2.2 offers big theoretical performance improvements over <2.2. We all know that.

The graphs on this, however, are ludicrous. It's putting the 2.2 device up against 2.1 devices, adding questionable statements like "Even Samsung's 1GHz Cortex A8 Hummingbird chip can't compete versus the 1GHz Qualcomm Snapdragon chip in the Streak, when the Epic 4G is running Android 2.1 -- but over a 3X improvement from Android 1.6 to 2.2 on the Streak?"

Yes, JIT offers big performance improvements. It doesn't somehow make the Snapdragon a better chip, however.

<comment><AUTHOR> I don't think that was the intent of the statement. Read it again. The Hummingbird chip can't compete versus Snapdragon when it's tied down by Android 2.1... that was the point.

<comment><USER2> Indeed. I said questionable. Go to any review of the release of Android 2.2 and you can see the performance improvements that are pretty much universal across devices. This simply conflates the two and implies something that isn't true.

With 2.2 the Streak is competitive with other 2.2 devices. There is no surprise there, given that it runs essentially the same processor as the Nexus One.

<comment><USER3> The Dell Streak is actually a QSD 8650, while the Nexus One runs the QSD 8250. Both phones run on the Qualcomm dual-core architecture: arm9/arm11, with one processor dedicated to linux "apps" and one dedicated to the "amss", aka modem software stack.

I have both devices sitting on my desk here, so I ran a comparison. As I suspected, they are close. Also note that the Dell Streak's resolution is much higher and I'm not sure how/if the benchmark takes that into account:

      Linpack (higher is better):
      Nexus One: 32.94 MFLOPS
      Streak 2.2: 33.373 MFLOPS

      CaffeineMark (higher is better):
      Nexus One: 5587 (rank 124)
      Streak 2.2: 5738 (rank 109)

      An3dbench (no idea how scores stack up):
      Nexus One: 4746, Fill rate = 10MP/s, Game level FPS = 24.87
      Streak 2.2: 4495, Fill rate = 17.65 MP/s, Game level FPS = 32.26

<comment><AUTHOR> Great data, thanks.</comment></comment></comment></comment></comment>


Ask HN: Best solution for hosting docker app - <AUTHOR>

Hi, I am starting my path to the developer career. I've started using docker, it's amazing and keep my work portable! I would like to know which is the best solution to host docker images for production. I'd prefer something more solid than DigitalOcean or other pay-per-use services! <comment><USER2> If it's only about solidity DigitalOcean, AWS, and similar are ok for running single-host instances of your dockerized apps. If you want to get into clusters and scaling or are looking for a way to just take care of your containers and not of the infrastructure anymore, there's not many ready-made solutions, though. Amazon is working on ECS, and Google on GKE, but both are in a very early invite only Alpha stage. Other than those two, there's currently only us at Giant Swarm ([http://giantswarm.io/](http://giantswarm.io/)) afaik. If you're interested you can register for an invite and if you contact me directly, I could get you the actual invitation a bit faster. Also note that there's quite a lot of self-service solutions based on Mesos or Kubernetes, but then you're back at managing your infrastructure yourself again and you still have to book DigitalOcean or Amazon Servers.

</comment><comment><USER3> Can you please elaborate on what you mean by "more solid than DigitalOcean or other pay-per-use services"? I would dare say that DigitalOcean, AWS, Google Cloud, and the like are quite solid and a great, cost efficient solution for hosting a production application. They are also quite easy to use with docker containers.

</comment><comment><USER4> DigitalOcean is pretty solid so far. I've been monitoring uptime on my instances for a year and while a relatively new datacenter like Singapore was unstable for a while, I haven't gotten any alerts for the past few months.</comment>


Firefox 3 smart bar is just too smart - <AUTHOR>

[ I don't have a blog, so I'll rant here instead ]
FF3 came out today and I followed the crowd and upgraded to it. Within 5 minutes it became obvious that I passionately hated new "smart bar" feature.
A smaller thing was that it wasted tons of screen real estate and just didn't look esthetically pleasing. It rendered auto-complete items in two lines. It also made the whole list look like an Xmas tree with its liberal use of fonts, bolding and favicons. Apparently this particular "improvement" was so good that the FF3 devs removed a setting for disabling it from the about:config page. One now has to resort to using an add-on called "oldbar" instead. This made the suggestions list far more compact and it looked way cleaner and more usable.
However a far more annoying change was how smartbar populated the list. It matched what I typed not just to the head of the old URLs, but to any part in them. And to the bookmarks. And to the bookmark descriptions. And the page titles.
So typing "news" no longer brought up a list of news.ycombinator.com, news1130.com, etc, but rather slashdot.org (News for Nerds), digg.com (All News, Videos ..) and some other obscure URLs that I didn't even remember visiting. They say it learns and will eventually put most relevant URLs at the top of the list. Great, thanks. This just solved a problem that I didn't have to begin with. And it all would've been well, but here's a kicker - YOU CANNOT DISABLE THIS.
This leads me to the reason why I decided to make this post. This situation is a good example of how not to approach adding features to the application.
1. New features and behavioral patterns. These can be the defaults for new installs and this should gradually migrate everyone to the new feature set. However users arriving to a new version via an upgrade path should have their experience preserved as intact as possible.
2. Replacing features instead of adding them. You can bet that there are users that explicitly depend on existing behavior and taking it away is a big deal.
FF does not conform to these principles. Also by looking at the Mozilla forums it is obvious that the devs were aware of the problems these changes created, but decided to ignore them. Too bad really. It's not like it would've been too much work to handle these changes a bit more gracefully.
/eor <comment><USER2> While I agree that there should be a way to disable the awesome bar, it's worth nothing that it does take some training and getting used to.

The awesome bar uses historical data from previous searches, so if your search for "news" always ends with you clicking on HN, it will put that at the top. Over time, the bar will learn your preferences and become much more useful.

I hated the bar at first, to the extent that I considered going back to FF2. For example, I used to always type "en." to find a wikipedia page, but that no longer worked well. Now I love being able to type in parts of pages, and I no longer use bookmarks since I can just search my entire history. The only thing missing is the ability to sync the history and awesome bar training to other machines, which we're working on ( <http://labs.mozilla.com/2007/12/introducing-weave/> ).

Disclaimer: I work for Mozilla :)

<comment><AUTHOR> Well, it may sound strange and counter-intuitive, but when I am typing something in the address bar, I am _typing a URL_. Not _searching_ God knows what in God knows where. I know that in FF3 I could be, but that's not what I am used to. So all non-URL stuff that smartbar throws at me is just a noise that I have to filter out.

As I said above - the transition logic for FF2/IE/etc users was not thought through AT ALL.

Given it's a _smart_ bar, I expect it to be more flexible in its configuration, so that I could adjust its smarts as needed. E.g. it could have configurable weights that control how important a match in particular piece of data is. This way I would've zero'ed the importance of everything, but the matches at the head of the URL and happily went about my business without ranting :)

Again, this sort of flexibility is not a hard thing to implement nor does it pollute or burden the UI in any way. Why this or something similar didn't make it into a production release is beyond me.

<comment><USER3> I don't see your problem: you can still "just type your URL", can't you?

<comment><USER4> His problem is that he has to go through a lot more effort because under FF2, etc., he only had to type a few letters from the beginning of the URL in order to get where he was going.

<comment><USER5> This is still the case: typing in 'news.' will be recognized as a URL, and only subdomains of 'news' will be matched.

<comment><USER6> No it's not, it searches entire URLs, names, etc. So site.com/news will come up as well. I found the "awesome bar" entirely un-awesome as well.

<comment><USER5> No, it won't with the trailing '.' -- try it yourself, visit site.com/news and then search for 'news.'

<comment><USER6> But then you have to have the full domain, which is shitty. Defeats the purpose of having it search at all.

</comment></comment></comment></comment></comment></comment></comment></comment><comment><USER7> As someone mentioned above, it learns your habits. It irritated me at first, as any fairly major feature change would, but it is pretty awesome and useful.

When I find that I visit a site so often that I habitually key in the first few characters, hit down, and hit enter, it is time to bookmark it and give it a keyword (in a bookmark's properties). After doing so, (as an example) if I go to the bar and type 'hn' and hit enter, it automatically takes me to <http://news.ycombinator.com/>. I think using this feature would benefit you, and maybe ease your hatred to mild distaste, and, just maybe, eventually you'll even _like_ the Awesome Bar.

I wish you luck.

<comment> mark-t When I find that I visit a site that often, I subscribe to the rss feed. I use keywords for searches: / for google, m-w for merriam-webster, and so on.

<comment><USER7> I use <http://yubnub.org> in the Firefox search bar for that. It has commands for nearly every search you could imagine. I'm a bit of a command-line-geek, so that likely factors into its appeal for me.

</comment></comment></comment><comment> mark-t To be fair, there is an obvious benefit to being able to search titles and bookmarks. I've been using the betas (and nightly builds) for quite some time, and it's stopped getting in my way. I do believe that the default behaviors were not thought through very well (strings at the beginning of a url should have higher precedence than page titles), it does take up too much space, and it takes too long to show up. It also tends to interfere with autofill.

</comment><comment><USER8> I agree that when you start using it you hate it, but I've grown to love it. It's one of those little learning curves, and you learn to start typing what you mean instead of a cryptic URL. I think this is one of those things that "normal" users will love because it matches how they think. And us techy folks will learn to love it because it really does make more sense.

</comment><comment><USER9> Completely agree, I can't stand it. That combined with the fact that (in the Windows theme at least) the drop down on the back button is now in the wrong place are two pretty random changes that are exceedingly irritating.

Without reading up on it, I'd guess the SmartBar is an attempt towards trying to address the fact that "a lot of" [1] people don't distinguish or understand the differences between the address bar, a search box in the chrome, and whatever largish text box is at the top of their home page. That doesn't mean I don't hate it though.

[1] [http://blogs.msdn.com/oldnewthing/archive/2006/11/27/1160055...](http://blogs.msdn.com/oldnewthing/archive/2006/11/27/1160055.aspx)

<comment><USER10> Be careful-- the next thing you know, in FF4, the smartbar will be the "Google-as-you-type-suggestion-bar".

</comment></comment><comment><USER11> Good points. I've been using FF3 since alphas and have gotten used to the "smart bar". (I didn't even know it was called that until today.)

I tend to agree though. I'm still being driven nuts that Google's favicon has changed. I think companies need to be sensitive to all the momentum that people bring to their products.

But then you have to balance that with the overhead of supporting an "old" feature for the sake of old users.

This might have been one of those things that might have worked better as an add-on. I think it might have been kinda slick when you first fire up FF3 to be presented with a choice of basic add-ons to play with, like "Smart Bar".

<comment><USER12> People only want to learn one thing. If there's a default way, and an optional way, most people will use the default, so you'll be able to expect it and learn it. If, however, everyone is forced to choose at the beginning (without a default), there will be a pretty even distribution of people with and without the feature enabled. In a case where this severely affects the usability of the browser for those who aren't used to it (e.g. those who expect to be able to use the beginnings of URLs in the smart bar and can't, and, vice versa, those who expect to use keywords in the "old bar" and can't), this causes problems.

For example, say you wanted to set up computers for public use at a school or library. Which way is it better to set the option? If it were a default/option pair, it would obviously be better to set it to the default, since people would be more familiar with it. If, however, it were just two equally valid options, which one would people be more likely to be familiar with? Multiply this by every possible [add-on on/add-on off] pair, and you have, perhaps, 1000 or more default browser configurations, any of which are equally likely to run into in the wild!

Anyway, on your first point, I think _users_ need to be a little more sensitive to the fact that, if they don't allow themselves to be pushed out of their comfort zone every once in a while, their experience using their software (or anything for that matter) will never improve. If a feature worked crappily, one would never know it until they adapt to the "new way" enough to see how bad it was before. Until then, their comfort with the old way makes them much too partial to be a good judge.

</comment></comment><comment><USER13> A Firefox extension to turn off the AwesomeBar has been out since February.

Oldbar <https://addons.mozilla.org/en-US/firefox/addon/6227>

<comment><USER14> That only makes it _look_ like FF2. It still uses the same annoying way of guessing what URL you want.

<comment><USER15> How is it annoying? Just unlearn the cryptic prefixes or urls, and type in what you really want.

<comment><USER14> Well, starting to type "news" when i want "news.ycombinator.com" and getting "reddit.com" or "digg.com" is kinda pointless. Unless you're suggesting that URL's are obsolete?

<comment><USER15> not at all, but why not start typing "yc..." or "redd" etc instead? Be specific.

<comment><USER14> Maybe my line of thought where a URL that only one website can own is outdated, but i thought that by typing the URL it would be more specific then, say, going to google and typing in "news" and hoping to find hn.

</comment></comment></comment></comment></comment></comment><comment><USER16> I've gotten (semi)-used to it now, but I wonder why they did not make it an option to switch between the new way and old way. Or at least, keep the current "look" but have an option for it to behave the old way.

</comment><comment><USER17>
      --> about:config
      --> set browser.urlbar.maxRichResults to 0

This appears to work, but at the expense of removing the URLs you typed in the address bar. So I guess your point is still valid.

Personally, I think the Awesome Bar is fantastic.

<comment><USER14> Not having any sort of URL defeats the purpose of having a history. There has to be (and already is) an in between. It's what Firefox 2 and every other browser has.

And according to my IRC conversation with someone on #firefox # irc.mozilla.org earlier, Firefox 3.1 will have the option of having. They even have the patches all ready. So why it's not in Firefox 3 is beyond me.

<comment><USER17> > Not having any sort of URL defeats the purpose of having a history. There > has to be (and already is) an in between. It's what Firefox 2 and every > other browser has.

Yeah, which is why that setting is pretty much useless. Also, when setting that property to 0, it causes the screen to flicker intermittently when typing in the address bar (at least on Mac OS X Tiger).

</comment></comment></comment><comment><USER18> I've never hand any of these problems, the awesome bar is brilliant. Sure I'm not entirely sure where the sites I use all the time are but that is what bookmarks and keywords are for. d for digg, s for slashdot, f for facebook. The awesome bar is brilliant as a tool for finding search results you are trying to get back to, you have search friendly URL's that are indexed quickly, I can navigate my web app if I remember any part of the URI. This will be a big call for search friendly URL's as identifying a page by the id number just won't hack it when I'm looking for something by subject. This is the biggest improvements from FF2 to FF3, just let it grow on you. The aesthetics here are following the function, this URL is easy to read.

Brilliant.

</comment><comment><USER19> Sometimes there needs to be a hard break to what you're used to if it is simply a better interaction model. Firefox's smart bar is a definite improvement, although it takes adjusting to (like the Office 2007 ribbon, and the Vista start menu)

Not all of us want feature creep, and if we're doing something a crappy way, then I don't mind if I sometimes get dragged kicking and screaming to a better model. I eventually got used to opening my browser windows in tabs instead of new windows. I got used to Gmail compared to Eudora. It's hard to satisfy everyone, and if you can satisfy a lot _more_ people with a hard change that upsets a few people, sometimes it is better.

I don't think the points you made are prerequisites for good UI design.

</comment><comment><USER20> I understand the reaction, but I have to echo the other commenters who say they've "gotten used to it". This feature annoyed me for the first day or two I used it. Then I began to expect this behavior, and actually began to use it. Now I prefer it.

That's just me, though.

</comment><comment><USER21> The awesome bar is less than awesome. Definitely sticking with FF2 here.

</comment><comment><USER3> I think it is great. Bookmarks on FF always sucked really, really bad. With the ability to search them on the fly, I am almost happy (it is a hard problem, how to organize information).

Maybe it should be possible to disable it, but since I actually like it, I don't care...

You know about the bookmark keywords, right? I have set news.yc to keyword yc (in the properties of the bookmark), so when I type "yc", I go straight to this site. Maybe that feature could alleviate your pain?

</comment><comment><USER22> What annoys me the MOST about the smartbar is that it doesn't always work. Example: I type in maps.google.com and hit enter. Nothing happens. I click the little green arrow. Nothing happens. I edit to include the <http://> and still nothing happens. I have to search for google maps in the search box to get to the site. wtf?

</comment><comment><USER23> Give it some time, I thought it strange at first but after a few days once it learned what I wanted most of the time it became very useful.

</comment><comment><USER24> It takes some getting used to but once you wrap your brain around it and its quirks it's VERY useful, to me at least. Of course YMMV.

</comment><comment><USER25> It learns while you use it, so the sites you like (news.ycombinator, news1130.com, etc) will get to the top the more you use them.

</comment><comment><USER26> the super-wicked bar is a respectable addition. it works like just the all- hyped instant search technology (e.g. of google, copernic, etc.) by (instantly) finding any url (which includes descriptions) containing the relevant search phrase. it's super-wicked. and the greatest part is that it learns!

i could see why someone might want to disable it, but i find it supremely useful. i don't have to search through my history...the super-wicked bar does it automatically for it. it's like my whole history is instant-searchable in the url ("super-wicked") bar!

more and more software is continually making use of instant search technology (e.g. application launchers like Launchy), and it's a great thing indeed.

</comment><comment><USER27> I TOTALLY AGREE WITH YOU! When I'm typing a url, let me see URLS! If I want to search, there is a search box immediately to the right. >_<

</comment><comment><USER28> wat i hate happen is when i type in "p" it automatically goes to pornhub! m definitely not going to install ff3 in the computer down stairs.

<comment><USER29> Yes, someone on slashdot was complaining of this. He visited a pr0n site daily. Fine. However, now there's a good chance that site will flick by, two lines high, as he starts typing in the location bar before he gets too specific. He doesn't want to wipe his whole history, but nor does he want it appearing all the time. I can see his point. Just type `e' and the top match isn't specific to the very vague `e' but may be embarassing.</comment></comment>


Why Haskell for Semantic? - <AUTHOR> https://github.com/github/semantic/blob/master/docs/why-haskell.md <comment><USER2> Good pros and cons for Haskell. I really like Haskell but I frequently find myself reaching for Common Lisp instead. I have about 37 years experience using Common Lisp professionally and just a few years of more casual Haskell use, so I am not a good datapoint for comparing the languages.

Semantic is a cool project.</comment>


Taming math and physics using SymPy [pdf] - <AUTHOR> http://minireference.com/static/tutorials/sympy_tutorial.pdf <comment><USER2> It would have been useful to say that sympy means "symbolic Python" or, more generally, "a symbolic mathematics library". This means one can submit algebraic and differential equations to be solved, and sympy can solve a great number of them.

[http://docs.sympy.org/dev/modules/solvers/solvers.html](http://docs.sympy.org/dev/modules/solvers/solvers.html)

<comment><USER3> > It would have been useful to say that sympy means "symbolic Python" or, more > generally, "a symbolic mathematics library". This means one can submit > algebraic and differential equations to be solved, and sympy can solve a > great number of them.

I'm not sure I understand this comment; SymPy here is the name of the program ([http://sympy.org](http://sympy.org)), not the author's abbreviation. Surely one need not explain the etymology of the name of a program in order to give a tutorial on it?

If, on the other hand, you meant that it is good to learn how to use any sort of symbolic mathematics library, not just SymPy, then that is certainly true—but the author's advice appears to be quite specific to SymPy.

<comment><USER2> > SymPy here is the name of the program > ([http://sympy.org](http://sympy.org)), not the author's abbreviation.

It's not a program, it's the name of a Python library responsible for mathematical functions:

[http://sympy.org/en/index.html](http://sympy.org/en/index.html)

Quote: "SymPy is a Python library for symbolic mathematics."

> Surely one need not explain the etymology of the name of a program in order > to give a tutorial on it?

It's useful to know what these terms mean.

> ... but the author's advice appears to be quite specific to SymPy.

Yes, no problem there. SymPy's abilities appear in IPython ([http://en.wikipedia.org/wiki/IPython](http://en.wikipedia.org/wiki/IPython)) and Sage ([http://www.sagemath.org/](http://www.sagemath.org/)) to some extent also -- I've been involved in these projects for years.

My Sage tutorial: [http://arachnoid.com/sage](http://arachnoid.com/sage)

My IPython tutorial: [http://www.arachnoid.com/IPython](http://www.arachnoid.com/IPython)

My Python tutorial: [http://www.arachnoid.com/python](http://www.arachnoid.com/python)

<comment><USER4> SymPy doesn't appear in IPython, but IPython is aware of SymPy if it's installed so you can get nice printing of math in the notebook. Also, why link to the Wikipedia page for IPython and not the homepage?

For most people, I'd actually recommend the use of the IPython notebook for doing any SymPy work as you can get the nicely formatted math and inline plots. If one is doing debugging, then you're better off in one of the Python IDEs.

The PyDy guys who work on the sympy.mechanics module have done some nice IPython worksheets.

The SymPy tutorial that's part of the SymPy docs isn't too bad and there's the SymPy live shell so one can try things out.

While we've mostly moved away from IRC, we're now on Gitter and there's also the mailing list if you have specific questions.

Note: I'm a SymPy developer (and a GSoC 2014 mentor).

</comment></comment></comment></comment><comment><USER5> > Special care is required when specifying rational numbers, because integer > division might not produce the answer you want. In other words, Python will > not automatically convert the answer to a floating point number, but instead > round the answer to the closest integer

Note that this applies only to Python2, Py3k does float-division by default and integer division with // operator:

        Python 2.7.3 (default, Apr 10 2012, 23:31:26) [MSC v.1500 32 bit (Intel)] on win32
        Type "help", "copyright", "credits" or "license" for more information.
        >>> 1/7
        0
        >>> from __future__ import division
        >>> 1/7
        0.14285714285714285
        >>> 1//7
        0
        >>>

<comment><USER4> There's a couple of other things you can do. Since those are Python integers, you can specify a SymPy Integer instead with Integer(1)/7 instead. The other thing you can do is S(1)/7\. Both of these should work.

</comment></comment><comment><USER6> I've never used SymPy, but after looking through the tutorial, it looks like a nicer symbolic mathematical library than Theano. I know that the libraries have different focuses; Theano is about speed and tensors, while SymPy appears to be about algebra, but I would be interested in seeing if they have similar capabilities.

<comment><USER7> They are different projects with different goals, but some of the sympy team do try to employ sympy's capabilities in order to help theano generate better optimized code.

</comment></comment><comment><USER8> Python really is taking centre stage these days - glad to see. I still use R sometimes, but my Python usage grows daily. Also nice I can stick a web front end on things via Django or Flask.

<comment><USER9> Maybe someday we can say goodbye to Matlab. So many toolboxes to replace, though.

<comment><USER4> SciPy is the closer analog to Matlab. That said, it is missing many toolboxes.

</comment></comment></comment><comment><USER10> Good stuff, but maybe it would be nice to do a mini tutorial in the blog post itself. I only like PDFs if I'm going to spend 20m+ reading something.

<comment><AUTHOR> Good idea. It would make a nice series of blog posts... though I must say the easy-to-print PDF format has some nice things going for it too ;)

<comment><USER5> I think IPython notebook would be the best format for this.

<comment><USER2> Complete agreement -- IPython is a nice, relatively lightweight mathematical environment based on Python. Runs locally in a browser [EDIT: and command line as well]. Easy to use. Free.

My IPython tutorial: [http://www.arachnoid.com/IPython](http://www.arachnoid.com/IPython)

<comment><USER5> > Runs locally in a browser

And in terminal or a native Qt-based app. The Python runs always natively (ie not in browser), notebook/browser is merely a frontend to it.

<comment><USER2> Yes, thank you -- I edited my earlier post to reflect this.

</comment></comment></comment></comment></comment></comment><comment><USER11> by the way your students might like jasymchat.com, it is a mobile web app for jasymca..not as capable as sympy but ideal for undergrad work...shoot me a message if you have any thoughts.

</comment><comment><USER12> The PDF has

"Calculus is the study of the properties of functions."

Better would be:

Calculus is some mathematics for analyzing systems that change continuously, usually over time. The first motivation, by Newton, was to analyze the motion of the planets. Since then, calculus is central in nearly all of of physics, most of engineering, a lot of chemistry, much of the rest of mathematics, and also probability and statistics.

Calculus works, first, with real valued functions of a real variable. An example would be the speed of a baseball as a function of time. Later calculus works with real valued functions of several real variables.

The first important concept in calculus is 'rate of change' or the 'first derivative' of a function.

The second important concept is the integral which in effect 'adds up' changes. Integration can be used both to define and to find areas and volumes, e.g., the volume or the surface area of a sphere. Or if apply a force of 500 pounds to a car weighing 3000 pounds, how much time will the car need to accelerate from 0 to 60 MPH?

The fundamental theorem of calculus is that, with mild assumptions, if take the first derivative of a function and integrate that, then get back the original function.

Sometimes we have some information about the first derivative of a function and want to find the function; in this way we have a start on the subject differential equations. Some of the elementary parts of differential equations are also in a first course in calculus.

Here is a simple differential equation: Suppose t denotes time in days and our revenue per day is y(t). Suppose we know the revenue now, that is, at t = 0. So, we know y(0). Suppose we believe that we will have saturated our market when our revenue reaches b per day. Suppose we believe that the rate of growth of revenue is directly proportional to both the number of our current customers and also the number of our target customers we do not yet have. Calculus denotes the rate of growth as y'(t). Then for some constant k we have

y'(t) = k y(t) (b - y(t))

Then with integration in calculus, we can find y(t). What we get, depending on k, is a lazy S curve that rises slowly, then more rapidly, then slowly, and approaches b from below. So, this is an elementary case of differential equations. At one point, this differential equation and its solution kept FedEx from going out of business.

Differential equations are important in calculating trajectories of space craft, how to get a fighter jet to 60,000 feet in least time, the analysis of analog circuits in electronic engineering, Maxwell's equations in electricity and magnetism, the differential geometry of general relativity, Newton's second law, the heat equation, the stiffness of beams, etc.

Calculus is one of the main pillars of mathematics, science, engineering, technology, and civilization.</comment>


Show HN: JustA.ML – My first OSS project to share anything between your devices - <AUTHOR> https://justa.ml/ <comment><USER2> I'm a pushbullet zealot. What drove you away from PB to build your own solution? Just for fun, or was there a specific feature you wanted to see?

<comment><AUTHOR> I needed to send a long URL to my Smart TV browser, and you know the pain to type them using the remote (even the short links) - I love pushbullet and have it installed on all the rocks it can be installed to ... but not in TV :)

</comment></comment><comment><USER3> This was enjoyable to use. Looking forward to E2E and local transfers!

<comment><AUTHOR> Thanks, E2E was done for message, still working on files... local transfer is also in the research phase (compatibility is a huge concern).. i just hope no new project ideas comes up ;)

</comment></comment><comment><USER4> Looks cool but the site is super messed up on my Nexus 6P.

<comment><AUTHOR> Aahh I didn't realize this as i turned up the DPI in my phone. Will surely sort this out tonight. Thank you so much for letting me know this.

<comment><USER4> You are welcome</comment></comment></comment>


Are pointers and arrays equivalent in C? (2009) - <AUTHOR> http://eli.thegreenplace.net/2009/10/21/are-pointers-and-arrays-equivalent-in-c <comment><USER2> You can actually pass an array as an array in C99:

        #include <stdlib.h>

        void f(size_t m, size_t n, float a[m][n])
        {   for (size_t i = 0; i < m; i++) {
                for (size_t j=0; j < n; j++) {
                    a[i][j] = 0;
                }
            }
        }

        int main(int argc, char* argv[]) {
            float a[10][20];
            f(10,20,a);
        }

This "conformant array" feature was supported in C99. GCC supports it. Microsoft didn't like it, though, and didn't implement it, so nobody uses it, and it was made optional in later versions of the C standard.

It doesn't do what it looks like it does. The last subscript is totally ignored by the compiler. For 1D arrays, it's not only ignored, the object is still passed as a pointer to the element type.

I once proposed making arrays in C size-safe by taking conformant arrays seriously and adding some features to make them more useful.[1] After much discussion, the idea was considered sound, but not popular enough. So buffer overflows in C continue.

I have great hopes for Rust.

[1] [http://animats.com/papers/languages/safearraysforc43.pdf](http://animats.com/papers/languages/safearraysforc43.pdf)

<comment><USER3> That's ordinary C89 behavior, not a C99 feature, and I'm pretty sure Microsoft supports it too. The C99 feature here is VLA (variable-length array), arrays whose length is a runtime value.

If you change m and n to be constants, it works with C89.

The rule is simple (yet confusing!): In a function prototype, if the parameter (top-level) type is an array, it is de-sugared to be an element-pointer instead.

Thus, the code you wrote with constants instead:

        #define M 10
        #define N 20
        void f(size_t m, size_t n, float a[M][N])

De-sugars, as per C89 ordinary rules, to:

        void f(size_t m, size_t n, float (*a)[N])

And it is an ordinary array degradation to a pointer, except instead of pointing to a float, it happens to point at a float[N].

<comment><USER2> Variable length arrays are a different feature. They are local temporary arrays of variable size:

        int f(size_t n) {
            int temp[n]; /* local array of size n */
        ...
        }

Someone once used that feature in the Linux kernel to get temp space for a string. It was taken out, because those arrays went on the stack and thus allowed large kernel stack growth based on data from outside the kernel.

Nobody uses that feature either.

<comment><USER3> EDIT: I now see what you mean, sorry for misunderstanding.

The feature sounds useful, but the reason I misunderstood you is that you used the same syntax that represents array-to-ptr degradation, which made me think you were confused :-) I'm not sure how you would make this properly backwards compatible with C. You'd need to use a different syntax for such a major new feature.

Kept here for posterity:

You used variable length arrays in conjunction with ordinary array-of-array notation that (in function parameter list context) degrades to ptr-to-array.

Here is the output of gcc on your code, with -Wvla (which warns about use of vla):

      gcc -c testvla.c -o /dev/null -Wvla -std=c99
      testvla.c:3:1: warning: variable length array 'a' is used [-Wvla]
       void f(size_t m, size_t n, float a[m][n])
       ^
      testvla.c:3:1: warning: variable length array 'a' is used [-Wvla]

The VLA is why your code is C99. If you use a[10][20] in the function prototype, it is ordinary C89, and if Microsoft wrote a C89 conformant compiler, it works on Microsoft's compiler as well.

</comment></comment></comment></comment><comment><USER4> When I was first learning C, pointers scared the crap out of me, and it took me longer to understand them than I am comfortable admitting to.

Then I got pointers and this big "NOW I get it"-moment and felt really clever.

And _then_ came the moment I had a problem with pointers and arrays being interchangeable _most_ of the time and became very confused about when they were not equivalent.

People who like C (which I do, too) will often point out C's perceived simplicity when compared with, say, C++, but C definitely does have its murky corners, and the need for backward compatibility with existing code will most likely prevent them from getting cleaned up.

<comment><USER5> Much of my initial confusion with C style pointers was using & to show pass- by-reference and to get the address of a variable. It still doesn't make sense, but at least I've got it deeply ingrained now :\

<comment><USER6> C doesn't have pass by reference.

<comment><USER7> It has "pass a pointer by value", which works out conceptually to the same thing, only with slightly different syntax.

<comment><USER6> Yeah I was talking about this:

> was using & to show pass-by-reference

</comment></comment></comment></comment></comment><comment><USER8> One other difference on modern compilers relating specifically to character arrays:

This will work fine:

        char arr[] = "stuff";

        printf("arr:%s\n", arr);
        arr[0] = 'b'; arr[1] = 'l';
        printf("arr:%s\n", arr);

arr is allocated on the stack (not heap, sorry about the mistake) and is mutable.

But the following will segfault:

        char* ptr = "stuff";

        printf("ptr:%s\n", ptr);
        ptr[0] = 'b'; ptr[1] = '1';
        printf("ptr:%s\n", ptr);

Strings are allocated in the read-only data segment. Technically you can only write const char* ptr = "stuff", but due to wanting to remain backward compatibile, gcc will let you write the above and not even warn you unless you use -Wall or similar.

<comment><AUTHOR> Yeah. I was exploring exactly this problem when i came across this original article. Later i saw that "char arr[] = "stuff" " actually inserts assembly code that puts the value stuff into the stack. That was interesting news to me. stackoverflow.com/questions/29184100/char-array-and-pointer- initialization-semantics/29184190#29184190

</comment></comment><comment><USER9> This is straight from Expert C Programming book, including the diagrams. It's dishonest to recycle and present it as if it's yours with a reference mention at the very bottom. This is not a reference, it's a copy.

<comment><USER10> I agree with the other poster. I was going to upvote you earlier, and torrented the book you refer to for verification (ironically because I don't believe material should be stolen like this), but apparently I never got around to it because I was able to downvote you just now. The reason I never finished upvoting you was that I didn't think I found the right book: Expert C Programming doesn't match your description (of not being a reference, but rather the article being a copy of it). I didn't find the diagrams, and the text was very different.

So it sounds like your accusation is way off-base, and you should specify that you were wrong. Maybe you were just reminded of that other book but didn't verify that the article was a copy of it?

</comment></comment><comment><USER11> Also sizeof is different.

       char a[20];
       char *b;

sizeof a -> the size of the array (20)

sizeof b -> the size of the pointer (8 on my machine)

<comment><USER12> I was really surprised that it wasn't mentioned since it is the most important difference and a cause of frustration for programmers just beginning to learn C.

</comment></comment><comment><USER13> Funny how old articles resurface suddenly :-) It's great that HN still likes technical content, though.

FWIW I also wrote a (shorter) follow-up post a few months later about multi- dimensional arrays and their relation to pointers-to-pointers: [http://eli.thegreenplace.net/2010/04/06/pointers-vs- arrays-i...](http://eli.thegreenplace.net/2010/04/06/pointers-vs-arrays-in-c- part-2d)

</comment><comment><USER14> I like to think of them as being different and the equivalence - in some cases - only comes from what is known as the "array-pointer-decay" semantic:

[http://www.lysator.liu.se/c/c-faq/c-2.html](http://www.lysator.liu.se/c/c-faq/c-2.html)

This is why &a+n is not equivalent to a+n, something that a surprisingly large number of "C pointer tutorials" seem to get wrong.

</comment><comment><USER15> Excellent. Years ago (15-20?) I wrote a program with the bug he mentions at the end. Way before Stack Overflow was a Google away. I could not work out why it crashed. I ended up rewriting it and it worked, but never understood what the bug was (in my mind it has been logged as 'don't extern arrays' ever since). I just read that and ah-ha!

</comment><comment> je-so Another interesting thing to know about pointer and arrays is:

      #include <stdio.h>
      typedef int a_t[100];

      int main(void)
      {
         int  a[100];
         a_t* p = &a;

         // all printed pointer values are equal
         printf("%p %p %p %p\n", (void*)a, (void*)&a, (void*)p,  (void*)*p);
         return 0;
       }

</comment><comment><USER16> Will I be correct if I say that in the end, the difference is that arrays are immutable (in the address that they point to) and pointers are not?

<comment><USER3> No. An array has size (N * sizeof(element)). Arrays are immutable in their address in the same sense that any lvalue is immutable in its address.

      int x;
      int y[2];

The two declarations above are similar, one happens to be an (int). The other an (int[2]).

The difference is that when you take the rvalue of an int, say x, you get an rvalue int. When you take the rvalue of an int[2], you get a degraded (int *) rvalue that points to its first element.

Until you convert the array object to an rvalue, it is no more related to an (immutable) pointer than the above int. Both have an immutable address, like all lvalues do.

</comment></comment><comment><USER17> This is a well-presented version of [http://c-faq.com/aryptr/](http://c-faq.com/aryptr/).

</comment><comment><USER18> Aren't everything equivalent in C?

<comment><USER18> Why down vote? I don't think anyone who disagrees with this really knows C, or more accurately, how most computers work. Can down voters name something that can't be converted to any others? Unless you are using a Harvard architecture, anything in memory are equivalent.

<comment><USER19> You can't just freely reinterpret memory in C without following certain rules, or you get undefined behavior. Also, types have sizes, and alignment restrictions, and on some systems, trap representations.

</comment></comment></comment><comment><USER20> Ah Betteridge's law of headlines at work!

Arrays are aggregates of contiguously allocated objects.

Pointers are values indicating the storage locations of objects.

Thus, not equivalent.

Pointers are involved when you access an array. That doesn't make it an array. Just like scanning written text on a piece of paper using your index finger does not mean that "paper" and "your index finger" are equivalent. That's true even if you always instantiate an index finger before evaluating a piece of paper: co-ocurrence is not equivalence.

<comment><USER21> Why is this comment being downvoted? The explanation is correct and the analogy quite good too!

<comment><USER22> I suspect it's downvoted for the mention of Betteridges Law of Headlines, which (rightly) earns downvotes whenever it's mentioned.

<comment><USER20> Look, it even worked for your comment! Must be true.</comment></comment></comment></comment>


Pyjnius: Accessing Java classes from Python - <AUTHOR> http://txzone.net/2012/08/pyjnius-accessing-java-classes-from-python/

<comment><USER2> This is pretty much a perfect example of when to leverage import hooks.

<comment><USER3> Can you explain that a bit more?

<comment><USER4> So that you could:

      from java.util import Stack

Instead of:

      from jnius import autoclass
      Stack = autoclass('java.util.Stack')

[http://www.doughellmann.com/PyMOTW/sys/imports.html#custom-i...](http://www.doughellmann.com/PyMOTW/sys/imports.html#custom- importers)

<comment><AUTHOR> Someone on reddit asked for it, we'll do it.

</comment></comment></comment></comment><comment><USER5> Interesting. It would be great to see some docs touching on pros/cons vs jython, jpype, etc

I for one am interested in keeping everything in cpython if possible. But I currently have a web service in jython...

</comment><comment><USER6> Deocumentation: <http://pyjnius.readthedocs.org/en/latest/index.html>

<comment><USER7> I've used JPype in the past, but unfortunately it seems pretty much dead.

This looks really promising. Thank you for the hard work.

</comment></comment><comment><USER8> Looks good!

Has anyone tried this for accessing a Java Socket API? (e.g. Interactive Brokers API) Im currently using Jython but would love to switch to "real" Python, unfortunately i am still a noob when it comes to get these things working..

<comment><USER9> @jpdus Will you elaborate on why you are eager to ditch Jython in favor of CPython? I guess I have a soft spot for Jython.

Overall this project looks very interesting- Can't wait to go through the source code at <https://github.com/kivy/pyjnius> to see how this works under the hood.

Cheers.

<comment><USER8> @jaytaylor The main reason for my part is that most/all my projects are pure python so far and im way more familiar with (C)Python and its libraries (numpy/scipy fe), dependencies, etc. than i am with Java. I like Jython too, but if i had the opportunity to do everything in pure Python i would ditch it nevertheless!

</comment></comment></comment><comment><USER10> what's wrong with JCC?

<http://lucene.apache.org/pylucene/jcc/index.html>

i have used it a lot to generate JNI bindings for other code via a simple Makefile template (list JARs and packages, alter names and versions, and poof). it works quite often, but it does run into some wonky C++ code it can't quite figure out.

still, pretty easy. one example are some (work-private) mahout bindings.

</comment><comment><USER11> Does this mean we now have a convenient way to speak JMX from python? That would be very handy!

</comment><comment><USER12> How are generics handled?

</comment><comment><USER13> How does it handle the two types of exception?

<comment><AUTHOR> When an exception from Java side is throw, we catch it, and raise our own JavaException python class.

</comment></comment><comment><USER14> Very promising, thanks for the great work!</comment>


Interviewing the algorithm - <AUTHOR> http://www.niemanlab.org/2014/03/interviewing-the-algorithm-how-reporting-and-reverse-engineering-could-build-a-beat-to-understand-the-code-that-influences-us/ <comment><USER2> > The optimal solution isn't always necessarily the best solution

Actually that's the definition of "best".</comment>


Ask HN: Foreign Student as Cofounder in the US - <AUTHOR>

I'm not a US citizen, but I'm studying in the states on an F1 Student Visa (I'm an undergrad) and am interested in doing startups with some friends. However, a major concern I have is that as a foreign student I don't think I'm allowed to have equity in a company that my friends start.<p>My questions are then, 1) What options do I have in my position as a foreign student in the way of starting up? 2) If we apply for YC in the future, will this affect me? 3) If we build a web app and start to monetize it, how do I ensure that I don't break laws regarding employment? I would like not to be deported :) <comment><USER2> You can own or start a company, but you cannot work for it until you have proper authorization, ie. CPT, OPT, H1b, Green Card, etc. If you are found to be working for any company including your own, you could be out of status and hence deported. Thats my understanding.

</comment><comment><USER3> As a foreign student you are allowed to have equity in the company as long as you are not employed by that company. You are legally allowed to own a company as a foreigner, just not to work there. So the myth about you not being able to own equity is b/s.

Honestly, just start your startup, go as hard as hell at it, make money, get funded by a renowed VC firm and if they think you are useful, then they will sponsor you as their employee and you will be legally employed in this country.

Another route is to make so much money that you are given a green card. I believe if you generate more than $1 mil. in rev. and employ 12 citizens (any restaurant can do that), then you'll be all set.

You will not break laws regarding employment by monetizing on the app.

<comment><AUTHOR> Thanks for the information!

"You will not break laws regarding employment by monetizing on the app." I would still be in college if this web app were to be launched. I'm not quite sure what the rules regarding earning money from a website are(you're not technically employed for someone).

</comment></comment><comment><USER4> Have you looked @ the startup visa? And let me add that I have an enormous amount of empathy for you...

</comment><comment><USER5> same situation here! moving to the bay area for freshman year from hk</comment>


A customer on Amazon abused a promotional code I gave them and I've lost $50,000 - <AUTHOR> https://www.reddit.com/r/legaladvice/comments/5a2ycq/a_customer_on_amazon_abused_a_promotional_code_i/ <comment><USER2> I think trusting a web user on the good faith that they won't share the discount code is like asking a troll to stop trolling. I love the cyber security paradigm that says that every user input you have to treat it carefully.

You might want to liquidate your company and restart again.

<comment><USER3> Yea for anything faith based a rule I follow is to never trust with anything more than I'm willing to lose. This is the equivalent of giving out your bank card and pin to someone and asking that they kindly take $10 out and no more please. Doesn't matter if the bank rep tells me that is the only way to give money to the customer, I'd sooner take the hit to my reputation than to risk such a terrible worst-case scenario as the OP seems to now have learned.</comment></comment>