Virtual Wind Instruments (2018) - <AUTHOR> https://www.jefftk.com/p/virtual-wind-instruments <comment><USER2> I play the Aodyo Sylphyo electronic wind instrument, which can do this: [https://www.aodyo.com/?langue=en](https://www.aodyo.com/?langue=en)

By default, it maps breath pressure to intensity (for its onboard synth) and/or MIDI Expression (for external synths). SWAM Saxophones is one of the more popular software instruments among Sylphyo players.

Moreover, it offers a few other modulation controls that generate MIDI control changes, which one can map to things like initial attack. I think the post author might find that the breath sensor is expressive enough to control attack, though.

For anyone who wants to learn more, check out [https://www.reddit.com/r/windsynth/](https://www.reddit.com/r/windsynth/). I've also got quick start docs for different soft synths at [https://github.com/troy/wind-controller-synth-quick- start](https://github.com/troy/wind-controller-synth-quick-start)

<comment><USER3> Nice to see the Sylphyo mentioned on HN! (I'm the software developer at Aodyo)

To answer Jeff's post, in fact, the SWAM virtual instruments _do_ have a way to derive attack intensity from the breath signal. You have to explicitly select "Expression" for the "Attack Sens." parameter. You can also fine-tune the response using the "Auto Expression", "Expr. Trigger Mode" and "Expr. Trigger Sens." parameters in the Options. It's not the default behavior because many SWAM users play them using a keyboard instead of a wind controller, but it's definitely there. Obviously, our onboard synth does this automatically on our sounds, when it makes sense.

I don't know about Jeff's setup, but there's no need to add MIDI velocity on top of the breath signal[1]. When a wind controller outputs a MIDI velocity, it's just something derived from the breath signal, but it's best that synths just use the breath signal and produce attack sounds themselves based on that. That's what SWAM instruments do when "Attack Sens." is set to "Expression", and I'd say it's the correct way. If your wind controller outputs a breath signal at a high enough frequency (the Sylphyo can do up to 1 kHz), then there's enough information for the synth to produce an attack that really sounds like what the performer intended to do on the controller. On the Sylphyo, you can observe this with the onboard sound Meow[2]. Attacks will sound different depending on whether your attacks are done using the tongue ("tu ku tu") or using the throat, but the processing stays minimal so that any advanced technique (flutter-tonguing or growling in the video) can be faithfully retranscribed, and it works well with a subtractive/FM sound like Meow (it might be more difficult for physical models).

[1] MIDI velocity could serve another purpose in a wind controller playing a SWAM instrument: telling how hard you're pressing a key when changing the note, similarly to how flautists sometimes use the sounds of their keys clicking in their performance.

[2] [https://youtu.be/UDcR4I1zatQ?t=33](https://youtu.be/UDcR4I1zatQ?t=33)

</comment></comment><comment><USER4> I designed / plagiarised a virtual wind instrument a while ago. I was unhappy with the straight pressure sensor. On a reeded instrument, the mouthpiece does the duty of loudness, pitch bend and harmonic intonation. Loudness is obvious (pressure) pitch bend also (bite pressure but it's not actually bite if your technique is right, it's lip pressure) but I don't know how the harmonic intonation corresponds to physical parameters except it's about altering the shape of the chamber behind the mouthpiece (i.e. mouth and throat) and some modification to the air-stream as well which I also don't quite understand.

</comment><comment><USER5> This reminded me of my country building the first wind organ instrument in the world. It will be located on the top of the mountain and it produces the sound when wind flows inside organ tubes and pipes.

</comment><comment><USER6> I can recommend checking out the Linnstrument MPE controller for this, too, especially when coupled with VSTs by Audio Modeling (e. g. SWAM Saxophones mentioned by user troydavis.</comment>


Skype: What happened on August 16 - <AUTHOR> http://share.skype.com/sites/en/2007/08/what_happened_on_august_16.html <quote>receiving a routine software update</quote><p>Sounds like they're pointing the finger at microsoft to me. <comment><USER2> This in my view confirms that the people who run Skype are either incompetent, dishonest, or both. I'm leaning towards dishonest, since it's hard to imagine how anyone could be so incompetent to both (a) roll out a network to millions of nodes without simulating how the network responds to major disruptions, and (b) build a large system which cannot be promptly "rebooted" into a clean state if anything goes wrong.

The alternative explanation -- that Skype was the target of a deliberate attack, and they're trying to keep quiet about this -- is to my paranoid mind far easier to believe; Skype would hardly be the first multi-billion dollar company to keep quiet about an attack out of fear that shareholders and/or customers would react unfavourably.

<comment><USER3> When is the last time someone launched a _massively_ successful attack like the one on Skype without claiming credit for it?

Napoleon once said, "Never ascribe to malice that which can be explained by incompetence."

<comment><USER2> What makes you think that whoever launched this attack against Skype (assuming that it was an attack) hasn't taken credit for it? Denial of service extortion (historically, most often against online gambling websites) is a thriving business; but you don't need to take credit publicly to get paid. There's also the possibility of profitting from Skype's outage without even taking credit privately, simply by using the advance knowledge that an attack will take place to make profitable trades on the stock market.

<comment><USER3> I see. So the Skype PR team was sitting around, possibly even delaying the relaunch...

\- _Harp plays, scene fades in_ -

"Neil, what's going on with the spin? _We need that spin!_ We've just finished hiding the build numbers. Marketing has never been happier, so we can't afford anyone to know that we've been attacked now!" yelled Niklas, his ears flattening against his head. Being Supreme Skype Commander was hard work, and it was _not_ made easier by this doofus from PR.

Neil glanced back, mildly annoyed. "I'm workin' on it, I'm workin' on it. Okay, hey, guys, a meteor. No wait, _Velociraptors_. Damn, no.."

They were all huddled in the conference room. Management had commanded them to stay late two days in a row now, until 6 PM. No one wanted to stay an hour late another day.

Suddenly, Tamma burst in. "I've got it! _There was a windows update!_ It happened to coincide with the attack. We're saved!"

Everyone cheered, picking Tamma up and carrying her high in the air. Neil remained seated, slumped, head down.

"I still liked the Velociraptors.." he mumbled.

"Me TOO!" It came from behind him.

Neil had just enough time to turn around and scream in shock and horror before the Velociraptor jumped on him.

\- _Harp plays again, scene fades out_ -

I'm thinking no.

</comment></comment></comment></comment><comment><USER4> i dont understand why people are giving skype such a bad time. they have been quite honest (technically) about what happened - a bug got exposed by some really really extreme workload. Also, whoever thinks that they should have "modeled" this has no idea how hard it is to develop distributed systems. It's a fine ideal to have, but in practice it is ridiculously hard to achieve. Especially as the code evolves. What you need is the same code base being able to run on a real TCP/IP stack and in a simulated environment. This looks easy in the abstract, but it's really tricky to do in practice.

</comment><comment><AUTHOR> <quote>receiving a routine software update</quote>

Sounds like they're pointing the finger at microsoft to me.

<comment><USER5> Sometimes "a routine software update" means "not a routine software update."

</comment></comment><comment><USER6> This is going to serve as a lesson on how not to communicate a screw up to your customers in the modern age.

What could have simply been, "we screwed up, we're sorry" is now going to be talked about not only in terms of the event, but the poor communication strategy.

tsk tsk skype.

</comment><comment><USER7> In other news, Microsoft announces a new peer-to-peer telephone network!</comment>


Boston Dynamics Big Dog Weaponized. Now in Trials with Marines. - <AUTHOR> http://www.defenseone.com/technology/2013/11/massive-robot-could-soon-join-marines-battlefield/74285/

<comment><USER2> Badly editorialized title. Big Dog has not been weaponized.

<comment><USER3> From the Boston Dynamics YouTube channel:

BigDog Weaponized - [http://www.youtube.com/watch?v=ptyV1cpE14o](http://www.youtube.com/watch?v=ptyV1cpE14o)

BigDog throwing cinderblocks - [http://www.youtube.com/watch?v=2jvLalY6ubc](http://www.youtube.com/watch?v=2jvLalY6ubc)

It's only a matter of time before it gets a machine-gun or grenade launcher attached.

<comment><USER2> Sure, and on that day someone will write a story with that headline. As of today, it isn't and the HN title is wrong.

<comment><USER3> If you run over someone with a vehicle then you are using your vehicle as a weapon, same with throwing a cinderblock or having BigDog kick an enemy.

My point was that the headline was technically correct.

I'd be willing to bet that they're absolutely not allowed to show the BigDog or a similar animal-like robot with a machine-gun mounted to it. That's why there was the "teaser" video with the bull horns.

Numerous robots have had machine-guns and grenade launchers attached to them, it would be trivial to attach one to the BigDog platform.

It would be cool to use as a distraction as well. If the BigDog was heavily armored and sent out to draw fire. If the BigDog ran up to an enemy and kicked them or threw a cinderblock at them, that would be a pretty effective weapon (from a psychological and physical standpoint), with no gun required.</comment></comment></comment></comment>


Cap'n Proto 0.8: Streaming flow control, HTTP-over-RPC, fibers - <AUTHOR> https://capnproto.org/news/2020-04-23-capnproto-0.8.html <comment><USER2> Kenton,

THANK YOU for not only designing Cap'n Proto but also continuing to work on it.

Before today, I had slight concern that in the face of Sandstorm, Cap'n Proto would fall in priority. Perhaps Cloudflare Workers are now making a great case for it?

My usecase has been Cap'n Proto w/ Python. Being able to do RPC is icing on the cake.

I will be looking into streaming fields of entities (classes) soon - the idea being decentralized microservices have local knowledge on how to transform and output a field and other modules/microservices just reach out to them and ask for the same.

A silly question: do you forsee any issues getting Cap'n Proto 0.8 to work over a completely locked down Docker environment that only allows HTTPS proxy as the connection between nodes that use Cap'n Proto RPC?

PS: Thoughts on why Cap'n Proto did not win over MessagePack? MessagePack had a better JS implementation? Is it the convenience of not needing to define a schema when using MessagePack vs Cap'n Proto schema requirement?

<comment><AUTHOR> > A silly question: do you forsee any issues getting Cap'n Proto 0.8 to work > over a completely locked down Docker environment that only allows HTTPS > proxy as the connection between nodes that use Cap'n Proto RPC?

If it supports WebSocket, it should be relatively easy to layer Cap'n Proto RPC on top of that. Alternatively, some proxies allow full-duplex HTTP (request and response bodies streaming simultaneously), which could also be enough to bootstrap a connection on top of -- but in practice that tends to run into a lot of problems.

Otherwise, that's tough. HTTP is fundamentally a one-way, FIFO request- response protocol, whereas Cap'n Proto is multi-directional and asynchronous. Starting a separate HTTP connection for each call -- with connections initiated in both directions -- would be pretty ugly and have lots of issues with synchronization and routing.

> PS: Thoughts on why Cap'n Proto did not win over MessagePack? MessagePack > had a better JS implementation? Is it the convenience of not needing to > define a schema when using MessagePack vs Cap'n Proto schema requirement?

I don't really consider MessagePack a direct competitor to Cap'n Proto. It's more of a competitor to JSON. Schema-driven vs. non-schema-driven changes everything about how you use a serialization.

A more apples-to-apples comparison in Protobuf. Protobuf is much more popular for a simple reason: It has had a lot more engineering investment, leading to mature implementations in more languages and lots of great tooling that capnp doesn't have (yet). No amount of clever design can beat that.

<comment><USER3> > If it supports WebSocket, it should be relatively easy to layer Cap'n Proto > RPC on top of that.

How would the new streaming functionality be implemented over WebSockets? WS has no flow control. You can check bufferedAmount but I found it to be fairly useless[0]. Maybe it's improved in the last 1.5 years or I was using it wrong.

> HTTP is fundamentally a one-way, FIFO request-response protocol, whereas > Cap'n Proto is multi-directional and asynchronous. Starting a separate HTTP > connection for each call -- with connections initiated in both directions -- > would be pretty ugly and have lots of issues with synchronization and > routing.

I think you could get a long way using HTTP/2 and server-sent events.

[0]: [https://github.com/websockets/ws/issues/492](https://github.com/websockets/ws/issues/492)

EDIT: added link to bufferedAmount issue

<comment><AUTHOR> > How would the new streaming functionality be implemented over WebSockets? WS > has no flow control.

Sure it does. WS is just a framing protocol on top of a regular TCP connection. Though it sounds like you're not talking about the protocol so much as the JavaScript API, which perhaps doesn't give you enough visibility into the underlying TCP socket state.

But a BBR-like algorithm could still work. Basically (massively oversimplified):

1) Determine the connection latency based on the fastest response you've seen.

2) Determine the connection throughput by tracking the highest throughput you've ever seen.

3) Set your window size to be a little bit more than latency * throughput.

This "should" saturate the connection with just a little bit of buffering. If it doesn't saturate the connection, then your measured throughput will go up until it does.

This way there is no need to ask the OS or browser to tell you how much is buffered...

Disclaimer: I have yet to actually implement something like this. Obviously, it gets tricky in the details.

<comment><USER3> > Sure it does. WS is just a framing protocol on top of a regular TCP > connection. Though it sounds like you're not talking about the protocol so > much as the JavaScript API, which perhaps doesn't give you enough visibility > into the underlying TCP socket state.

Every WS implementation I've ever seen is nonblocking on both sides. Are you aware of any that aren't? I'm not even sure the spec allows for that.

But yes you are correct that you can implement more advanced algos on top.

EDIT: Sounds like blocking implementations do exist, but unfortunately I'm constrained to a browser environment, and all the browsers are nonblocking.

<comment><AUTHOR> Heh. The WebSocket implementation I wrote for KJ does in fact provide backpressure (the send() method returns a promise that resolves when it's a good time to send the next message). I guess I'm surprised to hear that most don't...

<comment><USER3> I think it's more likely I've just been too deep in JS-land. Does KJ send() do any internal buffering, or wait for the OS to tell it to send more?

<comment><USER4> I've been looking into streams in detail recently because I'm preparing for the OpenJSF exam... maybe this is relevant to you too: [https://nodejs.org/es/docs/guides/backpressuring-in- streams/](https://nodejs.org/es/docs/guides/backpressuring-in-streams/)

<comment><USER3> Thanks for the link. I'm actually quite familiar with that article. It's been very useful for me when designing omnistreams. You may find some of the links on the bottom of this page useful:

[https://github.com/omnistreams/omnistreams- spec](https://github.com/omnistreams/omnistreams-spec)

</comment></comment></comment></comment></comment></comment></comment></comment></comment><comment><USER5> I'm using grpc/protobuf for the fact that it supports plenty of languages: C++, C#, Python, Dart, even Rust and others (Node, PHP, etc.). What is the state of CapnProto when comes to this? I've tried to look at the C# project, but the page was missing on github.

<comment><AUTHOR> Admittedly, this is a huge weakness of Cap'n Proto. The C++ implementation (which is the one I use and work on personally) is mature. There are pretty solid implementations in Rust and Go, too. But it falls off after that, with most implementations being serialization-only and at various levels of (im)maturity.

There's not a lot I can do about this. Cap'n Proto adoption doesn't directly drive revenue for anyone in particular, so I can't hire an army of engineers to throw at it... People who want better Cap'n Proto support in each language need to step up to help make it happen.

One thing I am looking at doing is making it easier for per-language serialization implementations to bind to the C++ RPC implementation. This might make a lot of sense, since the serialization implementations have wide APIs but shallow implementation details, while the RPC implementation is a pretty narrow API with very complex implementation. And it turns out Cap'n Proto messages are super-easy to pass between languages since the in-memory format is by design the same across languages -- passing around byte buffers tends to be pretty easy.

<comment><USER5> A big selling point for me, would be built-in IPC mechanism, instead of TCP, or UDP - be it mailslots (Windows), named pipes, shared files, etc. - does not matter. Now there are some projects that implement IPC over gRPC, but not part of the actual project.

Why I'm asking for this - for the simple reason - I don't want to deal with port allocation on a CI.

<comment><AUTHOR> Cap'n Proto works great over unix sockets. For sandboxing usecases in Sandstorm and Cloudflare Workers, I've commonly used it over anonymous socketpairs -- definitely no ports involved there. :)

In fact, you can adapt the RPC system to operate over any kind of byte stream transport pretty easily, by implementing the kj::AsyncIoStream interface. Or if you already have a standard file descriptor (or iocp-compatible HANDLE in Windows), you can use that.

One fancier thing that's still on the roadmap is shared-memory IPC. Cap'n Proto's zero-copy serialization was really built for this, but so far for all my real-world projects, Unix sockets have been fast enough, so I haven't been forced to full implement a shared memory transport yet. Maybe soon?

<comment><USER6> It's bit frivolous question, but would it be easy to use stdin/stdout as transport for capnp?

<comment><AUTHOR> Sure, you could do that. You'd need to write a little shim to bind separate input stream and output stream FDs into a single AsyncIoStream but that shouldn't be hard.

</comment></comment></comment></comment></comment></comment><comment><USER5> Kenton, have you looked into what Fuchsia is doing with FIDL? [https://fuchsia.googlesource.com/docs/+/ea2fce2874556205204d...](https://fuchsia.googlesource.com/docs/+/ea2fce2874556205204d3ef70c60e25074dc7ffd/development/languages/fidl/tutorial.md) (not sure if recent page, but good enough)

Just wondering about your opinion... Thanks!

<comment><AUTHOR> I've heard it mentioned but haven't had the chance to look closely.

</comment></comment><comment><USER7> I just want to say, I've been following Capn for a few years now, excellent work, keep it up! I feel it's a better architecture overall than protobuf and wish I had more time to contribute to the project.

<comment><AUTHOR> Thanks!

</comment></comment><comment><USER8> kenton, I admire your work on Cap'n Proto and Sandstorm.

Question about time traveling promises - I read the documentation, and it sounds to me like - taken to the logical extreme, that would effectively mean an interpreter - because at some point, you don't just want to use return values from one call as parameters in the other - you'd also want e.g. to build a one-network-roundtrip "create-if-not-exists" call from "exists(name)" and "create(name)", which would require the second call's _activation_ to be dependent on the first call's result (rather than its parameters) - which is just a small change.

But if you consider that, and error handling, and a few other relatively simple cases, you quickly end up with an informally specified, bug ridden, incomplete implementation of Emacs Lisp inside the RPC implementation.

So, my question is - where do you draw the line, and how do you decide to draw it? I don't believe there's a right answer, but I wonder about your philosophy.

<comment><AUTHOR> Indeed, the comments allude at this possibility (note the TODO):

[https://github.com/capnproto/capnproto/blob/77f20b4652e51b5a...](https://github.com/capnproto/capnproto/blob/77f20b4652e51b5a7ebda414e979e059a6c7c27c/c++/src/capnp/rpc.capnp#L1050-L1093)

But in practice, the only kind of "script" we support currently is following a chain of named fields followed by invoking a new RPC method, unconditionally, as in:

        fooResult = cap.foo();
        quxResult = fooResult.bar.baz.qux();

This seems to satisfy the vast majority of real-world use cases.

I would only add other operations if I identified some use case where it turns out to be a really big performance win. So far I haven't seen any.

</comment></comment><comment><USER9> Does anybody know if the Go implementation is still maintained? The author is unresponsive and there haveNot been any updates in quite a while.

[https://github.com/capnproto/go-capnproto2](https://github.com/capnproto/go- capnproto2)

<comment><USER3> There was a commit yesterday? But it does seem to have slowed down.

<comment><USER9> Go figure, just as soon as I post my concern to HN! Oh well, here's to hoping development picks up again :)

Edit: unfortunately the commit seems to be to a funding.yml. While I really can't afford to contribute myself, I hope someone does.

</comment></comment></comment><comment><USER10> Impressive work! I just wish it had a less awkward API for serialisation and deserialisation. Compare the Rust example for Capnp with Protobuf:

[https://github.com/capnproto/capnproto- rust/blob/master/exam...](https://github.com/capnproto/capnproto- rust/blob/master/example/addressbook_send/addressbook_send.rs)

[https://docs.rs/prost/0.6.1/prost/trait.Message.html#method....](https://docs.rs/prost/0.6.1/prost/trait.Message.html#method.encode)

(Ok I couldn't actually find an example for Prost because all you do is create a normal Rust `struct` and call `encode()` on it.)

<comment><USER11> Yeah, this is kinda the cost of not having an encode/decode step. The Haskell implementation (of which I am the primary author) provides a higher-level API with "normal" data types for cases where performance requirements aren't stringent enough to merit the extra burden on the developer. I'm mostly interested in RPC, so I rarely use the low-level API myself...

</comment></comment><comment><USER3> This is awesome. The new streaming stuff is particularly interesting to me, and it's very impressive that you managed to implement it with no protocol changes. I have a couple questions. Please forgive any misconceptions as I've never used capnproto myself, since all the streaming I've done has to work in the browser, and as far as I know capnproto doesn't work over WebSocket or WebRTC transports. But I've long been impressed with and inspired by capnproto and sandstorm.

Main question: is there a reason you opted for traditional window flow control a la TCP, as opposed to "request-N" style like in reactive streams[0] (see rsocket[1] for a great implementation)?

So with request-N, a server->client stream would look something like this:

interface MyInterface {

      streamingCall @0 (callback :Callback) -> (requester :Requester);

      interface Callback {
        sendChunk @0 (chunk :Data) -> ();
      }

      interface Requester {
        request @0 (n :int) -> ();
      }

}

And the server will only ever send as much data as has been requested by the client with requester calls. This results in really elegant flow control that takes into account both the network, and the client's capacity to consume, without the necessity of tracking windows. The receiver simply calls request(1) each time it processes a message. If you want a buffer you can just start with an assumed N=10, 100 etc.

I've found this worked really well when implementing omnistreams[2], which is basically a very thin streaming/multiplexing layer for WebSockets, since WS doesn't have any flow control. (fibridge[3] is a good example of it in action). I started with a window-style but once I learned about reactive streams the request model was much easier to reason about for me.

[0]: [https://github.com/reactive-streams/reactive-streams- jvm](https://github.com/reactive-streams/reactive-streams-jvm)

[1]: [https://github.com/rsocket/rsocket](https://github.com/rsocket/rsocket)

[2]: [https://github.com/omnistreams/omnistreams- spec](https://github.com/omnistreams/omnistreams-spec)

[3]: [http://iobio.io/2019/06/12/introducing- fibridge/](http://iobio.io/2019/06/12/introducing-fibridge/)

<comment><AUTHOR> Hmm, to me, what you describe still sounds window-based, it's just that the receiver chooses the window size. The question then is: _how_ does the receiver decide on a good size? If it chooses a window that is too small, it won't fully utilize the available bandwidth. If it chooses one too big, it'll create queuing delay.

This is a very hard question to answer and many academic papers have been written on the subject. But the strategies I thought about seemed easy enough to compute on the sender side, and the sender is the one that ultimately needs to know the window size in order to decide when to send more data.

But I can totally imagine that there are applications where the receiver knows better how much data it wants to request at a time. You can, of course, use a pattern like you suggest to accomplish that, without any help from the RPC system.

Regarding WebSockets, you could totally make Cap'n Proto RPC run over WebSocket. It wouldn't even be much work to hook up the C++ RPC implementation to KJ's HTTP library which supports WebSocket. The harder problem is that there isn't currently a JavaScript implementation of capnp RPC... :/

<comment><USER3> > If it chooses a window that is too small, it won't fully utilize the > available bandwidth. If it chooses one too big, it'll create queuing delay.

Yeah, that's a valid concern, and one I've run into in practice.

It's true that in environments where the server has access to TCP socket information, traditional windowing will have an advantage for performance. You may even be able to do some sort of detection as to how saturated the interface is from other processes.

As I see it the main advantage of the pull-based backpressure I described is the simpler mental model, making it easier to reason about and implement. So in environments with limited system information for the sender (ie WebSockets, which knows basically nothing about how full the buffers are), you don't have to pay the extra complexity cost with no benefit.

<comment><AUTHOR> Hmm, but if the puller doesn't actually know what value of `n` is ideal, then what benefit is there to a pull-based model vs. having the pusher choose an arbitrary `n`?

<comment><USER3> The network isn't the only resource in play. The puller is hypothetically more aware of the size of it's buffers, processing capacity, internet connection speed, etc. But again, to me the primary advantage is the mental model. For omnistreams the implementation ended being almost the same as the ACK-based system I started with, but shifting the names around and inverting the model in my head made it much easier to work with.

<comment><AUTHOR> Fair enough.

FWIW, Cap'n Proto's approach provides application-level backpressure as well. The application returns from the RPC only when it's done processing the message (or, more precisely, when it's ready for the next message). The window is computed based on application-level replies, not on socket buffer availability.

My experience was that in practice, most streaming apps I'd seen were doing this already (returning when they wanted the next message), so turning that into the basis for built-in flow control made a lot of sense. E.g. I can actually go back and convert Sandstorm to use streaming without actually introducing any backwards-incompatible protocol changes.

<comment><USER3> Ah I think I misread the announcement to mean you were using the OS buffer _level_ information. But if I understand correctly you're just using the buffer _size_ as a heuristic for the window size, then doing all the logic at the application level?

If that's the case, then implementation-wise these approaches are probably very similar, and window/ACK is the normal way of doing this, and also the pragmatic approach in your case.

<comment><AUTHOR> Yep. I probably should have gone into more detail on that, and about the problem of slow-app-fast-connection. Oh well.

<comment><USER12> I would hope you'd be amused by: [https://blog.apnic.net/2020/01/22/bufferbloat-may-be- solved-...](https://blog.apnic.net/2020/01/22/bufferbloat-may-be-solved-but- its-not-over-yet/)

and I am curious if you have considered a fq_codel-like approach to message queuing? Sending a whole socketbuf kind of scares me.

</comment></comment></comment></comment></comment></comment></comment></comment></comment><comment><USER13> I'd really like to read an experience report of using the promise pipelined / time-travelling RPC mechanism in production.

</comment><comment> xyz-x For me, new to cap'n'proto, this blog post doesn't cut the mustard because of multiple red flags:

\- to start, it's self-congratulatory at stating that streaming already exists "[via] promise pipelining" — but that has a name, it's called polling, not streaming. Making asynchronicity explicit doesn't make a protocol streaming.

\- in the same paragraph an "object-capability model" is introduced as a concept, but not explained

\- second paragraph: "think of this like providing a callback function in an object-oriented language", when it should be "in a functional programming language" (callbacks aren't OOP, they are per definition functional programming)

\- second paragraph, vocab: what's a "temporary RPC object"? Contrary to the precise, albeit unexplained vocabulary, in the first pragraph, this is vague.

\- creating examples with "MyInterface" being the service shows a lack of creativity and a rather low ability to communicate; is this service on the server side, or the client side? Noone knows, and "Callback" is not a good name for a callback, it should be "SendEmailWithData" or something that makes sense.

\- `sendChunk @0 (chunk :Data)` doesn't make sense to a beginner without explaination; what's `@0` and why do I care?

Here's what made me write this comment despite the threshold annoyance in commenting:

\- Why name a _message_ , `Data` when it's clearly NOT a chunk of data in layer-3/layer-4, but rather a layer-7 artifact with retries and checksumming implemented to ensure complete and accurate message delivery?

Finally, the articles goes on and discusses control flow via a proxy variable; your OS'es TCP send buffer size. But the linked Wikipedia article states:

> because the protocol can only achieve optimum throughput if a sender sends a > sufficiently large quantity of data before being required to stop and wait > until a confirming message is received from the receiver, acknowledging > successful receipt of that data

Which is not the case for Cap'n'Proto (admittedly it states it uses a hack). And there's no discussion of end-to-end problems like BufferBloat, which are very hard to solve by only looking at your own buffer [https://en.wikipedia.org/wiki/Bufferbloat#Solutions_and_miti...](https://en.wikipedia.org/wiki/Bufferbloat#Solutions_and_mitigations) — or even the semantics of "blocking on server's return value" (Is it enough for the receiving process to have the message in memory? The type system showcased seems to tell that story)

The article also doesn't state how a simple RPC call works. Going to [https://capnproto.org/rpc.html](https://capnproto.org/rpc.html) immediately puts me off by inventing "time travel", calling it "promise pipelining" and showing an impossible trace diagram (you can't have messages go backwards in time).

But when explaining it, it's really RPC message coalescing and compile-time reference indirection, from the promise to the underlying object instance as it is after executing the coalesced message pipeline. However, even when using the example of a file system (which is about as exception-intense as you can imagine), exceptions are ignored.

Looking through the Calculator example ([https://github.com/capnproto/capnproto/blob/master/c++/sampl...](https://github.com/capnproto/capnproto/blob/master/c++/samples/calculator- client.c++)) it turns out they haven't actually performed the compile-time indirection, but actually block the calling thread like any random do-it- yourself-RPC framework out there.

What a RPC framework should do is give you:

\- an extremely clear serialisation model that is outside of the framework

\- a clear API

\- clear garantuees / invariants on how it manages the complexities of network programming

In short: it must be very clear in what it promises. Cap'n'proto is not.

<comment><AUTHOR> Wow ok... lots of incorrect assumptions here. Just for fun let's address some of them.

> but that has a name, it's called polling, not streaming.

It's not polling. The idea is that the callback is called multiple times to send all the chunks, for one invocation of `streamingCall()`. Sorry if that wasn't clear.

BTW, Promise Pipelining is only involved in the client -> server streaming example.

> \- in the same paragraph an "object-capability model" is introduced as a > concept, but not explained

> \- `sendChunk @0 (chunk :Data)` doesn't make sense to a beginner without > explaination; what's `@0` and why do I care?

> \- second paragraph, vocab: what's a "temporary RPC object"? Contrary to the > precise, albeit unexplained vocabulary, in the first pragraph, this is > vague.

This is a news post about a new release of an existing tool. You're expected to be familiar with the tool already, or if you are not, you can go read the rest of the web site to learn about it.

> \- second paragraph: "think of this like providing a callback function in an > object-oriented language", when it should be "in a functional programming > language" (callbacks aren't OOP, they are per definition functional > programming)

As others have pointed out, you are taking a very superficial and literalist definition of OOP and FP. That said, I should have said "callback object", because that's what the example actually illustrates.

> is this service on the server side, or the client side?

Cap'n Proto is a peer-to-peer protocol, not a client-server protocol. Either side can export interfaces and either side can initiate calls.

> \- Why name a message, `Data` when it's clearly NOT a chunk of data in > layer-3/layer-4, but rather a layer-7 artifact with retries and checksumming > implemented to ensure complete and accurate message delivery?

`Data` is a basic data type in Cap'n Proto. It means an array of bytes. You can use any other type here if you want, it's just an example.

> > because the protocol can only achieve optimum throughput if a sender sends > a sufficiently large quantity of data before being required to stop and wait > until a confirming message is received from the receiver, acknowledging > successful receipt of that data

> Which is not the case for Cap'n'Proto

What is "not the case"? The whole point of this streaming feature is to do exactly what's described in your Wikipedia quote.

> And there's no discussion of end-to-end problems like BufferBloat

BufferBloat is mentioned several times in the post (though I called it "queuing latency", describing the symptom rather than the cause).

> Going to [https://capnproto.org/rpc.html](https://capnproto.org/rpc.html) > immediately puts me off by inventing "time travel", calling it "promise > pipelining" and showing an impossible trace diagram (you can't have messages > go backwards in time).

"Time travel" and "infinitely faster" are obviously tongue-in-cheek claims.

> However, even when using the example of a file system (which is about as > exception-intense as you can imagine), exceptions are ignored.

They are not ignored. Exceptions propagate to dependent calls. So if you send a chain of pipelined calls and the first call throws, all the later calls resolve by throwing the same exception. Eventually the caller waits for something and discovers the exception.

> it turns out they haven't actually performed the compile-time indirection, > but actually block the calling thread

No, the calling thread does not block.

> like any random do-it-yourself-RPC framework out there.

Haha yeah that's me, just some amateur that knows nothing about network protocols...

<comment> xyz-x > it turns out they haven't actually performed the compile-time indirection

Here's how much monadic control flow he actually has in Cap'n Proto: [https://github.com/capnproto/capnproto/blob/77f20b4652e51b5a...](https://github.com/capnproto/capnproto/blob/77f20b4652e51b5a7ebda414e979e059a6c7c27c/c++/src/capnp/rpc.capnp#L1081-L1090) — nothing except fields. Gut feeling was correct then.

[https://news.ycombinator.com/item?id=22972728](https://news.ycombinator.com/item?id=22972728)

<comment><AUTHOR> No, that part of the protocol defines mobile code -- code which an RPC caller can ask the remote callee to execute directly on the remote machine. It's intentionally limited because Cap'n Proto is not trying to be a general- purpose code interpreter. Most RPC systems don't have this at all.

KJ Promises -- the underlying async framework that Cap'n Proto's C++ implementation is built on -- let you write arbitrary code using monadic control flow. But that arbitrary code executes on your own machine, not the remote machine.

<comment> xyz-x It doesn't have to have a turing complete interpreter; it just have to be provably terminating, and you can build most use-cases as an active message.

What I'm after with the monadic control flow are the error-cases; let's say you have

> music.getPlaylist(ps => ps.userId == > "u123").findTopSongs(10).enqueue(qInstance) => Result<C, Error>

it would be nice to see how this would be interpreted into an AST and executed as an active message on the server (receiver).

That said, I brought it up because the copy alluded to it. It's a great time sink to build an interpreter, even if it's only acting on a unit of work whose variant is strictly decreasing, just look at Linq-to-SQL and IQbservable<T> a decade ago.

> KJ Promises

Side note: another copy that greatly frustrates me, as I now try to find the docs on the above async stuff:

> Essentially, in our quest to avoid latency, we've resorted to using a > singleton-ish design, and singletons are evil [linked to a page that crashes > for HTTPS-everywhere users (me) with PR_END_OF_FILE_ERROR].

(Besides the broken link,) singletons are not always evil. I know you know this, I know the copy is tounge-in-cheek again and being ironic — BUT POE's LAW FOR CRYING OUT LOUD :D [https://en.wikipedia.org/wiki/Poe%27s_law](https://en.wikipedia.org/wiki/Poe%27s_law) — "Poe's law is an adage of Internet culture stating that, without a clear indicator of the author's intent, it is impossible to create a parody of extreme views so obviously exaggerated that it cannot be mistaken by some readers for a sincere expression of the views being parodied"

...so KJ Promises; I can't find that mentioned. I only find Promise Pipelining; but that must be your Op:s that allow for field traversal? The site has this copy:

> [RPC Page] With pipelining, our 4-step example can be automatically reduced > to a single round trip with no need to change our interface at all.

But I must be from another planet, because I really don't understand:

\- first you have a pretty decent design of files that mimic local files

\- now you instead showcase what rich messages look like, calling that a "[message?] singleton", linking to a broken site

\- path string manipulation exists in every standard lib, it's not something we implement

\- if someone wants to perform multiple ops on a file - let's say read a chunk of it * only Data needs to be resused for there to be no copies (contrary to the copy), but that's also a problem in the first decoupled example

      * often, almost always, when I read about what an RPC system can do, I'm not in the memory-management mind-set, so I don't care about re-allocating resources

      * caching is not a relevant solution, it's to the contrary; completely irrelevant in this context and it's detracting from understanding what you want me to understand

      * caches aren't error-prone when used right, like with immutable data, or read-through caches as transparent proxies can do, but all of this is beside the point

\- then there's a discussion about "giving a Filesystem" to someone, when it's really all in my program

      * hard-coding a path is out of scope; that's about engineering process, not about the software. You ask "But what if they [have] hard-coded some path", I answer "yes, so what?"

      * what if we don't trust them (our own code?) — no, it's not an AuthZ decision locally, it's remotely, so you want to be explicit about the error cases here, but there's nothing about it — instead the copy says "now we have to implement [authN authZ systems]" — but again, this has nothing to do with merging small interfaces into a larger interface; it's a problem even with the small interfaces

\- the section ends with the broken link and then the next section states "Promise Pipelining solves all of this!" — but noo, there's so much mentioned above, and the premise is unclear and I have no idea what exactly promise pipelining solves!

And then you go with the calculator example; but the file is large and I still don't know what "Promise Pipelining" means, where to look. I see a lot of construction of values going on and then a blocking wait (polling of the event-loop, but that's also not the point). There are so many bugs in that copy, that it's really hard to know where to start detangling it! With that copy, I would never in my life touch the underlying code! It should be fixed! (sorry, I'm getting into a state here, but that copy... wow)

And this is the kicker that seals the deal:

> Didn't CORBA prove

Ehm, WTF? Why not contrast with gRPC? But also, why not clarify the above first so I can use that understanding myself? If I'm _not_ a newbie at this, why do you mention CORBA? Do I look like the kind of person that would ask that question? It's demeaning to the reader.

And you mention object capabilities; that's a HUGE area of research, of which I've worked with no live system using it. But here it's casually mentioned, like building such as system is a walk in the park without explaining how.

\---

So here I am after another frustrated 40 minutes on the site, and I still haven't found the docs on KJ Promises.</comment></comment></comment></comment></comment>


Behold The Leaked TouchPad--HP's Response To The iPad  - <AUTHOR> http://www.fastcompany.com/1756751/behold-the-leaked-touchpad-hps-response-to-the-ipad

<comment><USER2> People are all over the Tweetie iPad interface. (Sliding stacked split views) The TouchPad email app isn't the only tablet app I've seen that uses that design. Along with pull to refresh, fast scrolling, flick for menu, and many other UX gems, the developer of Tweetie is a genius.

<comment><USER3> The three-column view dates back to NeXT, if I recall correctly. It's a great implementation of the three-column view on touch-based devices, but this is no different...

whoa, wait, the columns SLIDE OVER?! Wow...brilliant.

<comment><USER4> > _whoa, wait, the columns SLIDE OVER?! Wow...brilliant._

FWIW, that's how Reeder works on OSX (though Reeder is relatively new).

<comment><USER3> Only on iPad though, right? I have the iPhone version.

<comment><USER4> I'm referring to the desktop client which came a few months after the iOS version, I haven't used the iPad one myself.

</comment></comment></comment></comment></comment><comment><USER5> There is tons of smacktalk coming from HP on this. Is the confidence justified? WebOS has plenty of lovers, but iPad's a market share monster. Competition, still, is healthy.

<comment><USER6> I agree. Competition is healthy but I'm sick of companies trying to jump on a bandwagon just to scrape whatever profit they can. It's so uninspired. It does nothing but clutter the market with things we really don't need. Now, if HP were truly doing something new and innovative, that would be different. But all they're doing here is leaching and creating more trash for landfills.

<comment><USER7> Have you seen WebOS? I find it rather interesting and thinks its better for a tablet than iOS is.

<comment><USER8> Mostly what I'm seeing (watching the video) are what look like garbage- collection hitches, and instances where the demonstrator has to repeatedly hit the same spot on the screen to make something happen. It doesn't look anywhere near as smooth as a first-gen iPad. This stuff matters, as it turns out.

As for the rest of the demo, well -- shrug -- it looks like iOS. I tend to agree with the downvoted grandparent: bring something new to the table, or don't waste my time. My guess is that few people other than patent attorneys will end up making any money from this product.

<comment><USER9> The task switching is nothing like and far better than iOS. Unless you like that hacky double-tap home thing.

<comment><USER8> Well, no, the task-switching _UI_ is better than iOS, I do agree with that. It's perplexing that someone at Apple of all places thought the double-tap home thing was a good idea.

In any case, if someone at Apple were to load up on Red Bull and pizza and camp out in their office for a weekend, iOS's task-switcher could look and work exactly the same. They apparently believe they're doing it the right way now, though, for whatever reason.

</comment></comment></comment></comment></comment></comment><comment><USER10> Forget beating the iPad, let's start with the basics- does it beat the Playbook? Can it challenge the Galaxy Tab or other Android tablets?

</comment><comment><USER11> I was one of the people who waited in line for the Palm Pre on launch day, but I left for android after about a year because of the limited app selection. I've been extremely happy with android, but have always missed how WebOS does multitasking. I'm genuinely excited by the Touchpad and I hope that HP doesn't screw it up.

</comment><comment><USER12> Using your own platform with 2 Giants already out in the market is ballsy to say the least. Another way of putting it would be "not very clever". I'm going with the latter here. Unless WebOS is extremely innovative and porting an app from another platform to this is ridiculously simple, it's surely going to fail.

<comment><USER13> Two giants? I'm not sure which you mean. iOS, sure. Microsoft has been in tablets for years, and HP has shrugged them off, rightly as far as Windows goes. It will be interesting once they make a tablet size version of the Metro UI. RIM's PlayBook is just getting started, still waiting for an email client. Android is out, but it doesn't seem to be making much impact. Perhaps once it is good enough for Google to release the source for a wider range of hardware something interesting will come out.

So, the second place looks like it Is still up for grabs.

<comment><USER12> I was referring to Android

</comment></comment></comment><comment><USER14> In the email app demo, the controls at the bottom to hide/reveal the accounts and message lists are pretty nice.

</comment><comment><USER15> Keep chasin them taillights, everyone-else-but-Apple.</comment>


Ask HN: SaaS startup success stories - <AUTHOR> Hi,
Do you know good SaaS startup success stories? I would be interested in companies that first tried to build something for a few trusted customers, then opened up to the public.
A friend of mine needs some inspiration how this could work out for their idea.
Thanks! <comment><USER2> I built [https://SendToMyCloud.com](https://SendToMyCloud.com) with 3 customers in mind: myself (for my wedding guest's photos), a friend (for their wedding guest's photos), and my previous employer (an agency, to collect large files from nontechnical clients).

It's less of a startup than a lifestyle business, but it's done fairly well. My email is in my HN profile if you have any followup questions. Don't hesitate to get in touch!

</comment><comment><USER3> There are so many great SaaS microservices out there it can seem overwhelming and scary to think your idea is a good idea -- a solid plan is to create something that focus on a niche, initially. Gain traction with the 2% -- expand and market to the 98% when able.</comment>


The Diary of Samuel Pepys - <AUTHOR> http://www.pepysdiary.com/ <comment><USER2> I have tried to keep a diary, or journal, in the past. Because, well, "you should." The average day would be "nothing to say." So I quit multiple times, and now I've quit starting.

But I wonder, if I have nothing to say, does that say something about my life? If the unexamined life is not worth living, is the unexaminable life even less so?</comment>


Show HN: I synced 1 million pixels in real-time on Android to make a MMO canvas - <AUTHOR> http://www.neelmango.com/onemillionpixels

<comment><AUTHOR> Some technical details: The backend runs on Google App Engine. The server keeps a concept of the 'freshest' canvas. I have a cron job that aggregates all pixel changes and creates a fresh canvas. When you download the app, you initially download the fresh canvas. After that, you only download a very small amount of JSON which represents the pixel changes.

</comment><comment><USER2> This is basically a rip off of [http://www.milliondollarhomepage.com/](http://www.milliondollarhomepage.com/)

<comment><AUTHOR> Yea, that's where I got the idea from. I wanted to improve it though. His system had people sending him entire images, and you had to go through him to pay.

In this app, you can control it pixel by pixel through in-app purchases, and you get 1,000 for free so you can actually participate without paying.</comment></comment>


Senate Approves Bill to Rein in N.S.A. Surveillance - <AUTHOR> http://www.nytimes.com/2015/06/03/us/politics/senate-surveillance-bill-passes-hurdle-but-showdown-looms.html <comment><USER3> I have read so many articles over the past week about various bills and efforts to further them or block them and I have no idea what's going on at this point. I still read this and do not understand.

> the Senate voted on Tuesday to curtail the federal government's sweeping > surveillance

> the passage... will lead to the reinstatement of government surveillance > efforts

Did we stop the surveillance? Did we continue it? Is this really going to do anything at all to change the culture of mass collection? Who is counting this as a win? Who is against this and who is for this?

<comment><USER4> Great questions. USA Freedom has some reforms, and shifts the collection to the telcos rather than the NSA. Then again it largely keeps the current regime in place (which makes it a win for the NSA), and it misses out on a lot of potential improvements. Some privacy and civil liberties organizations supported it; EFF and ACLU neither supported nor opposed it.

Unfortunately, more aggressive reforms -- like the Surveillance State Repeal Act -- weren't on the table; and there was a lot of concern that the Senate would further weaken it. So given the makeup of the House and Senate, passing the House version unmodified after a sunset was probably the best outcome. ACLU's Jameel Jaffer says "This is the most important surveillance reform bill since 1978, and its passage is an indication that Americans are no longer willing to give the intelligence agencies a blank check."

While the sunset doesn't actually have any long-term effect, IMHO it's still symbolically important: it meant that the usual tactics of "engineer a last- minute crisis" didn't work this time. And because of Rand Paul, it's actually going to be an issue in the GOP Presidential campaign -- which is huge. [Sanders voted against it as well, saying it was too weak.]

So on the whole I'd say it's a win for reformers ... a small win, admittedly, and tinged with disappointment that even after Snowden we couldn't do better. Still, it's a long term battle. And frankly it's been a while since we've had even a small win.

<comment><USER5> Its technically a win, but in reality its a victorious battle that has likely cost us the war. Now everyone who voted for this anemic pile of shit can go back to his/her constituents and brag about how they fought the tyranny of the NSA. This "victory" is going to prevent a more meaningful reform bill from gaining any traction in the future. Meanwhile, the NSA gets >99% of what they want.

<comment> tosser-004 What would be an acceptable level of data collection in your opinion? I've heard a lot about what people think is wrong, but what would the intelligence landscape look like if you had your way? Has the EFF stated what they would find acceptable?

<comment><USER6> I like the way it worked before the Patriot Act: want to search someone's property? Get a warrant. Want to tap someone's phone? Get a warrant. Want to collect whatever private information? Get a warrant with the target's name on it.

<comment><USER7> All of those things still require a warrant, and collecting call metadata has never required a warrant.

<comment><USER8> The NSA does not need a warrant to track people outside the USA which is more or less it's job. It can then trade that information with a foreign governments for there collection of US suspects without a warrant.

From 1946: [http://en.m.wikipedia.org/wiki/UKUSA_Agreement](http://en.m.wikipedia.org/wiki/UKUSA_Agreement) "For example, the British newspaper The Independent reported back in 1996 that the U.S. National Security Agency "taps UK phones" at the request of the British intelligence agency MI5, thus allowing British agents to evade restrictive limitations on domestic telephone tapping.[53]"

<comment><USER9> Can it actually do that?

<comment><USER8> The NSA can and has, the other side may have limitations. [http://techcrunch.com/2015/02/06/ipt-nsa-gchq- ruling/](http://techcrunch.com/2015/02/06/ipt-nsa-gchq-ruling/)

Note the actual judgement is linked on the bottom.

<comment><USER9> Sorry, I was imprecise.

I believe you that the NSA might provide intelligence to its partners about foreign nationals that those partners could not lawfully collect themselves.

I'm wondering if NSA can actually procure intelligence about US citizens from its partners.

<comment><USER8> It's a well established rule that private party's can hand the U.S. government information of there own free will without issue. The issue is the government can't request specific information, but a wink wink system of bulk data sharing should be perfectly legal.

Beyond that point, I have no idea if there is some exemption that lets them request specific information.

</comment></comment></comment></comment></comment></comment></comment></comment></comment></comment></comment><comment><USER10> The USA Freedom Act? Based on the Patriot Act should I assume it is the exact opposite of freedom?

From Wikipedia:

[http://en.wikipedia.org/wiki/USA_Freedom_Act](http://en.wikipedia.org/wiki/USA_Freedom_Act)

"According to supporters of the USA Freedom Act, the USA Freedom Act was meant to end the bulk collection of Americans' metadata by the NSA, end the secret laws created by the FISA court, and introduce a "Special Advocate" to represent public and privacy matters."

"The USA Freedom Act is perceived as containing several concessions to pro- surveillance legislators meant to facilitate its passage, such as extending the Patriot Act powers until 2019."

I'm so confused. Is this bill a good thing or a bad thing?

<comment><USER11> We should also stop calling these bills like "the patriot act", "USA freedom act" and replace the names with something like a unique identifier. That would remove some of the support from bills like the patriot act.

<comment><USER12> The USA Patriot Act is actually a ridiculous backronym: "Uniting and Strengthening America by Providing Appropriate Tools Required to Intercept and Obstruct Terrorism Act of 2001"

[http://en.wikipedia.org/wiki/Patriot_Act](http://en.wikipedia.org/wiki/Patriot_Act)

<comment><USER13> USA FREEDOM Act is similar, too.

</comment></comment></comment></comment><comment><USER14> The USA Freedom Act that passed the House and Senate extends the Patriot Act until December 31, 2017. This article is complete horseshit.

<comment><USER11> Not a surprise, given it is New York Times...

<comment><USER15> Not sure why this gets downvoted - the NYT has a terrible track record reporting about issues like this so it's a fair point.

<comment><USER16> "We give you access in exchange for favorable reporting", is the standard arrangement.

</comment></comment></comment></comment><comment><USER4> The Senate rejected all the amendments, and passed the same version of USA Freedom that the House did, so this round of legislative battles is over. Barring anything unexpected, the next fight is 2017 over FISA renewal.

[All the amendments they voted on would have weakened the protections. Paul and Wyden weren't allowed to introduce their amendments to strengthen it.]

</comment><comment><USER17> For all those confused about this, this is a mild victory. Certainly better than the Patriot Act, but not as strong a piece of legislation as it could have been. EFF writes their opinion of it here:

[https://www.eff.org/deeplinks/2015/05/usa-freedom-act- passes...](https://www.eff.org/deeplinks/2015/05/usa-freedom-act-passes-what- we-celebrate-what-we-mourn-and-where-we-go-here)

"Technology users everywhere should celebrate, knowing that the NSA will be a little more hampered in its surveillance overreach, and both the NSA and the FISA court will be more transparent and accountable than it was before the USA Freedom Act.

It's no secret that we wanted more.

...

Even so, we're celebrating. We're celebrating because, however small, this bill marks a day that some said could never happen—a day when the NSA saw its surveillance power reduced by Congress. And we're hoping that this could be a turning point in the fight to rein in the NSA."

<comment><USER14> The USA Freedom Act extends the Patriot Act until December 31, 2017. It seems like nobody, not even the EFF, read the actual legislation.

</comment></comment><comment><USER18> A weak bill that does little or nothing to properly stymie the torrent of civil liberties intrusions. Much stronger legislation is needed. At least Rand Paul's efforts produced a symbolic if temporary rebuke of Patriot Act powers.

<comment><USER19> > Much stronger legislation is needed.

Make sure you let your legislators know this via a phone call or written (not email) comunication. Might not change things overnight, but it's pretty easy to do.

<comment><USER20> Some would argue it won't make much of a difference what the public thinks:

[http://scholar.princeton.edu/sites/default/files/mgilens/fil...](http://scholar.princeton.edu/sites/default/files/mgilens/files/gilens_and_page_2014_-testing_theories_of_american_politics.doc.pdf)

<comment><USER19> If you don't do anything, it will _certainly_ not make a difference.

</comment></comment></comment></comment><comment><USER13> Given that 215 had already expired, and (as I understand) that was the one thing in previously-existing authorities that USA FREEDOM Act restrained a bit (while expanding others), is it accurate to say that USA FREEDOM Act actually reins in anything? Or would it be more accurate to say it is a pure expansion of surveillance powers?

<comment><USER21> Compared to yesterday, it is an expansion of surveillance authority.

Compared to May 30th, it is a slight contraction of surveillance authority.

</comment></comment><comment><USER22> The title of this article would suggest that there is a delta between where we are now and where we are after the bill. Is there a material difference in the way NSA will behave after the bill? Are surveillance powers any weaker if they can still query CDRs from operators?

Isn't this, on some level, a subsidy to ATT, Verizon, T-Mobile and Sprint?

<comment><USER23> At least now we get to see the invoice. Don't imagine that Room 641A was set up for free.

<comment><USER24> I actually wouldn't be surprised if it were.

"Hey $ATT_EXECUTIVE - see what happened to [Qwest's CEO] Joe Nacchio? Good. Now go splice me some fiber or you'll be joining him."

<comment><USER23> I would be surprised. Both Ma Bell and the clandestine service are always looking for ways to move more money in more directions. A typical scenario: from NSA to some secret shell company, from there to ATT for the project, from there to a favored systems integrator to run the project, from there to the agent-in-charge's nephew for unspecified services, from there back to the shell company, etc.

</comment></comment></comment></comment><comment><USER25> "The passage of the measure, achieved after a vigorous debate on the Senate floor, will lead to the reinstatement of government surveillance efforts"

What the heck does this mean? Should the title of the article read "Senate votes to keep the NSA doing almost exactly the same thing?"

</comment><comment><USER26> Ars Technica's coverage of the same event carried a slightly different headline:

[http://arstechnica.com/tech-policy/2015/06/let-the- snooping-...](http://arstechnica.com/tech-policy/2015/06/let-the-snooping- resume-senate-revives-patriot-surveillance-measures/)

</comment><comment><USER27> This is hilarious in a gallows humor kind of way.

They get articles trumpeting that they "did away" with Section 215, they get articles claiming they "reigned in" Surveillance by passing a new bill.

The reality is nothing changed for all this theater, its just been dressed up in different clothes to put the bad publicity behind them.

</comment><comment><USER28> Such doublespeak in the title of this article.

<comment><USER29> Fitting for this bill named FREEDOM.

</comment></comment><comment><USER30> Headline should be "Senate Approves Bill to Reinstate most of NSA Surveillance"

<comment><USER31> Nytimes is as close to state-run media as there can be under our microkernel government.

As to our brief respite from one small part of tyranny: [https://news.ycombinator.com/item?id=9642843](https://news.ycombinator.com/item?id=9642843)

<comment><USER32> > microkernel government

Hah. I wish. In reality, it's more of a modular monolith than a proper microkernel.

<comment><USER31> The nominal government has ballooned in size, but the whole power structure is still a microkernel architecture. How many aspects of your daily life are determined by insurance companies and private rulemaking bodies? Nothing can get through congress unless it benefits some special interest, illustrating that most power is outside of USG itself, as it is held by capital. Even large scale policy is set by prominent universities that prevail through attrition by repeatedly broadcasting "the way it's going to be". None of these things are accountable to the voters, even if democracy actually worked.

<comment><USER32> That's not a microkernel you're describing. That's a modular monolith with malicious drivers (read: lobbyist-influenced legislators) you're describing. In a microkernel government, said legislators would be running in userspace, and therefore not have a direct influence on kernel-space policies like they do now.

The only way our government could possibly be described as a "microkernel" is if it's a microkernel _a la_ AmigaOS, where memory protection is virtually nonexistent (at least in the early versions).

<comment><USER31> Our disagreement is a matter of perspective on where the real power lies.

> _legislators would ... not have a direct influence on kernel-space policies_

They don't. The kernel is not the federal government, which is but one group of (albeit somewhat privileged) processes. The kernel is economic control, which is why I pointed out that most of your daily life is shaped by non- government processes.

<comment><USER32> Then we're not talking about a microkernel _government_ , but instead talking about microkernel _socioeconomics_.

If we stick to the former case, though, then it's not accurate to say that the economy is the kernel of this hypothetical operating system. The federal government very much is; just because it's susceptible to a multitude of security-related bugs doesn't mean that it's no longer the kernel, much like how just because the NT kernel is susceptible to a multitude of security- related bugs doesn't mean that it's no longer the kernel.

<comment><USER31> As I said, different perspectives on the power relationship between USG and megacorps.

It's like someone used a security bug in NT to load a hypervisor. You could say that NT was still "the kernel", but most of the important stuff goes on outside of it.

</comment></comment></comment></comment></comment></comment></comment></comment><comment><USER33> Thanks Facebook, Google, Apple, Twitter, Microsoft, Yahoo and friends for being on the wrong side: [https://www.reformgovernmentsurveillance.com/](https://www.reformgovernmentsurveillance.com/)

From take action with Google: "Senator __* said YES to USA Freedom. Say thank you and show your support. " "Thank your Senator now for saying YES to the USA Freedom Act."

Freedom Act (Patriot Act v 2.0.. Same author: Rep. Sensenbrenner) must be vetoed... Someone please start a change.org thing, or whatever.

Freedom Act is going to require everyone to keep records for the NSA... Simple fix for the no funding problem... "No datacenter, no problem; we'll use yours"

Do not sacrifice your privacy for security.

<comment><USER32> > Do not sacrifice your privacy for security.

Note that "security" is (or ought to be) in massive finger-quotes here. Bulk data collection like this is actually a liability in terms of data security, not an asset, due to being a large target for attack.

</comment></comment><comment><USER34> I honestly can't tell from the article if this is a good thing or a bad thing.

<comment><USER35> It's a bad thing. Also, you shouldn't trust the Times on issues like this. And I wonder why, of all the available articles, the Times was the one chosen to be submitted here on HN.

Anyway, just read ArsTechnica reporting:

* Let the snooping resume: Senate revives Patriot Act surveillance measures [http://arstechnica.com/tech-policy/2015/06/let-the-snooping-...](http://arstechnica.com/tech-policy/2015/06/let-the-snooping-resume-senate-revives-patriot-surveillance-measures/)

* How the end of Patriot Act provisions changes NSA surveillance [http://arstechnica.com/tech-policy/2015/06/how-the-end-of-pa...](http://arstechnica.com/tech-policy/2015/06/how-the-end-of-patriot-act-provisions-changes-nsa-surveillance/)

</comment></comment><comment><USER36> Link to the bill text: [http://thomas.loc.gov/cgi- bin/query/z?c113%3AH.R.3361%3A](http://thomas.loc.gov/cgi- bin/query/z?c113%3AH.R.3361%3A)

Section regarding bulk collection: [http://thomas.loc.gov/cgi- bin/query/F?c113:4:./temp/~c113LpL...](http://thomas.loc.gov/cgi- bin/query/F?c113:4:./temp/~c113LpLijo:e34262):

<comment><USER33> "The Government shall compensate a person for reasonable expenses incurred for producing tangible things"... Great! Thirty pieces of silver for everyone!

<comment><USER37> Oh come on. That's not an issue by itself, it's perfectly reasonable under proper oversight to require that someone turn over material evidence. That's never been controversial.

<comment><USER38> Well... the draconian _overreach_ of the third party doctrine, including the _in praxis_ requirement to backdoor services sold to the public, is and certainly has been controversial, as have tap and trace laws.

In fact, the only reason the Section 215 even had a sunset clause was because the legislature was so uncertain about the legislation that they wanted to put in an escape clause.

<comment><USER37> Fair comment.

</comment></comment></comment></comment></comment><comment><USER39> Thoughts on next steps at the end of the article:

"Senator Mike Lee, a Utah Republican, and Senator Leahy made it clear after passage that curtailing the phone sweeps might be only the beginning. The two are collaborating on legislation to undo a provision in the Electronic Communications Privacy Act of 1986 that allows the government to read the contents of email over six months old. House members and senators from both parties are already eyeing a section of the Foreign Intelligence Surveillance Act that they say has also been abused by the government.

"But opponents of the law said they imagined further fights going forward for their positions, too. Senator Susan Collins, Republican of Maine, said she and others would continue to seek reforms and oversight.

"'It's not the end,' she said."

</comment><comment><USER36> According to The Verge[0], Senator Wyden -- who I trust very much in these matters -- said the passage of this bill is "the most significant victory for Americans' privacy rights in more than a decade." That gives me some hope that this bill represents actual change.

[0]: [http://www.theverge.com/2015/6/2/8714651/senate-passes- usa-f...](http://www.theverge.com/2015/6/2/8714651/senate-passes-usa-freedom- act-nsa)

</comment><comment><USER40> The headline should read, "Senate Approves Bill to continue NSA phone surveillance."

</comment><comment><USER41> A Center for Democracy and Technology (CDT) press release about the bill: [https://cdt.org/press/victory-passage-of-usa-freedom-act- rei...](https://cdt.org/press/victory-passage-of-usa-freedom-act-reins-in-nsa- surveillance/)

which links to a great table explaining the difference between the house and senate bills: [https://cdt.org/insight/comparison-of-house-senate- versions-...](https://cdt.org/insight/comparison-of-house-senate-versions-of- the-usa-freedom-act/)

</comment><comment><USER42> I'm sure that when Snowden's revelations came out the first thing that happened is that the government created a new more hidden level that could not be touched by any retaliatory regulation. How could this happen? Does the legislation call out the NSA by name? If it does consider that maybe another agency is now doing it.

</comment><comment><USER43> Maybe but the FBI is taking over the spying role!

[http://hosted.ap.org/dynamic/stories/U/US_FBI_SURVEILLANCE_F...](http://hosted.ap.org/dynamic/stories/U/US_FBI_SURVEILLANCE_FLIGHTS?SITE=VACHA&SECTION=HOME&TEMPLATE=DEFAULT)

<comment><USER38> This isn't really right. The FBI does perform surveillance, but they aren't in charge of signals collection. The NSA is in charge of these capabilities - <USER2> also the protection of the Gov networks.

The FBI also spies, but it is not taking over the NSA's spy role.

They both spy. Neither is decreasing.

</comment></comment><comment><USER44> In other news NSA lawyers have changed the definition of 'domestic surveillance'. Seriously, that would be hilarious.

</comment><comment><USER45> Is there any reason to assume it'd stop anyway?

If it hadn't been approved, I doubt the real outcome would've been different.

</comment><comment><USER46> How long until there is a new fee on my phone bill to pay for the storage and retrieval cost of this?

</comment><comment><USER47> if the senate approved, does it mean surveillance was actually good for the nation's security ?

</comment><comment><USER48> so snowden can come home ?</comment>


Oracle v Google: Judge orders Ellison, Page to attend mediation - <AUTHOR> http://legalpad.typepad.com/my_weblog/2011/09/alsup-getting-creative-with-oraclegoogle-fight.html?utm_source=feedburner&utm_medium=feed&utm_campaign=Feed%3A+legalpad_feed+%28Legal+Pad%29

<comment><USER2> Isn't that like asking Bush to work things out with Osama in a roundtable meeting before going to war?

Seriously though, these software patent cases are getting ridiculous. I could see why a judge would have little patience to deal with one after another.</comment>


Top ten reasons to quit your job (doesn't talk about startups, but in general) - <AUTHOR> http://humanresources.about.com/od/whenemploymentends/a/quit_job.htm

<comment><USER2> I see #4,5,6,7,10 as pretty common problems.</comment>


Tech's most egregious violations of user privacy - <AUTHOR> https://www.axios.com/tech-user-practices-subscription-privacy-moviepass-12223fd0-b5f8-4e47-9fdb-03ead988516f.html <comment><USER2> Today was the news that Alibaba wants to share users social credit score with immigration authorities in foreign countries to prevent unreliable people from going abroad.

Is this bad enough or can we do worse?

</comment><comment><USER3> The last item in this list is really disappointing and gives the rest of the article a lot less credibility, which is too bad. Most of these are good examples of things that users should be outraged about - they are deliberate decisions made by companies or their employees to further their own interests on the backs of and at the expense of their users without their consent. While I'm no Amazon fan, I'm pretty convinced that the last example of an Alexa malfunction really was an unintended bug. Conflating the two types of situations makes it easy for people to write this off as biased.

<comment><USER4> Fair, however the fact that it's a totally unintended bug is what makes it all the more terrifying. In fact I would assume the Alexa team has been freaking out pretty hard about this because it has the potential to kill the entire market before it matures.

<comment><USER5> It's too late for that. Alexa is bundled in new Sonos units, and anybody with a Fire TV already has it.

</comment></comment></comment><comment><USER6> I don't understand the MoviePass one. It says it is difficult to cancel a membership because accepting TOS updates, which the app requires you to do when you open it, cancels the membership cancellation.

That's certainly bad, and is a strong sign of either maliciousness or an incompetent testing department--but I don't see how it is a _privacy_ violation.

</comment><comment><USER7> I've been reading stuff like that for years. But is there, somewhere, a thorough explanation of how these "stolen" data are actually used against us, how they are valued, by whom, etc. ? (I didn't look in Google). Not some ideological explanation ('cos we all understand that the data collection induces weakens us against big-corp), but concrete, such as "this advertiser has done this kind of (horror) stuff using that kind of google collected data". I ask 'cos advertising doesn't look that dangerous to many people; it doesn't have the blood of us customers on its hands.

<comment><USER8> > "this advertiser has done this kind of (horror) stuff using that kind of > google collected data"

Data collected by Facebook was used to radicalize USA population looking into their political preferences and organizing groups in the extreme of the spectrum.

Political ads were used to show lies like "Europe, is negotiating to open borders with Turkey" to people depending on their political orientation during the "Brexit" vote by also Russia.

Targetted ads by hostile countries without any electoral supervision are running amok in social networks as ads are private and personalized.

</comment></comment><comment><USER9> 'Improving user experience' is a dead giveaway of shady untenable behavior.

They want your data, but they don't want to be transparent about it. Why do highly paid highly educated people get a free pass to behave unethically? If you think users are 'idiots' why go to such lengths to deceive them.

You can just imagine the tyrant calmly responding to accusations of tyranny that it's to 'improve the citizens experience'.

<comment><USER10> Just last week I spent a day implementing a small new feature (I'm a web developer). Now that the feature has been published, I'd love to track how many users actually use it. To see if it was worth spending the time, whether we should make that feature available in more places etc. But I can't because we're forbidden to collect any sorts of data.

If I was allowed to collect data, as what should I frame it, if not "improving user experience"?

<comment><USER11> "User experiences" can also be "improved" by selling the usage data to advertisers for tracking.

How's about "Our site collects usage data to inform us about how our site is used. We use only this data to inform our feature development priorities and we do not share your data with anyone else. Thanks for coming to visit"

<comment><USER12> This reminds me that I like to mention that doing targeted ads that is actually good require a system specifically designed to do so.

</comment></comment></comment></comment><comment><USER13> The moviepass one is a bit silly. Not to defend them, but if you're gonna cancel a service you know is pretty shady, don't go and click accept. All those people should have deleted the app right away. It's kind of like deleting a Facebook account then logging back in.

<comment><USER14> >It's kind of like deleting a Facebook account then logging back in.

It's not like that, though. You pay for MoviePass up front each month. Cancelling means you don't want to pay for next month, but you are still able to use it for this month. Deleting the app would just be throwing money away.

They're exploiting users who want to get fair value from their existing purchase.</comment></comment>


QA job interview questions for managers to ask - <AUTHOR> https://www.functionize.com/blog/the-best-qa-job-interview-questions-for-managers-to-ask/ <comment><USER2> This smells of a marketing article shoved to the homepage. I'm not a fan of the trend I'm seeing of articles with little technical merit suddenly making it on the homepage next to legitimate technology pieces.

I'm not sure what HN can do about it and maybe I'm just cynical and people genuinely think this PR piece has good technical value and "How do you test a soda machine?" is a good QA question.

<comment><USER3> So what is?

<comment><USER4> He's right though, not even Paul Graham's blog gets 25 HN posts in 3 months.

</comment></comment></comment><comment><USER5> How the heck does this get onto the front page?

The top question is "What methodologies have you used?" \-- is this a joke? The answer will tell you nothing about the candidate's ability to do a good job.

This article is a waste of time.

<comment><AUTHOR> It says up front: Get the obvious questions out of the way (such as "what methodologies do you use") so you can put your attention on the ones that matter.

<comment><USER6> Why get them "out of the way" when you can just skip asking pointless questions?

<comment><AUTHOR> Because there ARE good reasons to ask job candidates about the skills they put on their resumes. Some people add the keywords to be buzzword-compliant. Others include a tool or technology in passing, as a summary of 5 years of work with it... and if it's important in your shop, it'e reasonable to ask about it. Find out whether "experienced with ToolName" means "I once started up the app" or "I can make it dance."

My resume barely mentions OS/2 anymore, because I'm unlikely to get a job that requires the knowledge. But if I happened to interview at a company where it mattered (perhaps for legacy tech) or where the interviewer shared an interest ("oh! something we can chat about!") then it's a reasonable topic of discussion.

Also, interviewees expect those questions. They can be a kind of throat clearing. That is... get 'em out of the way.

</comment></comment></comment></comment><comment><USER7> "Best Catch" and "One That Got Away" are the only good questions here, and "Best Catch" is the only one I ask every single time.

This is one of the most important question because it reveals the "soul" of the tester; the flavor of brokenness that excites them most.

For every once in a lifetime "you won't believe it, but..." answer there are dozens of boring "one time mysql went down on prod" answers. It's not a golden snitch or anything like that, but I find it to be indispensable in the interview process.

</comment><comment><USER8> Looks like another marketing article, empty of any insight.

<comment><USER9> Looks like HN should have used Functionize(r)(tm) to test their software to make sure this doesn't happen.

</comment></comment><comment><USER10> I am a developer who happen to also have to manage a QA team and found this article interesting to atleast ask some questions to get the interview warmed up. Otherwise I always struggled to find good questions to ask for a QA interview. Am sure if I had googled I might have found something- but I never did. This coming on the HN feed just removed that friction too for me to read!

</comment><comment><USER11> This is just blog spam.

</comment><comment><USER12> Had to triple check that this wasn't satire after reading the first two points. Focusing on familiarity with buzzwords and trendy tools is exactly the wrong thing to do.

</comment><comment><USER13> QA here. The article is decent for someone who has little to no experience in the field and wishes to know more about QA practices or processes.</comment>


Netflix faces European content quota - <AUTHOR> https://thestack.com/world/2016/05/19/netflix-european-commission-20-percent-content/ <comment><USER2> 20% is not that much. It's a sign that they are being "not shut out" as much as it is that they are being included.</comment>


Ask HN: Ideas for next iOS side project? - <AUTHOR>

I'm looking for my next idea for an iOS side project, my rule is generally something that can be created in a couple of weekends but has future scope for expansion. Thanks :) <comment><USER2> Find a subject matter you have a passion for, research the field of existing apps (because every genre is now saturated) and then make a better app.</comment>


Is the room open? - <AUTHOR> https://www.noudaldenhoven.nl/wordpress/?p=288 <comment><USER2> This problem has a nice array solution:

        q)where mod[;2] sum 0=til[500] mod/: til[500]
        0 1 4 9 16 25 36 49 64 81 100 121 144 169 196 225 256 289 324 361 400 441 484

        q){x*x} til ceiling sqrt 500
        0 1 4 9 16 25 36 49 64 81 100 121 144 169 196 225 256 289 324 361 400 441 484

but I think it's very interesting to look at them side by side: Do you see the "triangle" in the above that suggests the sqrt-solution?

        q)0=til[500] mod/: til[500]
        00000000000000000000000000000000000000000000000000000000000000000000000000000..
        11111111111111111111111111111111111111111111111111111111111111111111111111111..
        10101010101010101010101010101010101010101010101010101010101010101010101010101..
        10010010010010010010010010010010010010010010010010010010010010010010010010010..
        10001000100010001000100010001000100010001000100010001000100010001000100010001..
        10000100001000010000100001000010000100001000010000100001000010000100001000010..
        10000010000010000010000010000010000010000010000010000010000010000010000010000..
        10000001000000100000010000001000000100000010000001000000100000010000001000000..
        10000000100000001000000010000000100000001000000010000000100000001000000010000..
        10000000010000000010000000010000000010000000010000000010000000010000000010000..
        10000000001000000000100000000010000000001000000000100000000010000000001000000..
        10000000000100000000001000000000010000000000100000000001000000000010000000000..
        10000000000010000000000010000000000010000000000010000000000010000000000010000..
        10000000000001000000000000100000000000010000000000001000000000000100000000000..
        10000000000000100000000000001000000000000010000000000000100000000000001000000..
        10000000000000010000000000000010000000000000010000000000000010000000000000010..
        10000000000000001000000000000000100000000000000010000000000000001000000000000..
        10000000000000000100000000000000001000000000000000010000000000000000100000000..
        10000000000000000010000000000000000010000000000000000010000000000000000010000..
        10000000000000000001000000000000000000100000000000000000010000000000000000001..
        10000000000000000000100000000000000000001000000000000000000010000000000000000..
        10000000000000000000010000000000000000000010000000000000000000010000000000000..
        ..

Isn't that beautiful? This is really illustrative of what I think is valuable in learning array programming, and whilst I've noted it previously on HN[1], this might be an even better example. Try writing the algorithm in C or Python:

        void main(){
          int i,j,k;
          for(i=0;i<500;++i) {
            for(j=k=0;j<499;++j)if(!(i%(1+j)))++k;
            if(k%2)printf("%d ",i);
          }
          puts("");
        }

Now because I can't see the shape of the data so easily anymore, I might not so quickly recognise the optimisation waiting for me in that code, especially if this spanned more than a screenful (because e.g. we were doing something else besides printing the results)

[1]: [https://news.ycombinator.com/item?id=16851862](https://news.ycombinator.com/item?id=16851862)

<comment><USER3> Being pedantic, there is no room zero, so it should be 1 _ til 500.

<comment><USER2> You can try that, but it produces the wrong answer: "where" is still zero- based. You would also need 1+ i.e.

        q)1+where mod[;2] sum 0=(1_til 500) mod/: til 500
        1 4 9 16 25 36 49 64 81 100 121 144 169 196 225 256 289 324 361 400 441 484

...but this is not a huge bother for me: 0 mod 0 is 0N which doesn't equal zero, and I think the extra 1_ or 1+ distracts somewhat from the point I'm trying to make.

</comment></comment></comment><comment><USER4> Summary: There are 500 doors numbered 1, 2, ..., 500. All doors are closed initially. In iteration k, we toggle the states of doors k, 2k, ..., floor(500/k) * k where k runs from 1 to 500, inclusive. What doors are open in the end?

Only perfect squares have odd number of factors. All other natural numbers have even number of factors. Therefore, only the doors with perfect square numbers on them get toggled odd number of times and end up in states that are opposite of their initial states.

Python solution:

      >>> [k**2 for k in range(1, int(500**0.5) + 1)]
      [1, 4, 9, 16, 25, 36, 49, 64, 81, 100, 121, 144, 169, 196, 225, 256, 289, 324, 361, 400, 441, 484]

<comment><USER2> That's incorrect. Room 484 stays open.

Edit: I see you've updated your code susam.

<comment><USER5> 484 is a perfect square. (22×22)

Edit: I see you've updated your comment geocar.

<comment><USER2> 484 wasn't returned by the code susam originally posted.

Isn't it funny how a python one liner required two edits to produce the correct result? (The summary description still matches the old incorrect code)

<comment><USER6> > The summary description still matches the old incorrect code

The summary description matches the current correct code. So it could not possibly match any incorrect code (if it really existed).

<comment><USER2> > The summary description matches the current correct code. So it could not > possibly match any incorrect code.

Incorrect. Here's the summary reproduced (in case susam edits again):

>>> There are 500 doors numbered 1, 2, ..., 500. All doors are closed initially. In iteration k, we toggle the states of doors k, 2k, ..., floor(500/k) * k where k runs from 1 to 500

Note the "floor(500/k)" statement. That matched the original code fragment (and what is still sitting in a terminal on my laptop):

        >>> [k**2 for k in range(1, int(500**0.5))]

but not the new one which includes a +1. int(…) is floor. int(…)+1 isn't, and it's wrong: It works for 500, but not for other values. math.ceil would have been more correct, but it might've been more obvious that it doesn't match the "summary".

> (if it really existed).

Let me make sure I understand what you mean here: You actually think it more likely that my two implementations, written in a comment [1] with a lower timestamp than [2], and the perl6 implementation on the linked article all include 484 as part of the valid result, and yet my comment [2] that calls on this value specifically, was somehow meant to indicate that 484 is not part of the valid result?

Ha.

[1]: [https://news.ycombinator.com/item?id=22288534](https://news.ycombinator.com/item?id=22288534)

[2]: [https://news.ycombinator.com/item?id=22288554](https://news.ycombinator.com/item?id=22288554)

<comment><USER7> The +1 makes the range inclusive rather than exclusive. This matches the summary, which is inclusive of floor(500/k). Ceil wouldn't correctly handle the case where the number of rooms equals a perfect square. That is,

      [k**2 for k in range(1, ceil(484**0.5))]

does not return 484.

<comment><USER2> Quite right! So a 1+ is needed.

I can't amend my comment to that point, but the original comment didn't have +1 in there anyway.

</comment></comment></comment></comment></comment></comment></comment></comment><comment><USER8> Behold my enterprisey Java solution

public static void main2(String[] args) {

            final List<String> rooms = new ArrayList<>(Collections.nCopies(MAX_ROOM, "CLOSED"));
            int employee = 1;

            do {
                int roomIndex = employee - 1;
                do {
                    final String roomState = rooms.get(roomIndex);

                    if (roomState.equals(OPEN)) {
                        rooms.set(roomIndex, CLOSED);
                    } else if (roomState.equals(CLOSED)) {
                        rooms.set(roomIndex, OPEN);
                    }
                    roomIndex = roomIndex + employee;
                } while (roomIndex < MAX_ROOM);
                employee++;
            } while (employee <= MAX_ROOM);

            for (int i = 0; i < rooms.size(); i++) {
                if (rooms.get(i).equals(OPEN)) {
                    System.out.println("Room " + (i + 1) + " is OPEN");
                }
            }
        }

</comment><comment><USER9> Simpler explanation for why

perfect square <=> odd number of factors

Proof: For every divisor d of n, n/d is another, different, divisor. This gives a pairing of all the divisors. The only exception is if n/d = d.

The exceptional case n/d=d only happens when n=d^2, i.e. when n is a perfect square.

Thus, when n is not a perfect square, there is a pairing of all its divisors, hence the number of divisors is even.

If n is a perfect square, the pairing pairs up all the divisors except for sqrt(n). Thus the number of divisors is odd.

<comment><USER10> What about 27? It has an odd number of factors but isn't a perfect square.

I think your reasoning fails for x^y where y is an odd number > 1.

<comment><USER9> The factors of 27 are 1,3,9 and 27. That's four factors. That's why door 27 is closed at the end of the open/closing process - employees 1,3,9 and 27 touch the door and so the final state of the door is the same as the initial state of the door.

Maybe you are talking about the number of _prime_ factors. This quantity is irrelevant to door open/closing problem.

<comment><USER10> Aah you're right. Thanks.

</comment></comment></comment></comment><comment><USER11> This isn't really a one-liner "programming" solution. The author solved it by hand and then made the computer write out the solution.

<comment><USER12> You wouldn't _want_ a brute force solution to a problem that could be solved by hand. It's really the fault of the problem that no programming was needed to solve it.

</comment></comment><comment><USER13> PowerShell solution:

        1..[Math]::Sqrt(500) | %{$_*$_}

        1
        4
        9
        16
        25
        36
        49
        64
        81
        100
        121
        144
        169
        196
        225
        256
        289
        324
        361
        400
        441
        484

</comment><comment><USER14> I am getting:

Attackers might be trying to steal your information from www.noudaldenhoven.nl (for example, passwords, messages, or credit cards). Learn more NET::ERR_CERT_AUTHORITY_INVALID

from:digicert:

TLS Certificate is not trusted The certificate is not signed by a trusted authority (checking against Mozilla's root store). If you bought the certificate from a trusted authority, you probably just need to install one or more Intermediate certificates. Contact your certificate provider for assistance doing this for your server platform.

Beside of that http works and isnt room 3 only closed once and never opened or am I missing something

<comment><USER15> [https://www.ssllabs.com/ssltest/analyze.html?d=www.noudalden...](https://www.ssllabs.com/ssltest/analyze.html?d=www.noudaldenhoven.nl) says the site has an incomplete certificate chain.

I'm guessing that "Let's Encrypt Authority X3" isn't in your local keyring?

<comment><USER14> Seems like issue only on fedora even everything updated, debian test latest with chromium works fine: [https://pastebin.com/URBBUgSU](https://pastebin.com/URBBUgSU)

</comment></comment></comment><comment><USER16> [https://rosettacode.org/wiki/100_doors](https://rosettacode.org/wiki/100_doors)</comment>


Pryv is one of the first internal partners of Misfit Shine wearables - <AUTHOR>

<comment><AUTHOR> [https://twitter.com/pryv/status/507822445030408193](https://twitter.com/pryv/status/507822445030408193)</comment>


Ask HN: What is your oldest living public presence on the internet? - <AUTHOR> I'd love for people to share links to their oldest remaining presence on the internet - outside of archives.
For me it may be this review of an album released in 1998 by Wrapped in Wire magazine: https://www.wrappedinwire.com/V/Vojna.htm.
For this exercise, should Usenet on Google Groups qualify? That's difficult to say. It's "living" because you can still reply to it, but these messages are no longer part of the living Usenet. Here is a reply I wrote on Aug 9, 1998: https://groups.google.com/d/msg/rec.music.industrial/pseJluJPys4/dx5fvt8roXgJ.
If there is a legitimate timestamp for the link you share, that's even better. <comment><USER2> I have various posts available on archives dating back to 1994, possibly 1992, but not sure they qualify as "living". Certainly they exist and can be read.

 _Edit:_ OK, I've found a post on sci.math from 1993 to which you can apparently reply

 _Edit 2:_ OK:

Jul 1993: [https://groups.google.com/d/msg/sci.math/VfqtjzqD5vk/_I2qHiT...](https://groups.google.com/d/msg/sci.math/VfqtjzqD5vk/_I2qHiTdy9MJ)

Jun 1993: [https://groups.google.com/d/msg/sci.math/sM5obXgILLg/WSMskMV...](https://groups.google.com/d/msg/sci.math/sM5obXgILLg/WSMskMVRyR8J)

Apr 1993: [https://groups.google.com/d/msg/sci.math/pDjjVvQiQts/umBn0h2...](https://groups.google.com/d/msg/sci.math/pDjjVvQiQts/umBn0h2Fj78J)

<comment><AUTHOR> Indeed, there is some controversy, but many have identified this post as the 'oldest on the net' and couldn't resist the urge to reply: [https://groups.google.com/forum/#!msg/net.general/yJn8WHlzc7...](https://groups.google.com/forum/#!msg/net.general/yJn8WHlzc7U/lPyVdYqCXyAJ)

I guess it's motivated by the same urge people have when the decide to etch their names into the Colosseum in Rome.

</comment></comment><comment><USER3> The first time I used the internet was around summer of 1998 at the tender age of 6 years old, mostly to use instant messenger with my cousins. Well before that I also used WebTV to write emails, but anyway...

As for information written by me that is publicly preserved somewhere, I have a feeling that is actually a considerable amount of time later, likely around 2001 or 2002 when I started posting on random paintball forums, ebaumsworld forums, xbox forums. I'd also uploaded some videos on Putfile by that time.

So I guess it's time to celebrate my 20 year internet anniversary soon :)

</comment><comment><USER4> Ha, found this on the wayback machine: [https://web.archive.org/web/19990224155732/http://www.coastl...](https://web.archive.org/web/19990224155732/http://www.coastlink.com.au/cp/) A site a friend and I made for a popular local band in 1997. We loved music, and the internet gave us a reason to talk to all the bands we loved and see if they wanted one of these new-fangled web sites. It was awesome!

<comment><AUTHOR> That is awesome. It's too bad the Wayback Machine doesn't archive those .wav files from 1997.

</comment></comment><comment><USER5> Usenet seems like a good place to look, and I can go back to Dec 4, 1999 that way: [https://groups.google.com/d/msg/sci.math/r9pz4ScvUxg/x8p6V02...](https://groups.google.com/d/msg/sci.math/r9pz4ScvUxg/x8p6V028UA0J)

Someone named "Nathaniel Silver" replied, and I wonder if that's the political and sports forecaster or someone else of the same name.

<comment><AUTHOR> "Good job, Mike. Your post not only solves the problem but also makes the rest of the posters look like defensive hotshots."

Hah - don't mess with Nate.

</comment></comment><comment><USER6> Mine's probably this question (and fabulous answer) on sci.math.numerical- analysis in 1999

[https://groups.google.com/g/sci.math.num- analysis/c/2j8pg4NV...](https://groups.google.com/g/sci.math.num- analysis/c/2j8pg4NVIgs/m/j72ez9OgLzkJ)</comment>