Google Will "Feed The Winners" And "Starve The Losers" -- Like Wave - <AUTHOR> http://www.businessinsider.com/google-will-feed-the-winners-and-starve-the-losers-like-wave-2011-1?utm_source=feedburner&utm_medium=feed&utm_campaign=Feed%3A+typepad%2Falleyinsider%2Fsilicon_alley_insider+%28Silicon+Alley+Insider%29&utm_content=Google+Reader <comment><USER2> 2011: Chrome OS</comment>


A deep dive into the official Docker image for Python - <AUTHOR> https://pythonspeed.com/articles/official-python-docker-image/ <comment><USER2> > Debian names all their releases after characters from Toy Story.

I can't believe I'm just now learning this, but that's good to know next time someone asks why the names seem random.

<comment><USER3> It's cute but really frustrating. I wish they'd just use the version number or force everyone to use

        "<version #>-<stupidname>".

but I'm a FreeBSD user so what do I know?

<comment><USER4> To be fair, you can just point to the `stable` repositories in the `/etc/apt/sources.list` configuration file and simply just refer to your install as "Debian Stable" ('s/stable/testing/g').

However every few years there might be a not so "stable" update around the new release.

<comment><USER3> It's not for me, it's for when I get bug reports and I need to decipher what flavour of linux, what release of the kernel, what libc etc. "I'm running decrepit duck" doesn't really narrow it down too much. Especially when multiple distributions use these jovial monikers.

