premchai21's comments

premchai21 | 13 years ago | on: Refining Ruby

Among other things, MyModule.camelize doesn't provide an extension point for polymorphism. Consider a serialization library in which different classes should be able to have separate freeze/thaw behavior. It's possible to do this in current-day Ruby without easy collisions, but it tends to involve cumbersome manual prefixing or emulating method dispatch yourself.

Methods being namespaced in packages separately from the class hierarchy is something CLOS has that I miss in almost all the more Smalltalk-y languages.

premchai21 | 13 years ago | on: Tips for C libraries on GNU/Linux

fork() only leaves the one thread running in the child, and at that point the fd tables are no longer shared, so trying to detect and close unwanted descriptors in the child after fork is not racy by itself as a way of mitigating the possibility of uncontrollable non-CLOEXEC opens elsewhere in the process (though this doesn't preclude it being a bad idea for other reasons).

premchai21 | 13 years ago | on: Git push over XMPP

There's signed commits, yes. Is there also "apply these but only if they have a valid signature from one of these people"? That's what I didn't see.

premchai21 | 13 years ago | on: Git push over XMPP

Darcs's send and apply work on this principle, of course, though I haven't seen it applied to XMPP specifically. As I recall, the manual even has an example of how to add an easy hook in Mutt to apply a patch from email. git diff and git apply are available for single patches, of course, and git format-patch and git am are optimized for the mail case so that multiple commits can be sent at once, though darcs apply has integrated PGP signature checking and at a glance I don't see anything similar in the git versions. git-send-pack and git-receive-pack also have an underlying role not strongly coupled to the overlay transport, but seem to be designed for bidirectional communication so that the repositories can negotiate about which objects they already have.

premchai21 | 13 years ago | on: That'll Never Work

If you change it so that what feels "natural" to you is not what feels "natural" to everyone else, then you are in for a world of hurt when you find that all the resources you were relying on are no longer presented in a way that you're compatible enough to access.

premchai21 | 13 years ago | on: Ask HN: Got unexpected feedback - where do I go from here?

As it happens, I'm currently in a slow period and looking around for side projects that might lead to money. The other posters have some reasonable general ideas, but if you're willing to provide more detail, I can see whether it's the sort of thing that I'd be able to either help with or find someone else for—right now I can't determine enough from your post to say anything useful that hasn't already been said. You can send me email at my HN username at mailforce.net, if you wish. :-)

premchai21 | 13 years ago | on: OStatus: like Twitter, but open

I had not! That appears to work for now, though I'm not convinced it will continue working if Twitter continues going the way they are. For some reason that didn't appear in my search; thank you.

premchai21 | 13 years ago | on: OStatus: like Twitter, but open

Sure, but you have to be careful of the gradual lockdown effect as more people get involved. The handling of non-public information is a cross-cutting concern. If everyone builds their software and security models around the assumption that all posts are visible to everyone (because it's the common case, and they decided, just as you're saying, that supporting the common case was the most important thing), then going back later after everyone's gotten attached to the software and trying to add private multicast without any leaks can be a nightmare. No one will be able to use it because their friends won't be able to use it unless every piece of software in between makes it work.

I'm tempted to compare to how deploying new transport protocols over IP is nearly impossible for consumer clients now, because everyone's built NATs that assume TCP and UDP, because those were the common cases and therefore the important ones and now anything else is instantly hosed. It's a bit of a bad example, though, because in the case of transports there are other reasons as well.

premchai21 | 13 years ago | on: OStatus: like Twitter, but open

Well, let me clarify just in case: the “impossible” is an exaggeration, since they will eventually respond to things like email, but it's not enough to keep up. Many of the socially-important multicast messages only occur on Twitter. I've been meaning to subscribe to them with a local aggregator, since for those whose tweets are publicly visible that should be sufficient, but while my existing RSS links still work, I can't find any way to acquire new ones, so right now I'm reduced to manual polling.

premchai21 | 13 years ago | on: OStatus: like Twitter, but open

Does that really qualify as open-Web facilities, though? Is it “show it to these people”, or is it “show it to these Google Plus users”? The latter is not appreciably better than the LiveJournal case, for me, and in fact this provides a demonstration of the lock-in effect.

Here's another one: Dreamwidth runs an LJ-derived codebase, arguably an improved one (they had considerably better separation of “subscribe” and “authorize” last I checked, rather than a “friends list” that conflates these), and some of the people I contact on LJ have moved there, but they all have continuous crossposts back to the original LiveJournal, and if I moved there I think either no one would read anything I wrote, or else the comment streams would be so disjoined that I would be effectively a strange-looking LJ user anyway.

