ICBMs Still Matter - <AUTHOR> https://www.realcleardefense.com/articles/2020/07/04/intercontinental_ballistic_missiles_still_matter_115440.html <comment><USER2> The argument is not quite well constructed. Let me try to improve on it a little:

1\. The program is dirt cheap as far as military expenditures go: it will cost about $86 BN for a lifecycle of 50 years, which comes to less than $2 BN per year [1]. For comparison only maintaining the nuclear stockpile safe and ready costs about $4 BN per year [2]. Another comparison is the cost of the French submarine launched missile M5.1: €3-4 BN for 10 years [3], which will cover only between 16 and 64 missiles (1 to 4 submarines, 16 each), versus 450 for the American ICBM project.

2\. While it is true that currently all the nuclear deterrence can be performed by the nuclear submarines, it's difficult to be 100% sure there won't be some technological breakthrough during the next 50 years to make them vulnerable. The Columbia class boomers will cost $110BN [4], and that's without the missiles they'll carry. Currently those missiles are Trident II, and their latest version is supposed to be good until 2042, after which there needs to be a replacement that will come at a cost too. So one can think of the $86 BN price tag for the ICBMs as a somewhat inexpensive insurance policy for the SLBMs.

[3] The main role of the ICMBs is to be a magnet for the enemy's missiles. They are all positioned in deserted areas. Whoever intends to perform a decapitation strike will need to take all of them down. As explained in the article, one would need to spend about 1000 nukes for that. 1000 nukes that don't go towards dense urban areas. Compare this with the SLBMs: if you can synchronize a torpedo attack against all of them, you only need to sink at most 14 subs, and you don't even need nukes for that.