<comment><USER5> I think Ubuntu strikes a good balance— goofy, lovable names, but a clear alphabetical sequence. Robot operating system (ROS) inherited this approach with its naming as well: [https://wiki.ros.org/Distributions#List_of_Distributions](https://wiki.ros.org/Distributions#List_of_Distributions)

<comment><USER6> Why do we need the names at all though?

Every now and again I have to translate between a code name and a version string, or between a version string and a code name, and I think 'why on earth am I having to do this lookup work as a human?'

<comment><USER5> I feel like there are scenarios where it's convenient to have a plain text string that is certain not to gum up parts of the system that would choke on punctuation or a leading digit (see for example this package-mapping yaml: [https://github.com/ros/rosdistro/blob/master/rosdep/base.yam...](https://github.com/ros/rosdistro/blob/master/rosdep/base.yaml)). Of course, Fedora 19 is codenamed `schrödinger` including the unicode character, so that's been an interesting experiment in ensuring that all the systems which ingest and process the codenames can handle that.

Anyway, the obvious thing is that a codename is more fun and memorable than a number; it's something to hang marketing and such off of. Presumably this is why MacOS versions have always had public codenames since 2002. But I think the practical reasons are valid as well.

</comment></comment></comment></comment></comment></comment></comment><comment><USER7> > The packages—gcc and so on—needed to compile Python are removed once they > are no longer needed.

Is there a reason to prefer this method, where installation, usage, and removal all happen in one RUN, vs. using a multi-stage build? I tend to prefer the latter but am not aware of tradeoffs beyond the readability of the Dockerfile.

<comment><USER8> The reason is to minimize the number of layers, mostly the layers that are not used in the final image (in this example, a layer would include gcc while another would remove it, but you would still need to download the layer with gcc).

<comment><USER7> I thought non-final stages in a multi-stage build are left out of the final artifact; is that incorrect?

I'm thinking the "build step" would be done in an earlier stage; it could be the exact same RUN statement, or it could be split into multiple for readability, and wouldn't bother removing any installed packages, since they won't carry over to the final stage. Then the big RUN in the final stage would be replaced with something like `COPY --from=builder ...`.

<comment><USER9> EDIT: Provide example below

If you are doing multi stage builds it only matters to combined as many statements as possible in the last layer.

I agree that for clarity it is nice not to optimize layers in the build stage - those will be thrown away anyway.

I vastly prefer multi stage builds over having to chain install and cleanup statements

Example: I usually want to use the python:3-slim image, but this doesn't have the tools to compile certain python libraries with C extensions. Generally I will use the python:3 image for my build stage to do my "pip install -r requirements.txt" and then copy the libraries over to my final stage based on the python:3-slim image

Of course I could install and uninstall GCC and other tools in a single stage.. but that actually takes longer to do and is messier in my opinion.

<comment><USER10> > Example: I usually want to use the python:3-slim image, but this doesn't > have the tools to compile certain python libraries with C extensions. > Generally I will use the python:3 image for my build stage to do my "pip > install -r requirements.txt" and then copy the libraries over to my final > stage based on the python:3-slim image

Example on how to do that, please.

</comment></comment></comment></comment></comment><comment><USER5> An interesting aspect of this that isn't touched on in the article is about the much-maligned [1] scheme where Debian's Python is patched to look for packages in `dist-packages` instead of `site-packages`. The scenario in the Docker image is I believe the exact one that this is intended to provide sanity for, since you have two Pythons in play— the Debian-packaged python and also the built-from-source Python. Things get hairy once you start using the pip from either of these pythons to start installing pypi packages, especially if those packages or their dependencies have compiled parts which may not work for the other Python. Anyone who has used a Mac with brewed Python has also likely experienced this pain— especially in the days before wheels, where you basically had to use brewed Python for scientific work unless you wanted to compile big packages like numpy from source.

So the deal is that the system-supplied Python can get deps from apt packages, or from pip (into ~/.local, or as root into /usr/local), but either way will install them into a dist-packages directory. This keeps them separate from the packages which the built-from-source Python installs into site-packages.

Upstream Python has put a bunch of pieces in place to address this natively, for example with the "magic" tags that keep compiled assets separate in a directory of packages being potentially used by multiple different interpreters (see [https://www.python.org/dev/peps/pep-3147/#proposal](https://www.python.org/dev/peps/pep-3147/#proposal)). And obviously the ideal solution where possible is to simply use a virtualenv and be totally isolated from the system python. But there are situations where that isn't possible or desirable, such as in this docker container, and so here we are.

1: eg [https://github.com/pypa/setuptools/issues/2232](https://github.com/pypa/setuptools/issues/2232)

</comment><comment><USER11> One thing I've learned is that rather than use a docker-entrypoint.sh, most Linux software can be ran just using the `--user 1000:1000` or whatever UID/GID you want to use, as long as you map a volume that can use those permissions. It is a lot cleaner this way.

<comment><USER12> > _Why Tini?_

> _Using Tini has several benefits:_

> \- _It protects you from software that accidentally creates zombie > processes, which can (over time!) starve your entire system for PIDs (and > make it unusable)._

> \- _It ensures that the default signal handlers work for the software you > run in your Docker image. For example, with Tini, SIGTERM properly > terminates your process even if you didn 't explicitly install a signal > handler for it._

> \- _It does so completely transparently! Docker images that work without > Tini will work with Tini without any changes._

[...]

> _NOTE: If you are using Docker 1.13 or greater, Tini is included in Docker > itself. This includes all versions of Docker CE. To enable Tini, just pass > the `--init` flag to docker run._

[https://github.com/krallin/tini#why- tini](https://github.com/krallin/tini#why-tini)

<comment><USER11> I didn't know it was included by default. I'll check it out, thanks!

</comment></comment></comment><comment><USER13> After a few years' break from professional s/w dev, I'm really trying to get into the docker-based dev mindset.

You can use docker (or, less efficiently, a full-blown VM) for any purpose, but it looks like the killer app that has emerged appears to be devops. I guess same goes with k8s, as well as Chef/Puppet/Salt/Ansible/whathaveyou.

However, I'm noticing there is a new way of doing s/w dev emerging, let's call it modern software development, which utilizes some of these tools to maximize s/w dev productivity. I'm just not clear what is the best way to approach this.

The core issue is obviously dependency hell, and install-reinstall-reconfigure hell.

I guess a useful way to think is, what if I want do to web-dev, and android- dev, and, iOS dev, but I don't want these dev environments to interfere with each other, and all these dev environments should be available accessible on a single workstatation or powerful laptop.

I guess I could have docker for web-dev, docker for android-dev, and so on. I came across docker compose, and then I heard it's known to be cumbersome for dev-environments, and someone created binci to address those problems (though it's not a well-known tool).

<comment><USER14> The solution for this is to do your development in cloud directly. Projects like Skaffold, tilt and VSCode in browser are one step in this direction. Developer machines would become just thin clients and GUIs for these remote machines.

<comment><USER13> So you mean fire up an instance at AWS/Azure/GCP/etc that acts as an android- dev vm?

So dev environment is on the cloud? and all the data (working dir, data files, pdfs, whatever is involved during the dev phase) is also on the cloud storage?

That would be expensive, especially if you're a indie dev, and a tremendous waste of local compute/storage capabilities.

Again, I'm really not sure what near-future looks like in this space.

<comment><USER14> Indie devs are small minority, majority of the folks work in companies. You are already paying 2000-4000USD for your laptops, plus you also have to cost in lost productivity because of not being able to replicate your stack locally. Eventbrite is already doing this for all their employees - [https://kelda.io/blog/eventbrite- interview/](https://kelda.io/blog/eventbrite-interview/) So the economics of this does check out.

<comment><USER15> Larger companies can do this with virtual machines in their own datacenters, which cuts down a lot on the cost. Especially for developer machines, which have relatively high requirements on memory.

</comment></comment></comment></comment></comment><comment><USER16> is it really a deep dive if it doesn't go into the base image at all?

edit: ok reading the article further, there are handwavy explanations. Don't call it a deep dive if you're gonna say

"There's a lot in there, but the basic outcome is:..."

and then not explain anything beyond that.

</comment><comment><USER17> Why doesn't it just use the Debian python package?

<comment><AUTHOR> Debian Stable currently ships Python 3.7. If that's what you want, great.

But if you want Python 3.8, the soon-to-be-released Python 3.9, or other versions, you don't have that.

<comment><USER18> > _Debian Stable currently ships Python 3.7._

That's surprisingly new even. I remember Debian being very behind when it came to Python3.

<comment><USER19> But isn't that only because it was released just last year? Won't it stay stuck on Python 3.7 until bullseye is released in approx 2 years time? It'll likely be very dated by then.

<comment><USER20> Next Debian stable should be released in less than a year. It's been more than a year since Buster (current stable) was released. But yes the point stands that 3.7 will be all you get built-in for the next several months regardless of how many Python releases occur.

<comment><USER19> Thanks for correcting, you are totally right. No idea where I got the idea their releases were roughly ever 3 years, it's clearly every 2 years.

</comment></comment></comment></comment></comment></comment><comment><USER21> I would love to read this article on a phone but the top banner is not only highly confusing but also blocking a lot of the content ... please fix this

</comment><comment><USER22> > A common mistake for people using this base image is to install Python > again, by using Debian's version of Python

Is that really a common mistake?

<comment><USER23> Whoa boy, is it ever, but maybe not for the reason you're thinking. ie it isn't caused by people typing `apt-get install python`.

There are _many_ packages that have Python as a dependency these days. For example, on my Ubuntu system:

> ~$ apt-cache rdepends python|wc -l

> 4649

I think the best illustration of how this can happen is installing postgres libraries needed to build the psycopg2 PG client. If you know to install `libpq-dev` then you're great. But if you do something that on the surface feels totally reasonable, like installing the `postgresql-client` package... guess what? You just installed another Python interpreter.

edit: formatting

</comment></comment><comment><USER12> There are Alpine [1] and Debian [2] miniconda images (within which you can `conda install python==3.8` and 2.7 and 3.4 in different conda envs)

[1] [https://github.com/ContinuumIO/docker- images/blob/master/min...](https://github.com/ContinuumIO/docker- images/blob/master/miniconda3/alpine/Dockerfile)

[2] [https://github.com/ContinuumIO/docker- images/blob/master/min...](https://github.com/ContinuumIO/docker- images/blob/master/miniconda3/debian/Dockerfile)

If you build manylinux wheels with auditwheel [3], they should install without needing compilation for {CentOS, Debian, Ubuntu, and Alpine}; though standard Alpine images have MUSL instead of glibc by default, this [4] _may_ work:

      echo "manylinux1_compatible = True" > $PYTHON_PATH/_manylinux.py

[3] [https://github.com/pypa/auditwheel](https://github.com/pypa/auditwheel)

[4] [https://github.com/docker- library/docs/issues/904#issuecomme...](https://github.com/docker- library/docs/issues/904#issuecomment-544181321)

The miniforge docker images aren't yet [5][6] multi-arch, which means it's not as easy to take advantage of all of the ARM64 / aarch64 packages that conda- forge builds now.

[5] [https://github.com/conda-forge/docker- images/issues/102#issu...](https://github.com/conda-forge/docker- images/issues/102#issuecomment-619963279)

[6] [https://github.com/conda- forge/miniforge/issues/20](https://github.com/conda-forge/miniforge/issues/20)

There are i686 and x86-64 docker containers for building manylinux wheels that work with many distros: [https://github.com/pypa/manylinux/tree/master/docker](https://github.com/pypa/manylinux/tree/master/docker)

A multi-stage Dockerfile build can produce a wheel in the first stage and install that wheel (with `COPY --from=0`) in a later stage; leaving build dependencies out of the production environment for security and performance: [https://docs.docker.com/develop/develop-images/multistage- bu...](https://docs.docker.com/develop/develop-images/multistage-build/)

<comment><USER24> Interesting! I use miniconda extensively for local development to manage virtual environments for different python versions and love it. I hardly ever actually use the conda packages though.

I assume the main benefit of using these images would be if you are installing from conda repos instead of pip? Otherwise just using the official python images would be as good if not better

Edit: I guess if you needed multiple python versions in a single container this would be a good solution for that as well

<comment><USER25> Quite a few conda packages have patches added by the conda team to help fix problems in packages relying on native code or binaries. Particularly on Windows. If something is available on the primary conda repos it will almost assuredly work with few of any problems cross-platform, whereas pip is hit or miss.

If you're always on Linux you may never appreciate it but some pip packages are a nightmare to get working properly on Windows.

If you look through the source of the conda repos, you'll see all kinds of small patches to fix weird and breaking edge cases, particularly in libs with significant C back ends.

<comment><USER12> Here's the meta.yml for the conda-forge/python-feedstock: [https://github.com/conda-forge/python- feedstock/blob/master/...](https://github.com/conda-forge/python- feedstock/blob/master/recipe/meta.yaml)

It includes patches just like distro packages often do.

</comment></comment></comment></comment><comment><USER26> Why would the image remove the *.pyc files?

<comment><USER27> It keeps the image size down and they'll be recreated on first load for what you actually use. If you use the compileall module you can generate them for your app in the final layer.</comment></comment>


PyTorch-ProbGraph – Hierarchical Probabilistic Graphical Models in PyTorch - <AUTHOR> https://github.com/kpoeppel/pytorch_probgraph <comment><USER2> This still doesn't fix the fact that PyTorch libraries like torchdiffeq tend to benchmark orders of magnitude faster than other libraries (1) and then devs just write off the performance issues (2)

(1): [https://gist.github.com/ChrisRackauckas/cc6ac746e2dfd285c28e...](https://gist.github.com/ChrisRackauckas/cc6ac746e2dfd285c28e0584a2bfd320) (2): [https://discuss.pytorch.org/t/why-torch-jit-is-so- slow/36616...](https://discuss.pytorch.org/t/why-torch-jit-is-so-slow/36616/2)

<comment> t-vi A more charitable view on the PyTorch forums thread is that Ed's explanation "torch.jit, at this point in time, is not designed to take pointwise loops as you've written here, and compile them into machine code directly." is a description of "this is the feature you're implicitly asking about, and it isn't implemented in PyTorch yet". What would have been a better answer in your view?

It would seem btw that 1.5 years later, people are working on implementing generated kernels for reductions, even if it is still somewhat experimental.

The speed comparison, which is about 9 months old, is marginally related. The issue here is optimization of pointwise operations, which would be handled by the JIT fuser, except it is disabled by default on the CPU. The latest version of the benchmark code seems to not run on recent PyTorch versions as given. It still still a fair comparison in terms of it is what a user will get by default. I won't be the first PyTorch developer to say that Julia and its libs do a great job at JITed optimizations. Nonetheless I'm relatively certain that a determined PyTorch user would find ways to get that a better optimization of that ODE step using some of the disabled by default features.

The other truth, of course, is that for PyTorch, there still is more emphasis on GPU when it comes to implementing optimizations.

(Disclaimer: I'm one of the people on that thread.)

</comment></comment><comment><USER3> Where are HMMs / CRFs?

<comment><AUTHOR> Feel free to add them. :)</comment></comment>


Foursquare Mayors are back - <AUTHOR> http://blog.foursquare.com/post/122180869423/claim-that-crown-mayorships-are-back

<comment><USER2> Incredible! What's next? Merging Swarm back into Foursquare?</comment>


Ask HN: Are there any high-end rentacoder type sites? - <AUTHOR>

I make good money at my job, but I want to buy my own place and I'd like to make an extra few hundreds pounds a month on the side.
I've looked at rentacoder type sites, but the bids on there appear from the outset to be quite horrendous.
Are they as bad as I'm making them out to be? Do others do work on these sites? If so, what sites can you recommend, and can you share some figures?
I'm a web developer by trade: php, mysql, postgresql, js, photoshop, etc.
Thanks. :) <comment><USER2> The problem is that as soon as a site shows up and allows bids, there will always be people willing to underbid. It's a race to the bottom; and the people coming from places with lower costs of living will always be able to underbid you.

<comment><USER3> It seems that the more the site focuses on bids, the more likely this is to happen.

Bidding systems inherently ignore distinctive qualities of at least one side of the transaction. In this case, it treats programmers as commodities, and so the prices tend toward commodity prices.

</comment></comment><comment><USER4> These rentacoder or elance sites make money by being the middleman. You can do the same by hiring these same workers overseas and reselling their services to local companies at a premium.

</comment><comment><USER5> Would be nice to have a list of all sites of this type and a general indication of their quality.

It's certainly an interesting way to get stuff done.

<comment><USER6> I found a recently published list of 20 of them. This is by no means a complete list, and there is no indication of quality that I can find.

<http://acrisdesign.com/2009/08/hello-world/>

<comment><USER5> thank you!</comment></comment></comment>


Ask HN: "Interesting" Job Contract - <AUTHOR>

This question comes from an unexperienced young hacker who is at the beginning of his professional career. Recently I had an interview with a local software firm and was offered a developer position. But there's a little quirk: The employer told me that the developers were entitled to half of their salaries and had to earn the other half by turning in coding assignments throughout the month. He made his point by saying "This way slackers and hardworkers get what they deserve, and it is possible for a hardworking developer to earn twice his salary".
Also there's another important condition in the job contract: If I sign it, I'll have to work for a year. If I ever try to leave the job before that I'll have to pay a compensation to the company for every month that I won't be working.
So here's the question: Is this a "normal" kind of contract that software firms generally offer? Or is this a sign of danger?
TL;DR:
Job offer with half normal salary, must earn the other half by creating code. Can't quit for a year when started. Is it a Trap? <comment><USER2> Do not accept this offer. Do you really want to work with someone who A) Doesn't trust you to work hard and B) Doesn't believe their work environment or product is good/fun/exciting enough to keep you around for only one year?

We all have to start somewhere, but this sounds like a situation that will leave you feeling deflated, powerless and bored.

</comment><comment><USER3> Based on your location (Turkey) this is what I would do if I were in your shoes:

Rather than decide on yes or no based simply on the terms (which might appear ridiculous to those in US), I would check the track record/references of the company.

Do they use these terms to drive the programmers as slaves? or is it simply a defensive strategy (in response to local job market/legal environment) meant to ensure employee productivity and stability in the company?

Obviously its a no-no, if it is the former and an ok-yes if it is the latter.

\</comment><comment></comment><comment></comment><comment></comment><comment>-----

Why I say this: (the long of it for those interested) (All these refer to developing companies with high growth rates, high inflation, high competition and low number of truly qualified professionals - this is the reality of their job market/legal/economic environment)

Such contracts are often common in developing countries, where the turnover rates are ridiculously high. ( how about employees jumping every 6 - 12 months as sort of a norm among the non-mncs? - for a different reality)

Often, some employees join a company, complete training for a few months and then jump to another company showcasing that training. And latter companies often don't hold it against the employees for jumping so soon, because they dont' have to spend time and money on getting that employee trained - this is the nature of competition in those countries.

It is also a sort of protection for the company so that employees come in, get to know their good ideas (if they are worth) then just jump to other companies with those ideas or start their own companies based on them - the legal protection against this is ridiculously low or non-existent in almost all countries (even the democratic ones) except for those in NA/EU and Japan.

There is also this problem of prospective employees putting up fake certifications and experience, and claiming higher salaries in many developing countries. Systems to verify educational and occupational records of prospective employees are almost non existent, if at all.

Fyi,I am not pointing fingers at the employees, they are also under tremendous pressures to maintain a decent standard of living in environments subject to very high inflation ( against the typical 1-2% in the US, how about around 10%? and those are the 'official' rates which are often watered down for the international press). So they have to keep getting higher and higher salaries to maintain the same standard of living. Often that job hopping is the best way to ensure that increasing salary.

Either way, good luck.

<comment><AUTHOR> Thanks for the informative response man. I had a bad feeling about the contract when they explained the conditions. Later I read at a local message board about someone else's experience's with the same firm and how he was advised to not work for that firm by an inside developer. That is why I started this thread and now I realise the direness of the situation I may get myself into.

<comment><USER3> I guess you did your homework right!

</comment></comment></comment><comment><USER4> This strikes me as very odd. I have worked places where you got a bonus... that was contingent on performance or the company's performance. but i had a decent base salary.

i also worked at one place as a consultant where you had to give "6 months notice"... the spirit of the agreement was that you wouldn't work on a project and quit near the deadline. however, the only penalty was refunding your last bonus.

this deal seems pretty bad... unless the 1/2 the base salary is actual decent and i thin there would need to be very clear criteria for getting more money... it seems like that would be difficult.

the paying if you quit... that seems pretty crazy, how much would you have to pay?

<comment><AUTHOR> Half of the base salary is about $650. Probably I'll have to pay at least that much for every month short of contract period to the company if I quit.

</comment></comment><comment><USER5> I've never seen anything like that and would be very wary. You have no idea what will happen during that year. It could turn out to be an awful place to work that people are dying to get away from. It certainly doesn't sound like a great shop. There are better ways to deal with slackers than not paying as much as hard workers ( like not paying them at all, not hiring them to start with, weeding them out as quickly as possible ).

</comment><comment><USER6> I've never heard of this. It could be a trap. Talk to others who are currently working at the company, and who might have been working there for over a year. Personally I wouldn't do that for a whole year, maybe 6 months though.

</comment><comment><USER7> Don't ever let someone play games with your compensation. You're a professional.

</comment><comment><USER8> Please, can you share the name and location of this firm? Just curious, hahaha.

<comment><AUTHOR> It's a Turkish firm which creates hospital automation systems. Actually they just sell a basic program to all hospitals and tweak it a little bit for each case. It's been in the market for 20 years but I doubt it has many loyal developers.

<comment><USER8> If you can negotiate, then sign a contract that isn't a trap.

<comment><AUTHOR> Unfortunately, it's a standard contract. Only negotiation factor is the salary and that is as high as it gets in my current situation.

</comment></comment></comment></comment><comment><USER9> sounds like a wtf.. turn and don't look back</comment>


'Green' billionaires behind suppression of 'Planet of the Humans' documentary - <AUTHOR> https://thegrayzone.com/2020/09/07/green-billionaires-planet-of-the-humans/ <comment><USER2> Appalling.

A similar thing happened to Cassie Jaye (with Red Pill) a former feminist who decided to make a documentary on men's right activists and ended up recognising men have problems to.

<comment><USER3> People didn't think it was a very good film?

</comment></comment><comment><USER4> People who have money and a stake in green energy have the motivation and means to actively fight against the movie, while part-time volunteer activists don't.

That doesn't make the content of the film any more accurate [1], nor does it mean that the technologies put forward by profiteers of green energy less valid. This article too seems to cherry-pick problems without comparing the size to alternatives (which it doesn't offer).

It's ironic that the solution would lie in the hands of common people (change their consumption, become active), but prefer to blame rich people, left and right. Billionaires don't drive billions of cars or eat billions of beef steaks, the "average Joe's" do.

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

<comment><USER5> Thanks for the link. It infuriates me that beef consumption is subsidized by all tax payers. Big money. The externalities of beef production are devastating (water use, extra pollution, incentive to destroy Amazon Basin, etc.).

If consumers had to pay an unsubsidized price for beef and other products that gut-punch the environment, that would be a step towards making things better.

I don't want to take away anyone's right to eat beef, I just want them to pay for the externalities.

<comment><AUTHOR> I think this would drive a lot of interest to faux meats and other alternatives like tempeh, seitan, etc. Here's hoping!

</comment></comment></comment><comment><USER6> I am completely ignorant on costs and viability of green energy tech, but given the massive failure (by first world standards - load shedding is the norm in many developing countries) of the California energy grid now requiring forced blackouts, it does seem like someone was writing checks that they couldn't cash.

Governments getting heavy handed tends to backfire, but we refuse to learn this lesson.

</comment><comment><USER7> Being told that your ideas are horrible and ill conceived is not censorship - it is more free speech.

And Planet of the Humans certainly qualifies with the moving the goal post nonsense of fear mongering about landfill usage of mixed fiberglass turbine blades.

</comment><comment><USER8> I watched it because it I was told it was an alternative to the environmental fundamentalist.

After watching, which was painful, I thought is was more dribble from the environment fundamentalist.

I guess as an outsider it's all the one cult but from within there are these factions where not following the most extreme version is sacrament.

</comment><comment><USER9> might give it some eyeballs tonight</comment>


How we seamlessly moved from PHP to Django over 22 months - <AUTHOR> http://devblog.policystat.com/php-to-django-changing-the-engine-while-the-c

<comment><USER2> There are two things that strike me as odd in this report:

1) Why would you go through the process of switching the language. There are perfectly suitable frameworks in PHP, e.g. Symfony, that have the exact same approaches than Django and ROR. MVC, ORM and configuration over Convention over Configuration. Once you have a team that is good at a Language, you'll loose a lot in switching... and this leads me to the second question:

2) How can it take 22 month to rewrite this kind of application? A bit of CRUD and workflow should not take so much time.

WDYT?

<comment><USER3> _Why would you go through the process of switching the language?_

Well, if you want to know the truth of it:

If that language just so happens to be PHP, then they might have a whole bunch of reasons. A lot of people just _don't like_ PHP; don't consider it to be a very fun or interesting language to program in, and in particular, don't consider it long-term viable for large, multi-faceted projects.

<comment><USER2> I've heard a lot of that. Yet, mostly from people who've never or hardly ever used the language.

By reputation, PHP is a bit like JavaScript. JavaScript was this language nobody liked. It wasn't even considered a real language by most programmers. Some of it's design errors made it a language with low barrier to entry. Hence a lot of mediocre programmers made it unpopular with code that does not deserved to be called code.

This changed with people like Crockford and his 'JavaScript the good parts'...

It's pretty much the same with PHP. It gets the job done very easily... And once you know what you do, you can rely on it for large projects too. Especially with the changes that were introduced in the latest release: Namespaces, Closures, ...

</comment></comment></comment><comment><USER4> On the one hand, kudos to a team for taking on a big project and getting it done without interrupting service. But on the other, the article does nothing to explain the why-behind-the-why. Why did this change need to happen? What benefits are they now realizing? What aspects of Django attracted them in the first place? I want the sequel to this post.

<comment><AUTHOR> You're definitely correct that this post was light on the motivation for Django versus continuing with custom PHP. Perhaps it would be worth a follow- on post, as long as I can figure out how to not turn it in to a framework flamewar :)

In short though, we wanted to realize the obvious benefits of web frameworks over our poorly-constructed prototype raw PHP application (DRY, code re-use, reusable applications, MVC organization, testing tools etc.). We're now seeing basically all of those. Our code is clean and well-constructed because we were able to lean on the wisdom of the Django community. We use fully 24 different reusable Django applications, along with a couple dozen python libraries. Whenever we face a challenge, more often than not we can find a great blog post from the community that addresses a very similar issue and sometimes we can contribute back a little bit. When we hire new people, we can point them to Django's great documentation if they're new to Django, or they can jump straight in to our project and feel at home because it looks like basically every other Django project.

We're very very happy with Django and what it's given us over our own raw PHP. Other frameworks, like RoR would have given most if not all and more of these benefits, but the important thing in my opinion is that if you're doing a web application, you find a web framework that meets your needs. Honestly, when it came down to evaluating frameworks, it was RoR versus Django because that's where the community was. For me, it was Django because I like python's "one obvious way" versus ruby's many ways, which is a purely aesthetic judgement that plenty of people much more qualified than me make in the other direction. Once I realized that both of them would do a great job solving the problems our business was facing, I just made a decision and started writing code :)

</comment></comment><comment><USER5> That is very much a good way to do it. However for 22 months, I was expecting a larger project than one with 45 php files.

<comment><AUTHOR> We definitely could have ported the entire thing in under 22 months if that was our goal. The goal was actually just to make product improvements and gather customer feedback as fast as possible in the time we had, and the porting from PHP to Django just kind of naturally fell out of that. For example, the only PHP left for quite a while were the index and login pages. Until we actually needed to touch that code again for other reasons (a bit of a UI refresh), it didn't make sense to port that piece. It was working just fine and we had (and still have) a lot of other things that are important to work on instead.

Also, for about 2/3 of those 22 months, the development, operations and support team were the same guy, so that does have some impact :P

</comment></comment><comment><USER6> What is the performance difference (page load, processor load, memory load) after switching?

</comment><comment><USER7> Nice hack on the session sharing. "2. Build a Django Session Engine using phpserialize to speak PHP's serialization format"

<comment><AUTHOR> That was definitely the eureka moment that made us realize that it was possible. I'm pretty sure someone on the django users mailing list actually pointed me to the phpserialize library, which was the key to the whole thing.

</comment></comment><comment><USER8> I would very much like to see his Apache vhost.conf file!

<comment><AUTHOR> Sure thing. I'm going to try and get together a follow-up post with some of the php session engine details and the apache configuration we went with. Hopefully you'll find it interesting :)</comment></comment>


In Brazil, Major New Corruption Scandals Engulf the Faction That Impeached Dilma - <AUTHOR> https://theintercept.com/2016/11/25/in-brazil-major-new-corruption-scandals-engulf-the-faction-that-impeached-dilma/ <comment><USER2> The saddest fact is that it was obvious that would happen. The worst is still to come :-(</comment>


Woman who was shot while pregnant is charged in fetus's death - <AUTHOR> https://www.nytimes.com/2019/06/27/us/pregnant-woman-shot-marshae-jones.html <comment><USER2> "The police have said she was culpable because she started the fight that led to the shooting and failed to remove herself from harm's way."

The headline is shocking, but I can certainly imagine situations like this in which a negligent parent is responsible for putting their child/fetus at risk. Is there a precedent for a manslaughter charge for something like this?

<comment><USER3> The headline is clickbait, because it omits the only important detail.

<comment><AUTHOR> I think the headline is accurate. The fact that the pregnant woman may have started the argument or threatened the person who shot her are certainly important details to how this situation arose. The fact is that the pregnant woman was shot, and was arrested for endangering her fetus. This has a chilling effect on other pregnant women. Sometimes people argue and have heated disagreements. The idea that as a pregnant person you can now be arrested specifically because it endangers the unborn is frightening.

<comment><USER4> > The idea that as a pregnant person you can now be arrested specifically > because it endangers the unborn is frightening.

As of 2015 three states criminalize substance abuse particularly during pregnancy: Alabama, South Carolina and Tennessee.

[https://projects.propublica.org/graphics/maternity-drug- poli...](https://projects.propublica.org/graphics/maternity-drug-policies-by- state)

</comment></comment></comment></comment><comment><USER5> How does this make any sense? If they're going to press charges for the shooting of an unborn baby (which isn't new - the charge is manslaughter), the person who pulled the trigger ought to be the one charged.

<comment><USER6> The person who pulled the trigger was deamed to have acted in self defense and is not being charged. Getting a manslaughter charge when acting in self defense is what shouldn't make sense.

<comment><USER5> > Getting a manslaughter charge when acting in self defense is what shouldn't > make sense.

The instant someone pulls a gun trigger, they assume legal responsibility for the path of the bullet, and everything it does along that path.

If I fire a shot in justified self-defense but miss and kill someone else, I can (and should) be charged with manslaughter. That makes good legal sense, as far as I can tell.

<comment><USER7> in some states that is just not true.

In some states if you rob a bank and cop shoots at you but misses and hits and kills a bystander, then YOU the robber who did NOT shoot anyone will be charged with manslaughter.

that is sort of what is happening here.

<comment><USER5> Wow, that strikes me as really unjust and backward.

So if a policeman is willfully negligent and doesn't keep up his target practice, his own lack of skill could result in someone _else_ being charged with manslaughter. I disagree: If anyone is charged, it should be him—though I do recognize the court would rightly not hold him responsible if a reasonably competent person couldn't have been expected to do better.

If it worked that way, perhaps people would think twice more often before discharging a firearm - and fewer people would be harmed.

</comment></comment></comment></comment></comment><comment><USER8> I can't access this article. I've read another one about the case (Washington Post) and it doesn't really get into the cause of the fight.

But it sounds to me like the root cause is probably misogyny and what a lot of people would decry as "the evils of patriarchy."

As best I can infer, some guy got a woman pregnant that he wasn't married to. Before the baby is even born, he's keeping company with some other woman, probably de facto abandoning the pregnant woman and their child in the process. The two women fought. The fetus died.

He's not likely to ever be charged with anything. We are just going to argue about which woman he was screwing should be hung high.

<comment><USER4> Particularly given that your scenario includes no allegation of rape, it seems that you're draining these women of moral agency and responsibility for their actions. Such infantalization of women is hard to distinguish from misogyny.

<comment><USER8> The woman being charged is Black. How much agency do you think a poor Black woman living in a backwards Southern state should be expected to have in a world that increasingly wants to criminalize abortion, among other things?

Blacks and women: it's your fault your lives don't work. We don't want to talk about systemic issues, like how we think all men are entitled to sex and are not to be held responsible for the consequences of their actions. If your life gets ruined because he knocked you up and promptly bailed, well, bitch, it's your fault for spreading your legs, clearly.

Next!

<comment><USER9>
      a poor Black woman

The article says _nothing_ about her economic status aside from stating that she successfully posted a $50,000 bond and was released. Assuming that she is poor because she is black is racist.

</comment></comment></comment></comment><comment><USER10> To summarize (as I had considerable trouble wading through the _huge, vague articles on this proceeding_ ), hopefully accurately:

The logic is that she committed manslaughter by dragging the infant-to-be into a violent confrontation that she started, and which she escalated to the point that force was justified in defense against her (that part seems to be considered established). Like if you involved yourself in a high speed chase with an infant in the car, and that infant died in the proceedings, you would likely be guilty of manslaughter (in Alabama and some other places).

<comment><USER11> Shooting a pregnant woman out of defence can be justified only in the U.S. In any other country in the world you have to be extra careful with weapons.

<comment><USER10> So when a pregnant woman puts somebody in mortal danger, it is somehow the victim's fault for meeting deadly force with deadly force? I don't think that would fly even here in Canada.

The law may differ on duty to retreat and other matters (though in this case the victim retreated after retaliating), but at the end of the day, there is a circumstance where use of deadly force is justified against a person, whether that person is a pregnant woman or not. You're not meant to simply roll over and die when attacked by a pregnant woman so as not to offend the sensibilities of some random HN commenter.

<comment><USER11> According to the article it was ,,a dispute with another woman over the father of the child''. Of course if it's mortal danger, things are different, but I think it's generally very hard for a pregnant woman to kill another woman without a gun. The death statistics of U.S. compared to other countries don't support the theory that guns are used only in mortal danger.

<comment><USER10> > _...but I think it 's generally very hard for a pregnant woman to kill > another woman without a gun_

You are extremely wrong in that thought. One wrong bump on the head, and you are a goner. Don't get in a fight, don't start a fight, and don't stay in a fight you won't finish. Two average-build women fighting is perilous for the participants just like two average-build men fighting.

In the heat of an argument, one or the other is going to get the upper hand, and maybe today they don't choose a good time to stop pounding their opponent's head into the pavement. If you aren't willing to defend yourself, you can only hope that your opponent will show mercy when the time comes; I don't think it is really appropriate to ask the victim of an escalating battery to wait and see if they'll be killed once the situation is completely out of their control.

More details will probably become available, but there are circumstances that can be established, under which the charge discussed makes sense, and under which the person who fired the firearm is not guilty of an offence; such as if the pregnant woman is committing assault in the first or second degree.

> _The death statistics of U.S. compared to other countries don 't support the > theory that guns are used only in mortal danger._

What kind of non-sequitur is that? Nobody is making that claim or any statement that could depend on it.

<comment><USER12> If I follow your logic, lethal force is justified in any physical conflict because of the risk of "one wrong bump to the head."

<comment><USER10> Depends on the degree of escalation and a tremendous number of other factors, but yes: my understanding is that in Alabama, you do not necessarily need to wait until somebody is obviously trying to kill you to respond with deadly force.

On a personal note, I agree with this. It is unjust to ask people to wait until they're dead to defend themselves, when another person has initiated force that could rapidly become deadly.

It is not uncommon that one pushes another over in anger, and that other is killed. That's not manslaughter, that's _murder_.

P.S: Be careful mixing up _lethal_ with _deadly_ , or either of those with _fatal_. There are subtle but important differences.

<comment><USER13> > It is not uncommon that one pushes another over in anger, and that other is > killed.

What, like a cliff? No, I don't think "getting pushed over" is a statistically significant cause of death.

</comment></comment></comment></comment></comment></comment></comment></comment><comment><USER14> Dupe from yesterday [https://www.oregonlive.com/nation/2019/06/woman-charged- for-...](https://www.oregonlive.com/nation/2019/06/woman-charged-for- miscarrying-after-being-shot-while-shooter-goes-free.html)</comment>


Business Sense from 50 Cent - <AUTHOR> http://news.bbc.co.uk/today/hi/today/newsid_8327000/8327575.stm

<comment><USER2> 50s best business move was hooking up with Vitamin water early on. He advertised for them and in return got stock options instead of cash. Vitamin water was eventually bought out by one of the big drink makers and 50 made out with ~100M.</comment>


18 year guy found dead after playing Diablo III for 40 hours non-stop - <AUTHOR> http://www.pcgerms.com/18-year-guy-found-dead-after-playing-diablo-iii-for-40-hours-non-stop/

<comment><USER2> _The care taker of that café woke him up, and Chuang stood and walked a few steps, and then later he bowed. He . . . he reportedly died after his arrival to the hospital. . . the law enforcement agencies and medical guys reported that he died due to sitting for so long. His cardiovascular malfunctioned and Chuang eventually died._

Sounds like he formed a blood clot from sitting too long, and when he stood up it dislodged and caused a pulmonary embolism (or maybe a heart attack or stroke).

The sensationalist video game angle aside, this is a good story for us hackers to keep in mind. We tend toward long periods of sitting, and even a couple hours without getting up and walking around a bit will put someone at increased risk of having this sort of thing happen to them.

For a less "video games are evil" example, there's Heavy D's death following an intercontinental flight.

(disclaimer: not a doctor)

<comment><USER3> I would be interested in the autopsy results to see if a blood clot really did him off, or if it was exhaustion from 40 hours of playing a video game.

</comment></comment><comment><USER4> In other news, 90 people died in traffic-related fatalities yesterday.

Sorry, correction: that isn't news. Something which happens every day is, by definition, not news.

</comment><comment><USER5> Oh wow, Taiwan. I was expecting South Korea.

</comment><comment><USER6> Now loading final boss level!

</comment><comment><USER7> Good case for a standing work station</comment>


Ask HN: I released my project. Where do I go from here? - <AUTHOR>

I've just released my latest project, http://5factsabout.me and I submitted a story here and it got 3 comments, I've submitted to reddit and it didn't get much attention.
I've emailed Mashable and Techcrunch to try and get some coverage, so I'm waiting for a response.
I want to try and get it out to a wider audience (my target market is generally the sort of people who use, tumblr, twitter and facebook very actively) I'm not sure where to go from here to get it some attention. though. It's the first web project I've ever really made. I think it's got potential so far it's been live just over a day and I've got 60 users.
tl;dr Released project, how do I market it to social users. <comment><USER2> your marketing model should not be "email techcrunch and get coverage".

i hope that you have features that make this social tool easy to socially spread. if thats the case and you have something people are interested in using, it should spread.

if i were you, i'd reverse the process. having people sign up first before knowing anything about your app is off-putting. switch it up, have them enter in their 5 facts first and then once they save it, let them do their account. people will be more willing to sign up to save their work than sign up just to see the product.

how do you spread it? make it interesting and easy to use. it'll spread from the ground up.

<comment><AUTHOR> I have twitter/facebook buttons to make it easy to sign in, on the dashboard it has facebook/twitter share buttons that lets them post a message to the service and the same system on the results page. I tried to make it so whenever there's something that could or would be wanted to share, I made it available at the click of a button.

I like your idea on entering the 5 facts and it'll definitely be something I'll look into. Thanks for the advice.

<comment><USER2> no problem. this isn't the kind of thing that people are going to search for on google to find and use. you're going to have to get people using it and it'll spread like that. make it easy for high schoolers to use it. perhaps (i don't know if you're doing it already or not) widgetize it for blogs.

</comment></comment></comment><comment><USER3> I think the concept is pretty good, and I could see something like this going viral, but before marketing it I would work on the user flow a bit more..

1\. Engage people right away. I think those login / signup forms are going to scare people away. If it were my site, I'd just have a box where users input 5 facts about themself, an input box where they pic a username, and a big button that says "Create my page at 5factsabout.me/xxxx". Once they do that, ask for the their email / pass (or fb / twitter login) to finish the process.

2\. Make it as easy as possible for people to choose their facts. Suggest some ideas for real facts (a place where you lived, your middle name, etc..), and then possibly pull up facts entered by other people to give people ideas for fake facts. Maybe they can just click a suggested fake fact to add it.

Also, I'd suggest using the standard fb and twitter connect buttons. The buttons you're using now don't seem like login buttons. People are used to the standard fbml facebook connect button.

In my opinion, those changes could easily be the difference between it going viral and not going anywhere.

<comment><AUTHOR> Thanks for the reply it's been note. I was thinking about changing the login buttons myself aswell, I thought that they didn't really look much like login buttons. Thanks for the advice.

</comment></comment><comment><USER4> Start with closest evironment- your friends, collegues, people you know. Let them know what you built, invite them, may be ask a favor to come and register.

I remember how founder of CollegeHomour shared his experiences how he started site by creating countless accounts by himself and posted basic content to make site rolling. You should start with some user base to make site rolling.

What from technical point of view- sign in twitter and facebook icons looks wrong. You should make Twiiter/Facebook auth as first choice.

</comment><comment><AUTHOR> <http://5factsabout.me></comment>


G7 countries to provide $22m to fight Amazon fires - <AUTHOR> https://www.bbc.com/news/world-latin-america-49469476 <comment><AUTHOR> This seems disproportionately small considering seriousness and urgency of the problem.</comment>


Apple Confirms HomePod Can Leave White Rings on Wood Surfaces - <AUTHOR> https://www.macrumors.com/2018/02/14/homepod-leaves-white-rings-on-treated-wood/ <comment><USER2> Earlier today: [https://news.ycombinator.com/item?id=16378472](https://news.ycombinator.com/item?id=16378472)

</comment><comment><USER3> Ha ha, great. Good thing people with lots of money don't tend to have nice wooden furniture. /s</comment>


Apple dismisses Google's criticism over turning privacy into a 'luxury good' - <AUTHOR> https://www.theverge.com/2019/5/27/18641372/apple-craig-federighi-privacy-criticism-google-luxury-good <comment><USER2> Ridiculous criticism. If Google wanted to bring privacy to the masses for cheap, they could do it. Nobody is stopping them. If Apple makes it part of their sales pitch, regardless of the price of their devices, I see no problem with that.

<comment><USER3> The funny part is that it's precisely Google and friends who are giving Apple this position to make privacy a selling point.

<comment><USER4> How? Google respects privacy more than Apple does.

<comment><USER5> > How? Google respects privacy more than Apple does.

[citation needed]

<comment><USER4> Google lets you delete more of the things they record of you doing. Google gives you more control.

</comment></comment></comment></comment></comment><comment><USER6> The fact that this criticism was uttered by the Google CEO is deliciously ironic.

I do think, however, that it is a valid point in general: I would love to see Apple selling low(er)-cost devices that appeal e.g. the Indian market, so that they too can benefit more from the privacy advantages of an iPhone. While I do see that, at first (and second) glance this would be hard to reconcile with Apple's general strategy and image, I'm sure a company with Apple's resources would be able to "sell" this move well.

<comment><USER7> Apple is selling older models in those markets e.g. iPhone SE/6.

And remember that India is rapidly moving towards a typical middle class society and so people want premium products to show off their new found wealth.

<comment><USER8> People look at older models as older models, even though they may be good enough and may provide software updates for longer compared to many Android phones in that price range. It also looks odd (to the purchaser) when one is buying something that's a four year old model. Android phones, with the range of hardware differences, don't yield to such simple comparisons, and many of them offer slightly better hardware Year on year at the same price points.

Apple probably needs to come up with newer, refreshed (hardware), low priced models to beat this. But I wouldn't hold my breath on such a move happening.

</comment></comment></comment><comment><USER9> Apple's focus on privacy is quite a smart move. Google can't respond to it by tightening the privacy of their devices because that would undermine their business model.

</comment><comment><USER10> I find both viewpoints laughable: That Google thinks it has any shade to throw at Apple over privacy, and that Apple doesn't think it has become a purveyor of luxury goods.

<comment><USER11> Apple's installed base is 1.4 billion devices. 1.4 billion of any consumer product isn't "luxury".

Words mean things and "luxury goods" are from brands like Hermes, Louis Vuitton, Chanel, Gucci, Rolex, and Ferrari. Scarcity is an actual strategy for those companies. And if you actually consider the total cost of ownership rather than the upfront price, Apple products will either be equivalent or even cheaper than the competition.

Pichai and Zuckerberg have both tried this deflection now, and it just isn't a very good line of attack for the above reason. Apple products are too ubiquitous that everyone intuitively understands it's nonsense.

<comment><USER12> Right, that's exactly the brilliant insight that made Steve Jobs the genius he was: offer a product that is unquestionably luxurious, yet somehow also widely attainable. Result: the richest, most successful people in the world are sporting the exact same iPhone as my mom.

</comment></comment></comment><comment><USER13> To be fair, the cheapest phone you can buy right now from Apple is an iPhone 7 which comes in at a hefty $450. For a large majority of the world's population, this is pretty much completely unaffordable.

People in developing countries have maybe $100 - $200 maximum they can afford to spend on a device, and that's often through a very long time spent saving. Such a purchase is more akin to buying a car for these people. You could see then how having the price be doubled in order to be able to get access to a new Apple device would scream "luxury" in many ways.

That Apple dismisses these criticisms so lightly shows to me, a lack of perspective, that is frankly quite concerning. The world is a lot bigger than just Cupertino or the Bay Area, and it seems like Google has managed to understand this point. I wonder when Apple will too. Perhaps a new CEO is needed? Someone like Sundar who has actually lived through the experience of growing up in a developing country, and truly understands the pain points and thus opportunities that come with it.

<comment><USER14> Luxury of course is a relative term and in many parts of the world a $450 device would be considered a luxury. I don't think Apple is lightly dismissing the point, however. Apple does not leverage user data in the same way and their profits are driven by sales of goods and services. Federighi implicitly states that there is an amount of private user data utilized by Google in order to subsidize the cost of the phones.

Apple is often compared with Google, but it'd be more appropriate to compare them against Samsung, Huawei, LG, or another phone manufacturer. They produce a limited amount of products that largely serve a higher end market. They produce all their own processors and they don't design low end versions of the chips like Qualcomm do.

Could they afford to design lower end chips and offer low end offerings that could serve a broader base? Perhaps, but I doubt they'd like to dilute their brand image in order to do so.

Google can say privacy shouldn't be a luxury item but until real action is taken on their part to eliminate their own exploitation of user's private data, it holds no value to me.

<comment><USER15> > exploitation of user's private data

You don't understand privacy. If Apple collects the same information as Google, that is just as bad for your privacy as Google collecting that data and doing something useful with it (e.g., allowing you to search your images by content or providing reasonable spam filtering). Of course, Apple collects _more_ information, so it is actually worse (e.g., banking details for developing apps for your own device and location data for AGPS that cannot be disabled).</comment></comment></comment>