That last is also a concrete example of why nonexclusivity is not a complete solution. The resource that's being fought over is not where one can read but where a bunch of other people do read. If everyone views your content at Phuubaar's House of Crossposts, then if Phuubaar cuts you off, you are still hosed in the general case even if you provide the same stream somewhere else, because those users are not going to know about it or are going to find it too inconvenient to subscribe.

And the tooling around Atom and RSS aggregation all seems to be built around the idea that feeds are almost always public. I haven't had any success with the idea of creating a private Atom feed and expecting any of my friends to be able to read it. Either it'll require authentication, at which point the software usually won't be able to access it, or I can try to use a capability-URL style, at which point one of them will punch it into their favorite everyone-shares-everything social aggregator (Google Reader?) and then my (illusion of) confidentiality is gone.

This is terrible, and I don't know how to fix it.

premchai21 | 13 years ago | on: OStatus: like Twitter, but open

I have a large chunk of friends and acquaintances who now conduct their ongoing visible conversations with each other almost entirely on Twitter, many of whom have started becoming impossible to reach by other means.

They also have visible half-conversations with a similar number of other people whose tweets are “protected” so that only “confirmed followers” can read them. I don't see OStatus doing anything with the latter, and I don't think those people are going to move to public streams, and if they don't move, the other people interspersed with them won't move because it'll become impossible to talk to them. This is more or less the same reason I still reluctantly keep a LiveJournal: the open-Web facilities for “but only show it to these people” are severely lacking (and I haven't found a good way of doing anything about this yet).

There's also the issue of social networks including things that are de facto currency-like: “number of followers” on Twitter is an obvious one. In a distributed network these usually can be faked, or at least are that way on the UI side since it's hard to generate a UI for that that doesn't drive the user's security-related cognitive load through the roof. (Or reveal more information about subscriptions than people prefer, but that's a shakier reason since some existing networks already reveal that graph.)

Is there any push for OStatus or other distributed social network approaches to handle these use cases? I haven't been able to find any, and OStatus seems to think the restricted stream case is explicitly out of scope.

premchai21 | 13 years ago | on: Fast Inverse Square Root

All right, I see it in C99 as well now (§6.5.2.3 footnote 82, if I'm not mistaken). Thanks for the correction.

premchai21 | 13 years ago | on: Fast Inverse Square Root

I actually use macros along the lines of:

  #define LOAD(TYP, ptr) (*((TYP *)memcpy((TYP[1]){ }, ptr, sizeof(TYP))))
  #define REINTERPRET(AS_TYP, FROM_TYP, val) LOAD(AS_TYP, (FROM_TYP[1]){ val })
In practice (that I've found, with GCC), the memcpy and single-use temporaries get optimized away entirely. In strict C99, writing one member of a union and then reading a different member of the same union is undefined in the general case, last I checked. http://cellperformance.beyond3d.com/articles/2006/06/underst... seems to agree, but suggests that every major compiler recognizes it as a de facto idiom and supports it anyway.

premchai21 | 13 years ago | on: The Design Of SQLite4 (work in progress)

But, last I checked, you could PRAGMA foreign_keys=off temporarily, which would also inhibit the automatic handling of foreign key constraints in other tables when the target table is renamed or dropped. Then you can create a new table, populate it, drop the old one, rename the new one to the old name, and turn foreign_keys back on, and the constraints will now target the new table.

premchai21 | 14 years ago | on: Wil Wheaton: Yo Hollywood, Let Me Download Ubuntu

Resuming fetching multiple unfetched fragments of a resource is already possible with HTTP range requests. Checking the entire file can be done if the server provides a Content-MD5 header (though I'm not sure actual client use of this is widespread), and checking parts of it is infrequently useful by itself to the processing application and would be highly application-dependent even if so. The big win of BitTorrent is the distribution of available channel capacity over the swarm of downloaders; if you're not going to use that part, HTTP does quite well by itself.

premchai21 | 14 years ago | on: Computer Scientists Build Computer Using Swarms of Crabs - Technology Review

In a billiard-ball model one would construct a NOT/inverter with a crab source that normally flows straight to the output but can be misdirected into a drain by crabs coming in from the input. Of course you need a crab source for this, but this is little different from electronic transistor-based computers, where the inverse of Vss is Vdd and the Vdd comes from the power supply.

premchai21 | 14 years ago | on: Caller ID Made Simple

I suppose being able to try out the API on the software level is useful, yes. I'm not sure how one is supposed to figure out whether results are likely to be good enough for a given application if they're so unpredictably degraded. I do suspect my perception is being colored by the website text, as quoted above.
page 1