What are the best non-database solutions you've seen? What did Viaweb use? - <AUTHOR> <comment><USER2> Keep everything in memory in the usual sort of data structures (e.g. hash tables). Save changes to disk, but never read from disk except at startup.

<comment><USER3> A similar approach is so-called "object prevalence" (<http://en.wikipedia.org/wiki/Object_Prevalence).> Basically, keep all the data in RAM and write a journal of changes. On startup, the journal is played back, incrementally restoring the state. Snapshots are taken periodically to keep the journal down to a manageable size.

It's a form of the Command design pattern and has some nice properties. You can get transparent thread synchronization by executing queries in parallel but serializing commands that modify state. For web apps, the HTTP request offers a natural representation for commands (but of course you'd want to strip them down to their essence). You can get fault-tolerance and scalability by feeding the command stream to replica servers. (State-changing commands must be executed by the master server but queries can be load-balanced across the replicas.) And if you keep the journals around, you have a complete history of the application's state.

EDIT: See also <http://www.advogato.org/article/398.html>

<comment><USER3> I probably should have pointed out the implications for disk I/O. In many cases, the serialization of the command in the journal has a smaller footprint on disk than the data that's modified. Consider an extreme case where a small HTTP POST touches dozens or hundreds of records.

And appending data to a log is essentially an ideal disk access pattern.

Of course this can't be said for the snapshots, but you can offload that task to a replica server.

</comment></comment></comment><comment><USER4> All you "must be stupid not to use rdbms" people need to pry open your minds a little.

There are all sorts of apps that use mem/fs for storage. Like mail servers, news servers, squid servers, static http servers, log files, and sql servers (discounting direct io)

rdbms are (usually) just another layer ontop of fs. A very usefull layer if you need what they offer. But if not just a layer of complexity and wasted mem/cpu.

Modern fs have journaling and smart buffering/caching. They kind of rock and discounting them out of hand is a mistake.

</comment><comment><USER5> I fully agree with what pg said about keeping everything you can in in-memory structures. You can save modifications to a sequential logfile, or some other simple on-disk structure that is easily maintained (e.g. separate file per record), and read this structure into memory when you restart. Once that becomes infeasible, I would switch to using SQLite's BTrees [1] directly and bypassing the entire SQL layer. Using the SQL layer is just pretty pointless and a waste of resources. You're going to have a "data access layer" over your database anyway, so why not have it operate on a level where you have precise control over the access patterns and can tune it for your application? If you use the SQL layer, you're basically _losing_ all that information by having your data access layer transform your operations into a high level data manipulation language by _building a string_ (eww), then you leave the SQL layer of the database engine to parse your string back to something sensible and have it _guess_ at how to optimize the query to get the best performance. Instead just tell it directly and skip the whole string construction, string parsing, and query analysis crap.

Notes

1\. I'd suggest BDB, but it seems to suck. YMMV, always benchmark it yourself.

<comment><USER6> I would second the suggestion to try SQLite first (or give metakit a glance if you want something that lets you iterate over a table quickly) and concur with staying as far away from BDB as is possible...

The other advantage that using memory/fs has over a RDBMS for most simple applications is that unless you are doing complicated joins you will keep things simple and avoid introducing an additional layer of complexity and point of failure into your app.

<comment><USER7> may you please explain why BDB sucks ? thanks !

<comment><USER8> Seconded, please explain. I don't have a view but was wondering about using Berkeley DB, including its replication, to have the web server running on each machine, with the BDB library linked in. Each machine would be a web server but also one of the replication group, with one master and many replicas. Writes go to the master, reads can be shared around the replicas.

BDB seems pretty flexible in policy decisions, e.g. the master can say the commit is complete when it hears back from N replicas depite not having written to disc itself yet.

</comment></comment></comment></comment><comment><USER9> If you need to store to disk at all, use a DB. The exceptions being if you have very small amounts of data or it is not a big deal if its lost (like user preferences or similar). You could just serialize those to flat files.

DBMS are optimized for the fastest possible disk I/O. At their very nature they are also designed with data integrity in mind. It would be a joke not to use one if you are handling important data where persistence is even remotely a factor.

As you grow you'll be glad you implemented the DB code as it will scale much better. You'll also be able to do Analysis easier which can be very important in learning about usage of your product.

But I'm definitely a fan of utilizing ram as much as is allowed in the interest of speed. Try to strike a good balance between data integrity and performance...

<comment><USER3> "DBMS are optimized for the fastest possible disk I/O."

I think that's disputable. DBMSes are designed for a number of considerations and it's not hard to demonstrate how alternatives can outperform a DBMS in terms of disk I/O and general performance.

Consider an HTTP request that modifies records. A typical DBMS-backed app will write all the changes to disk whereas a prevalent system (AKA object prevalence) need only write "POST /someurl arg1=value1:arg2=value2:..." or some equivalent. The data is updated in RAM with a write to only one or two disk sectors in the majority of cases, no communication with a DBMS, no construction and parsing of SQL, and none of the other overhead. A typical prevalent system will be orders of magnitude faster than the DBMS-backed equivalent, and simpler to boot.

Object prevalence doesn't offer a query language and has different scalability considerations, but it would take an absurdly broken design for a DBMS to outperform it.

</comment></comment><comment><USER10> Perhaps this makes me just a programmer, and not a 'hacker', but I for one can write SQL queries and design a good DB schema in far less time than I could create something similar in RAM myself.

<comment><USER11> I don't think so. Basically the idea is just to use whatever data structures you were already using (lists, arrays, hash tables, etc.) and just keep them around. Since you already have this in your code, you avoid doing anything with a DB. There are tools in a variety of languages and frameworks to help with the persistence aspects.

I don't see how that could take more time than doing both the normal program data structures and the DB.

<comment><USER10> On further thought I think you're right. The need for joins can be alleviated with pointers, and sorting and grouping can be done in the application.

The tricky part would be the synchronization and transactional aspects, and if the system became sufficiently distributed that part could get fairly nasty.

<comment><USER12> You're still missing the point. Joins and sorting and grouping in SQL are what you use to populate the real data structures. Whether you know it or not, in all but the most simplistic CRUD application, you've gotta write code to deal with all of those data structures. The database is always in addition to that complexity. The argument being made is that you can leave out the database entirely in some environments, and not add that complexity.

The entirety of this thread is questioning the pervasive use of databases in web applications. There are some where it makes excellent sense (accounting, CRM, ERP, the stuff that's been the strong-hold of Oracle and SAS for years). And others (wikis, blogs, forums, photo galleries, etc.) where it may not make good sense, because you introduce hundreds of unnecessary operations and significant additional database support code. That's not to say a database is never the right solution for these problems (when your problem starts looking relational, you should start looking at relational databases, because your Ruby or Python or Lisp implementation is going to be worse than what PostgreSQL or MySQL have). And, as someone else mentioned (but got modded down)...when you start building your own flaky transactional layer, then it may be time to consider a database that has good transactions support.

</comment></comment></comment></comment><comment><USER13> You can also reference this article:

<http://radar.oreilly.com/archives/2006/04/database_war_stories_2_bloglin.html>

<comment><AUTHOR> Awesome info, thanks ;)

<comment><USER13> Sure, glad you found it useful!

A few months ago, I created a silly little sudoku site, then blogged about how I did it with no database backend (man, I got flamed). Truth is, I really didn't need one but lots of people couldn't see past the fact that I wasn't using the conventional database approach. In their minds, there was simply no reason why I should have used a few flat files.

The whole idea of databases and flat files is such a polarizing topic. It's terribly interesting.

</comment></comment></comment><comment><USER14> Ok, here's the obvious follow-up question:

What DB does news.YC use?

<comment><USER2> Same as Viaweb. Hash tables in memory. Updates to disk, but no reads from disk except at startup.

<comment><USER15> Does the Arc/Lisp process only handle one request at a time? If it handles multiple requests at once how do you keep the writes atomic?

</comment></comment></comment><comment><USER16> Allegro-cache looks interesting although I haven't tried it: <http://franz.com/products/allegrocache/index.lhtml> I like the idea of having a powerful datastore within the same process as the application because you don't have the IPC overhead. Although, if you're using prolog you're probably going to be less likely to want to do complex things in memory as you sometimes are with SQL.