[1][https://en.wikipedia.org/wiki/Ground_Based_Strategic_Deterre...](https://en.wikipedia.org/wiki/Ground_Based_Strategic_Deterrent)

[2] [https://en.wikipedia.org/wiki/Ground_Based_Strategic_Deterre...](https://en.wikipedia.org/wiki/Ground_Based_Strategic_Deterrent)

[3][https://en.wikipedia.org/wiki/M51_(missile)](https://en.wikipedia.org/wiki/M51_\(missile\))

[4] [https://en.wikipedia.org/wiki/Columbia- class_submarine](https://en.wikipedia.org/wiki/Columbia-class_submarine)

</comment><comment><USER3> Can the USA even build a new ICBM without using made-in-china electronics? And then there is not just the missile itself, but all the ground support equipment.

<comment><USER2> Most likely yes. The US military is well aware of its supply chain, and realizes that in times of war you don't want to have part of it in enemy's hands.

Here's a visualization of F35's supply chain [1]. You can only NATO and other close allies like Israel, Japan, South Korea and Australia.

[1] [https://www.lockheedmartin.com/en- us/products/f-35/f-35-glob...](https://www.lockheedmartin.com/en- us/products/f-35/f-35-global-partnership.html)

</comment></comment><comment><USER4> It seems to me that the United States is more likely to be the aggressor given its record of interventionism, not to mention Hiroshima and Nagasaki. The Russians and the Chinese are far more peaceful - they do not position military bases aggressively around the world, do not fund proxy armies, and do not fund countries like Saudi Arabia that are responsible for the ongoing Yemeni famine (I've refrained from touching the more contentious topics in US foreign policy). The idea that the United States is under threat, rather than the threat, is laughable.

If any country is well positioned to de-escalate a nuclear arms race, it is the United States, and this is the action that it should take.

<comment><USER5> China spent half a billion on a military base in Djibouti at the mouth of the Red Sea less than three years ago.

Russia funds separatist anti government groups in Donbas and annexed Crimea, while maintaining military bases across Eurasia specifically near their former subjects.

Russia funds Iran, responsible for the ongoing Yemeni famine, and as a cherry on top, Iran funds various groups across the middle east through Russian instruments.

(This is all ignoring the idea that they've refrained from projecting power more often at a global scale due to being peaceful, as opposed to lacking the capability entirely due to being relatively poor and weak.)

<comment><USER6> > Russia funds Iran, responsible for the ongoing Yemeni famine

Iran is responsible for the Yemeni famine? Now I've heard it all.</comment></comment></comment>


Show HN: Lisp and HTML to 70kb zipped MS Windows app - <AUTHOR> https://github.com/chr15m/htabuilder <comment><USER2> Ok but if I understand correctly this does not compile to a 'real' Windows app but to a HTA? Or is it that it uses the HTA runtime to handle your HTML?

<comment><AUTHOR> That's correct it compiles to an HTA. There is a thin native executable which simply launches the HTA.</comment></comment>


The Most Influential Person in Modern History: No Creator, Thinker, or Leader - <AUTHOR> https://medium.com/dialogue-and-discourse/the-most-influential-person-in-modern-history-e393eb3a14fe?source=friends_link&sk=9594c72b3f856bb68044329b962420d3 <comment><USER2> My understanding has been that historians generally agree that Austria-Hungary was going to declare war on Serbia regardless and Ferdinand's assassination was just a convenient excuse. But if not this event, some other inevitable action would be used as a _casus belli_.

My vote still goes to [https://en.wikipedia.org/wiki/Fritz_Haber](https://en.wikipedia.org/wiki/Fritz_Haber) .

<comment><USER3> Perhaps, but just as conditions in Europe might have inevitably led to war given the right spark, couldn't the discovery of the chemical engineering to develop fertilizer have been just around the corner and if not Frank Haber, one of his students or some other chemist might have found it.

I agree with you though that it was a turning point for mankind.

<comment><USER2> > if not Frank Haber, one of his students or some other chemist might have > found it.

Sure, and we'd credit that person instead.

<comment><USER3> How true!

</comment></comment></comment></comment><comment><USER4> I cannot find the book off hand, but there was a fascinating book that argued that throughout history, war has been the norm and peace the exception (and converted me to that opinion as well).

The book argued that the reason that peace happened for so long was because someone held it together. That person (the book argued) was Otto von Bismarck. Bismarck even was quoted in 1987 saying that "One day the great European War will come out of some damned foolish thing in the Balkans."

<comment><USER5> Pretty sure that was in 1887. That quote would have been 2 wars too late in 1987...

</comment></comment><comment><USER6> Granted this is a trigger of the major events that followed. I wouldn't classify it as influential per se. The conditions that prevailed were built up of many factors over time. This act was like a spark of a forest fire. If it wasn't this act another could be as effective. Influence I would say is creating a coherent view in many people toward a purpose.

</comment><comment><USER7> If you're interested in the leadup to WWI, I recommend this book: [https://www.harpercollins.com/9780061146657/the- sleepwalkers...](https://www.harpercollins.com/9780061146657/the- sleepwalkers/)

<comment><USER8> If books aren't your thing, I also highly recommend the BBC's miniseries 37 Days [[https://en.wikipedia.org/wiki/37_Days_(TV_series)](https://en.wikipedia.org/wiki/37_Days_\(TV_series\))] for a slightly dramatized, but still highly educational take on the titular period between Ferdinand's assassination and the declaration of war.</comment></comment>


Ask HN: Clever uses of cryptocurrency - <AUTHOR>

I've seen several clever uses of cryptocurrency, that is, uses outside buying stuff.
For example, using the bitcoin blockchain as a proof of existence mechanism[1] and using namecoin as a replacement for SSL[2].
What clever uses of cryptocurrency have you seen?
[1] http://www.proofofexistence.com/
[2] http://blog.mediocregopher.com/namecoind-ssl.html <comment><USER2> From an earlier Hacker News post: The money is in the Bitcoin protocol [https://news.ycombinator.com/item?id=6823394](https://news.ycombinator.com/item?id=6823394)

pasted below: Alternative chain examples

1\. Peer-to-peer, social trading of "normal" (government-backed) currencies without the need of a centralised clearing house. Called a ripple exchange, it is based on a design loosely inspired by the Ripple monetary system.

2\. A decentralised, open DNS (Domain Name System) using the .bit Top Level Domain. This is an alternative DNS root based on Namecoin and outside the official DNS root administered by ICANN. Early work in this area included discussion on BitDNS.

3\. A service called Proof of Existence which is a sort of notary public service on the Internet. It easily and cheaply (0.005 BTC) allows people to verify ownership, integrity, and that a document existed at a certain point in time.

Building on the Bitcoin protocol examples

1\. Bitmessage for encrypted peer-to-peer communications, including hiding metadata like the identity of the sender and receiver, from eavesdroppers. The message transfer mechanism is similar to Bitcoin's transaction and block transfer system, requiring a 'proof of work' for each message.

2\. Zerocoin that augments the Bitcoin protocol to allow for fully anonymous currency transactions by placing anonymity technology into the Bitcoin network itself. Zerocoin uses Bitcoin as a "distributed, online, append-only transaction store."

3\. Gliph adds secure mobile communications to the Bitcoin landscape. It edges into controlling digital identity "that shares as many (or as few) facets of yourself as you want to."</comment>


Python Decorators in Ruby - <AUTHOR> http://yehudakatz.com/2009/07/11/python-decorators-in-ruby/

<comment><USER2> While this is nice, I think it somewhat misses the point of Python's careful syntax debates & decision-making process. Yes, it is good to have the flexibility to do cool stuff (and I'm sure there were ways of getting somewhat decorator-like behavior hacked into Python before decorators), but it's even better when there's a standard, readable, clear way to accomplish whatever cool thing. Then whenever someone needs to do whatever-it-is, they can, easily, and anyone else who comes along will know just what they're doing, and not have to read through whatever code works behind the scenes to make it happen.

IOW, complete flexibility is not the only end goal: adding predictability as well makes the feature twice as nice. There are many possible syntaxes for doing roughly similar things, but if every app uses a different one, life can be hell for whoever has to read the code.

<comment><USER3> If you read PEP 318, <http://www.python.org/dev/peps/pep-0318/>, it's easy to see how much thought went into what is syntactic sugar.

</comment></comment><comment><USER4> Gregory Brown recently posted a different take on Decorators using Ruby's delegate standard library.

Worth a look : [http://blog.rubybestpractices.com/posts/gregory/008-decorato...](http://blog.rubybestpractices.com/posts/gregory/008-decorator- delegator-disco.html)</comment>


Visiting the Valley and planning my next move in life, thoughts? - <AUTHOR> Hey there HN!
My questions are at the top followed by my story.
1.If you're not a technical founder but need to get programming done for your startup would you recommend: getting a CTO, teaching yourself programming, getting a MS in CS, something else? 2.Would you recommend starting a startup in the Valley? Or do you think starting in Buffalo, NY and then moving here once the idea is validated is a good idea? 3.What opportunities in the startup space are there with a BS in chemistry + MS in biology? 4.What places should I visit while I'm here? People to talk to? 5.General thoughts/comments!
I'm from Buffalo, NY (2200 miles away!), visiting the Valley for two more weeks, BS in chemistry + MS in biology, love to build things,  and I'm at a crossroads in life: do I go the startup route or do I continue onto more school?
Startup route: My background is in science and I have a heavy interest machine learning. Tech startups really excite me, but I'm trying to figure out how I can contribute with my science/medical background.
I have three tech startup ideas which I've built prototypes for (didn't use programming, just simple mockups.) So I'm thinking I need to teach myself programming, learn programming from a Masters' program, or join up with a CTO to help bring these ideas to life.
School route: If I went back to school I would pursue either a MS in Computer Science or a fellowship in Biodesign (biomedical engineering at Stanford.) I really love science and I love tech, if I could combine both interests I would be really happy.
Miscellaneous: I visited the Hacker Dojo + have spent plenty of time at Stanford. Loving the culture here!
Thanks so much for all your help + I really appreciate it, Mike <comment><USER2> 1\. CTO-grade developers aren't cheap, but they aren't scarce either. You either need to pay for their skills (employee/contractor) or convince them to spend their time on your idea (prove you can sell, market, and/or fund the enterprise as a cofounder).

2\. Stay in Buffalo until you have something to show investors. Maybe even stay there afterward. Rents will bleed your company dry before it makes it out of the crib.

3\. Use your imagination. Many coders of skill don't have compsci degrees and none would bat an eye at your background if you claimed you were an expert developer. Much more impressive would be the ability to sell and market and get funding for your ideas.

4\. Computer History Museum, Google's campus (a little networking can net you a free lunch there), Land's end, Ocean Beach, 2nd & Market (SF).

5\. If you can't sell to save your life, commit to building a project yourself and avail yourself to online code courses to learn the craft as you build.

<comment><USER3> Why 2nd & Market? That sticks out from that list.

</comment></comment><comment><USER4> Hi Mike! Here's my two cents:

1\. I would try to find a technical co-founder. If you want to do a technical startup, there's often a lot more involved than just programming (including configuration and architecture). Of course, that's easier said than done. Let no one stop you from learning programming, if that's interesting to you, but it will definitely increase your odds of success if you have a co-founder who knows their stuff.

2\. _Would you recommend starting a startup in the Valley?_ No. Not if it's your first startup. My feeling is that nearly anywhere else is going to be cheaper. You'll be able to raise funding much more easily here when the time comes, but that's probably not going to happen right away. It's not as easy to raise investment as it might seem. That said, if you love it here, and it won't bankrupt you, go for it. But I would be wary.

3\. _What opportunities in the startup space are there with a BS in chemistry + MS in biology?_ There's always space for a good idea/execution, no matter the background. But -- the easy areas are crowded, the hard areas tend to fail because, well, they're hard. Looking at your domain, say Biology, are there areas that are under-served or poorly executed? But be careful, an easy answer to that might be hiding the devil in the details. It's a place to start, though.

4\. _What places should I visit while I'm here?_ If it was me, I would hang out on University Avenue in Palo Alto; find someone at Google to invite you to lunch; check out event sites, like meetup.com, for things going on.

I don't know if that's _good_ advice but it's _my_ advice. Hope you have a great time on your trip, Mike!

</comment><comment><USER5> > learn programming from a Masters' program

A Master's in CS won't teach you programming. You can learn the programming part on your own with online content or a bootcamp. If you have been able to conquer that level of difficulty in academia, you should have no problem getting started with programming. It's unintuitive to most people from the outside but Computer Science and programming really are pretty separate things.

> 1.If you're not a technical founder but need to get programming done for > your startup would you recommend...

This is a biased answer, but I am a one-man shop independent contractor software engineer who also takes freelance projects sometimes. There are certainly a few other people out there that offer similar services like me as well. I'm currently helping a non-technical client in a situation like yours build their MVP.

I also often encourage people to go work for a startup or try to understand the industry from the inside before founding.

</comment><comment><USER6> 1\. Learn to Code as goog as possible BUT don't try to code your product. Use what you learn to be able to be on tech people shoes and make communi cation flow.

2\. The valley is a good place to interact with people that is building things... But it is not THE place to be 100% of the time.

The best place to be is where you can get/onboard customers better. Maybe you can get an important market share from Buffalo. After all you live near financial market customers. Look what it makes sense to you.

</comment><comment><USER7> > BS in chemistry + MS in biology, love to build things...

Considering your background-- have you explored Biotech?

Before launching your own startup; suggest getting some base-level experience at any early-stage company > [http://www.biospace.com/News/the-10-hottest-bay- area-biotech...](http://www.biospace.com/News/the-10-hottest-bay-area-biotech- startups/391820)

</comment><comment><USER3> Don't do it. A startup is a lot of work and the chance of success is miniscule even for the people with decades of background in CS.</comment>


Ask HN: Is contacting a startup's users for feedback impressive or creepy? - <AUTHOR>

A few weeks ago, I decided to start emailing users of our app for feedback with a personal message from me (the founder of our little startup). By and large, the feedback has been very useful; many people are impressed at the personal attention. However, this morning, I received the first bit of negative feedback about this practice, calling it "creepy."<p>Do you think that such personal emailing is a good or bad practice? Are there better ways to engage users in a dialogue? We all know how hard it is to get real, honest information from users when we have such a small sample size. <comment><USER2> 1\. Include it in the terms of service.

2\. Depends on the product. If you sell anything that is considered to be _hush_ , then don't. [personal massagers, married dating circles, etc.]

3\. In general, people don't mind hearing from you. Though don't email them weekly, unless they subscribed to a weekly newsletter. Once every 3 weeks has proved to be a good start for me.

4\. Make the emails personal, and answer them. The aim is to talk to people, not sell them something outright.

5\. Resist the temptation to upsell. Why? People will then think that you are just emailing them to squeeze more money out of them. Having an email address like so: email@example.com_ , makes things easy. If anyone has an interest in buying, just tell them that someone from the sales department will contact them. Then send an email from that address and continue the dialogue.

</comment><comment><USER3> I personally don't find it creepy at all, however, it may depend on how your site privacy policies are setup and what kind of product it is. I could possible see how some people may not want to be offended, although I wouldn't classify that under "creepy", but just more of "don't want to be bothered."

Maybe, if they have an account page for the startup, add something in their settings that says "opt in for email feedback" (that's bad phrasing, but you know what I mean) so you know which users are okay with giving back feedback and don't mind being contacted.

</comment><comment><USER4> Its super tempting! But, I would err on the side of perceiving it as creepy, as really it only takes one creeped out user to generate some bad publicity. Also, depends on what your privacy policy is. Perhaps the best way to do this would be to disclose at time of sign up that during your "beta" period you may reach out to them directly? Set the expectation at least, so it doesn't feel like an invasion.

<comment><AUTHOR> The idea of using "beta" language is interesting. It sounds like a big part of managing expectations is how big the users think the startup is. As they think it's bigger, they expect less attention... for better or for worse.

</comment></comment><comment><USER5> I think it's a great practice. We've received some of the most valuable feedback for matchist (<https://matchist.com/talent>) from our users by simply asking.

You'd be surprised at how many people are willing to give honest feedback when you personally email them and let them know you're completely open to their honest opinion.

</comment><comment><USER6> I personally think it is a great idea. The hardest part is making the email look genuine and not like a mass email. We used this tactic at my last startup and quickly found out that our assumptions about our audience were very false, and we quickly pivoted which avoided a long drawn-out period of time failing.

<comment><AUTHOR> That's exactly how I feel about it. We've gotten some great feedback, and I attribute it exactly to the fact that the email is personalized, and includes an introduction to me.

</comment></comment><comment><USER7> I am doing this right now and I am not sure how my users perceive it, as I had no responses so far.

Would you mind share how you phrased your email? I think the copy is the key to how users perceive it.

<comment><USER8> I did this on one site of mine. I sent the signup confirmation from my real email account at the company and made it a personal letter from me welcoming them, while at the same time being an automated form letter (and not trying to disguise that fact). I mentioned that if they had any questions they could just reply to this email and then I signed the email with "Regards, <myname>". The site wasn't very big and it's now getting no attention from me, but of the hundred or 2 who signed up, a few responded.

The email was basically:

Hi <username>,

Welcome to the site! To confirm your email click this link: <link>

We've just launched this site and are working on developing new features now. If you have any feedback or comments, just reply to this email. It would be a delight to hear from you.

Regards,

<name>

<startup>

Founder & CEO

</comment></comment><comment><USER9> I've had great success with honest personal emails to every new customer. It helps build trust, which, at least in my case, has been extremely valuable.</comment>


LevelDB: a fast and lightweight key/value database library - <AUTHOR> http://code.google.com/p/leveldb/ <comment><USER2> Note that this is not a database _server_ , like Redis or Memcached. This is a database _library_ , more along the lines of sqlite. In particular: "There is no client-server support builtin to the library. An application that needs such support will have to wrap their own server around the library" and only one process can access a database a time.

<comment><USER3> It's the same model that Tokyo/Kyoto Cabinet uses. The difference is that Tokyo/Kyoto Tyrant is an available network interface :)

<comment><USER4> LevelDB should not be compared with the storage model of TC, because leveldb could be looked on a bigtable that run on single node, which is a model that is optimzied for updating instead of reading. The application situation for leveldb is different with that of TC

</comment></comment></comment><comment><USER5> This could be great news for iOS. AFAIK, this is the first K/V DB that could be built for iOS (c++) _and_ has a free license that is compatible with the AppStore (Tokyo Cabinet uses LGPL and the author has shown no interest to me in adding a static linking clause, Berkeley DB requires an expensive commercial license, etc).

<comment><USER6> What advantages does this have over the built-in SQLite?

<comment><USER7> It stores key/value pairs instead of relational data. I've been looking for something like this for a while as a replacement to NSUserDefaults.

<comment><USER8>
        CREATE TABLE kv (key text PRIMARY KEY, value text);

</comment></comment></comment></comment><comment><USER9> This is pretty neat, and different from many other "simple" KV stores, because it arranges things in key-order on disk, and permits forward/reverse iteration over keys. (ie, range queries are cheap)

edit: it's actually full log-structured merge, sstables, memtables etc.

</comment><comment><USER10> The implementation seems to use Log-Structured Merge Trees.

The only paper on this data structure seems to be: <http://goo.gl/CVF1l>

This paper is poorly written and quite honestly not useful to implement an LSM tree. Does anyone know of a better paper than this one?

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

<comment><USER10> But it doesn't really describe the LSM data structure!

<comment><USER11> It describes the approach used here (cf. all of the discussion of the tablet system). The few differences are documented:

[http://code.google.com/p/leveldb/source/browse/trunk/doc/imp...](http://code.google.com/p/leveldb/source/browse/trunk/doc/impl.html)

</comment></comment></comment></comment><comment><USER12> The leveling here reminds me a bit of how Lucene organizes and compacts its segments files. When you write documents to Lucene they are written to a segments file, usually one for each batch of documents you write. When searching, each of the segments files are searched for terms, so the more segments files you have, the slower the search tends to be. When segments files reach a certain size they are automatically compacted into other segments files. Users can (and should) then "optimize" their index, which compacts all the segments files into a single file. The log files and sorted tables of leveldb appear to work very similarly.

</comment><comment> cool-RR All the code files have this as a first line:

        // Copyright (c) 2011 The LevelDB Authors. All rights reserved.

I wonder how come it's not copyrighted to Google.

<comment><USER13> That's what Google does when they set up a project that accepts contributions. Google Inc. is the author; see <http://code.google.com/p/leveldb/source/browse/trunk/AUTHORS>

<comment><USER14> The initial version written by the authors of MapReduce and BigTable

</comment></comment></comment><comment><USER15> This looks like it has similar goals to bitcask. The tradeoffs and differences would be nice to know.

<comment><USER16> leveldb is a persistent ordered map; bitcask is a persistent hash table (no ordered iteration).

bitcask stores a fixed size record in memory for every key. So for databases with large number of keys, it may use too much memory for some applications.

bitcask can guarantee at most one disk seek per lookup I think. leveldb may have to do a small handful of disk seeks. To clarify, leveldb stores data in a sequence of levels. Each level stores approximately ten times as much data as the level before it. A read needs one disk seek per level. So if 10% of the db fits in memory, leveldb will need to do one seek (for the last level since all of the earlier levels should end up cached in the OS buffer cache). If 1% fits in memory, leveldb will need two seeks.

<comment><USER5> Also worth noting: bitcask is written in erlang and leveldb in c++.

<comment><USER17> Technically bitcask is a combination of Erlang and C.

</comment></comment></comment></comment><comment><USER4> I uses boost::atomic to make it usable without c++0x <http://www.chaoticmind.net/~hcb/projects/boost.atomic/>

#include <boost/atomic.hpp>

class AtomicPointer { private: boost::atomic<void _> rep_; public: AtomicPointer() { } explicit AtomicPointer(void_ v) { } inline void* Acquire_Load() const { return rep_.load(boost::memory_order_acquire); } inline void Release_Store(void* v) { rep_.store(v, boost::memory_order_release); } inline void* NoBarrier_Load() const { return rep_.load(boost::memory_order_relaxed); } inline void NoBarrier_Store(void* v) { rep_.store(v, boost::memory_order_relaxed); } };

</comment><comment><USER18> Anybody know what hardware those benchmarks were on? Is it actually durable? They mention problems with writeback caching, but are they at least durable from the OS perspective? How well does it scale?

<comment><USER16> It is durable from an OS perspective. I started typing in a long explanation, but I think the comment for the "sync" field in the options.h file captures things well:

      struct WriteOptions {
        // If true, the write will be flushed from the operating system
        // buffer cache (by calling WritableFile::Sync()) before the write
        // is considered complete.  If this flag is true, writes will be
        // slower.
        //
        // If this flag is false, and the machine crashes, some recent
        // writes may be lost.  Note that if it is just the process that
        // crashes (i.e., the machine does not reboot), no writes will be
        // lost even if sync==false.
        //
        // In other words, a DB write with sync==false has similar
        // crash semantics as the "write()" system call.  A DB write
        // with sync==true has similar crash semantics to a "write()"
        // system call followed by "fsync()".
        //
        // Default: false
        bool sync;

We don't have much experience with scaling to larger databases yet. There are known problems which will cause a (smallish) constant factor slowdown in write performance after the database becomes a few (10?) GB in size, but I don't recall the details all that well, and the implementation has changed somewhat since that experiment. I would like to characterize this better and fix things so we can support somewhere between 100GB-1TB databases well. It just hasn't become a priority yet.

The benchmark numbers on the linked page were from a small million entry database that easily fits in the OS buffer cache.

<comment><USER19> Writes being lost means what, a trashed file? Or merely an incomplete one?

<comment><USER16> Merely an incomplete one. Leveldb never writes in place: it always appends to a log file, or merges existing files together to produce new ones. So an OS crash will cause a partially written log record (or a few partially written log records). Leveldb recovery code uses checksums to detect this and will skip the incomplete records.

</comment></comment></comment></comment><comment><USER20> What I would like to know is, is there support accessing values by nth-largest key?

I had to roll my own b-tree library specifically to get this feature since nothing out-there had it.

<comment><USER21> Why not index size(key)?

Then lookup the n-th largest key and then pull the values?

eg. SELECT value from key_value_pairs order by size(key) LIMIT N

<comment><USER20> I don't get it,

How would you use this approach to find say, the 195687th largest element in O(log(n)) time?

Edit: However, I do know I _can_ write a SQL query to find this - an ordinary index plus limit should do this. It's just such an approach gets really awkward and so unpredictable when you are dealing with a lot of distinct columns and tables - why I implemented this with key-value DB (a custom index on top of Kyoto Cabinet).

<comment><USER21> Why does lots of columns and tables make this approach awkward? Sure you might need a couple computed columns, and a little table de normalization, but IMHO most of where NoSQL gets it's performance is from de normalization.

Regardless of how many elements compose the key the calculation is the same. I'd be surprised if you couldn't approach O(log(n)) time with a good SQL implementation, some computed columns and/or indexed views.

Just wondering was the b-tree implementation you did a pure B-Tree or was the data structure itself modified in some way. eg. storing the number of elements to the left or right?

<comment><USER20> You certainly _could_ do a SQL implementation. For my purposes, each of the many queries was going to involve something like at least six lines of logic (it was "find the nth value satisfying X, Y, and Z condition"). Debugging and trying make sure the indices worked correctly for each query looked uglier than creating a whole different structure - my structure was native C++ so there wasn't the translation issues of SQL.

I used a B-tree modified by adding a member variable including the total number of children of each parent. Its so simple a modification I don't know why more implementations don't use it but, it seems they don't.

</comment></comment></comment></comment></comment><comment><USER22> Was really psyched until I saw --std=c++0x in the Makefile. What 0x features does leveldb depend on, and can those dependencies be realistically removed?

<comment><USER16> The use of c++0x should be limited to the small AtomicPointer class in port_posix.h. The class uses <cstdatomic> for its implementation. If you can provide a different implementation of "acquire store" and "release load" for your architecture, you should be all set without the need for c++0x.

I suspect that you may find suitable code in the chromium source code. See leveldb's port_chromium.h.

<comment><USER23> I managed to get an initial patch up here:

<http://code.google.com/p/leveldb/issues/detail?id=2>

</comment></comment></comment><comment><USER24> @sghemawat: Are you planning on implementing atomic CAS operations?

<comment><USER16> We have no such plans. The library is designed so that concurrency control is outside its scope. If I needed it for an application, I might consider using some application level code that looks like:

        bool CAS(db, key, oldvalue, newvalue) {
          lock some mutex;
          read key's value from db;
          bool result = (value == oldvalue);
          if (result) write key=>newvalue to db;
          unlock;
          return result;
        }

This should be not much slower than any hard-wired CAS we could provide from inside leveldb.

</comment></comment><comment><USER25> It looks like this is a local storage tool, similar to sqlite. Is that correct? Lots of chromium devs on that list.

<comment><USER26> That's correct. We're using leveldb as the back-end for IndexedDB in Chrome.

<comment><USER27> Please enlighten me, in the LevelDB page it said:

> Only a single process (possibly multi-threaded) can access a particular > database at a time.

But I presume Chrome is multiprocess by nature?

<comment><USER28> All leveldb access is done in the main process (which also handles UI, network, most file access, etc).

</comment></comment></comment></comment><comment><USER29> something similar + benchmarks <http://stsdb.com>

<comment><USER30> "STSdb is coded in 100% pure managed C#." & tri-licensed (GPL2/GPL3/Commercial) vs LevelDB's C++ & New BSD license.

Hackers should be able to figure out which bests fits their particular use case.

</comment></comment><comment><USER31> Does someone have any idea, how the benchmark results compare to other databases (e.g. redis) ?

<comment><USER32> Based on their numbers it looks slower than TokyoCabinet but still much faster than BerkleyDB. Would need to design a head to head benchmark.

I don't think Redis is a good comparison as that's an in-memory database so better suited for the 10% of hot data you'd need to cache. Whereas disk stores like TokyoCabinet and LevelDB would be great for storing the other 90-100%. If your use case involves a large dataset and you don't have terabytes of RAM lying around, that is.

<comment><USER16> One of the leveldb authors here. TokyoCabinet is something we seriously considered using instead of writing leveldb. TokyoCabinet has great performance usually. I haven't done a careful head-to-head comparison, but it wouldn't surprise me if it was somewhat faster than leveldb for many workloads. Plus TokyoCabinet is more mature, has matching server code etc. and may therefore be a better fit for many projects.

However because of a fundamental difference in data structures (TokyoCabinet uses btrees for ordered storage; leveldb uses log structured merge trees), random write performance (which is important for our needs) is significantly better in leveldb. This part we did measure. IIRC, we could fill TokyoCabinet with a million 100-byte writes in less than two seconds if writing sequentially, but the time ballooned to ~2000 seconds if we wrote randomly. The corresponding slowdown for leveldb is from ~1.5 seconds (sequential) to ~2.5 seconds (random).

<comment><USER33> Did you consider fractal trees?

<http://tokutek.com/presentations/bender-Scalperf-9-09.pdf>

<comment><USER4> fractal trees should have a faster read performance with leveldb with a comparable updating performance. There does not exist any open source solution for such structure, while we could hope that www.acunu.com might provide an open source solution for similary Stratified B-tree [http://www.acunu.com/2011/04/log-file-systems-and-ssds- made-...](http://www.acunu.com/2011/04/log-file-systems-and-ssds-made-for- each-other/)

<comment><USER34> Being in-kernel, acunu is very far from the lightness of LevelDB.

</comment></comment></comment></comment></comment></comment><comment><USER35> Anyone manage to compile this on OS X?

<comment><USER36> You'll need a compiler from MacPorts: it wants C++0x which Apple's gcc doesn't support yet.

<comment><USER35> Argh... that makes it even harder to use on iOS. :)

</comment></comment></comment><comment><USER37> Sounds like a possible redis or memcached replacement.

A performance comparision with memcached would be interesting.

<comment><USER38> replacement is a strong word when you consider that you are talking about:

get/put/delete vs <http://redis.io/commands>

<comment><USER39> That is beautiful documentation.</comment></comment></comment>


Red wine research may have been falsified - <AUTHOR> http://boingboing.net/2012/01/17/red-wine-research-may-have-bee.html

<comment><USER2> I think this happens a lot. Whenever a new study comes out, I always try to find out who actually funded it.</comment>


Ask HN: Is Perl making a comeback? - <AUTHOR>

For years, there were pretty much zero articles about Perl posted here. Even Java received more linkage.
Recently, I'm seeing a small trickle of Perl posts, which makes me wonder if this is the beginning of a new trend.
Is Perl making a comeback? <comment><USER2> I was a Perl hacker for almost three years. It was my first dynamic, interpreted language and is what made me fall in love with writing software. Writing Perl was when I first felt that I was hacking rather than programming.

The largest problem is that it's largely unreadable, a write-only language. There's too much magic in Perl. Perl 6 is making strides to correct this, but the culture of Perl is what makes me believe that it will never be a viable choice over other dynamic, interpreted languages. I moved to Python and will never look back. The Perl culture is exactly what lured me in to programming, so I'd rather it not change anyways.

There are definitely still companies using Perl in production, but my guess is that it's always for legacy reasons.

<comment><USER3> > * the culture of Perl is what makes me believe that it will never be a > viable choice over other dynamic, interpreted languages.*

What's wrong with Perl culture? Perl as a language and as an implementation has many weaknesses (esp. maintainability), but I've never seen any reasonable criticism of its culture as a whole. Only very recently have I noticed a somewhat annoying trend towards evangelism, I attribute this to the loss of interest in the language with the exception of somewhat fanatic users. But most current users are probably still grumpy old men like me who just want to get work done without rewriting large legacy code bases from scratch.

<comment><USER2> Nothing is wrong with culture. I love the culture. It's just that there is an emphasis on doing things in clever ways, not necessarily readable or maintainable ways.

The average thread on PerlMonks (at least when I was a heavy reader) eventually turns to code golf. The language and culture both encourage that. I had a lot of fun writing clever code, and it really helped me understand data structures and efficiency at a deep level. Trying to force that culture of expression and code gymnastics to write a maintainable codebase just isn't worth it in my opinion. A language with more constraints and less magic will benefit a team trying to come together to build a product.

I see Python as being somewhere between Perl (express yourself in clever ways) and Ruby (I know it's attributed to Rails, but omakase) in terms of culture. That's why I love Python.

<comment><USER3> > _The average thread on PerlMonks (at least when I was a heavy reader) > eventually turns to code golf_

That might not be representative of the Perl community as a whole really ... Perl is used in corporate environments where "code golf" or "super clever" solutions will get you odd looks, Perl isn't an excuse for writing unmaintainable code, even if it's straight from PerlMonks. Books like "Modern Perl" by chromatic and software like Perl::Critic have moved the focus from writing "clever" to writing maintainable code in the last couple of years. In my opinion, it was too little and too late though and lacking supporting changes in Perl's implementation to reverse the trend (i.e. losing users).

For people who have touched saner languages (like Go) in the mean time, it's just hopeless to keep messing about with Perl, no matter how disciplined people are and how supporting the toolchain is (I run Perl::Critic and _perl -MO=Lint -c_ before every commit and it takes longer than "go build", which checks code much more thoroughly).

</comment></comment></comment></comment><comment><USER4> For many of us, Perl never went away. Been using it since the early 90s. It's ugly, but I know it, it does the job well, and it's reliable.

<comment><USER5> Def. never went away. Picked it up in 1999 when working in a web design shop, still hackin' away at it, on my own.

Still, on the same, evolving code base!

</comment></comment><comment><USER6> No, people just started jamming in Perl headlines in the past few days. Anyone can submit, after all. It's the 3rd most popular dynamic language. One of Perl's claim's to fame was CPAN, but at this point there's probably more than enough Python or Ruby library support. Ruby and Python also have also JVM support. You'll still find Perl in a lot of legacy software because it was king for a decade. These days, I would probably just go with Python or Ruby on any new project because it's easier to find developers.

Finally, consider if you want to outsource on oDesk, for example. There's a better chance of getting readable Python than readable Perl.

</comment><comment><USER7> It never left. You won't read about it here because its not _in_. Remember that this community revolves around a younger generation of programmers that learned to build web cruds with rails. Not a bad thing. They just see Perl as _old_.

<comment><USER8> Perl 5 maintains that perception because of its refusal to break backward compatibility and fix longstanding warts.

<comment><USER9> That was true until about 5.12. Since 2011, Perl's been much more aggressive about fixing warts and breaking backwards compatibility in intelligent ways (where it's getting in the way of something better or actively harmful).

</comment></comment></comment><comment><USER10> Hacker News represents a VERY small segment of the computer programming population. That's fine, but don't be confused if the echo chamber occasionally produces weird results. Perl is still in use in major companies, for web stuff and system administration, but also game development, hardware simulation testing and other cool things. It's not sexy, and it seems arcane to programmers used to more modern languages. But there are things happening in it.

</comment><comment><USER11> perl is in active use among sysadmin and devops people.

</comment><comment><USER12> No.

[http://en.wikipedia.org/wiki/Betteridge%27s_law_of_headlines](http://en.wikipedia.org/wiki/Betteridge%27s_law_of_headlines)

</comment><comment><USER13> please not

<comment><USER14> I guess it will be more popular if Perl6 catch up in speed.</comment></comment>


Stanford U enacts adaptive password policy - <AUTHOR> http://itservices.stanford.edu/service/accounts/passwords/quickguide

<comment><USER2> This can be done in Linux using

      pam_passwdqc(8)</comment>


If You Bought Apple Stock Instead of Products - <AUTHOR> http://bits.blogs.nytimes.com/2011/03/10/if-you-bought-apple-stock-instead-of-products

<comment><USER2> In March of 2007 I bought 25 shares of AAPL for $2,299.50. It's now worth $8,666.75

In June of 2007 I bought a MacBook Pro for $1,999 to run my startup off of. (The chart says that if I had bought stock instead, it'd be worth $4,413.)

The ROI on the MacBook Pro has been the better investment in my opinion.

<comment><USER3> Yes, this is the point. It's not like we're just pouring the money down the drain. Technology is (often) an investment.

<comment><USER4> Most of the HNers don't, but a lot of folks do. They buy certain technology because it's cool or everyone else is doing it, even though they would be the same off with something half the price.

<comment><USER3> I will confess that I do this too :-)

</comment></comment></comment></comment><comment><USER5> Another day, another imaginary profit using 20/20 hindsight. Yes, stock trading is easy using a time machine. Do you have a time machine? I didn't think so. Next!

<comment><USER6> Time Machine™ comes with every Mac!

</comment></comment><comment><USER7> If (in early 2000) You Had Bought Nokia Stock Instead Of A Nokia Phone...

<http://www.google.com/finance?q=NYSE:NOK>

...you could today afford two styrofoam cups and a piece of string.

An off-hand observation: Nokia's late-90's rise looks just as spectacular as Apple's in the 00's.

<comment><USER8> I think the differnece here is the P/E multiple apple is getting. They have more E (Earnings) to justify their P (stock Price).

</comment></comment><comment><USER9> Skip the article and go straight to the numbers: <http://www.kyleconroy.com/apple-stock.php>

</comment><comment><USER10> Of course, the flaw here is that if you take this to it's logical extreme, a world in which everybody instead spent money on Apple stock instead of buying Apple products, then Apple's revenue over that period would have become zero, and then almost inevitably the stock would become zero too.

But yeah.

</comment><comment><USER11> Based on this table, it looks like if you buy the equivalent amount of stock every time you buy a new Apple production, you'll get a free upgrade within 2-3 years?

My current machine is:

Apple MacBook Pro "Core 2 Duo" 2.8 15" (SD) 2009-06-08 $2299 $4,328

and it's about time to upgrade.

And I could really use an iPhone 4 upgrade from my 3GS:

Apple iPhone 3GS 16, 32 GB 2009-06-08 $199 $375

The Mac Mini sitting under my TV could more than replace my whole entertainment center:

Apple Mac mini G4/1.42 2005-01-11 $599 $5,026

<comment><USER12> Also, you can sell your apple products for close to 50% of their value.

</comment></comment><comment><USER13> How were companies like APPL, GOOG, and MSFT perceived in the time before their stocks took off?

Was it obvious to people in the industry that these companies would be successful? Was it seen more of a hit or miss? Were people betting against their success?

<comment><USER14> Apple was a complete and total mess back in 1997. Let me count the ways.

\- Windows 95 eradicated most of their "ease-of-use" advantage, which destroyed their profit margins

\- They had a string of serious hardware and software quality problems, leading people to wonder if

\- Their computers were seriously overpriced. (Not mildly expensive like today, but like half the specs for 150% of the price.)

\- Their cloning strategy had totally flopped and eradicated their margins even further.

\- The Newton, which was pitched as a "save the company" thing, had flopped

\- Apple was trying to sell itself to anyone interested, and nobody would buy

\- The Wall Street Journal thought there were serious accounting shenanigans going on

\- And unlike today, they had no consumer electronic products to fall back on.

The Mac business was so fucked, it took them about 10 years before they really "fixed" it. And I don't think anyone at the time really could have predicted that Apple would become a consumer electronics juggernaut.

Still their stock was considered a steal at $15 a share or whatever, and it's depressing to think you missed an opportunity of a lifetime.

<comment><USER15> It was a steal at ~89 in January of 2009 as well.

</comment></comment></comment><comment><USER16> Sure, if I bought stock instead of Apple products I'd be loaded.. but would I understand why?

</comment><comment><USER17> Annoyingly, over the years I have told myself that I should be buying AAPL instead of the products. Never took my own advice.

Although it'd be more interesting to see the differential between AAPL and the SP500 in the same time (because you probably actually did buy that via a 401k or whatever)

</comment><comment><USER18> I wonder if this would work as an investment strategy:

A month after I buy a product, if I still love what I bought, buy the same amount in stock of that company (or a fixed multiple/divisor of the amount spent).

</comment><comment><USER19> But then I'd be sitting at an empty desk in silence!

</comment><comment><USER20> Well in 2007 I bought a mac and ended up developing for my iPhone and I've made much more than 6x (about the going rate for 2007 items).

</comment><comment><USER21> If we all would've bought Apple stock instead of their products the stock would've gone nowhere!

</comment><comment><USER22> 2003 seems to be the best year for those missing out on 1997:

<http://goo.gl/PqYeQ> (best bang for buck version - google sheets).

</comment><comment><USER23> of course, if everyone followed the above advice the stock would not have gone up (at each snapshot in time) since the reduction in purchased products and profits would not have moved the stock. That is, unless you subscribe to the tragedy of the commons, and let the commons write their own tragedy as you raked in the stock uptick / gains. <http://en.wikipedia.org/wiki/Tragedy_of_the_commons>

</comment><comment><USER24> I would have made $200. I'll stick with the iPod.

</comment><comment><USER25> This kind is logic might work with coca cola stock but it certainly doesn't with apple. How do you measure the roi of a Mac Pro?

<comment><USER26> Yeah, I built myself a (non-mac) computer in 2003 for about $1,000, and am using it as I write this. I wouldn't have set aside that money to buy Apple stock, and I have no idea the stock value of the various component vendors (the intel components were a few hundred at most).

If you're going to buy a computer anyway, you'd be measuring the Apple anyway, not the entire product cost. That is, if an equivalent Apple machine cost $1,500, then the money I could have spent on Apple stock by building my own is $500, not $1,500.</comment></comment>


Minikube: easily run Kubernetes locally - a-robinson http://blog.kubernetes.io/2016/07/minikube-easily-run-kubernetes-locally.html <comment><AUTHOR> Minikube is awesome! We used it at Apprenda in a recent K8s 101 webinar (0). Standing up a local K8s cluster in 1-2 minutes is a really great experience.

(0): [https://apprenda.wistia.com/medias/ckbmoa10sd](https://apprenda.wistia.com/medias/ckbmoa10sd)

<comment><USER2> Great webinar! Kudos!

I set this up on my laptop and am noticing a strange behavior. When accessing the pod via [http://192.168.99.100:30764/grid?cols=3&rows=5](http://192.168.99.100:30764/grid?cols=3&rows=5), all pods display the same ID. This means that the "NodePort" load-balancer is not performing round-robin load-balancing as expected. Any thoughts?

My environment: Macbook Pro, Intel i7, 16GB OS X (El Capitan 10.11.5) Docker for Mac (v1.12.0-rc3 client and server versions, [https://www.docker.com/products/docker#/mac](https://www.docker.com/products/docker#/mac)) kubectl v1.3.0 minikube v0.6.0

<comment><USER2> Nevermind. The root-cause seems to be aggressive browser caching.

Chrome and Safari display the same behavior i.e. all pod IDs the same.

Firefox displays different pod IDs (90% of the IDS are the same, however there are a few that are different)

</comment></comment></comment><comment><USER3> Starting Minikube on your laptop ([https://github.com/kubernetes/minikube](https://github.com/kubernetes/minikube)):

       minikube start

Seriously, it's that easy. Let me know if you have any questions!

Disclosure: I am a PM at Google working on Kubernetes.

<comment><USER4> There's a bit more to it - it took me a while to realise that I still needed kubectl and the rest of the binaries on the host. I have had a heavy day though so may just have missed that bit.

Love Kubernetes though, this'll be a superb way of spinning some test stuff up!

<comment><USER3> Heh, that's true - you can't run binaries that aren't there :)

<comment><USER4> Another thing - the docs state to go to [https://<kubernetesIP>](https://<kubernetesIP>) but that does nothing. Instead I have to go to [http://kubernetesIP:30000](http://kubernetesIP:30000) for the UI. Am I missing something else?

Also, using the KVM driver on Ubuntu 16.04 I have to run the start command twice to be able to bring up a pod. That's with the 'vm-driver=kvm' at the end.

Got there in the end anyways - thank you!

<comment><USER5> Hey,

[http://kubernetesIP/ui](http://kubernetesIP/ui) should work. Where in the docs did you see [https://kubernetesIP](https://kubernetesIP) ? I can get those cleaned up.

<comment><USER4> In addition the VM isn't even listening on 80, it's only listening on 443 and 30000:

"Kubernetes is available at [https://192.168.42.174:443](https://192.168.42.174:443). Kubectl is now configured to use the cluster. root@thinkbuntu:/root/kubernetes# nmap 192.168.42.174

Starting Nmap 7.01 ( [https://nmap.org](https://nmap.org) ) at 2016-07-11 22:44 BST Nmap scan report for 192.168.42.174 Host is up (0.00061s latency). Not shown: 996 closed ports PORT STATE SERVICE 22/tcp open ssh 443/tcp open https 8081/tcp open blackice-icecap 30000/tcp open unknown MAC Address: 52:54:00:C8:F1:38 (QEMU virtual NIC)

Nmap done: 1 IP address (1 host up) scanned in 25.54 seconds"

</comment></comment></comment></comment></comment></comment><comment><USER5> I'm an engineer working on Minikube. Feel free to ask about the tool here!

<comment><USER6> When will there be a windows version ?

</comment></comment><comment><USER7> I've used kid ([https://github.com/vyshane/kid](https://github.com/vyshane/kid)) to launch a docker based kubernetes environment on my laptop.

Means I don't have to use VirtualBox</comment>


NotchUp.com Arranges Pay for Job Interviews - <AUTHOR> http://www.nytimes.com/aponline/technology/AP-Pay-Per-Interview.html?ref=technologyechnology&oref=slogin

<comment><USER2> Good idea. The website is slow, even at 1:20 am Pacific. They allow you to import your LinkedIn profile and invite any of your linkedin contacts. They also offer 10% referral bonuses; you get % of your contacts' interview revenue. I can see why the registrations are growing exponentially even if it's invite only.

They evaluate you post-interview on the following:

\---% - you took the interview seriously

\---% - you were on time for the interview

\---% - your profile was accurate

\---% - they'd recommend you to others

</comment><comment><USER3> There are a lot of startup founders here. Would you pay for this?

<comment><USER3> PS i wouldn't

</comment></comment><comment><USER4> Is this a YC company?

This sounds like a good idea. I wonder how they decide if you get the money or not? I.e., how do you weed out people just doing this for the money?

<comment><USER5> Not a YC company; the article says self-funded.

-

The company rates you post-interview, and one of the things they rate you on is how seriously you took the interview. So, basically, they can't weed out people just doing it for the money, as long as the person takes the interview seriously and acts professionally. Regardless, I think this is a good idea, it will definitely work as a self-funded company.

</comment></comment><comment><USER5> I have invites which let you skip the "application" process; email me and I would be happy to give you an invite.</comment>


Supporters of Mexico's Soda Tax Targeted with NSO Exploit Links (2017) - <AUTHOR> https://citizenlab.ca/2017/02/bittersweet-nso-mexico-spyware/ <comment><USER2> It seems logical that when once we have a pure "wild west" situation where anyone contract for the hacking of any target, that corporations producing products arguably not in the public good will have an incentive to target their critics.

<comment><USER3> >where anyone contract for the hacking of any target

Unfortunately, the law does not reflect this. Governments still have a monopoly on these sorts of attacks. If you do it without the government blessing, you usually end up in a cage.

</comment></comment><comment><USER4> Companies like this have a bright future as the result of a quirk of resource economics.

Short version is, resource rich governments don't need a sophisticated state apparatus to stay in power, so long as they can pay the army. (See "resource curse," and demesquitas "logic of political suvival")

It means their domestic intelligence capability is not as mature as that of a democracy, so they have to go to market for sophisticated technical surveillance services. Enter mercenary intelligence companies like NSO.

Mexico is an exception, but in general if there were a way to get early exposure to this market, the margins are probably hyper political and irrational, and it's not going away.

Maybe DPRK will trade these services to unstable regimes for currency and support, but imo these sort of companies are here to stay.

<comment><USER5> > _It means their domestic intelligence capability is not as mature as that of > a democracy,_

That step is not one I can follow. Wouldn't a military kleptocracy stand even more to gain from keeping an eye on everyone than a democracy would? In a democracy almost nobody is an enemy of the people but in a militaristic dictatorship almost everyone is an enemy of the state. Domestic intelligence a la East Germany is way more important when the government is brutal and hated. In America the average person would not side with the revolution if they had the opportunity, so spotting revolutionaries isn't very important.

If anything, private companies are springing up to do this because small military dictatorships want their services way more than the average small democracy.

If democracies tend to have expansive intelligence agencies it is not because they need them more than, say, Putin, but because their populations are so rich and happy that they are willing to shoulder a giant black budget on pure faith.

<comment><USER4> Democracies have mature intel capabilities because their public services are so large that they can mobilize the resources for things like custom malware, electronics, and a kind of parallel tech industry.

Basically, if a government depends on a tax base (and not resource money), it's going to have a real domestic intelligence capability. This also explains non-democratic but sophistcated states, as it's a question of tax base. Democracies are a useful example of this.

In a resource cursed economy, the government doesn't need public services because they make their money on resources, not taxes. What's changed is their people have cell phones and can organize online, which means small coalition resource states are on their back foot, hence going to the mercenary market for intel solutions.

I encourage you to look up the references in the original comment to become familiar with the dynamics at play.

<comment><USER5> > _Democracies have mature intel capabilities because their public services > are so large that they can mobilize the resources for things like custom > malware, electronics, and a kind of parallel tech industry._

This still comes across as an unsupported assertion. To use the US as an example, the NSA isn't particularly synergistic with the NHS or any other non- clandestine government agency. They have their own budget and an independent asset sheet. The NSA actually competes for resources with the NHS, as the tax burden can only be so high. In an alternate universe where heart disease killed more people every every year than domestic terrorism ( _cough_ ), Congress could make the NHS bigger without raising taxes by reducing funding for the domestic surveillance system.

With the same economy, a country with no civil service would be able to afford more internal security than one with a large, expensive civil service. Taken to the ultimate extreme you get a government that provides no services but levies a high tax/bribery burden, so that it can use it to fund a domestic security apparatus (which is badly needed because military kleptocracies are not popular!).

<comment><USER4> Again, I would encourage you to look up demesquitas "logic of political survival." It provides the foundation for the view, and isn't really something one can intuit without familiarity with the model.

<comment><USER5> I've been down that road before, and trust me geopolitical theories are a dead end. Nobody can predict anything, and almost everything written is just an elaborate justification for why whatever is happening today was inevitable. It is disappointing to realize but armchair HN comments are the best you can hope for in this area, as they have the advantage of not being as long to read.

<comment><USER6> _I 've been down that road before, and trust me geopolitical theories are a dead end. Nobody can predict anything, and almost everything written is just an elaborate justification for why whatever is happening today was inevitable. It is disappointing to realize but armchair HN comments are the best you can hope for in this area, as they have the advantage of not being as long to read._

That's a far more sweeping and far less supported statement than the one you've been demanding citations for, don't you think? Besides, unless you're a peofessional commenting on your field, then you're matching armchair with armchair, without even the benefit of being able to point to existing theories supporting your view.

<comment><USER5> Gesturing at a body of academic work will only move the discussion forwards if everyone already likes it from past experiences or trusts it implicitly, which might be true for chemistry but is not so true for polsci!

<comment><USER6> That's true, and as a debate it's not very fertile ground. On the other hand if we all go into this with an eye on sharing perspective rather than changing minds, it could be edifying. I'm pretty skeptical of political science theories, but they can be very compelling even as they lack the rigor of a true science. Moreover, the people who lead us definitely ascribe to these theories and this "science" and understanding their mindset has to have some value.

Besides, even if the conclusions can only have the strength of guesses and inferences, or just demonstrating historical patterns that can have value.

<comment><USER5> > _but they can be very compelling even as they lack the rigor of a true > science_

That's really the heart of the problem. As any good salesman knows, there are many ways to convince someone that don't involve demonstrating your case, and many of them appear rational. This "scientific rigor" thing isn't just a cultural gatekeeping mechanism, it was built up over a centuries-long slow realization that the natural emotion of being convinced has to do with the truth in only the rarest of cases. The feeling that you're learning something is seriously intoxicating, and it turns out that it is just as prone to leading you astray as any other feeling. Geopolitical theory is _always_ compelling; and it's just as compelling on every side of every argument, to the point where it's clear that it won't actually help you determine which side is right. That's because, along with a few other fields that I won't drag in to this, it is essentially the crystalized art of activating the human feeling of being compelled.

</comment></comment></comment></comment></comment></comment></comment></comment></comment></comment><comment><USER7> > _targeted with government-exclusive spyware._

Honestly, who can even say that? What makes something "government exclusive"? These types of comments are a legitimacy stink to me. What type of narrative are these people selling?

Reminds me of the "proof" the DNC was hacked by the Russian government was because guccifer email was... sent through a random Russian email relay???

<comment><USER8> > Reminds me of the "proof" the DNC was hacked by the Russian government was > because guccifer email was... sent through a random Russian email relay???

Russian email relays had nothing to do with the attribution of the Guccifer 2.0 hacks. Separately, the identity of Guccifer is known because he confessed: [https://en.m.wikipedia.org/wiki/Guccifer?wprov=sfla1](https://en.m.wikipedia.org/wiki/Guccifer?wprov=sfla1)

<comment><USER9> the wikipedia article clearly states that there was no proof he did it and it even says in the opening paragraph that it's a lie by the US govt

<comment><USER8> You appear to still not understand that Guccifer and Guccifer 2 are two separate entities.</comment></comment></comment></comment>


IE6 in the browser - <AUTHOR> http://app.cloudinternetexplorer.com/ <comment><USER2> Whoever has made this RDP server publicly accessible (if that's what this is) sure is brave—I'll bet that it's ridden with viruses, popups, and other nastiness in no time.

Also, I get IE9, not IE6.</comment>


Measuring Success - <AUTHOR> http://earlystagevc.typepad.com/earlystagevc/2007/02/measuring_succe.html <comment><USER2> Measuring success, in what units?! The revenue in dollars or millions?

<comment><AUTHOR> That's upto you to decide. Takeaway from this post is to define your units and be dead honest with yourself and your investors about where you stand and where you are headed.

-Zaid</comment></comment>


Why does Firefox not report before crashing? - <AUTHOR>

My computer has about 3Gb RAM, and Firefox often takes about 1,5Gb. The problem is, whenever it crashes because of unavailable RAM, it doesn't know about my computer RAM status. Why not have an alert when i create new tab ? Or firefox doesn't know RAM is full ? <comment><USER2> Do you have swap disabled by chance?</comment>


Fiat Chrysler is giving up to $1,500 to hackers who find bugs in its software - <AUTHOR> http://fortune.com/2016/07/13/fiat-chrysler-bug-bounty-program/ <comment><USER2> Would even the max ($1500) be enough to attract bug hunters? Does that seem pretty cheap?</comment>


U.S. Withdraws from Extractive Industries Transparency Initiative - <AUTHOR> http://www.reuters.com/article/us-usa-eiti/u-s-withdraws-from-extractive-industries-transparency-initiative-idUSKBN1D2290 <comment><AUTHOR> These are the little things, relative to Paris for example, that end up being administrative/environmental tipping points. Years from now, a documentary will point to moments like this, and ask why no one was paying attention. Transparency in resources, or the lack thereof, can have far reaching diplomatic/political and economic impact.</comment>


Ask HN: How are you monetizing your site? - <AUTHOR>

What are all the different ways you found to make money off your site? <comment><USER3> I wrote this last week for another 'Ask HN' thread regarding starting a successful blog. Thought it would also apply here -

"Generating revenue - whole books can be written on this subject (and they have been). But it can broadly be broken down into five categories -

1\. Advertisements - the magic word here is CPM (read up on that). The higher the CPM, higher the payout for you. A word of advice in this matter - <USER2> is complete horseshit when it comes to CPM. Don't buy into the hype, it's absolutely pathetic. Same goes for Adbrite, Chitika etc. The real money is in PRIVATE ads. Take a look at the prominent blogs - like techcrunch.com for example - do you see any adsense or other types of nonsense on their blogs? It's mainly used as a placeholder in case any private ad spots weren't bought by advertisers. NEVER rely on adsense for your primary ad revenue. Having said that, you won't have private advertisers till you have good traffic, so it's ok to start with adsense. But as soon as traffic spikes up, dump adsense like it's the plague.

2\. Affiliate - this is a bit trickier than ads being that it's not completely straightforward. The basic idea is that you link to products on your site and if you readers follow your links to buy those products, you get a cut of the sale. Amazon is a good start, but they're not the best. The key is finding a good affiliate that fits YOUR blog audience the best. The next step would be to beef up on your affiliate marketing skills. Start reading affiliate marketing blogs like shoemoney.com for this.

3\. Merchandising - you can sell stuff on your blog. This can be as complicated as actually creating your own product or as simple as setting up a cafe press store and selling related merchandise (INSANELY easy! Just go to cafepress.com and set up a store for your blog, and they will handle the rest, by taking a commission of your sales.)

4\. Job Board - a specific section on your blog where ppl can post or look for jobs. Charge based on traffic. You can either set up your own job board from scratch (check out the problogger job boards on the bottom right of problogger.com) or do some research on alternatives - [http://www.blogtrepreneur.com/2008/04/29/make-money-with- you...](http://www.blogtrepreneur.com/2008/04/29/make-money-with-your-own-job- board/) (Job-A-Matic has a good premise). Read up on this.

5\. Donations - Bloggers like Steve Pavlina and Leo Babauta use this method and it works out great for them. But it's not for everyone. Your audience has to LOVE you, or at least really appreciate you, for this."

There's actually two more methods as well -

6\. Newsletter - [http://www.businessweek.com/technology/content/feb2009/tc200...](http://www.businessweek.com/technology/content/feb2009/tc20090224_035701.htm) \- this guy makes a $40 CPM, which is absolutely incredible. Sign up for successful newsletters like dailycandy to get an idea of how they monetize them.

7\. Sell a Service - from freelance writing to consulting etc.

What's your site about? That could help narrow down your options.

<comment><USER4> Job Boards are great for monetization if you have a community around a specific niche. Even in these times, there's money in recruitment.

You could try Easy Job Boards for a simple hosted solution where you get to keep 100% of revenue - <http://www.easyjobboards.com/>

</comment></comment><comment><USER5> Sell stuff. Get people to sell their stuff on your site and take a small bite of the sale price. Don't rely on ads and seo - too competitive. Then, go out and pound the pavement and get people to sign up to sell stuff. Would be good if you get a sales guy in your startup team.

</comment><comment><USER6> I run this site: <http://isitnormal.com>

It gets quite a bit of traffic, mostly from search, but it has proven very hard to monetize. Tried adsense, but my content was too risque for them. Was using an ad network called clicksor for a while, but their ads are very intrusive and didn't perform well enough to justify the bad user experience. I even tried the adult friend finder affiliate program for my "unsafe" content, but it performed absolutely horribly.

Would love to hear more ideas from the HN crowd. How does one go about finding private advertisers without a salesforce?

<comment><USER7> Dude your problem is not ad networks, rather the monetizing strategy. Traffic is huge, but comes from 600 some search terms / phrases (very, very defragmented). I'd group all search term based on similarity. Find yourself some kick ass affiliate offers to go along with each visitor group. Serve the ads accordingly, instead of relying on Google welfare. Based on what I've tried and seen, you should be able to get $20/25 CPM at minimum.

<comment><USER7> ...just think of it as PPC marketing in reverse. Instead of figuring out keywords, figure out an offer for a phrase. Hope this helps.

<comment><USER6> Thanks!

</comment></comment></comment></comment><comment><USER8> The only way I've made money on any site is by selling something. Ads are great, but I can never get them to cover anything but basic operating costs, and even then they will barely cover the costs to keep a server running.

Depending on how the site is set up, you can either sell a product or a service. The problem with that is largely that you have to have something people are willing to pay for. I know quite a few blog-type sites have had success with a model along the lines of Current month free, Archives require payment.

</comment><comment><USER9> sell a product. sell a service. sell ad space. referral programs.

<comment><USER9> forgot one -- ask for tips/donations.

i kind of think that most monetization solutions will fall under one or more of these overarching concepts. i might've missed one or two though.

</comment></comment><comment><USER10> There are also intangiable (non-physical) products you can sell.

For example, my product is a web based RPG. We use a points system, where users can purchase Brownie Points in various increments. Then they can redeem those points for various products (all of which web-site only features.)

It's an alternative to subscriptions (like Lighthouse). Where your users pay a monthly or yearly fee.

</comment><comment><USER11> We're running a freemium model. Users get to view ads or they can pay to remove them and get some other features. The free part gets a lot of people into the game (as a figure of speech, but also literally) and some buy a VIP account.

</comment><comment><USER12> My "website" is a digital brochure for my business. Ask me how I make money from brochures if you want.

</comment><comment><USER13> Making money is so last year.

<comment><USER14> I understand downvoting the useless and malicious, but this was a /joke,/ people. 0 is fine if you don't want it in the discussion; Negative numbers are just gratuitous.</comment></comment>


Ask HN: Efficient HTML Text Replace, RegEx? jQuery? - <AUTHOR>

[disclaimer] I understand the risk in using a framework, but I also understand the benefits.  I was only using jQuery to see if it was a fast enough approach.
So, the other day, i wrote a line of jQuery like so to find all elements that contained the word 'apple'.  the idea was that i could do the find/replace faster than doing it via a regex over the whole doc, which requires a redraw.
$("*:contains['apple']").each(
 function(){
   //do something
 });
the result was that i was processing iteratively on every item in the DOM that had a descendant which contained the word 'apple', rather than just the child objects.
I ended up using some code from Johann Burkard http://johannburkard.de/blog/programming/javascript/highlight-javascript-text-higlighting-jquery-plugin.html
Johann's approach iterates through the text using a string.indexOf(pat) pattern.  i was wondering if any of you had any better ideas?
In the ideal situation, i would use a jQuery selector to select only child nodes that contained 'apple', but there is no such selector 'isChild' that can be paired with :contains as far as i know.
I would like to replace all instances of 'apple' with '<span class="highlight">apple</span>" with the lowest impact to the dom possible. <comment><USER2> _but there is no such selector 'isChild' that can be paired with :contains as far as i know_

Maybe you can use $.children()? Something like:

      $('div').children(":contains('apple')").each(function() {
        var html = $(this).html().replace(/apple/,"apple");
        $(this).html(html);
      });

example: <http://www.fillerspace.com/apple.html>

<comment><AUTHOR> this doesn't seem to work to well on a complex page like <http://techcrunch.com/2010/07/29/apple-location/> .

<comment><USER2> Just a few small changes fixes it:

      jQuery('div.entry').find(":contains('apple')").each(function() {
        var html = jQuery(this).html().replace(/apple/gi,"Apple");
        jQuery(this).html(html);
      });

I made the str.replace global and case-insensitive (/apple/gi), and changed $.children() to $.find() since on TC the content wasn't the direct descendant of a div. $.find() goes more than one level down. They also seem to be using jQuery.noConflict() so I changed the $ to jQuery.

example: <http://fillerspace.com/techcrunch.html></comment></comment></comment>


Show HN: Connective – Large-scale reactive programming in Javascript/Typescript - <AUTHOR> https://connective.dev <comment><AUTHOR> ok a bit of background:

I have been working on my off time for some time now to bring reactive programming to the fore-front of web development, as I think it best captures the essence of the logic in those domains, which is basically an event/data flow graph. Current languages and tools are built around the traditional sequential flow of a program, and this mismatch makes it pretty hard to properly adopt the paradigm without proper libraries/tooling.

RxJS is one of the best such libraries, though it lacks some essential features for being properly used at scale:

\- It models the flows with inverse event/data flow trees, which though an improvement over the sequential flow still limits how larger flows are described,

\- It does not provide any abstraction for re-use of reactive flows, which is essential to large-scale codes based on the paradigm (imagine coding without functions).

CONNECTIVE is a thin library on top of RxJS that addresses those issues. It is designed to be complementary to RxJS, boosting its flexibility and scalability without limiting its potential. You can read the following entry on the docs section for more info about these issues and how CONNECTIVE addresses them:

[https://connective.dev/docs/connective-v- rxjs](https://connective.dev/docs/connective-v-rxjs)

<comment><USER2> I've been using RxJS for a while, but I'm confused about this. I don't doubt you are correct; I'm just having trouble understanding.

> It models the flows with inverse event/data flow trees, which though an > improvement over the sequential flow still limits how larger flows are > described,

What does this mean?

> It does not provide any abstraction for re-use of reactive flows, which is > essential to large-scale codes based on the paradigm (imagine coding without > functions).

Isn't this just functions? I pass my Observables as arguments and variables, and use pipe() to create transforms.

\---

Do you have Connective vs vanilla RxJS example to demonstrate?

With RxJS your hello world is

        fromEvent(a, 'input').pipe(
          map(() => a.value),
          filter(name => name != 'Donald'),
          map(name => 'hellow ' + name),
        ).subscribe(msg => p.innerHTML = msg);

EDIT:

I see you have [https://connective.dev/docs/connective-v- rxjs](https://connective.dev/docs/connective-v-rxjs)

I will look at that.

<comment><AUTHOR> > Do you have Connective vs vanilla RxJS example to demonstrate?

Yes, you can find them here: [https://connective.dev/docs/connective-v- rxjs](https://connective.dev/docs/connective-v-rxjs)

> What does this mean?

It means you (typically) have a few observables being transformed into one (the inverse-tree structure). Reactive flows are in their general-form a directed graph, which can be described as a composition of multiple trees, however that description distances the actual logical model and the description, leading to harder-to-read code.

Additionally, the inverse-tree model of RxJS (mostly) enforces order of fully defining the flow as well, which limits your ability of organization of larger reactive flows, specifically across multiple modules (imagine a case where you need to define the beginning and the end of the flow in one module and the middle in some other modules, like a typical http server).

> Isn't this just functions? I pass my Observables as arguments and variables, > and use pipe() to create transforms.

This goes hand-in-hand with the previous question: if all you need to do is to transform some properly defined observables into one transformation observable, then yes they are sufficient. On a more general form though, a re- usable part of a reactive flow would be a sub-graph of a directed graph, which can have multiple inputs and outputs. You can see examples of this across the docs, specifically in the link I mentioned above, or these places:

[https://connective.dev/docs/node](https://connective.dev/docs/node) [https://connective.dev/docs/composition](https://connective.dev/docs/composition)

> With RxJS your hello world is ...

yes naturally in simpler cases where none of the aforementioned apply, there is no difference in using CONNECTIVE over RxJS. this is why CONNECTIVE does NOT mask the full API of RxJS.

> I don't doubt you are correct; I'm just having trouble understanding.

Well I might as well be wrong actually, thats the main point of these discussions and contemplations, so thanks for asking :)

</comment></comment></comment><comment><USER3> The problem with these libraries are significant ramp up time. Unlike what the authors are claiming it's not because it's a difficult or greatly different mental model to grasp, it's because the API is clunky and poorly designed. You'll notice most of the popular and highly successful abstractions all share the common trait of being easy and quick to pick up.

It should be a red herring to anyone these days when they see demo code that looks completely unintuitive which purports to make something easier. If the author's haven't factored in ease of use and uptake it's already failed at its first principles.

<comment><AUTHOR> > The problem with these libraries are significant ramp up time. Unlike what > the authors are claiming it's not because it's a difficult or greatly > different mental model to grasp, it's because the API is clunky and poorly > designed.

Regardless of the quality of API design, reactive programming (and by extension RxJS) does indeed require a different mental model, as it is a different model for the flow of a program.

> You'll notice most of the popular and highly successful abstractions all > share the common trait of being easy and quick to pick up.

That is subjective. I remember how many people found node's async callback style unintuitive and confusing on first sight, and I personally find (at least the core abstractions of) RxJS pretty intuitive.

> If the author's haven't factored in ease of use and uptake it's already > failed at its first principles.

Yes this is part of the goal with CONNECTIVE, to bridge the gap between the description of a reactive flow (the code) and the most intuitive way to think about it (a directed graph), so that the end-result would be much more easily readable and intuitive code. I would love to hear if you have any more specific feedback on this front.

<comment><USER4> I don't believe this is the 'most' intuitive. A spreadsheet is a directed graph but that's not how people think when they use it--they just write function expressions.

Svelte 3 does a better job of making it intuitive.

[0] [https://svelte.dev/blog/svelte-3-rethinking- reactivity](https://svelte.dev/blog/svelte-3-rethinking-reactivity)

<comment><AUTHOR> > Svelte 3 does a better job of making it intuitive.

It might just as well be the case. Svelte is going is towards traditional reactive programming languages, which for example because of the implicit change propagation, typically bare the possibility of glitches, which translates into unreliability on the most basic level of the program. I do not know how Svelte 3 handles glitches (or change propagation for that matter), but am just mentioning this as a one of the hurdles of that approach that actually makes it less intuitive (though definitely it looks more magical).

> A spreadsheet is a directed graph but that's not how people think when they > use it--they just write function expressions.

That is true, though people also do not utilize spreadsheets to even one percent of what is possible to do with them, mostly due to the fact that the representation masks the directed graph and makes it harder for people to think of a little bit more complex things they can achieve with it. Saying this as a person who (with a friend) has created a full-blown CRM using google sheets.

> I don't believe this is the 'most' intuitive.

I can't (and didn't) claim it is either. I just suspect it is a really intuitive model since it reflects the actuality of what is being programmed.

EDIT: on closer inspection of Svelte 3's implementation of reactivity, it seems that they are not actually implementing support for reactive programming, just keeping the DOM reactive to variable changes in a transient way. This of course means that it will (most probably) not result in glitches, since its not true reactive programming.

On this front it is notable that:

1) CONNECTIVE (and RxJS) are general-purpose libraries, not just for front- end, 2) I suspect that mere DOM reactivity of Svelte will also not hold up in more complex front-end settings, where you would need (and benefit from) proper reactive logic.

</comment></comment></comment></comment><comment><USER5> This reminds me Cycle.js. I would definitely think stream paradigm is very useful to front-end.

The essential difference in front-end, is the programmer is dealing with continous, realtime signals, and transform it into the graphical interface. This is very different from most request/response style back-end. And the stream is obviously a proper abstraction for modeling this.

However, I found it's tedious to work with RxJS or other stream libraries, not because the design itself, it's just JavaScript lack of flexible DSL machanism like macro. If you invent a DSL for a stream flow diagram, you can get a lot of very neat equations between source and sink, but for JavaScript it's very hard to abstract away the stream context syntactically.

<comment><AUTHOR> > I would definitely think stream paradigm is very useful to front-end.

I think it is theoretically possible to mostly deprecate VDOM with this paradigm, leading to better overall performance and control.

> The essential difference in front-end, is the programmer is dealing with > continous, realtime signals, and transform it into the graphical interface. > This is very different from most request/response style back-end. And the > stream is obviously a proper abstraction for modeling this.

Even for the backend though, specifically for concepts like message brokers (or any similar construct based on application) I would think the paradigm is quite useful.

> If you invent a DSL for a stream flow diagram, you can get a lot of very > neat equations between source and sink, but for JavaScript it's very hard to > abstract away the stream context syntactically.

I personally tend to believe that the ideal DSL (representation) for flow diagrams is a graph (as it encapsulates both the logical and the execution flow), which means in the end of the day any textual representation would be sub-optimal (as any textual representation of any directed graph is sub- optimal and less intuitive compared to drawing the graph itself).

</comment></comment><comment><USER6> My issue with these libraries is the overheads.

\- Steep learning curve for new team members \- More lines of code to do the same logic chains \- Locked into a libraries way of doing logic chains

You can get the same functionality without the library in less lines of code, in a clearer functional or OOP way.

Am I missing something? This is much harder to introduce to organizations / teams.

<comment><AUTHOR> > More lines of code to do the same logic chains

this is typically untrue. the genesis of libraries like RxJS is encapsulating repeated code responsible for properly handling async resources/transformations. without them, you would either repeat similar code everywhere, or end-up writing your own version for the organization. you don't need to take my word for it though, try replicating some of the examples on the website (or on learnrxjs.io) to see this for yourself.

> Locked into a libraries way of doing logic chains

this is a valid concern, though the other side of this coin is not using anything like express, angular, react, etc as they all have the same effect. the design of such libraries should typically be pretty flexible to be more facilitating than restricting, and its always a bonus if they are smartly restricting (discouraging programmers from making mistakes and taking away cognitive load of making choices that can be mostly decided beforehand, etc). core concepts of RxJS for example are so basic that there are serious ECMA proposals to adopt them into the language itself (Observables), much like Promises before them (which were initially promoted by libraries that are still around).

> Steep learning curve for new team members

this is specifically true about libraries targeting reactive programming. the issue is not actually with the libraries but with the paradigm itself, as it requires a different mental model of the flow of the code. this is part of the reason CONNECTIVE exists to begin with, to offer an interface reflecting a more intuitive mental model of reactive flows compared to RxJS, though still it would be a different mental model compared to traditional synchronous programming.

this learning curve however is something that I personally believe is unavoidable in the long run. you already need to adopt it if you want to be competent at prominent frontend frameworks like React or Angular, the latter of which incorporates and utilizes RxJS extensively and the former borrows a lot of the concepts. we already had to go through such a curve with transition to NodeJS for backend, where before you would mostly write fully sync one- request at a time instance codes and compensate by paying extra for the hardware, but now-a-days that extra learning-curve is no longer considered a deterrent.

</comment></comment><comment><USER7> I just went away, learned all about RxJS, and then about Connective, and I think I'm in love.

This is a simple, pure, and elegant way of expressing complex systems. The site makes a whole lot more sense when you catch up with the reactive paradigm and see what RxJS does and what Connective provides that it doesn't.

I'll use this for my next project.

<comment><AUTHOR> thanks a lot. if you found any issues and/or had any questions while using this, there is a gitter chat room where you can ask them: [https://gitter.im/connectv/community](https://gitter.im/connectv/community)

</comment></comment><comment><USER8> Not gonna lie I wish we kept politics out of software

<comment><USER9> I don't think it is possible. And it's someone's right (freeze peach) to make a mark on this.

I've love some of the texts books that has small hints of the authors political attitudes hidden in the examples. It gives character to the work.

Especially in open source I believe this is important to have this freedom. Companies usually do not openly express political prefs (unless it's widely accepted, as in gay-pride rainbows when the fight for equality is largely won). Many opensource projects are not run by corps, but by individuals: and that individual decide to tag a message to the product he/she delivers.

This has always been done, it's form of activism, and I believe it is a good thing. Otherwise we would only encounter political statements in the places we expect it (media, which is largely paid for) and much of us have already chosen to ignore.

My main point: please do not be dismissive of politics as that only helps the lobbyists (and the corps/ultra-rich they represent), and at this point we need to free "our" democracies (means: people rule) from them. Shutting people up by telling them not to discuss politics is not going to help.

<comment><USER9> > I don't think it is possible.

What I meant by this is that choosing an opensource license it to some extend already a political act.

<comment><AUTHOR> well it used to be, but that battle seems to have been largely won on some level too, at least all involved parties now realize the value of open-source (though some may just treat it as a PR asset rather than a platform for inclusive innovation and progress).

<comment><USER9> I mean subtilities like going with a GPLv2 (+ commercial license), LGPLv2/3, GPLv3, BSD-like, CC0 or WTFPL... Or a combination! There you are already cross into politics IMHO. You made a statement, to a greater of lesser degree by choosing one (or more) of the mentioned licenses.

</comment></comment></comment></comment></comment><comment><USER10> It looks like you put a lot of thought into this!

Connective allows users to create graphs between sources and sinks flexibly (i.e., not only source to sink ala typical RxJS), without needing to worry about multicasting.

Is this a fair way to describe this library's benefit?

<comment><AUTHOR> the first benefit, yes (although I would say it is already two, the "graph" and the "flexible connection").

the second one being offering abstractions for re-use of partial graphs.

and it is notable that though CONNECTIVE takes away the worry of multi-casting in (hopefully) a lot of the cases, it is actually pretty conservative on that front and will in a number of cases default to not-multicasting, which might mean that you can get some unexpected behaviors if you are completely unaware of the concept. the plan is to expand the situations that it will make a good default decision for you on that front overtime based on how it is actually used.

EDIT: also thanks, yes as I mentioned somewhere else I actually started doing this for a super-efficient frontend framework (that effort epically failed), so I ended up being extra careful about a lot design choices (and to be fair, carefully delegating a lot of such choices to RxJS as it is a really brilliantly designed library itself).

</comment></comment><comment><USER11> I was missing an example of an async operation with Connective. Like fetch()ing something from an API based on a username.

<comment><AUTHOR> you can find one here: [https://connective.dev/docs/invoke](https://connective.dev/docs/invoke)

it is not featured on the main page since the atomic process is not essentially different (neither from RxJS nor from any other library you might want to use to do that, though the ease of just plugging in any other library for that perhaps is different from RxJS).

</comment></comment><comment><USER12> I've been recently using @grammarly/focal for state management and reactive flow programming.

It also uses rxjs behind the scenes, which I really like has gained some ground with Angular lately.

<comment><AUTHOR> yes it really is an interesting project in this area as well, though it seems to be mostly focusing on state-management and binding reactive flows to React components and leaving the flow programming mostly to RxJS (though I have only looked at the docs a bit and not used the library so I might be mistaken). however I feel maybe with recent release of React Hooks popularity of this library might fall, which is a shame (I definitely like the concepts much more).

</comment></comment><comment><USER13> very nice and i wanted to say i appreciate your docs :)

is there a personal "why" story writeup somewhere? i dont have a need for it but i'd love to learn more about what made you work on this

<comment><AUTHOR> do you mean "why I felt this was needed"? then this link should address your question: [https://connective.dev/docs/connective-v- rxjs](https://connective.dev/docs/connective-v-rxjs)

if you mean "how I got to doing this?" well I was thinking of writing a piece on it, but short story is that I was trying to extend what I was working on before (connect-platform.com) to front-end in a really efficient manner (as I realized the paradigm shift on front-end means much less need for constant performance overhead of mechanisms like VDOM) and hence ended up here.

and about the docs, thanks, I am perhaps going to also independently publish the code responsible for generating it on github pages as an NPM package alongside my next project.

</comment></comment><comment><USER14> 'large scale'

They need an editor for their marketing copy first.

<comment><AUTHOR> yeah its hard to hire people for one-person open-source projects.

<comment><USER14> No need to get grumpy. The wording I've used is just a bit more polite than pointing my finger on the one and only maintainer, you, telling his tonality is totally off and might scare people away.

<comment><AUTHOR> That wasn't intended as a grumpy remark actually, sorry if it came off as such.

And wait, I thought you were referring the '-' in 'large-scale' not the term itself ...

<comment><USER14> All good and sorry, maybe my initial comment was still offending.

However and what I meant is that your writing style, also looking in the comments here, is for my taste a bit too fluffy, elaborative, zealous and making it hard for the reader to grasp the essence of your statements quickly. If you can't win people with words your lib won't have the chance get tried.

While I like new takes in frontend, the overall wording was the reason not to read more about Connective but rather leave a snarky comment.

<comment><AUTHOR> > All good and sorry, maybe my initial comment was still offending.

No seriously I did not find it offensive even one bit.

> While I like new takes in frontend, the overall wording was the reason not > to read more about Connective but rather leave a snarky comment.

And I'm sorry to hear that. I am aware of this and do consciously try to keep it as simple and straight-forward as possible, though there is always room for improvement. It would be really helpful if you could perhaps elaborate a bit more on this, so I would know better on how and what to fix.</comment></comment></comment></comment></comment></comment>