What I learned from my first C coding challenge - <AUTHOR> http://blog.jasonmooberry.com/2012/09/what-i-learned-from-my-first-c-coding-challenge/ <comment><USER2> (I realise the poster came up with a different solution ultimately, but this bears repeating.)

Don't hand-roll standard library functions. You'll very likely regret it later.

In particular, as hardware advances, OS vendors often update their implementations with optimisations specific to new hardware platforms. This both allows improvements for all programs that consume those interfaces, and prevention of regressions when hardware changes in some cases.

In addition, you really don't want to be the one that introduces a security bug into your program because it turns out your optimisation work didn't account for a scenario that the standard library function does.

I'm aware that there may be cases where some believe it's appropriate; don't give into temptation. It's a bad idea to duplicate the standard library.

<comment><USER3> Your advice is good but a bit too generalized here.

The reason why the standard library functions, qsort in particular, were performing worse in this case is not related to the implementation to the functions themselves. Instead, it is because adding a function call to a foreign function will practically inhibit all compiler optimizations that can happen around the call site. So the "overhead" of the function call itself is a lot more expensive than differences in the function implementation itself. In the case of qsort with function pointer callbacks, the effect is especially devastating. Benchmark qsort vs. C++ std::sort to see how much (a lot).

So when writing performance critical C code, it's a perfectly good option to re-write a standard library function, especially a simple one like this. Make it an inline function in a header file to make sure the compiler can optimize.

If your compiler can do link time optimization to these function calls, then you don't have to re-write them. Before LTO becomes mainstream, sometimes you might have to.

<comment><USER2> But that's sort of my point; today's optimisation can be tomorrow's performance regression, security bug, or be outdone by an update by the OS vendor.

It's very rare that a program's performance is being held back by a standard library function (speaking of libc here). I remain highly skeptical that the algorithm isn't the real issue instead of the implementation of standard library functions.

It's just not worth it.

<comment><USER4> > But that's sort of my point; today's optimisation can be tomorrow's > performance regression, security bug, or be outdone by an update by the OS > vendor.

>It's very rare that a program's performance is being held back by a standard library function (speaking of libc here). I remain highly skeptical that the algorithm isn't the real issue instead of the implementation of standard library functions.

In the last year, we encountered a bug with Solaris Sun Studio 12 on x64 where memcpy wasn't automatically inlined, forcing a full function jump every time it was invoked. That was a major performance hit, and forced us to switch to an internal implementation(that normally is worse on Solaris). IIRC, we didn't have much luck getting a patch out of Oracle for the issue.

So no, this really isn't true. In an ideal world, it would be.

<comment><USER5> How about, "use the standard library function unless proven guilty"? Sure, if compiling with Solaris Sun Studio 12 on x86 is a loss, but what about SPARC? Or Linux GCC?

<comment><USER4> SPARC is pretty much a lost cause for us. I believe that we have had better performance with the system memcpy over anything we've written.

Linux GCC was all over the place, depending on the Red Hat Enterprise version. IIRC, RHEL 4 and above, our internal code worked better, but with 5 and 6, the included memcpy is generally better.

If you're writing code that has serious performance requirements, experimentation is key. There's absolutely no guarantee that the system call will be better than a hand rolled call.

</comment></comment></comment></comment></comment></comment><comment><USER6> It's interesting that he points out that testing for zero is cheaper than comparing two numbers. Interesting because this might not always be the case.

For a quick test I used the conditions (i=0; i < NUMBER; i++) and (i=NUMBER;i != 0; i--). Without optimizations turned on, gcc translates both of them to cmpl (compare long) operations followed by a jne (jump not equal). So on an assembly level, they're absolutely identical except that in the one case you're testing against zero whilst in the other you're testing against the number. Fine, so we'll have to dig deeper.

And this is where it gets complicated. This optimization depends entirely on the inner workings of the ALU. Theoretically one can test against zero with just one subtraction, because 0-n == n-0 is always true, whereas a-b == b-a iff a == b, otherwise the two sides will differ in sign. On a hardware level such operations might be parallelized inside of the ALU though, so a comparison of two numbers might actually take exactly as many clock cycles as the comparison against zero.

It's however an interesting excursion into how such basic things work. And concerning my test: They're both about equally fast on my machine. I've done multiple runs with no clear winner.

<comment><USER7> The second version (test against zero) benefits from the fact that the subtraction instruction sets the Z flag automatically. So the end of the second loop is something like "sub i,1" followed by "jnz top".

The most straightforward implementation of first loop would be "add i,1" followed by "cmp i,NUMBER" followed by "jb top" (or "jl top" if i is signed). It's an extra instruction which may be even slower, depending on specific CPU and surrounding code, if NUMBER is a literal or memory access (as opposed to register value).

My guess is that your compiler will produce code that takes advantage of the savings if you turn on optimizations, but you might have to actually do something in the body of the loop to keep the compiler from optimizing the loop completely out (or tweak flags to enable/disable specific optimization techniques). Adding a loop body will make the timing difference less noticeable, as the single-instruction savings of the zero-test version becomes a smaller percentage of the total time per iteration.

Disclaimer: This is how I'd write assembly by hand. A compiler could conceivably do something quite different, depending on the specific application code, compiler, version and flags. I also haven't yet taught myself 64-bit x86 assembly code, although I understand it's rather similar to 32-bit x86 with more registers available.

<comment><USER6> The compiler optimizing out the loop completely is one of the reasons why I didn't turn on optimizations here, although there was a loop body. gcc is smart enough to optimize loops with a fixed outcome away in some cases. I probably should have written a more complex loop body.

That said, it's very likely that the compiler _will_ make sense of such an optimization and produce the quicker assembly code like you just wrote it.

What I wanted to say with my post was really that things like these are heavily depended on architecture and that comparisons could be optimized in hardware.

<comment><USER3> > The compiler optimizing out the loop completely is one of the reasons why I > didn't turn on optimizations here

Use a non-constant value for the loop and put a dummy load inside to stop compiler from doing loop unrolling and/or dead code elimination.

I often use time(), rand() or even argc to get dummy values when looking at assembly from compiler optimizations.

</comment></comment></comment></comment><comment><USER8> Any more detailed information about the coding challenge?

For example the repo references a 5Murls.txt file, but it isn't part of the repo and the blog says it needs to "output in a standardized format:", but doesn't specify what "standardized" means nor does the current code actually output anything (the printf is disabled). Does it specifically need to go to stdout or just that it exists somewhere in memory? Does it require a char* or will this char* be instantly hashed and tossed away? Does the challenge forbid the use of threads/cpus/workers? In the blog it says: "In this particular context the plugin architecture we were writing against allowed for returning the original string or a new malloc'd string" Are you allowed to muck with the original string? In the code on github it has a function that takes a const char* forcing a malloc, but it could easily just re-write the string in place if allowed.