Some considerations that come to mind: 1) Relational databases bring a form of 'automatic' documentation to a project in that somebody who hasn't touched it before can expect to make a reasonable start on understanding it by using known tools to look at the schema. 2) You get powerful hot-patching tools with a relational database (sqlplus, psql, or similar) that have the safety of things like foreign key constraints. 3) Major version upgrades. As you're developing you can track db changes by writing change scripts. Then when you do your upgrade you can 'pull the lever'. There's nothing stopping you from doing this with any other structure, it's just something to think about.

<comment><USER17> Personal experience from AllegroStore, a predecessor of AllegroCache:

\- In AllegroCache/AllegroStore, the class definition _is_ the schema definition; so if the newcomer understands class structures he understands the schema. \- Hot-patching can be done through plain-old REPL. At least AllegroStore the system took care of key consistency (if it is explicit to the system). \- In AllegroStore schema change is handled as class change (of persistent instances). So you can use usual MOP to write update function, which corresponds to the change scripts.

The main difficulty, compared to RDBMS, seemed to come from the fact that the stored objects directly formed a graph, not a table. Some people seemed to have a hard time to "think" directly in graphs, and preferred table analogy.

</comment></comment><comment><AUTHOR> I've been using SQLite since it has the advantage of flat file storage and also the power to run SQL queries against your data. It's very light and powerful. But I was wondering about the specific setups other folks have used?

From: <http://paulgraham.com/vwfaq.html>

"What database did you use?

We didn't use one. We just stored everything in files. The Unix file system is pretty good at not losing your data, especially if you put the files on a Netapp.

It is a common mistake to think of Web-based apps as interfaces to databases. Desktop apps aren't just interfaces to databases; why should Web-based apps be any different? The hard part is not where you store the data, but what the software does.

While we were doing Viaweb, we took a good deal of heat from pseudo-technical people like VCs and industry analysts for not using a database-- and for using cheap Intel boxes running FreeBSD as servers. But when we were getting bought by Yahoo, we found that they also just stored everything in files-- and all their servers were also cheap Intel boxes running FreeBSD.

(During the Bubble, Oracle used to run ads saying that Yahoo ran on Oracle software. I found this hard to believe, so I asked around. It turned out the Yahoo accounting department used Oracle.)"

<comment><USER18> With Viaweb, the stores were islands, each dealing exclusively (or almost exclusively) with its own dataset. They would not run into locking/contention issues as they scaled the way some other apps would if they used flat files and conventional locking.

The database landscape was different in 1995. There were no good free relational databases, and no cheap Oracle licenses.

Lisp makes it very easy to write out any data structure. (Most Scheme implementations can only write non-circular structures easily, but Viaweb used CL). So if your app is amenable to using flat files, coding storage/retrieval is trivial.

So basically, if you're writing an app with lots of separate datasets, flat files are a viable option. If you're using Lisp, they're an easy option. If it's 1995, they're a cheap option.

<comment><USER19> It is interesting how flat files can manage the evolution of the data structures you use? Any advice?

<comment><USER20> Use hashtable for everything. So Person who has a name address age and occupation is represented as a hashtable with those fields. When you want to add a new field like emailaddress it's just another key in the hashtable.

Ideally you want to code the person accessors so that they still specific externally

person-name person-age

the rest of the program uses these so it becomes easy to move person to a different structure if that's what you want .

You want to write some function to read a hash-table and write on to disc. In lisp this is trivial, but most languages have some sort of serializer. Then a function to load all the hash tables up when you start up.

</comment></comment></comment></comment><comment><USER21> I hope this is not totally embarrassing, but with the file system I am always afraid of losing data. What if something happens to the server at the very moment you change the file? It seems to me the only solution is to keep two files and change them alternately, like the double buffering for graphics, and that would probably be slow.

How do you file-advocates solve that problem?

What would you use for firefox extensions? I suppose I can't connect to a database with Javascript.

<comment><USER22> As of FF2, you can use the built in SQLite database for your Firefox extensions. And yes, it's accessible from Javascript. The interface is a lot like JDBC.

<comment><USER21> Hey thanks, that is really good to know. I am just toying around with the idea of writing an extension, and every now and then I collect new information. So far it seems a bit scary to me, but there are so many cool things one could make as extensions.

</comment></comment></comment><comment><USER23> I think it is a bit harder when the data is highly connected (social web app).

However, memory is so cheap now that you could probably get away with keeping all of your business objects in memory, having them write-through to disk for persistence. I imagine that you would have to move business objects around the servers to decrease messaging latency as the connectivity between objects changes.

I don't know of any frameworks that use this approach.

</comment><comment><USER24> You still have to implement queries, sorting, joining, etc. If all your queries are simple key queries then you're basically done. You can also hash at the network level by assigning group hash identies to specific machines in your topology.

Where you will find a benefit to using a RDBMS is in heavy correlation, multilevel sorting especially when you're talking about very large data sets. This is one of the key problem that RDBMS address. If your requirements also say anything about atomicity and integrity of the data it may be a better investment in the long run to go with an existing database solution that had a couple decades to work out those details for you.

</comment><comment><USER25> The best non-database solutions I have seen are: 1\. Google file system, and crawler cache 2\. Lucene storage

</comment><comment><USER26> Umm, you realize MySQL is free right? The real question is really why would you even consider a non-database solution? Is ALL your data static and non- relational? If not, you are really limiting your application by not using a database.

<comment><USER27> As soon as you introduce an SQL layer to your app, your complexity goes to a higher order of magnitude, making it that much harder to debug and troubleshoot.

<comment><USER28> That's hardly true in all cases. Depending on the situation, the "layer of complexity" introduced by your having to build your own data structures is often far worse than whatever is introduced by using an sql database. If you're using a good ORM, it might not really be "complex" at all.

I don't mean this to argue that a db is always good, but I'd guess one of the reasons that people use a database even when it's inappropriate is precisely because it seems less complex.

<comment><USER29> How can you build an application without data structures anyway? If you ever load data from a database, it's loaded into a data structure of some kind.

Of course, if you're using a bunch of elaborate ORM stuff, I suppose it might build your data structures without you ever really seeing them. Is that what you meant?

<comment><USER28> Basically: more precisely, that modern database APIs (not just ORMs) can hide much of the complexity of using an sql database, so that it _seems_ neither "elaborate" nor "a higher order of magnitude" more complex to the programmer to build, test or debug. And since modern database layers often give you tools to help build data structures, it might seem simpler to use those tools than to build something without them.

</comment></comment></comment></comment></comment><comment><USER30> Metaweb (freebase.com) uses (or rather, is) a database, but not a relational one. Those comments that implicitly identify "database" with "RDBMS" may become outdated sooner than their authors expect.

</comment><comment><USER31> <http://labs.google.com/papers/bigtable.html>

</comment><comment><USER32> Domain-specific, but interesting RDBMS alternatives:

HDF5

Mnesia

Kx

</comment><comment><USER33> mmap of course?</comment>


Apple v. Samsung judge, at wit's end, asks if lawyers are "smoking crack" - <AUTHOR> http://arstechnica.com/tech-policy/2012/08/apple-v-samsung-judge-at-wits-end-asks-if-lawyers-are-smoking-crack/

<comment><AUTHOR> I think this is exactly why my wife got frustrated with law and changed careers. The judge seems just as frustrated as I would expect any reasonable person to be.</comment>


JQuery 1.3 Released - <AUTHOR> http://blog.jquery.com/2009/01/14/jquery-13-and-the-jquery-foundation/ <comment><USER2> Excellent, and the file is already live on Google's CDN:

[http://ajax.googleapis.com/ajax/libs/jquery/1.3.0/jquery.min...](http://ajax.googleapis.com/ajax/libs/jquery/1.3.0/jquery.min.js)

</comment><comment><USER3> live events are great since they can be bound to future elements. this simplifies, for example, adding components with ajax.

<comment><USER4> does it replace the livequery plugin?

<comment><USER5> Mostly. The livequery plugin lets you watch for new elements and do something when they appear. It's a little resource intensive, since it polls the DOM repeatedly. The jQuery version doesn't have that, and probably for good reason.

<comment><USER6> I believe the jQuery version attaches the handlers to document which allows it to use event bubbling.

I got this info from a comment posted here by jresig himself. <http://news.ycombinator.com/item?id=406653>

</comment></comment></comment></comment><comment><USER7> The new API looks really nice compared to the classic version:

<http://api.jquery.com/>

<comment><USER8> When I read that I thought they changed the API. I do agree though, the new API documentation is much faster.

</comment></comment><comment><USER9> _More importantly, though, we're taking a big leap with Sizzle: We're releasing it as a completely standalone project to be collaborated upon by many library creators and developers._

This should hopefully lead to a library that makes cross-browser development even easier:

[http://meyerweb.com/eric/thoughts/2008/10/22/javascript- will...](http://meyerweb.com/eric/thoughts/2008/10/22/javascript-will-save-us- all/)

</comment><comment><USER10> For anyone who uses Visual Studio, here's an accompanying vsdoc for jquery-1.3: [http://blogs.ipona.com/james/archive/2009/01/14/jquery-1.3-a...](http://blogs.ipona.com/james/archive/2009/01/14/jquery-1.3-and- visual-studio-2008-intellisense.aspx)

</comment><comment><USER11> Great news, I just checked it into my current project and was able to dump the livequery plugin.

<comment><USER12> How could they live that long without integrating livequery?

<comment><USER13> This isn't a straight-up integration of liveQuery. We've been very hesitant to bring in liveQuery wholesale because 1) It's quite large and 2) It's very slow (especially when you start using lots of selectors). We didn't want to integrate something until we felt good about the performance. The combination of the new selector engine and event delegation makes this a reality for us, so we're quite happy.

<comment><USER14> It seems like the jquery integrated live function does not work on the iPhone safari browser. The livequery plugin works just fine. Can someone confirm this?

</comment></comment></comment></comment><comment><USER15> The big question for me that I haven't seen discussed is whether or not I can update to 1.3 on an existing site using 1.2.6 without something breaking. Does any core functionality change that requires rewriting code

<comment><USER13> All of that is detailed in the release notes: <http://docs.jquery.com/Release:jQuery_1.3#Changes>

So far most people have had no problems upgrading.

<comment><USER16> What about users using jquery-ui, can we upgrade to 1.3 without crossing our fingers?

<comment><USER13> You'll need to wait for this final release candidate of UI 1.6 to come first. UI 1.5.x depends upon jQuery 1.2.x and UI 1.6.x depends upon jQuery 1.3.x.

</comment></comment></comment></comment><comment><USER3> thoughts on "no more browser sniffing"?

<http://docs.jquery.com/Utilities/jQuery.support>

is this helpful? i still get bit by js failures in ie, but i'm not sure what the impact of this change is. is the advantage more that no sniffing means less chance to get that wrong or be fooled?

<comment><USER13> It's primarily helpful to jQuery itself. The problem is that most libraries have blindly assumed that specific browser bugs (such as an Internet Explorer bug) will exist forever in all versions of the browser. When the time comes for IE to fix the bug (and it will come) the library will break due to the blind assumption. Using feature detection, like we have, is a sure-fire way to make sure that this doesn't happen.

jQuery.support, itself, will likely only be marginally useful to those outside of jQuery core (since we're checking for some very specific bugs or features). That being said we have documented it since it could still be useful.

<comment><USER3> word.

it's great that you're active on this discussion thread. is it challenging finding all the places that discuss jQuery? is it interesting engaging with different communities or are they all pretty much the same?

</comment></comment></comment><comment><USER17> I'm really interested in the new Sizzle selector component for a framework I'm working on.

This all looks really great! If I wasn't so eager to make some core changes to jQuery/Prototype, I'd probably give up and just use jQuery ;p.

Great job John, Ariel, Brandon, and Jorn (plus all of the unnamed contributors!).

</comment><comment><USER18> Really amazed at the way John ingeniously "patched" the broken cross-platform language

<comment><USER3> it's hard to tell what 'amazed' and '"patched"' mean. rather, it's hard to know what you're saying and with what overtones. are you sharing a fun joke or being rude? i think you might be downvoted for perceived sarcasm/meanness. it could be a mistake.

<comment><USER18> Oh, sorry! I wasn't trying to go specific about the detail, just some general feeling I have towards jQuery.

I guess I'd better explain why I feel so.

I was experimenting with JavaScript a couple of years ago before jQuery/Prototype/etc took off. IE6 was the absolutely major browser back then, but I was expecting JavaScript to work both in Firefox and IE6. You couldn't imagine how frustrated I felt trying to get anything work cross-platform flawlessly.

Then I came across jQuery. I think it was still in an "alpha" stage then -- the whole idea was awesome, but with many bugs (I even worked one out and had John patched it with my code). I was amazed at the way John solved the problems of JavaScript (personally I do not like JavaScript), saving a lot of trouble for me.

Later I moved on and was not involved with JavaScript for quite a while. But I still kept an eye on the evolution of jQuery. I was really excited by the animation effects jQuery provides (how could one possibly achieve that in such a language with broken support? He must be a genius!). As for the 1.3 release, I think "future detection" probably solves the cross-platform issue once and for all. That's what I meant when I said the word "patched".

Forgive my broken English -- it's not my mother tongue :|</comment></comment></comment>


Show HN: Free AngularJS 1 on 1 lessons - <AUTHOR> Just comment here and we can begin. <comment><USER2> I'm interested, i'm developing an angularjs app for my Rest API backend (nodejs + Mongo) and I think I have misunderstood some Angularjs concepts

<comment><AUTHOR> Cool.. let me know your availability and we can start...

<comment><USER2> I'm in CET timezone. From 19:00 to 24:00 I'm available. If it doesn't fit your schedule we can try to meet at weekends.

</comment></comment></comment><comment><USER3> Hi I'm also very interested in talking 1on1 about some Angular concepts/best practices, especially about testing and maintainability.</comment>


The Soylents of the Lambs - <AUTHOR> http://glog.glennf.com/blog/2015/5/27/the-soylents-of-the-lambs <comment><USER2> As someone that recently started using Queal - a Soylent alternative available in Europe, there are some things many people seem to be missing:

\- Unless you really pay attention to what you eat, you have absolutely NO guarantee you are actually eating what your body needs by stuffing random food in your mouth.

\- Soylent etc does not have to be the only food-source.

\- These shake meals do provide at least a lot of stuff your body needs we already know about.

And the first point is important, I am pretty sure my diet before Queal - which was not that long ago - was a LOT unhealthier, skipping breakfast, eating sandwiches at work overflowing with random sauses, eating fastfood just to get something nutricious in my body. You think mc donalds analyses every single nutricious ingredient in their burgers to see if it might be sufficient to what your body needs? Or Subway? Or <insert any food-chain here>? The ones mostly paying attention to this are probably vegetarian companies, because there it's clear they need to be careful, but that's about it. When people claim they don't really know what your body needs, what are they complaining about? This at least actively tries to do this, no other food does this.

And regarding what the body needs, don't underestimate your body. There are testimonies from people that had to survive for a lont time at sea, living mostly on raw fish suddenly craving the eyes of the fish because it contains nutricious things your body needs too. Rob Rhinehart himself said it too in his "How I stopped eating food" blog entry that started the Soylent adventure:

> When I was deficient of iron I felt a strong craving for red meat.

That said, I wouldn't have gone through the personal experimentation that Rob Rhinehart went through to find out what was missing, where he missed some basic stuff like iron, but I'm glad someone at least looked into this concept. How it has been done, that's another matter, but right now they seem to be as close as you can get right now.

So is it perfect? Maybe, maybe not, but for me at least, it's a huge improvement. For me it comes down to something someone somewhere said about soylent-like meals:

> The best meals to replace with Soylent are the meals you aren't excited > about.

But, since using it, I have more energy, have less trouble getting out of bed in the morning and overall feel a lot better. This could be due to me eating breakfast every morning now, but still it's a remarkable improvement. I still have at least one 'normal' meal every day, which is for me is the sensible thing to do, but I don't plan to stop using Soylent-like food at all unless I really notice health-problems.</comment>


Show HN: Drawboard – The multidimensional workspace and pen - <AUTHOR> https://www.drawboardvr.com/ <comment><USER2> Add an actual White Board Marker Pen Tip! Then educators can make their whiteboards into actual "smart boards" and share content.</comment>


Introducing Darkleaks - <AUTHOR> https://medium.com/@ZozanCudi/darkleaks-information-blackmarket-1ee5ac28c892

<comment> tom-lord Without even going into the technical side of things, what I really don't understand about these sorts of projects is: What are you trying to achieve, exactly?

Some of material that DarkLeaks is being advertised as "the best tool to trade" seems like it would be great to have publicly available, e.g.

> Proof of tax evasion, corruption

But most of these things, in my opinion, should NOT be publicly distributed! They are private/confidential for good reason - either for personal privacy, or even for national security reasons! E.g.

> (Recent) military intelligence, sex pictures, trade secrets, ...

I don't understand how anyone can wholeheartedly support a system that could help do so much damage to the world.

<comment><USER2> _I don 't understand how anyone can wholeheartedly support a system that could help do so much damage to the world._

There are many who, whenever they pay taxes or vote in the US, ask themselves the same question.

<comment> tom-lord Voting is not a fair analogy at all, because if you think both the main candidates are bad, you can always vote for a minor party! Sure, they almost certainly won't win, but you're sure as heck not making the situation any _worse_! Or in other words, there is absolutely no obligation for you to support "the system".

I see your point about taxes. However, as the old saying goes, two wrongs do not make a right. Whilst a file sharing system like Darkleaks may have some great potential, I think it is morally wrong to actively promote its use for such things as leaking celebrity sex tapes, and compromising national security.</comment></comment></comment>


Rickrolling GitHub - <AUTHOR> https://github.com/mathdroid <comment><AUTHOR> For anyone confused on mobile, this only works on desktop.</comment>


Ask HN: Funding Seed/Series A? - <AUTHOR> We're a startup in the SME/Enterprise space, and do date we're self-funded. We've also realized that in order to grow, we need to approach funding.  We have customers, but this round would allow us to fill out the product, whilst starting the lengthy sales cycle that exists in the enterprise space.
But how does one go about raising seed? Forget pitch decks, pro formas, competitive analysis, and warm introductions - we have all that. I mean what's the actual proess look like, detailed?  How can we learn to pitch (properly) to real VCs? Are there resources that are things like filmed/real pitches?
Basically... having read a tonne of this online, we're wondering how we go about doing it? How do we specifically set the valuation? How do we raise this seed/series A? Which is it?  Thanks in advance for any responses, I really appreciate it! <comment><USER2> why not go through an something like ycombinator or techstars etc?

<comment><AUTHOR> Currently we're self-funded. Given our analysis, neither YCombinator, nor Techstars provides enough funding that the give is worthwhile. Learning to pitch and the methodology is really where we're headed - and would like to do this outside of our own network.</comment></comment>


Tell HN: Please dont brick the app - <AUTHOR> An old friend of mine died of cancer on Sunday, alone in a Thai government hospital, with no family or friends around him, in a language he didn't really understand, it sad ending, it was not a dignified way to go.
His only contact with the others in world in recent months has been WhatsApp which I setup when I visited him earlier in the year. He had expected to live several months but things took a turn for the worse and rapidly deteriorated over a few days. WhatsApp the buggers put an arbitrary time limit on the app between updates so he was locked out - confused and desperate (coupled with the morphine), I guess he had enough mentally.
I presume his phone was never updating due to storage being near limit - tbf his phone was a mess and he was a technophobe, and since he never saved contacts just sent off the number I guess there was no record of his contacts in his main phone. I have in phone in my possession now, but my new number was not there for example, he had tried to call my old number via non Internet on the 8th. I've managed to sort out the hospital, the death certificates, family wishes, and temple send off, but I'm sure he would not of wanted to leave things in this way.
App devs - We're not all in 1st world countries surrounded by friends and family, with techies to troubleshoot. Please don't brick your communication apps on a time limit, maybe disable emoji or video calls or some non core functionality, but lets not go nuts and block the whole app for the sake of adding telemetry, ads, or more politically correct emojis. This wasn't a protocol change or anything else afaik which makes me quite angry. end of rant <comment><USER2> > We're not all in 1st world countries surrounded by friends and family, with > techies to troubleshoot

I was recently helping local veterinarians to clean their computers. It was so bad that they were switching between two machines when one of them was freezing.

Yes, their computers are old but they don't have a budget to buy new ones. Memory and CPU aren't cheap when you are not a middle-class citizen of a rich country. Bloated and bugged software with poor UX design seriously affects people's lives, prevents them from doing their important jobs.

Please, strive for quality. We are engineers – others depend on our creations.

</comment><comment><USER3> Sorry about your loss.

While I understand how frustrating it was to lose use of the app in a delicate situation like that, I can see why developers would do that. A business has to pay for maintaining compatibility over many versions (engineering time, complexity, ...), and with free consumer apps like WhatsApp, it makes business sense to bug users to update or disable altogether.

As a consumer, I hope such empathy for users catches on though. The emergence of UX designers and now accessibility experts has made software more empathetic, so who knows, maybe there will be pressure to stop forced updates.

</comment><comment><USER4> Especially when I know that WhatsApp system is built in ErlangVM, which is famous for its ability to maintain being functional across updates..

<comment><USER5> The client (assuming Android) is not in erlang. From what I've seen, WhatsApp actually tries its best to keep old clients running as long as possible, and they only stop working for critical functional updates.

There were Symbian phones which kept running WhatsApp till very recently.

</comment></comment><comment><USER6> Hear hear. If software engineers are truly engineers, there needs to be redundancy and graceful fallbacks.</comment>


How Stockfish chess engine works - <AUTHOR> https://technotes.substack.com/p/13-how-chess-engines-work <comment><USER2> I only spotted one error here. Well, maybe two things.

While both computer chess and human chess use the same Elo (not ELO) algorithms to calculate the strength of a player, I believe that they use different pools to players to calculate those values. Since Elo rankings are all relative to the rest of the pool that they are measured from, human Elo rankings are not directly comparable to computer Elo rankings.

<comment><AUTHOR> Thanks, Brad. Updated ELO to Elo and added that both rating may not be directly comparable.</comment></comment>


Trotskyite Singularitarians for Monarchism: A political speculation. - <AUTHOR> http://www.antipope.org/charlie/blog-static/2013/11/trotskyite-singularitarians-fo.html

<comment><USER2> tl;dr: radical ideologues have no clue what's going to happen and begin sort of freaking out, ideology-wise.</comment>


NEC shows 'flying car' hovering steadily for minute - <AUTHOR> https://www.apnews.com/2d4ce8955bc04032928afdf97ed42818 <comment><USER2> The EHang 184 looks more promising.[1] That has four sets of contra-rotating props, so there's some redundancy. Flight time 23 minutes, so it's a demonstrator, not something useful. Like the others, it's a scaled up quadrotor drone. This concept needs a higher battery energy density to work.

Someone recently flew a jet-powered "hoverboard" across the English channel.[2] That thing is powered by several large model aircraft jet engines. It's much like the Hiller Flying Platform of 1954.[3]

If you like strange VTOL craft, many of them are in the Hiller Aviation Museum in San Carlos, CA.

Also check out the famous AvroCar flying saucer.[4] The US National Archives has uploaded the declassified videos to YouTube. The first video, before the first flight, was classified SECRET. The second video, after the first flight, was only CONFIDENTIAL. The third and final video was UNCLASSIFIED, because it didn't work. The thing was sent to what is now NASA Ames to see if it was good for anything. The video shows it bumping around a meter or two off the ground, pretending to be a hovercraft. The original goal was a supersonic VTOL aircraft. Not even close. The U.S. Army canned the project in favor of the Huey helicopter, which actually worked.

[1] [https://www.youtube.com/watch?v=B7Hm- rmLQcU](https://www.youtube.com/watch?v=B7Hm-rmLQcU) [2] [https://www.cnn.com/videos/world/2019/08/04/french- inventor-...](https://www.cnn.com/videos/world/2019/08/04/french-inventor- hoverboard-english-channel-intl-vpx.bfm) [3] [https://www.youtube.com/watch?v=ANBeuGcZHBA](https://www.youtube.com/watch?v=ANBeuGcZHBA) [4] [https://www.fourmilab.ch/documents/army_saucer/](https://www.fourmilab.ch/documents/army_saucer/)

<comment><USER3> >That has four sets of contra-rotating props, so there's some redundancy

That is _no_ redundancy. With only four booms, it only takes a single boom failure (electrical or mechanical) to crash. And with co-axial counter- rotating props, a prop failure will almost certainly cascade to its partner - so again, you really only have four props.

There is almost no survivable failure mode with that design.

<comment><USER4> If just one wheel fails on a car travelling at 100km/h on a road with oncoming traffic you're very unlikely to survive either.

<comment><USER5> A 200km/h head on collision with equivalent modern cars is absolutely survivable. Gravity is pretty potent at getting you moving faster than that, and with extremely uncertain impact point

<comment><USER6> It's actually a 100km/h collision done twice. Each car goes from 100 to 0, not from 200 to 0. There's twice the energy but it's distributed across the two cars so for each one it's equivalent to hitting a stationary wall.

That said, based on this video I don't think an actual 200km/h is anywhere near survivable for the average modern car: [https://www.youtube.com/watch?v=LmRkPyuet_o](https://www.youtube.com/watch?v=LmRkPyuet_o)

Possibly higher end sports cars with cages and five point harnesses may fare better.

<comment><USER7> A 100km/h head-on with a similar car going 100km/h should be similar to a 100km/h head-on collision with a solid concrete wall. However a car traveling at 200km/h has _four_ times the kinetic energy as a car traveling at 100km/h so a collision at that speed is much less likely to be survived than a collision at 100km/h.

<comment> matt-attack Wow you are the first person to point out what I've been saying for decades. A car hitting another car at the same speed is _indistinguishable_ from a car hitting an immovable wall.

Intuition wants to think it's twice as bad.

As an aside can I pose another physics car challenge to you that 100% of people I've asked get wrong?

You're the only car at stop light waiting for the light to turn green. You look up in your rear view mirror and see a car bearing down on you presumably with a distracted driver. You know you're about to get rear-ended. In that split second do you: A) Let up on the brakes and put the car in Neutral or B) slam in the brake as hard as you can.

<comment><USER8> The brake will increase survivability for you; neutral will increase survivability for the other driver. What hurts you is the sudden acceleration from the impact, and the brake will decrease that. What hurts the other driver is the sudden deceleration of impact; your brake will make that a harder stop for him while being in neutral would make it a bit less of a hard stop.

<comment><USER9> This is backwards.

Your car will accelerate suddenly from the impact either way, so you want to increase the time-frame over which the impact forces of the crash are dissipated. If your car is in neutral, then the crash is less severe because only part of the other car hits you before your car starts gets pushed forward, so more of the energy of the impact gets transmuted to accelerating your car and less energy needs to be absorbed by your car's crumple zones.

If you slam on the brakes, you effectively turn your car into a stationary object, and that means you and the other car must absorb the full energy of the collision. At collision speeds where survivability is a concern, this usually means the crumple zones are inadequate to absorb the energy of the collision and so more of it gets passed on to your body.

Ideally, you would want to accelerate your car as much as possible before the impact to minimize the speed differential. Even a 10mph decrease in the differential has a huge impact on survivability.

[Note: bigger cars can survive crashes better because they have more _mass_ they can act as crumple zones to absorb the force of the crash. Older, more rigid cars would frequently survive with limited damage crashes that killed their occupants, at lower average speeds than today, because the cars transmitted more of the impact forces to the occupants. Modern cars are designed to crumple to dissipate impact forces.]

</comment></comment></comment></comment></comment></comment></comment></comment></comment><comment><USER10> > All of the flying car concepts, which are like drones big enough to hold > humans, promise to be better than helicopters. Helicopters are expensive to > maintain, noisy to fly and require trained pilots.

They forgot to add helicopters can also auto-gyrate in the event of engine failure.

Quad-copter drones probably just crash.

<comment><USER11> >Helicopters are expensive to maintain, noisy to fly and require trained pilots.

This part really puzzles me, I mean I guess they're better than helicopters but all those thing apply to flying cars as well, just to a lesser degree.

Getting some flying cars won't be cheap, maintaining them might be cheaper than a chopper but still not very cheap.

And if you're going to pilot one of these, and carry people around I guarantee you will have to be licensed and trained in piloting one. The regulations won't be as loose as with drones.

As for the noise, well this isn't exactly quiet.... [https://youtu.be/cmdilp9LM0E?t=67](https://youtu.be/cmdilp9LM0E?t=67)

Sure it might not be as bad as a helicopter but you also rarely have two dozen helicopters zipping around near ground level. While the whole plan is to have these zipping around everywhere.

<comment><USER12> >As for the noise, well this isn't exactly quiet....

I remember listening to Elon Musk dismissing flying cars for this reason.

<comment> yoz-y I wonder if asymmetric blades like in fans could work and if they would be any good for reducing the noise.

<comment><USER13> There has been a good deal of economic incentive for finding ways to reduce the noise of the fans in turbofans for a long time. the relatively recent introduction of chevrons on the exit end of fan nacelles shows how even minor improvements are pursued. It is unlikely that an opportunity for significant improvement has been overlooked.

</comment></comment></comment></comment></comment><comment><USER14> Flying cars have been functional since the 90s. There are more problems to this concept.

A. Imagine DUIs in widely available flying vehicles.

B. Autopilot is still dogshit. That's the truth.

C. If you're old enough, you'll remember when a commercial airline would be high in the sky and you'd still have to pause talking to someone on the ground. Now, even though they will be quieter, electric and all, but high speed rotors still make noise. Lots of it. Add lots of these in lower altitude. Good bye quiet spaces.

D. Maintaince. Oh my shit, few people properly maintain their ground cars. Wtf do you think is going to happen to a flying car? Difference is, you don't roll to a stop on engine failure. You crash into a home with someone's family in their teaching their toddler to walk.

E. You think those trucks through crowds were bad a while ago? This is borderline democratizing terrorism.

F. Mile per watt is going to be way worse than a car. Itll take way too much energy in comparison. Those power conglomerates are going to want their pound of flesh.

<comment><USER15> As far as E, not sure you could do more damage than a box truck would do. If you tried to fly into a crowd somehow you would crash and probably only hurt people within a relatively small radius.

<comment><USER14> Um... should I tell you about a little known event called 9/11?

Let's just add, oh, I don't know, 100 pounds of a fertilizer bomb like the Oklahoma city bomber. He used a lot more, but 100 is still crazy dangerous. Add you have a vehicle that laughes at bollards, gates and fences.

You do know, bad people actually do exist. Trusting tech companies and scifi hopes and dreams really isn't an effective strategy.

<comment><USER16> Which you can already do with existing small helicopters for rent, general aviation airplanes etc. Flying cars aren't a new threat in this respect.

<comment><USER14> Current pricing and registration are the current barriers to entry, especially training. It's not straightforward easy to fly a helicopter or small airplane. Not crazy difficult. But harder than a ground vehicle. Making it too easy and affordable and making them crazy plentiful in the air so they can't be tracked easily, that's the danger.

</comment></comment></comment></comment></comment><comment><USER17> [https://youtu.be/vzm6pvHPSGo](https://youtu.be/vzm6pvHPSGo) IBM decided lotus software was more important than flying cars

<comment><USER18> This commercial has stood out on my mind for nearly 2 decades. Probably a combination of Avery Brooks and flying cars, bit it had a lot of memorability to me for someone who used Lotus for 4 months at a job.

<comment><USER19> Where did Avery Brooks develop his speech technique...

<comment><USER20> (in Jon Lovitz Master Thespian voice) ACTING!

</comment></comment></comment></comment><comment><USER21> Reminds me of vaporware Moller Skycar[0] and Gyrocopters[1] from yesteryear.

[0] [https://moller.com/](https://moller.com/) [1] [https://i.imgur.com/JisWKOR.jpg](https://i.imgur.com/JisWKOR.jpg)

<comment><USER22> Gyrocoptors have been, and still continue to be a thing, for like... 85 years. The design has not been ever marketed as a "flying car" (to my knowledge), though it does have a relatively short takeoff roll compared to conventional aircraft. Search for "autogyro".

</comment></comment><comment><USER23> Video: [https://www.youtube.com/watch?v=cmdilp9LM0E](https://www.youtube.com/watch?v=cmdilp9LM0E)

It rocked back and forth and bounced when it landed, clearly a lot of tuning left.

<comment><USER24> The wheels are too narrow. When it landed, it almost tipped over to the side. A little bit of cross-wind and it's lying on its side.

</comment></comment><comment><USER25> I wouldn't call this a flying car, I would call this a quadcopter with wheels.

While the prospect of having less traffic jams is desirable, the odds of being T-boned from above or below by a distracted pilot become greater than zero.

I think we'll need Type 5-and-then-some AI pilots before any of this becomes a reality in day to day commutes.

<comment><USER26> > I think we'll need Type 5-and-then-some AI pilots before any of this becomes > a reality in day to day commutes.

Wouldn't AI in flight become much easier to create compared to driving AI on the ground? I mean don't planes already have somewhat of an autopilot.

I have no experience or knowledge on the matter, but common sense seems to indicate that air-flight has considerably less environmental variables and could be significantly easier in most cases.

<comment><USER27> > air-flight has considerably less environmental variables

Does it? Instead of routing in two dimensions you now need to do it in three. You then also need to take into account other actors who are also routing in three dimensions. There are no road delineators in the sky.

There's also the rather obvious safety concern that in the event of a malfunction, an accelerating, out of control thousands-of-pounds mass accelerating forwards becomes an accelerating, out of control thousands-of- pounds mass accelerating forwards _and coming down due to gravity_.

<comment><USER28> Routing is much easier when you can basically go from point A to B directly. Coordination would be required to prevent collisions with other vehicles, but evasion in 3D just means changing to an uncontended altitude. I think the extra dimension actually makes it easier.

<comment><USER29> I think you're right.

Planes have had autopilot systems for a while now where they basically fly themselves.

The big tech firms have been struggling to make a fully autonomous no-human- needed driving car for a while now. So many variables to deal with. Watch Tesla videos on YouTube and you'll see them still struggling on certain types/conditions of roads etc.

<comment><USER30> Large planes fly themselves on planned routes which avoid incursions by other planes by design: the function of air traffic control is to assign the routes such that incursions don't occur. In the event that the onboard collision avoidance system projects that another aircraft will come too close the warns the pilot with a recommended action. There is also a ground proximity warning system which issues warnings about collision with ground/mapped obstacles but again leaves it to the pilot to take the necessary action.

ATC relies upon surveillance radar that won't provide adequate coverage at low elevations (too many obstructions). ATC is also badly overstretched in busy airspaces coping with existing traffic. Adding a large number of new low- altitude aircraft will require new navigation technology (e.g. coordinating a swarm of vehicles in close proximity, relaying warnings about dangerous wind conditions or uncontrolled vehicles, etc)

Conditions in the air can be more treacherous than on a road: although there are more degrees of freedom the supporting air is also more variable than a road: wind shear and clear air turbulence can be perilous even for large aircraft, icing can quickly cripple aerodynamics, and in the event of failure safely halting can be problematic.

</comment></comment></comment></comment></comment></comment><comment><USER31> Has anyone effectively dealt with the noise problem? Vehicles this size would be unacceptable almost anywhere people are present for the noise alone.

<comment><USER32> Would this be a problem if these cars exclusively took off from the top of sky scrapers? If I remember from my time in Nyc, above the 20th floor it's quite hard to hear even the loudest noises from the street.

Presumably from the ground, it'd be hard to hear one of these taking off on the 30th floor.

<comment> semi-extrinsic It severely restricts the potential market if you do this (only travels from one skyscraper to another are supported). For instance you can just completely forget about Washington DC, London and Paris, and many more cities.

And even in cities with skyscrapers, they tend to be clustered in one or two districts, so you can only travel within a very small part of the city.

My feeling about the current push for flying cars and autonomous transport, is that when our grandchildren ask us about it, it will be in the same way as children today ask why they were still playing violins when the Titanic went down.

<comment><USER33> Well, skyscraper to skyscraper (or helipad, or other permitted areas) would be a start. Eventually the tech could catch up - for example, with materials like these - [https://phys.org/news/2019-03-acoustic-metamaterial- cancels....](https://phys.org/news/2019-03-acoustic-metamaterial-cancels.html) \- being developed.

<comment><USER34> Skyscraper cable cars would be less expensive/noisy/power hungry and with more capacity. [https://arstechnica.com/science/2013/02/envisioning-the- urba...](https://arstechnica.com/science/2013/02/envisioning-the-urban- skyscraper-of-2050/)

<comment><USER35> Skyscraper cable cars require them to be near enough to each other, which would limit them to far fewer city centres. London for example has very few skyscrapers, but several parts of town have some and quite a few more have a bunch of 20+ story buildings, but only two areas (City and Docklands) have many buildings like that clustered close enough for cable cars to seem potentially viable by far enough for it to possibly be interesting.

</comment></comment></comment></comment></comment></comment><comment><USER36> I don't understand why this is called a flying car and not a quadcopter. Cars by definition have 4 wheels and drive around.

<comment><USER37> It is supposed to cover many of the same use cases as a car.

Also, "car" has many meanings already: passenger car, train (or subway or roller coaster) car, and elevator car. It doesn't seem unreasonable to add another.

</comment></comment><comment><USER38> I haven't read much into this, but the Blackfly looks at least as promisin as the competition: [https://www.opener.aero/](https://www.opener.aero/)

edit: Forgot to add that it has already flown over 20,000 miles with payload (in about 2k flights)

</comment><comment><USER37> Same question as always applies: how much energy does it use compared to a car that drives on a road?

The article does mention electric (or hybrid) power, but since electric cars are a thing now, when comparing alternatives it seems like this would not have the lowest energy usage.

<comment><USER39> The Uber Elevate white paper answers many of these basic questions [1].

Bottom line:

      Conventional car about  1 mile / kWh
      Electric car about      3 miles / kWh
      Electric VTOL about     2 miles / kWh

[1] [https://www.uber.com/elevate.pdf](https://www.uber.com/elevate.pdf) page 81ff

</comment></comment><comment><USER40> A flying car, aka "helicopter"

</comment><comment><USER41> Moller's sham skycar managed this feat 15 or 20 years ago.

</comment><comment><USER42> Tethered. Just like the Moller car forever ago.

And you now someone will stand underneath this thing as it's landing and get beheaded. Just saying. If it can happen, it will.

</comment><comment><USER43> Has anyone thought about downdraught from these if they're ever sold en-masse?

It'll be a complete nightmare for pedestrians.

<comment><USER44> And the noise, and the things falling from the sky when they crash.

</comment></comment><comment><USER45> In my vision the only challenge we need to overcome is to increase energy density/weight ratio by a factor of 100. Rest of the tech is already there. Letting a car hover for a minute isn't that special. Letting one hover for 3 hours is.

</comment><comment><USER46> The only way there will be mass adoption/acceptance of flying cars will be if flight is completely automated. The thought of my neighbor landing on my house is all too vivid.

<comment><USER47> Yes, crash landing into people, building, trees, and other traffic is a concern. But automation is not enough, we also need standardization and synchronization, because I am not looking forward to a future where the whole sky above a city is filled with random flying objects everywhere. That would be a mess, particularly around/over low-rise buildings, such as in villages, suburbs, and similar neighborhoods. Flying everywhere you want to go might make sense in either densely populated high-rise cities where you could fly and park your car at height, freeing the ground floors for pedestrians, cyclists, nature, recreation, and so on, or for sparse populated areas where there is no-one to be bothered anyway.

</comment></comment><comment><USER48> Hovering steadily..... they've got rush-hour scenarios covered!

</comment><comment><USER49> Looks like a cross between drone and rickshaw. I want!

</comment><comment><USER50> looks like a death wish

</comment><comment><USER51> Not interested unless they've defied physics and made it silent.

</comment><comment><USER52> Stop trying to make flying 'cars' happen.

<comment><USER53> Why exactly?

Everyone knows they will have noise issues and thus cannot be used in tightly populated areas, but there are miriads of other places and usage cases for them.</comment></comment>


Distributed Read-Write Mutex in Go - <AUTHOR> https://gist.github.com/jonhoo/05774c1e47dbe4d57169

<comment><USER2> I thought "distributed" would mean distributed over the network, which I could definitely make use of! (Or perhaps I should just use zookeeper or equivalent for that ;)

Anyways, in this case the term "distributed" is being used to describe a mechanism which reduces memory contention when go is utilizing multiple cores on one machine.

I'd love to see more exhaustive analysis of the performance implications for this technique across a wide variety of usage scenarios.

<comment><USER3> N00b question here but when people refer to mutex's, they are usually talking about multiple cores on a single machine right? Isn't there a different terminology for locks taken across the network in distributed systems?

<comment><USER4> No. There are usually talking about 2 threads accessing the same code.

Let's suppose we have an int, and want to add 2, we would do:

1\. int i = sharedInt

2\. i = i + 2

3\. sharedInt = i

(that's what the compile actually does when you write sharedInt += 2).

If the runtime decides two stop the current thread on line 2 and lets the second one run all three lines, we would have a problem if I didn't use a mutex.

<comment><USER5> You can compile on x86 for atomic increments? (Go seems to support it [https://golang.org/pkg/sync/atomic/](https://golang.org/pkg/sync/atomic/))

<comment><USER6> This is available only under certain architectures (x86 is one of them as you've noted), but I've also seen scenarios where the atomic increment instruction is actually slower than using a mutex. Don't consider this feature to be a magic bullet and always test your use cases!

As for the parent discussion, usually a mutex is talking about the threading construct while a "lock service" is how you'd refer to something like etcd or zookeeper.

<comment><USER7> Mutexes are typically implemented over atomic instructions. So you'd do something like atomic compare/exchange to acquire the mutex and if there's no contention you got it. If there is contention you go to the OSes synchronization constructs which are typically much slower... An atomic increment _should_ always be faster than acquiring a mutex and incrementing...

</comment></comment></comment></comment></comment></comment><comment><AUTHOR> FWIW, this has now moved to [https://github.com/jonhoo/drwmutex](https://github.com/jonhoo/drwmutex) so you can use it directly in your projects.

</comment><comment><USER8> Possible unintended side-effect: `taskset -p` might have "interesting" effects on your process.

<comment><AUTHOR> I don't think taskset should affect this at all. It modified the CPU affinity, which my code respects, so everything should behave as expected.

<comment><USER8> So what happens when you find yourself running on a CPU that wasn't in your initial affinity mask?

Also, the "sleep for 1 ms" approach used in `init()` looks wrong -- if `sched_setaffinity()` doesn't guarantee that the calling task has been migrated to one of the target CPUs on return (which I suspect it does), I don't think sleeping for a millisecond is going to change anything.

<comment><AUTHOR> You'll acquire CPU 0's lock (since a map lookup with an invalid key yields the zero value). I agree this isn't optimal when you _change_ the affinity of a process after it has started. You could imagine a scheme where, if this happens, you create a new lock, but that would significantly complicate the scheme as you would now potentially need to take a read lock on the map in case it changes under you. It's annoying that CPUID values aren't guaranteed to be without holes, but that's what we're stuck with.

Yeah, the sleep is a leftover from an earlier version of the code that didn't use sched_setaffinity. I've remove it now.</comment></comment></comment></comment>


Starbucks customer's infuriating scheme to get free drinks every day (2015) - <AUTHOR> https://www.cbc.ca/news/trending/worst-starbucks-customer-ever-1.3199442 <comment><USER2> The story about the person having 365 cards to simulate having a birthday each day doesn't make sense, on two fronts.

#1, birthday is assigned per _account_ , not card, so that requires 365 accounts. Their terms of service forbids having more than one account (it changed sometime after 2010 per archive.org), so they can deny such misuse.

#2, the birthday gift is a free _item_ , so there is no need to artificially suppress the list price of that item. The entire item is free anyway, whether it is a $2 tall drip coffee or a $9 salad.</comment>


Is COBOL really understandable after 14 years? - <AUTHOR> http://trustafriend.com/articles/index.php?operation=display_article&article_id=2&title_caption=Is%20COBOL%20really%20understandable%20after%2014%20years?

<comment><USER2> The few COBOL programs I've seen (or had to deal with the output of) always seemed to handle fixed-width fields. Does COBOL have support for variable- width fields? And how would this lessen the verbosity of those record definitions? Modern regular expression and scattering assignment in scripting lanaguages

      (name, address1, address2, city, state, zip) = record.split(/\t/)

is somewhat self-documenting also. Dealing with fixed-width records even in modern languages can be pretty verbose

      name = substr(0, 40)
      address = substr(41,60)
      ...

as well (and the regular expression for fixed-width record parsing can easily become visibly unparsable, sometimes even if you use things like the /x modifier in perl).

I'd like to see a side-by-side comparison of COBOL vs modern scripting languages for some common tasks like report generation. And I'd like to see how COBOL tackles something hairy like extracting data from consistently defined but unregular inputs like HTML or wiki markup (this is fresh on my mind: I just was writing some perl/shell scripts last night to generate structured data from a bunch of pages on wikipedia), which is a more "modern" problem than the stock COBOL example of fixed-width reports.

Any links to show how COBOL really shines? Where using COBOL is a significant win from an understandability and maintainability standpoint?</comment>


Zeplin Raises $1.2M to Sync Designers and Developers with Less Hassle - <AUTHOR> http://techcrunch.com/2015/11/24/zeplin-raises-1-2m-to-sync-designers-and-developers-with-less-hassle/ <comment><AUTHOR> As an early beta user, i'm very proud to see this talented small group from Turkey grow and build one hell of product that has been providing value since day 1. Looking fwd to seeing more from them! congrats! Adobe your days are numbered...</comment>


ICFP Programming Contest 2009 - <AUTHOR> http://www.icfpcontest.org/wordpress/ <comment><AUTHOR> this competition is probably the most challenging programming contest in existence, or at least one of the few where you'll regularly have entrants who are research groups in computer science or Putnam fellows</comment>


JustFab's Checkout Tactics Are JustShady - <AUTHOR> http://techcrunch.com/2013/09/27/not-so-vip/

<comment><USER2> This may be the closest thing to journalism TechCrunch has done since AOL took over. It's definitely the first time AOL has impressed me since giving me 30 hours free internet ~16 years ago.

Edit: I hope they have the stones to do a follow-up about the JustFab articles vanishing from HN.

<comment><USER3> Really? Because it looks like they just picked the best comments from the Hacker News thread on the matter and just stuck them together.

<comment><USER2> They took a shot at a VC darling, signed up with and without VIP subscriptions, and went through the cancelation process, and didn't sugar coat what JustFab are doing and why they're evil.

That's a _lot_ from a company whose specialty is monitoring RSS feeds, HN, and favored companies' press releases for stuff to reword.

</comment></comment></comment><comment><USER4> Edit: we are still unsure if the cost of membership is in addition to the cost of the shoes? Would love if someone could clarify. \--

Funny enough my sister informed me that she ordered a pair of boots last night. I immediately think of this and ask her if she's heard of JustFab to which she says "how did you know?".

For what it matters, she is a law student and actually took the time to read the TOS(yeah!). She has it all planned and will cancel her subscription Monday.

Also learned from her that if you just make an account and wait for a few days, apparently they let you in for the first month for $20.

My sister felt a bit shitty after I showed her HN's view but at least for her she's getting a good deal. Too bad almost every other customer isn't likely to have the same luck.

<comment><USER5> What I think's going to ultimately stop these sorts of shenanigans is that enough people are going to get wise to it and start exploiting them. We'll be a nation of extreme couponers.

Then it just won't be profitable to try to dupe people anymore.

</comment></comment><comment><USER6> Very disappointing. I'm sure the internal stories of the UI/UX designers and product managers will start coming out soon. I suspect that management had a checkbox for "knowledge of dark patterns" on the job description.

Re: the investors. I wanted to give Josh Hannah of Matrix the benefit of the doubt - many investors have little interest in much besides the revenue and user growth. Unfortunately he decided to speak out about the situation and show he was not only completely aware of this bullshit, but fully supports it.

</comment><comment><USER7> Somebody is gonna get sued.

They are more than shady, they straddle the line over which they become misleading.

</comment><comment><USER8> Just wondering, do they atleast send an email reminder mentioning that you have to select your pair for the month?

That should give an indication to some people to cancel their subscription.

</comment><comment><USER9> Absolutely shady. It's a shame we don't have consumer laws or JustFab would have been closed a long time ago. Good thing they raised some money, at least they can afford lawyers for a while.

Another major deception going on is on search engines. All of them. They deceptively designed ads in a way so a lot of people (roughly half [http://www.seobook.com/consumer-ad-awareness-search- results](http://www.seobook.com/consumer-ad-awareness-search-results) ) do not know that they clicked an ad. Imagine seeing a commercial and thinking it was CNN content or reading an article and thinking it as an unbiased one from NYT? If you're buying an item and search for it, the ads do not have your best interests in mind, so this matters a lot. Of course, if you think the result is unbiased you're more likely to buy it. That is fraud, plain and simple and it has been going on for a long time.</comment>


As of today, women can attend the Software Circus conference for free - <AUTHOR> http://softwarecircus.io/diversity/ <comment><USER2> Nice work Mark. I fully support your approach. I hope it's successful!

<comment><AUTHOR> Thanks Michael!

</comment></comment><comment><USER3> Great way to support the development of our profession! Awesome initiative.

<comment><AUTHOR> Thank you Vasco.

</comment></comment><comment><USER4> I don't understand the rational for the free tickets. Are we saying that what's keeping women out of conferences is the price? I thought it was the unwelcoming atmosphere and sexist behaviors.

If you have the CoC and work on creating a good ambiance, how is a free ticket meaningful? Even worse for the opposite: if the atmosphere is not welcoming, how is a free ticket making it any better? You get harassed but at least you save $200?

<comment><USER5> Hey there. You have a very valid point, but it looks like the conference does have a strict code of conduct and explains a bit more about their rationale for free tickets in the post [http://softwarecircus.io/diversity/](http://softwarecircus.io/diversity/).

I think the conference organizers are trying to eliminate _any_ barriers that would limit women or other unprivileged groups from attending, some of which might be financial.

<comment><AUTHOR> That's a much more succinct version of what I was trying to say Seth. Thanks.</comment></comment></comment>


Google building Java build system? - <AUTHOR> http://www.sdtimes.com/blog/post/2011/06/13/Google-Building-Java-Build-System.aspx

<comment><USER2> I think the real question is whether this is project-level (Ant, Maven) or integration/deployment-level (Jenkins, Hudson), or both. Having played around with Maven and Jenkins a lot over the last month or so, I really can't imagine how they'd improve much over them. Jenkins' interface could use a pretty hefty facelift, but functionality-wise they're both rock-solid.

Is this going to be a case of not-invented-here syndrome, or will it really up-end the build and deployment culture like git and mercurial did to subversion? I'm guessing something in between, but we'll see.

<comment><USER3> I imagine they are trying for simplicity, on the lines of Guice.

I know Google are obsessed with SCons for building other stuff so I get the feeling we're going to get a Java version of Scons.

<comment><USER4> Scons already supports Java ([http://www.scons.org/doc/production/HTML/scons- user/c4348.ht...](http://www.scons.org/doc/production/HTML/scons- user/c4348.html)). But I believe you're right, it will be scriptable out of the box like Gradle. But not python though.

</comment></comment></comment><comment><USER5> Given that Google recently hired the author [1] of a good Python implementation [2] of djb's redo [3], I'm hoping for a build tool along those lines, but in a compiled language. It's probably too much to ask for something that simple though.

[1] <http://apenwarr.ca/log/?m=201103#24>

[2] <https://github.com/apenwarr/redo>

[3] <http://cr.yp.to/redo.html>

<comment><USER6> I hope so too, for those times that I cannot avoid Java -- although, following Avery's blog posts and programming style, I would assume that Java is not one of his favourite languages.</comment></comment>


Electric Imp and Quirky – Bringing Great Product Ideas to Life - <AUTHOR> http://blog.electricimp.com/post/48046143939/electric-imp-and-quirky-bringing-great-product-ideas <comment><USER2> Quirky's blog post is also an informative read: <http://www.quirky.com/blog/post/2013/04/quirky-meets-an-imp/></comment>


Simple Neuromarketing Hacks That Increased Revenue by 65% In The First Round - <AUTHOR> http://www.conversioner.com/blog/neuromarketing-hacks/

<comment><USER2> Thanks I really learned a lot from those 2 posts! where can I read more about neuromarketing?</comment>


Hacker News is Reddit by a different name - <AUTHOR>

Same people, same pedantic assholery. Why do you keep following me everywhere I go on the internet? Why can't I have a discussion with intelligent people about whatever I like without someone getting into a hissy fit about how social norms are being overstepped when the conversation flows in a manner they do not agree with? Why can't we all just get along and respect each other? I mean, I know that geeks are notorious social retards but this is ridiculous. I guess that this is the effect of implementing a popularity contest and applying it to what people say. That is to say, it creates swarms of idiots who dickride each other and a narrow-minded culture.<p>Produce, signing off, have a nice day. <comment><USER2> I think you should just accept how other people want to discuss things on the internet. If you can't handle the mainstream then find a niche were your own brand of 'intellectual' discussion is enforced by nazi moderation (don't take my Godwin's law descent as a bad thing, nazi-like moderation can be a good thing).

If Hacker News is evolving into something you don't like, then find somewhere else to discuss things. You have no right to complain that the place you've settled in isn't to your liking when you're on the internet. The reason why you don't have that right? Because you can just go the fuck elsewhere, seriously move on, settle somewhere else, see if it's to your liking, if you don't fit in don't whine about it, just move on again. Petty stuff.</comment>


Fmr. McDonald's USA CEO: $35K Robots Cheaper Than Hiring at $15 per Hour - <AUTHOR> http://www.foxbusiness.com/features/2016/05/24/fmr-mcdonalds-usa-ceo-35k-robots-cheaper-than-hiring-at-15-per-hour.html <comment><USER2> I'm just waiting for the first fast-food-robot-kitchen to appear.

Where you go up to a window and pay with your smartphone, choose an item from a menu and watch the robot make the food and then serve it - perfectly fried, cooked and spit free.

How would you compete with that?

<comment><USER3> Easy. You keep people employed. The missing point in all of these discussions is the revulsion most people will experience being served by a machine.

I can't wait for one of these restaurants to go all automatic and go bankrupt because people simply stop eating there.

<comment><USER4> These restaurants are un-health, filled with horror stories like people getting their burger spit in, and people still eat there. You might be underestimating how much people want their cheap burger.

Either way, if that does happen the chains will either have to react or competition will pop up. Both sound like good things.

Likewise, they will undoubtedly try it in a few stores first to figure out the impact. So the risk to them is low.

</comment></comment></comment><comment><USER4> Relevant discussion (re: Wendy's) [https://news.ycombinator.com/item?id=11735928](https://news.ycombinator.com/item?id=11735928)</comment>


Why the Mona Lisa Stands Out (2014) - <AUTHOR> http://moreintelligentlife.com/content/ideas/ian-leslie/overexposed-works-art#_ <comment><USER2> We have some understanding of how an image becomes a viral hit, the mix of intrinsic properties and random chance.

I would really like to know more about how individuals end up falling in love with other works, like in the first paragraph with Cutting and Caillebotte painting, or the man and his nieces in this article ([http://www.nytimes.com/2014/09/14/opinion/sunday/a-monet- of-...](http://www.nytimes.com/2014/09/14/opinion/sunday/a-monet-of-ones- own.html)) which has stuck with me for a while.</comment>


Ask HN: What are you doing to get the most out of your MBA in Silicon Valley? - <AUTHOR>

<comment><USER2> I would think the use and establishment of connections would be the biggest thing. The MBA's I know in this city are all Ivy League though, so I imagine their network effect is far greater than a 'regular' MBA program.

</comment><comment><USER3> I'm unsure of the question, getting the most out of an MBA at Stanford BS?

<comment><AUTHOR> Nope - What unique opportunities does the silicon valley offer for MBAs? How are you making the best use of these opportunities to make your MBA count?</comment></comment>


Facebook was called a 'chaos factory' and maker of 'data voodoo dolls' - <AUTHOR> https://www.businessinsider.com/facebook-tim-cook-chaos-factory-roger-mcnamee-voodoo-dolls-2019-6 <comment><USER2> While the article mentioned McNamee and "Zucked", on the topic of behavioral manipulation strategy by big tech, there's a _much_ better, more thorough recent book: _The Age of Surveillance Capitalism_ by Shoshana Zuboff, a professor emerita of economics at Harvard. It's an excellent analysis of what big tech is doing, and where it's heading.

Just one quote from an interview in this review:

[https://www.theguardian.com/technology/2019/jan/20/shoshana-...](https://www.theguardian.com/technology/2019/jan/20/shoshana- zuboff-age-of-surveillance-capitalism-google-facebook)

> "It is no longer enough to automate information flows about us; the goal now > is to automate us. These processes are meticulously designed to produce > ignorance by circumventing individual awareness and thus eliminate any > possibility of self-determination. As one data scientist explained to me, > "We can engineer the context around a particular behaviour and force change > that way… We are learning how to write the music, and then we let the music > make them dance." This power to shape behaviour for others' profit or power > is entirely self-authorising. It has no foundation in democratic or moral > legitimacy, as it usurps decision rights and erodes the processes of > individual autonomy that are essential to the function of a democratic > society."

<comment><USER3> People continuously call this stuff out throughout history, but it goes ignored by the general public and we keep pushing further down a dark path of unregulated madness for profit. How much are these companies destroying natural social processes and democracy itself for their own capital & power gain?

At least we can turn our RGB lights off when we're not home.</comment></comment>


Cloudflare Registrar is available to all customers - sahin-boydas https://blog.cloudflare.com/registrar-after-three-months/ <comment><AUTHOR> I've transferred two of my domains from Namecheap and haven't had any problems, but I wonder when they are going to start supporting direct domain registration.</comment>