edit: As for sorting the params, (based upon your comments about the common usage) pretty sure there is a way to do this without any string comparisons at all. Post a sanitized 5Murls.txt file and give it a go to make a patch.

<comment><USER8> The best algorithm depends upon the data presented. What is the:

\- Average number of parameters

\- The % that are already sorted

\- The % that don't have keys that start with same letter

<comment><USER7> It also depends on the assumptions we make about the problem.

\- Do we have to validate the URL strings in any way?

\- What do we need to do with duplicate names?

\- Are cases with small parameter names and/or small numbers of parameters common?

\- How common are parameters with lengthy common prefixes?

\- Is there a bound on the length of the longest common prefix of two different parameter names?

Tuning or special-casing with common cases in mind can often produce big wins.

</comment></comment></comment><comment><USER9> I made a varnish urlsort module a while ago: <https://github.com/cyberroadie/varnish-urlsort>

Here my blog post about it: [http://cyberroadie.wordpress.com/2012/01/05/varnish- reorderi...](http://cyberroadie.wordpress.com/2012/01/05/varnish-reordering- query-string/)

It parses the url and every token gets added to a binary tree which than gets traversed in order to get the parameters alphabetically

It's been used in production in several companies I worked for, so tried and tested :-)

Olivier

<comment><USER10> Interesting. Do you have any benchmarks handy to show how much of a difference this makes? I'd wonder if the dynamic allocations necessary to build the tree might undercut the lookup advantages.

</comment></comment><comment><USER11> As a note to the author about separating the arrays instead of using a structure, it was probably an alignment issue? Check out <http://en.wikipedia.org/wiki/Data_structure_alignment>

<comment><USER12> More specifically, a pointer in x86-64 (and most other 64-bit architectures) is going to be 8-byte aligned, which means that a struct of an 8-byte pointer plus a 2-byte short will actually consume 16 bytes.

Alternatively, keeping them in separate arrays removes the alignment overhead, and each pair of values will consume 10 bytes. That's a substantial savings when you're trying to fit into something like a 32KB L1 data cache.

Another technique that can help you fit as much useful data as possible into L1/L2 cache is to store offsets rather than raw pointers. Using a 2-byte unsigned short for an offset rather than an 8-byte pointer would save another 6 bytes of cache per entry, assuming you're happy limiting your URL size to 64 kilobytes. The extra address arithmetic should be essentially free on a modern pipeline.

<comment><USER11> I was hoping someone would fill in the details; it's been quite a while since I've dealt with anything like that. Thanks!

</comment></comment></comment><comment><USER13> > Pointer arithmetic I have always heard of pointer arithmetic but now I > understand why it's so useful. Taking a pointer to the first element in an > array and incrementing it to iterate through it's elements is elegant and > more efficient than taking an integer i and using it as an array index. __I > wish more languages afforded this. __

Trust me, no you don't. Pointer arithmetic is one of the easiest things to screw up in C, and the raw form can be very dangerous to work with.

For sure, treating a pointer as an integer and incrementing by a fixed number of bytes each time is fine, but more often than not languages have this implemented, just as a JIT or compiler optimization.

<comment><USER14> _For sure, treating a pointer as an integer and incrementing by a fixed number of bytes each time is fine, but more often than not languages have this implemented, just as a JIT or compiler optimization._

And here, you've inadvertently pointed out one of the major pitfalls (and amazing virtues) of pointer arithmetic: in C, pointers increment by the size of their data type. You don't add some number of bytes to the pointer, you add the number of elements by which to increment.

In other words, incrementing a uint8_t* will add one byte to the pointer address, but a uint32_t* will add four bytes, and a pointer to a 64-byte struct will add 64 bytes.

Here's an example. This code:

      #include <stdio.h>
      #include <inttypes.h>

      struct foo {
      	char bar[67];
      };

      int main()
      {
      	struct foo monkey[60];
      	struct foo *zoochild;

      	printf("sizeof foo: %zu\n", sizeof(struct foo));
      	printf("sizeof monkey: %zu\n", sizeof(monkey));

      	zoochild = monkey; // child points at first monkey
      	zoochild++; // child points at second monkey
      	printf("(monkey + 1) - monkey: %zd\n", zoochild - monkey);

      	printf("(bytes) (monkey + 1) - monkey: %zd\n", (uint8_t *)zoochild - (uint8_t *)monkey);

      	return 0;
      }

produces this result

      $ gcc -O4 -Wall -Wextra -pedantic -std=c99 ptr.c -o ptr
      $ ./ptr
      sizeof foo: 67
      sizeof monkey: 4020
      (monkey + 1) - monkey: 1
      (bytes) (monkey + 1) - monkey: 67

</comment></comment><comment><USER15> Good read. Reminds me of the oldie but goodie [http://ridiculousfish.com/blog/posts/old-age-and- treachery.h...](http://ridiculousfish.com/blog/posts/old-age-and- treachery.html)

<comment><AUTHOR> Interesting find.

</comment></comment><comment><USER16> I'm trying to picture a non-synthetic program where normalizing a URL is a significant part of the inner loop and I'm drawing a blank. Can someone help me out?

<comment> T-hawk Here's a similar case: Ranking of poker hands. That can involve many of the same steps, like sorting a small list of inputs (5 or 7 cards) into a normalized configuration (three-of-a-kind is represented as AAABC where B > C) and taking a hash to memoize the result. And you sure might want that in a tight inner loop if you're writing a poker simulator or AI where you want to crunch a few billion iterations.

<comment><USER17> Actually, for a poker hand evaluator the last thing you want to do is sort the hands. There's a small enough number of unique card combinations that you can arrange it so that you look up in pre-computed tables more often than not.

One clever trick is assigning a prime to each card value. By multiplying the values together you get a unique number representing each hand without needing to sort.

There's a great description of an algorithm at <http://www.suffecool.net/poker/evaluator.html>.

</comment></comment></comment><comment><USER18> Very interesting. The author at first seemed not that familiar with C, but in the end he got a good result

Depends also if there's pre validation (even with C you're never sure, so for example, reading that he used strcpy makes my head go "security hole", but this is a proof-of-concept so it's ok)

The best thing to keep in mind is that "There is no such thing as the fastest code"

Edit: strcmp to strcpy (or any str C function)

<comment><USER19> Reading strcmp() makes you think "security hole"? Why?

<comment><USER11> It doesn't take the length/amount of characters to compare as an argument relying on the null terminator, meaning it's susceptible to a buffer overflow attack.

Moral of the story, if you're going to use C strings, use the strn* variants.

<comment><USER19> No, strcmp is not susceptible to buffer overflow attacks.

<comment><USER11> [https://buildsecurityin.us-cert.gov/bsi- rules/home/g1/847-BS...](https://buildsecurityin.us-cert.gov/bsi- rules/home/g1/847-BSI.html)

If passed an unterminated string, the function will fail at least. How much you could exploit from that, I guess I exaggerated.

<comment><USER19> That's not a buffer overflow.

This whole subthread of picking on the guy's implementation because of "strcmp" is pretty silly. There are times where strcpy() is safe to use, but most of the time it's a red flag. There are conceivably times when strcmp() is unsafe to use, but to a professional reviewer, it is very rarely a red flag.

I should have just come right out and said that, rather than begging for the rationale for picking on strcmp().

</comment></comment></comment></comment></comment></comment><comment><USER20> The hand rolled strcmp almost certainly performed better than the native one merely because it can be inlined; consider using rep cmpsb or directly including another assembly version of strcmp (though since the strings are short the latter's overhead might not be worth it). Ditto memcpy.

Perhaps also consider using a radix sort?

</comment><comment><USER21> Good work, one obvious speed up is, if possible, removing the use of dynamic memory. Simply supply a static output buffer to url_sort so that it doesn't have to allocate/free memory for the resulting URL.

That took my execution for 5M lines of (not really representative but it's all I could be bothered to sort out at 11pm):

      /test.php?b=b&c=bb&a=3&a=4

down from 5.05s to 4.49s (so down 10%) on an old 1.5GHz Athlon Linux box that whirrs away in the corner of my flat. (Down to 2.81s when compiled with -O4).

(I assume you're compiling with -O4 as that's the only way I could make it worthwhile using your str_compare() function over libc's strcmp().

The only other thing I can think of that may speed it up more is a kind of binary search on the insertion as that is currently just a flat loop that does a comparison against each param; and therefore O(n).

In a pessimal case where you've already got 30 params and your 31st is going just before the tail (but not as the tail so you can't short cut straight to adding it as the tail) then it'll do a whole bunch of string comparisons on entries 1, 2, 3, ..., 30 before finding the right place. It'd be better to do them on, say, 1, 15, 23, 27, 29, 30. (This will only be beneficial when you have more than a certain number of params). An O(log n) algorithm will hopefully outweigh the slight expense of having to compute the midpoints.)

But, given you've got to 2M urls/sec, do you really need to eek out any more performance? That's an awful lot of traffic if you think each HTTP request will be about 500 bytes (including TCP headers, HTTP headers, etc). 2M * 500 bytes * 8bits = ~8Gbps, and that's just the incoming traffic from established connections.

For the binary search suggestion I get to point out the minor nitpicks:-

* Not all C compilers accept C++ style comments (gcc is way too lenient by default)

* Not all C compilers accept local variables to be defined mid-function

* unsigned long is not the same as size_t (fun fun fun when porting to different word sizes)

* If you ever have to port this code to work on a different CPU you may find yourself spending time adding lots of casts to (ptrdiff_t) to avoid it breaking due to unexpected sign extensions/etc.

These may seem OTT for a project like this, but it's not trivial when you've continued those practicises for years (and new devs have copied the house style) and have a bunch of projects totalling 20MLOC+ that you then need to port to a new compiler on a new architecture (with a different word size) and the code is riddled with assumptions about the old compilers and the architectures. Some things can be automated but spending _days_ moving variable definitions to the top of functions and fixing types of variables that hold return values of strlen() in an seemingly endless list of thousands of files gets boring after a very short period. Me? Bitter?

"gcc -Wall -ansi -pedantic" and lint should be your friends.

<comment><USER22> // comments and mid-function variables are C99 standard. The platforms that don't support them are probably not worth supporting yourself, and are not likely to be seen running varnish. This is the same mindset that held mozilla back for ages and ages because the hpux compiler from 1987 didn't support some c++ feature, so therefore nobody was allowed to use it even in 1997.

<comment><USER21> True, but not using // comments and mid-function variables is not quite the same thing as not using a whole feature.

I just know how much work there is to do, at short notice, when a customer comes along offering $$$ for a version of your product on an architecture that you hadn't originally considered. It was definitely worth the hassle of porting and cleaning up to code to provide them with it, but it would have been so much easier if we'd kept it clean from the start.

</comment></comment></comment><comment><USER23> Your insertion sort scans downwards from the highest populated index, bumping elements up as it goes. Given that you have space on both sides, I'm surprised that you didn't start in the middle and pick a scan direction based on the comparison result there.

</comment><comment><USER24> When I read that, I feel OLD !

</comment><comment><USER25> We're getting ready to deploy Varnish in (non-devops) work. Not having control over production and having the potential for C inline in the config was already making me a bit nervous. This thread is not helping!

<comment><AUTHOR> Varnish has actually been a great tool for us. The 3rd party url-sort plugin that we tried was not. Had a memory leak that caused the server to crash periodically. Once the url-sort module that we're building as part of this code challenge is tested and fully formed we'll make it available as open source.

</comment></comment><comment><USER26> I've never come across the Duff's Device previously and after staring at it for a few minutes it made horrifying sense. I can't tell whether it's a piece of true evil or true genius.

<comment><USER27> More like evil genius… Variations of this trick are a common optimization in embedded systems for years. (Stuff like this is why "premature optimization" is considered such a bad thing.)

On that note, I find it interesting that the article writer wanted to see more languages support pointer arithmetic. Language mechanics like that have developed a reputation of being "unsafe" due to they enabling common programming errors like buffer overflows and the like. Depending on the level of abstraction between the language and underlying iron, it might not even be possible to do stuff like this anymore. (Some modern languages/VMs/compilers use the more abstract concept of "references" over "pointers." Even Apple's flavor of Objective C, which AFAICT is still using pointers as an implementation detail, prefers to couch documentation and API conventions in the more abstract convention to deter some of the direct memory access abuses that were discovered during the Classic-to-Carbon Mac migration way back when…)

</comment></comment><comment><USER28> Nice, i remember my first coding challenge in c. Nice result for first attempt.

<comment><AUTHOR> Thanks!

</comment></comment><comment><USER29> A great read. I am curious about your double-wide insertion sort algorithm.

<comment><AUTHOR> Thanks. I haven't seen it anywhere else, but can't really be sure I came up with it. Just seemed like a good optimization.</comment></comment>


Economics of Drinking - <AUTHOR> http://papers.ssrn.com/sol3/papers.cfm?abstract_id=1532171

<comment><USER2> Some of the things I found really interesting within this paper...

1) They hypothesize that alcohol's legality vs. the illegality of other equally or less harmful drugs is a result of efficiency: we only need one drug, agreed upon by social norms, with roughly the same rate of effect (or predictability of effect, accounting for weight) on everyone, for the purpose of 'social lubrication' / 'signaling our true selves via willing loss of control'.

2) They talk about how knowledge of the effects of a drug is key to choosing how much to consume for desired signalling, and pretty much provide a perfect mathematical model for the horror that is college freshman drinking with older students.

3) Their references are pretty cool. e.g.:

Nutt, D., L. A. King,W. Saulsbury, and C. Blakemore (2007): "Development of a Rational Scale to Assess the Harm of Drugs of Potential Misuse," The Lancet 369(9566):1047 - 1053. -- This paper apparently provides a scientific basis for ranking the harm of different drugs.

<comment><USER3> That paper is great! Why can't more public policy be based on sensible metrics like this?

([http://web.mit.edu/mariya/Public/Exploring%20Pharmacology%20...](http://web.mit.edu/mariya/Public/Exploring%20Pharmacology%2008/addiction/Development%20of%20a%20rational%20scale%20to%20asses%20the%20harm%20of%20drugs.pdf))

<comment><USER4> Talking publicly about that paper is why David Nutt was fired last year from his post as technical chair of the Advisory Council on the Misuse of Drugs in the UK. I suspect that's the answer to your question, sadly...

Here's a recent interview with him: [http://news.google.ca/news/url?sa=t&ct2=ca%2F0_0_s_0_0_t...](http://news.google.ca/news/url?sa=t&ct2=ca%2F0_0_s_0_0_t&usg=AFQjCNFLAGET7TM0W6lz77lexfJjIMzBXQ&cid=17593692963640&ei=SpRPS- iDK4uwMtD- yckC&rt=SEARCH&vm=STANDARD&url=http%3A%2F%2Fwww.metro.co.uk%2Fnews%2F808938-david- nutt-alcohol-is-worse-than-drugs)</comment></comment></comment>


Police number plate camera scheme broke law in Royston (UK) - <AUTHOR> http://www.bbc.co.uk/news/technology-23433138 <comment><USER2> I seem to recall a story where a town put some traffic cameras on its roads, and a guy printed the mayor's license plate on a piece of cardboard and stuck it on the back of his car and proceeded to speed through the camera a few times.

Sounds pretty effective to me!

</comment><comment><USER3> The thing that annoys me most is that the locals referred to this palisade of cameras as a "ring of steel". Surely it's a ring of glass?

<comment><USER4> Probably this in reference to the steel towers and girders upon which the cameras are mounted.

<comment><USER5> "Ring of steel" was the term used for the road blocks, barbed wire and railings around central Belfast in the 1970s, when bombings there were common [1]. In this case it was literally steel barriers encircling the city centre. It was not a continuous ring of steel, as buildings formed parts of the barriers.

It's also the term used for the covert ring of CCTV cameras and checkpoints erected in the City of London [2] in 1993 in response to bishopsgate bombing. It shares the property of encircling the centre of a city for security purposes, but is not literally a ring of steel. At one point people would have recognised this as a reference to Belfast's situation.

[1] [http://www.independent.co.uk/news/uk/belfast-security- measur...](http://www.independent.co.uk/news/uk/belfast-security-measures- accepted-as-normal-people-in-belfast-have-become-accustomed-to-police-checks- and-the-ring-of-steel-which-protects-the-citys-commercial-heart-david- mckittrick-reports-1562036.html)

[2] [http://henriwilliams.blogspot.co.uk/2010/08/entering- panopti...](http://henriwilliams.blogspot.co.uk/2010/08/entering-panopticon- study-of-ring-of.html) [http://www.independent.co.uk/news/londons-ring-of- steel-to-e...](http://www.independent.co.uk/news/londons-ring-of-steel-to- expand-1313139.html)

</comment></comment></comment><comment><USER6> Strangely enough I just considered moving to Royston as it's slap bang between Cambridge and London.

This has changed my mind instantly.

<comment><USER7> Royston seems to take the worst of both places and the good bits of neither.

(I grew up just South of Cambridge and went to school not far from Royston; and I now live in London. For a while I commuted between the two by motorbike, passing Royston every day.)

<comment><USER6> Indeed I have discovered that. Decided on Ely instead.

</comment></comment></comment><comment><USER8> We only serve local people!!</comment>


Ask HN: Optimal cloud service to run tiny website with back end Python + SQLite? - <AUTHOR> Web ninjas: What is your go-to cloud service for running a small website served with python + jinja2 + sqlite?  The website does little besides searching an sqlite table, serving a form, and writing the form response to an sqlite table, all with minimal computation and bandwidth. Wants are:

  Low price
  Low maintenance time/cost
  Simplicity
 My strengths do not include web development/servers but I know the basics.  I'm particularly interested in the gotchas like: difficulties setting up SSL, transfer limits, and "X is perfect except that ____".
If I'm asking the wrong question or not providing enough info, please say so. <comment><USER2> Dokku + your favorite VPS: [http://dokku.viewdocs.io/dokku/](http://dokku.viewdocs.io/dokku/)

Installation is a breeze and there are plugins. If you're at all familiar with Heroku's deploy, you'll love this. It's the closest thing I've found to `git push` without any thinking.

<comment><USER3> Dokku + Hetzner + CloudFlare here. It's just so simple. I love it.

I have noticed that deploys eat HDD for breakfast. Prune often. ("docker system df" helps show stats on space usage).

I have also read many optimisation guides talking about Alpine Linux images, but not sure whether that makes a difference.

Running a Go stack. Often wondering whether Caddy could be an alternative?

Sometimes I feel like this is still "too much". Like I still don't have enough control over the stack. Cloudflare introduces a lot of magic. I am not sure I fully grasp Dokku, but it works. Oh well!

<comment><USER4> Docker sacrifies disk space, but at least do you have /var/lib/docker on btrfs ?

Traefik is a reverse proxy for containers out of the box, apparently you would need some plugin to have that feature on Caddy : [https://github.com/lucaslorentz/caddy-docker- proxy](https://github.com/lucaslorentz/caddy-docker-proxy)

As such, it seems like Traefik would be easier to setup for your use case.

</comment></comment></comment><comment><USER5> I've used DigitalOcean (ref link -> [https://m.do.co/c/a2a2c0826ff3](https://m.do.co/c/a2a2c0826ff3)) to host my Django sites, both with postgresql and sqlite. It will take you some time to figure out how to host it.

Once you a succeed each subsequent time becomes much easier. Plus you get to learn a ton about server management.

There are fantastic posts that will help you.

[https://www.digitalocean.com/community/tutorials/how-to- set-...](https://www.digitalocean.com/community/tutorials/how-to-set-up- django-with-postgres-nginx-and-gunicorn-on-ubuntu-18-04)

<comment><USER6> Second this. DO is insanely easy to use and it provides solid footwork to delve into a bit of an actual production deployment process.

</comment></comment><comment><USER7> PRGMR.com 1.25 GiB RAM, 15 GiB Disk for $5 per month.

[https://prgmr.com/xen/](https://prgmr.com/xen/) inexpensive. __no overage charges __. can pay by bitcoin. (and a FreeBSD friendly).

I wonder if you would also benefit from installing something like yunohost [2] on top of Debian. This will get you your personal cloud. And the use YounoHost's 'Custom web app' container [4]

This way, you get an automatically configured web server (nginx), with certificates (via Let's encrypt) that get auto updated.

You also get a pre-configured user/sftp access to your app's folders.

And those folders will be backed up when you hit the backup button...

Nginx will invoke your python app when the predefined URL is hit.

All you have to do is to point your domain registrar to the prmgr VPS host running yunohost.

[2] [https://yunohost.org/#/whatsyunohost](https://yunohost.org/#/whatsyunohost) [3] [https://yunohost.org/#/apps](https://yunohost.org/#/apps) [4] [https://github.com/YunoHost-Apps/my_webapp_ynh](https://github.com/YunoHost- Apps/my_webapp_ynh)

<comment><USER8> Are you affiliated with the company? I chuckle when I see this hosting shop pop up on HN. They had advertisements on the dividers at the Safeway in Mountain View. Was wondering how they worked that.

<comment><USER7> no.

I also know that they donate (or at least donated before now) hosting service to lobste.rs

I found them just by searching through like anybody else would.

I had never seen their ads.

are you affiliated with any of their competitors?

<comment><USER8> Nope. Just a Bay Area native who got into the local industry.

</comment></comment></comment></comment><comment><USER9> Google cloud run. If you can put your python app in a docker container (very easy) then you can run it on Cloud Run. They have a very generous "always free" tier.

<comment><USER10> If SQLite sends writes to the disk you cannot use cloud run, as it does not have a persistent disk.

<comment><USER9> Yes sorry, I should have said also you can use their always free VM Compute Instance to run the DB.

</comment></comment></comment><comment><USER11> I hate messing with nginx and ssl configurations that why I tried caprover ([https://caprover.com/](https://caprover.com/)) on a vultr server. It handles ssl through let's encrypt and it even includes some nice monitoring tool. It needs some familiarity with docker if you want to fully use its features but in general I am running it on 2 servers with success and I am very happy. I totally recommend it.

</comment><comment><USER12> Might not fit your needs exactly, but others looking for something similar might find NearlyFreeSpeech.NET a good fit: [https://www.nearlyfreespeech.net/](https://www.nearlyfreespeech.net/)

</comment><comment><USER13> If you don't have too much load, heroku could be good for you, but you'll have to use postgresql. The free tier is nice though.

<comment><USER14> Having to use postgres seems like a plus :) besides being a great dbms, using postgres means you can port to other hosts easily, as opposed to say firebase.

I second heroku for OPs requirements, _extremely_ easy to set up and manage, and the free tier handles many small sites well.

Whatever you choose, use cloudflare for free SSL.

</comment></comment><comment><USER15> try [https://uberspace.de](https://uberspace.de) \- name your own price (1-15€), HTTPS, python, sqlite, shell access, databases and much more included. Docs: [https://manual.uberspace.de/](https://manual.uberspace.de/) [https://lab.uberspace.de/guide_django.html](https://lab.uberspace.de/guide_django.html)

disclaimer: I work for them, but used to be a customer long before I started.

</comment><comment><USER16> [http://pythonanywhere.com](http://pythonanywhere.com) This guys specialize in python hosting and have a free tier

<comment><USER17> I too have a very good experience with them. Very, very simple and no hassle to set up.

In particular, all the web hosting side of things is preconfigured.

</comment></comment><comment><USER18> AWS has a free tier for a year after signing up. A 'tiny' instance for webserver with letsencrypt on for your free ssl/tls certificates. You can automate backups via snapshots, though make sure they delete automatically after a week or so. I would recommend you use MySQL instead of SQlite, use RDS free tier there, SQlite not so good with concurrent connections and definately not if people are adding their own information. Look into haproxy as your gateway so you can scale to multiple servers if need to but not be tied into AWS specific Route 53, if you set it up right you can basically grab the configs, site source, files etc and a database dump and run it on a Raspberry PI in your home if you need to and have a static IP. Try not to get tied into one specific cloud provider too and keep shopping around for free or better deals. You can have a web presence for no money except your DNS registration with a little bit of tinkering and looking around.

<comment><USER19> The user says, a tiny site, why the over engineering? Unless we are speaking of tens of concurrent connections SQLITE works.

</comment></comment><comment><USER20> Check out google cloud run for running your stateless webserver, its free tier is pretty good and you can run whatever stateless container you want to.

Personally from there I would use a min-spec Postgres CloudSQL for the DB, but you can use whatever hosting you like if you want to DIY.

</comment><comment><USER21> Amazon Web Services. Won't cost much.

If you want to keep it simple..

A very small EC2 box. Maybe even micro instance. That'll run your python code + sqlite.

If you want, you can use an elastic load balancer or Route53. If you don't have DNS already. Route53 is AWS's DNS service which is easy to use.

This whole setup should not cost you much. If you do it right, you can probably spend less than $10/month taking advantage of the free tier.

Later on, as a side project, you can try to make the app serverless. You're probably close to it being serverless. Doing this allows you to run it on AWS Lambda. Which makes things even cheaper, if not free. And it's just pretty cool.

But most likely you'd have to switch to a real data store. No problem since AWS has DynamoDB.

<comment><USER22> Absolutely nope. Both unfamiliar naming and the console interface is overwhelming, it's overkill to learn it just to run one VPS.

</comment></comment><comment><USER23> How important is SQLite to you? I run [https://crushentropy.com/](https://crushentropy.com/) (high-res scheduling) on Google App Engine (Standard) with data persisted on Firebase. It costs me $0 per month.

<comment><USER19> So the user must, re-write his code to fit into firebase?

<comment><USER23> No, just saying that's an option to consider, that's all. If the current code is super small, it can be a quick change.

There are different kinds of "simple". SQLite sure is simple in several dimensions, but then you need a writable file system for it, and file locking is not an issue for your usecase etc.

I consider my set it and forget it setup to be simple, and I haven't had to do any maintenance in 3 years, though Firebase is not exactly what you'd call "simple".

</comment></comment></comment><comment><USER24> Not mentioned by others, [http://atlantic.net](http://atlantic.net) starts at $5 a month. DigitalOcean has a similar offer with much better documentation. I run a couple of larger servers at DigitalOcean and am really satisfied with uptime, management console, etc. So my vote goes for DigitalOcean.

But Atlantic had a 256Mb RAM, 10Gb disk option years ago for just $0.99 I still have one server there for hosting static HTML, running some scraping tasks, MS document to PDF conversion service (Python Twisted) for a customer, etc. All that for just $1.20 a month (including VAT)

</comment><comment><USER25> Here's an easy example on Glitch that you can remix: [https://glitch.com/~hello-python-flask-sqlite3](https://glitch.com/~hello- python-flask-sqlite3)

</comment><comment><USER26> Would definitely be looking at removing the homespun server aspect and going with a high-performance, low latency paas / serverless setup. Lets you focus on and deliver the outputs you need (i.e. user interface + data).

If I were in your shoes I'd be looking at either:

\- Firebase (free tier). Probably just using their RTDB for storage. You could conceivably do away with your backend entirely here.

\- Cloudflare workers + KV storage (~$5 per month?) .. this would give you killer performance and let you write your storage logic in python. You're paying a minimum fee per month here, but in reality that could cover a large number of seperate sites.

Both suggestions raise vendor lock-in considerations, but given the use-case it doesn't seem like a major concern. Of course if you're looking forward to the joys of managing a box ...

</comment><comment><USER27> DigitalOcean (or any of the $5 VPS) with Debian 10, you will need to know "basics" like SSH and typing some commands (a bunch of sudo apt-get _____) and then you are done. The only thing you don't have with DigitalOcean is domain name registration but everything else is there. Use them for DNS! They have some pre-built stuff for your list here but I would just spin up a blank Debian 10 box.

You can also get a free tier at Amazon AWS but you have to learn all the EC2 stuff and almost piece yourself a server one piece at a time (like the good old days where you build your own PC but clicking buttons) -- IMHO this takes much longer than just doing a $5 VPS and typing things. So if you want to learn Amazon AWS stuff, this may be a good path but it is going to take a lot longer

</comment><comment><USER28> Sign up for an Amazon Web Services account and a Cloudflare account

Python + SQLite AWS EC2 t2.micro

DNS + SSL Cloudflare free plan

Total cost = $0

</comment><comment><USER29> I wrote this app last weekend mostly so that I could look at COVID-19 stats, but also as a learning exercise. I download data from John Hopkins, ingest it into a SQLite database and then have a couple of Python scripts to present an API to the front end. It is hosted on a Digitalocean droplet which costs me US$5.00 per month. Setup is easy - takes less than 10 minutes, and if you know Linux everything is pretty straightforward.

I also use Cloudflare as a DNS (free tier).

[https://martin.schweitzer.id.au/covid19/](https://martin.schweitzer.id.au/covid19/)

<comment><USER30> That's a pretty cool project. As a Sysadmin I know a bit of Python and how to use Rest APIs but would you mind pointing me in the right direction on how you present an API to the front end? I'd like to learn how to build a website like this.

</comment></comment><comment><USER31> A bit of a mix of the other comments, but I use a generic VPS (I use DO now, used to use EC2, but anything works) with my application wrapped in a Docker container with its port exposed. Nginx reverse proxy to pass from 80 to my container's port. After that is working, I use certbot and it automatically detects Nginx and offers to automatically set up TLS on 443 and redirect 80 -> 443 to ensure connections are coming through HTTPS. certbot is a god send.

</comment><comment><USER32> I switched from DigitalOcean to Hetzner. [https://www.hetzner.com/](https://www.hetzner.com/)

</comment><comment><USER33> [http://scaleway.com](http://scaleway.com) it costs 3$/month for a vps

<comment><USER34> Second.

Scaleway + Cloudflare + CapRover, you get the simplicity and joy of using PAAS without the cost. CapRover's one click install is awesome.

</comment></comment><comment><USER35> Can your code work on AWS Lambda with one of their DB services? If you need it to scale with growth starting on a cloud platform will save headache later. If you don't need scaling it's possible you could run it on the permanently-free tiers or very low cost once you utilize the free quotas each month.

</comment><comment><USER36> If you want something fire and forget and since this is simple I would go with a serverless solution. Static files (with some little JS) hosted on some CDN and serverless database. One option is AWS dynamodb and their CDN, a more friendly beginner solution is firebase. You can't get more low maintenance than that.

<comment><USER35> Do you know of any existing tools for this on the server(less) part and database that aren't hard to setup?

<comment><USER36> The firebase docs are pretty good, they have lots of videos also if that's your thing.

</comment></comment></comment><comment><USER37> I still use Webfaction for my webapps although since they were bought by GoDaddy, costumers seem to start moving away from it.. But it is quite simple to deploy a Python webapp, they have one-click installers and you can ftp your source files like we all used to do..

Prices start from 10$/month.

<comment><USER38> I moved to opalstack.com. Made by former WebFaction employees. Loving it.

</comment></comment><comment><USER39> Oracle Cloud only if you can use a their free VPS tier. If you can't, then Heroku or a cloud free tier.

<comment><USER13> Friendly reminder that Oracle has no customers, only hostages.

</comment></comment><comment><USER40> I like AWS Lambda with RDS and Cloudfront or whatever. It can be a pain setting up the VPC and security stuff, but it seems worth it because as far as I can tell it is extremely reliable and there is no server to maintain or secure.

</comment><comment><USER41> [https://www.wholesaleinternet.net/dedicated/](https://www.wholesaleinternet.net/dedicated/)

Dedicated server.

16GB memory. 2TB of drive space. $25.00/mo

</comment><comment><USER42> Another vote for DigitalOcean.

It's just a computer connected to the internet.

</comment><comment><USER43> Used to do everything on Digital Ocean but had better performance on Vultr for the same price.

But either will do. My use was crypto trading bots, also using SQLite for storage.

</comment><comment><USER44> Maybe try out glitch.com . Search for Python examples.

</comment><comment><USER45> www.pythonanywhere.com Nice little setup where you get python set up out of the box, and you even have some options of quickly setup database if you need to go beyond sqlite.

It's very flexible, cheap and definitely a time saver for when you want something up and running quickly.

</comment><comment><USER46> Small hosting (whichever you like best), plus cloudflare for DNS and transparent caching.

</comment><comment><USER47> I just wanted to say since you seem unsure of yourself a little:

You have a really great approach to simple software. Turns out your strengths do include setting up backends for web development!

Many self styled experts / People 2 digit years of experience who consider themselves solution architects could learn from you and your approach here.

</comment><comment><USER48> DigitalOcean, Vultr, Linode

</comment><comment><USER49> Find a friend with a hobby linode server who will put it up for free.

</comment><comment><USER50> Scaleway, with or without their DBaaS offer if you need more perf

</comment><comment><USER51> Linode/DigitalOcean

</comment><comment><USER52> digital ocean, the cheapest VPS bucks one.

</comment><comment><USER53> how about a raspberry pi and dyndns?

<comment><USER54> I would worry about being DoS'ed, and having my home network compromised because of a vulnerability in raspberry pi software stack. Other than that, I think it's a good idea. I do the same for a personal use server, but don't expose the port on the public internet.

<comment><USER55> If you put Pi in a segmented network this is a good solution. That's what I do now anyway with python + sqlite and Netgate sg-1100 as a firewall

</comment></comment></comment><comment><USER56> I suggest aws (probably elasticbeanstalk, maybe a raw box) simply because it's a very well trodden path. Lots of helpdocs, tutorials, instructions, etc etc etc.

Assuming you're a professional in the US / west europe, etc, the diff between $20 or $30/mo and $5 or $0 per month is negligible, while the time savings just from staying on a standard path can be huge.

My default suggestion would be:

Elastic Load Balancer, to talk to the internet and terminate SSL;

Elastic Beanstalk or something similar to host a box;

Certificate Manager for your SSL cert;

Route53 to serve your DNS.

All of the above should be cheap and, again, a very well trodden path with tons of help docs and people familiar with configuration.

<comment><USER57> That sounds completely overkill for OPs question - without digging deeper it sounds like OP really just wants a cheap VPS perhaps with a lightweight management layer on top.

Granted, Elastic Beanstalk/Load Balancer will allow you to scale should you end up with a massive influx of traffic - but I think you'd be far faster to spin up a VPS and use where-ever your bought your domain name from to point your domain name to it's IP.

In fact - this is exactly what I do and it took well under an hour _including_ choosing and buying a domain name and costs $5 a month.

<comment><USER56> I didn't intend any of this to be about scale. Again, it's about ease of setup and maintenance.

For example, I spent a pile of time getting letsencrypt to work with nginx. Admittedly, this was a couple years ago, but I had to go back in and fiddle with a config I barely remembered 6-ish months ago.

My ELB + AWS Certificate + EB have kept chugging along without a peep. I also ticked the EB setting to continually upgrade linux to take care of OS-level security issues.

You may be an expert on setting up linux/nginx/puma/bundler/ruby, but I've found that running my own (which I do!) requires a full couple days of maintenance a year. Again, from a person who does not do this regularly.

My AWS EB environment just does a new deploy and the magic keeps on magicking itself.

:shrug:

<comment><USER57> Don't get me wrong, I love that stack and it's what I generally use professionally, but for a small personal project that may or may not live for a whole year, I'd go for something cheap and cheerful, the difference between $5 a month and $30 is $300 a year - that's a whole lot of pizza and beer! ;)

FWIW - Setting up Let's Encrypt doesn't seem much of a chore these days: [https://www.digitalocean.com/community/tutorials/how-to- secu...](https://www.digitalocean.com/community/tutorials/how-to-secure-nginx- with-let-s-encrypt-on-ubuntu-18-04)

For my particular use-case (a personal blog) the software I wanted to run on a VPS had support for it so all I really had to do was install everything answer a few configuration questions and I was up and running.</comment></comment></comment></comment>


Did Socialmoth (YC 07) join the "simple blogging" battle?  - <AUTHOR> http://socialmoth.com

<comment><USER2> no, i just deleted the socialmoth vhost in my apache so it falls through to the isdeluxe.com entry which is on the same box.

isdeluxe is very tumblr-esque project of mine.

so yes, i made both and isdeluxe is 'simple' blogging. but it is unlikely that socialmoth.com will always point to isdeluxe

yes and no :)</comment>


Skittr, a Twitter clone that scales easily, written in 170 lines of Scala and lift - <AUTHOR> http://blog.lostlake.org/index.php?/archives/55-Prance-with-the-Horses,-Skittr-with-the-Mice.html

<comment><USER2> I don't want to be arrogant, but from the technology point of view Twitter is nothing. Write it in a way that scales better, write it in 170 lines of Scala or 10 lines of Lisp, you still haven't done anything. Come up with the idea before anyone else, get millions of users, that's the difficult part.

<comment><USER3> I think he's trying to advertise his framework and scala. He doesn't care about the idea.

</comment></comment><comment><USER4> First of all, I'll say that this (really neat sounding) project doesn't necessarily fall into the following category, the title just reminded me of a pet peeve of mine...

I'm always skeptical of the claims of "do this amazing thing in x lines of code" where x is some ridiculously small number. For example, the prototypical 10 minute Ruby on Rails blog, or the 1 line of code WebKit-based web browser.

The problem with these things is they make great whiz bang demos, but they really don't take any less code, it's just that _you_ don't have to write that code because it's already written for you and hidden behind a layer of abstraction... which is great, as long as it can also be applied to real world problems, not just little toy demos.

</comment><comment><USER5> With a name like Skittr, picking a name can be tough,

Skitter is Irish slang for diarrhoea (or a wee kid). As Twitter is a form of verbal diarrhoea, then SKittr is as good a name as any for a competitor! ;)

[http://books.google.com/books?id=5GpLcC4a5fAC&pg=PA1295&...](http://books.google.com/books?id=5GpLcC4a5fAC&pg=PA1295&lpg=PA1295&dq=skitter+irish+slang&source=web&ots=2wmST3hmA9&sig=oVoVZSG1tPDIj3GzZWse7FEPz-w) <http://www.bbc.co.uk/northernireland/voices/atilazed/s.shtml>

<comment><USER6> I remember the "Pikey" which was a USB key with PKI stuff built in. Hilarious.

</comment></comment><comment><USER7> Well, I didn't read the entire article, so maybe there was an answer to this but I'm a bit weary of claims like "can be modified to scale linearly with the number of machines with 1 week of coding".

<comment><USER8> There are some folks working on the code and we'll be testing it on an Amazon EC2 cluster. Once there's stuff to share, I'll share it.

<comment><USER7> Excellent, please do.

</comment></comment></comment><comment><USER6> Wow, scala really is pretty when David shows it like that. I like the new "point free" style syntax (I think that i fairly new).

messageViewers = messageViewers.remove(_ == who)

(so it creates a new list excluding items that are == to "who"). Nice.

</comment><comment><USER9> Impressive but I dislike the title because it tries make other looks bad. Please don't be like the Rails cult.

</comment><comment><USER10> Here are 4 twitter-like sites - built with php and mysql. I guess they won't scale all that well, we'll see :)

I just wanted to get them out there, like, quick.. so, people could, like, use them.

www.HelpWorldClimate.com

www.HelpWorldPoverty.com

www.HelpWorldPeace.com

www.HelpWorldWildlife.com</comment>


How I Convinced My Boss to Let Me Telecommute - <AUTHOR> http://blog.sqwiggle.com/telecommute-how-i-convinced-my-boss/

<comment><USER2> Just saw that this was commented as spam. Well, I wrote that post in hopes that others who want to break away from their desk jobs and start telecommuting could learn from my own experience.

Why did you think it was spam?

</comment><comment><USER3> seems like spam.

<comment><AUTHOR> Why would it be spam? It's definitely not.</comment></comment>


How founder control can hold back startups - <AUTHOR> https://hbr.org/2014/04/how-founder-control-holds-back-start-ups/ <comment><USER2> It seems if you wish to retain more control and give up less of your company, it would make more sense to scale slowly. Are VCs and other investors typically pushing product to market faster, in turn creating this landscape?</comment>


Migrating Russian eagles run up data roaming charges - <AUTHOR> https://www.bbc.com/news/world-europe-50180781 <comment><USER2> Their crowdfunding appeal, which has paid off more than 100,000 roubles (£1,223), was called "Top up the eagle's mobile".</comment>


Getting Rich By The Numbers, A CrunchBased How-To - <AUTHOR> http://techcrunch.com/2012/07/21/getting-rich-by-the-numbers-a-crunchbased-how-to/

<comment><USER2> There's obvious sampling bias here. The companies in CrunchBase are not chosen according to objective criteria. They're chosen because someone visited the CrunchBase website and added them.

It's not a big surprise that the only semiconductor companies anyone bothers to add tend to be the successful ones.

And, your company can be a cash cow even if it never gets acquired or has an IPO. I suspect this applies to a lot of consulting companies, but what would I know?

</comment><comment><USER3> So, if you want to get covered in Techcrunch, start a consumer internet company. If you want to get rich, don't start a consumer internet company.

</comment><comment><USER4> What I find interesting is that biotech and semiconductor have barriers high enough that you need to be high quality to even think of attempting. But lower barrier areas like web and software have a lot more people trying but similar numbers as biotech getting funded. This to me means that the hard stuff needs lower barriers because a larger sample size should be correlated with a wider variety of ideas. More stupid ideas sure, but also more of ideas so stupid they just might work.

The numbers funded is strange. Take other for example. Are the ideas in Other really that bad? Why are the numbers funded all within 2 magnitudes of each other regardless of number of people trying? My guess is that active VCs form a bottleneck on ideas and the numbers funded is more strongly coupled to the number of active VCs in the area than the average merit of the ideas. And that the number of VC per area does not vary too much, with areas like software and web having the most participants.

<comment><USER5> Or could it be that dealing with atoms, vs. bits requires more OpEx and CapEx?

</comment></comment><comment><USER6> Nassim Taleb makes a good argument in Fooled By Randomness that the best way to maximize the expected value of your net worth is to go into dentistry. But this isn't Dentist News...

<http://en.wikipedia.org/wiki/Fooled_by_Randomness>

<comment><USER7> Hmm, I don't think that's a fair representation of what Taleb wrote. Dentistry is just a profession he chose to illustrate his point. A stereotype. And the point is not so much the high expected value of a dentist's income, it's the very low variance of that income, i.e. a dentist's lifetime earnings are pretty much predictable within a certain range. He could have said "train conductor" and it would still be true.

Of course, dentist has the added merit of allowing you to get moderately rich. But the real distinction is between dentistry vs. fiction writing or entrepreneurship, fields where the difference between #1 and #10 can be an order of magnitude.

I suppose Taleb's caveat here would be that while a table of past results can be very useful for someone working in insurance or logistics, they are not so useful or are even harmful if we're talking about startups. Until the other day, the largest exit in the "web startups for sharing pics" category was (say) $50 million, then the next day we saw a $1 billion acquisition.

</comment></comment><comment><USER8> (+) Past performance is no guarantee of future results.

Edit: to clarify, the intro paragraph is extremely misleading. This analysis looks back in time several years; he might as well tell you to start a social network or a search engine. It would be honest to say that it's simply an analysis of what _has_ done well, but of course it would not be as sensationalistic.

<comment><USER9> to further your point Diego, maybe there hasn't been an IPO or major acquisition in something like education because few companies are focusing on that, and therefore it is an opportunity.

</comment></comment><comment><USER10> I will love the day that I can start a biotech company with a laptop and an internet connection.

<comment><USER11> That day is coming: <http://t.co/E1oURlQ9>

</comment></comment><comment><USER12> Reads like a TechCrunch advert.

Good thing this isn't Reddit else I'd have phrased that less politely.

</comment><comment><USER13> This is terrible, simplistic advice. The supposed "get rich" acquisition industries both involve so much fundraising that by acquisition time, the founder is likely to be buried under such a large liquidation preference that he won't see a cent.

Total funding should never be an indicator "getting rich" -- it either correlates with failure or a capital intensive project, neither of which have anything to do with improving the founder's net worth.

</comment><comment><USER14> It sounds like there's supposed to be a table at the end, but it's not showing up for me.

The first question I have, without seeing the numbers, is: do the higher percentages of IPOs/acquisitions for more capital-intensive fields just mean that it's harder to start and fund a company in those area without a much more fleshed out idea?

<comment><USER15> Here you go: <http://i.imgur.com/R7cZ5.png>

</comment></comment><comment><USER16> "Well, if you want to make TechCrunch, you might want to start one of those web companies. [...] At the bottom of the list was Biotech, with less than half a percent of Biotech startups getting any coverage."

</comment><comment><USER17> For all the kind of derision in the article, I don't feel anymore knowledgeable about startups, other than some vague thing about only worthwhile business being biotech or semiconductors.

I would say don't let this article be any real part of your decision making process, unless you're doing biotech, in which case I guess you can let it boost your confidence. :)</comment>


Exxon's climate lie - <AUTHOR> http://www.theguardian.com/environment/2015/oct/14/exxons-climate-lie-change-global-warming <comment><USER2> > In its greed Exxon helped — more than any other institution — to kill our > planet.

This is an excellent article right up to the last sentence, which is the sort of unfortunate hyperbole that often trips up McKibben in particular and many climate activists in general. It's frustrating, in a discussion about how Exxon misled the public, to see hyperbole in the other direction.

Climate change is not killing the planet. It is altering the environment in a way that will interfere with human society, and will shift the balance for some species.

Just to be clear: the planet is indeed being killed, in that a mass extinction is taking place right now. But climate change is only a small factor in that. Most species decimations have come from 3 other human sources:

1) Habitat destruction: converting wild areas (characterized by high biodiversity) into farmland, towns, or cities (characterized by very low biodiversity). This is the biggest impact on plant biodiversity.

2) Hunting and fish for food: taking breeding-age adults out of animal populations faster than they can be replaced. This is the biggest impact on ocean macrofauna, for instance.

3) Toxic pollution: point-source and non-point-source pollutants that depress biodiversity by either directly harming plants and animals, or by altering the local environment to make it less habitable (for example, when fertilizer runoff feeds algal blooms that reduce free oxygen in the water).

<comment><USER3> _Until now_ , species losses have been due to factors 1,2,3. But climate change does threaten to greatly accelerate the rate of species collapse, perhaps unstoppably so, in the coming decades and centuries.

So you're giving Exxon (and the fossil fuel industry generally) a hell of a break, simply because thus far, we've barely been able to see the effects of climate change.

<comment><USER2> > But climate change does threaten to greatly accelerate the rate of species > collapse, perhaps unstoppably so, in the coming decades and centuries.

What is the evidence for this? For example I'm not aware of any correlation between the historical records of warming periods and historical records of mass extinctions.

There is no reason that warmer temperatures or higher levels of CO2 should be bad for life in general. As cold areas shrink, populations of species adapted to cold habitats will suffer, but warm habitat species populations would expand.

I'm not trying to take away from the reality or seriousness of anthropogenic global warming, or give Exxon a pass. Just because something is real and is bad in certain ways, that does not mean it threatens all of life on Earth, which is how I interpret the concept of "unstoppable" species collapse.</comment></comment></comment>