Mochabot log - CommonJS IRC channel: #commonjs on irc.freenode.net

2010-05-05:

[6:15] <saikat> is there a zlib module for javascript?
[6:33] <saikat> has anyone used http://code.google.com/p/gzipjs/source/checkout
[6:50] <ondras> nice
[6:50] <ondras> not tried, though
[6:50] <saikat> i'm a bit scared to - it seems old and i haven't seen any references to it online
[6:50] <ondras> native module with bindings to zlib might be a better idea (in terms of performance)
[6:50] <saikat> yeah
[6:50] <saikat> i need something fairly performant
[6:50] <saikat> seems like it doesn't exist though
[6:50] <ondras> once the commonjs binary is done, this module would be one of the first new things in v8cgi
[6:51] <saikat> cool
[6:51] <ondras> but it is mandatory we have some kind of binary standard :/
[7:18] <ashb> tlrobinson has a zipjs (for .zip, not gz)
[9:20] <saikat> ashb: oh thanks, i completely forgot about that
[9:22] <saikat> though seems like it currently only unzips
[9:24] <ashb> yeah probably
[11:43] <ondras> guys
[11:43] <ondras> some SM people
[11:43] <ondras> ".z".localeCompare("a")
[11:43] <ondras> what are your results?
[11:47] <ashb> -51
[11:48] <ondras> that makes sense
[11:48] <ondras> my ff @ ubuntu, however, reports a positive number
[11:48] <ondras> which is not very nice
[11:49] <ondras> and I am trying to find out why
[11:49] <ashb> so does mine.
[11:49] <ashb> curious
[11:49] * ondras is sorting file names and this is a PITA
[11:50] <ashb> maybe it has some wierd locale?
[11:50] <ondras> how can I check this?
[11:51] <ondras> preferred language is en-us
[11:52] <ashb> not sure
[11:57] <ondras> I tried changing system regional settings from CzechRep to USA
[11:57] <ondras> nothing changed
[11:57] <ondras> Wes--: ?
[11:58] <ashb> it seems to be firefox specific
[12:00] <ashb> ".z" , "a" is true
[12:00] <ashb> so not sure whats goign on there
[12:01] <ondras> ?
[12:01] <ondras> 14:07 < ashb> ".z" , "a" is true
[12:01] <ashb> <
[12:01] <ashb> missed shift key
[12:01] <ashb> ".z" < "a"
[12:01] <ondras> ah, ok
[12:02] <Wes-> ondras: pong
[12:07] <ondras> 13:50 < ondras> ".z".localeCompare("a")
[12:07] <ondras> 13:50 < ondras> what are your results?
[12:09] <Wes-> ondras: same as ashb, was there supposed to be a special character in there or something?
[12:11] <ondras> no
[12:11] <ondras> regular dot
[12:11] <ondras> Wes-: so your firefox also yields strange result here?
[12:12] <Wes-> ondras: I get -2 from firefox
[12:12] <Wes-> What's the right answer?
[12:13] <ondras> wow!
[12:13] <ondras> imho any negative number is right
[12:13] <ondras> but my and ashb's ff report positive number
[12:14] <Wes-> how did you evaluate? I used the location bar
[12:14] <Wes-> Interestingly, the docs say that 1, 0, and -1 are the only right answers
[12:15] <ondras> Wes-: both firebug console and addressbar
[12:15] <ondras> (and my XUL extension as well, where I originally found this issue)
[12:19] <ondras> http://michael.susens-schurter.com/files/localecompare-x-browser.png
[12:19] <ondras> wow
[12:19] <ondras> this seems to be just a tip of the iceberg :)
[12:45] <ashb> ondras: http://pastebin.mozilla.org/721224
[12:45] <ashb> seems to be problem in ubuntu's libc
[12:45] <ashb> (thanks Wes- )
[12:46] <Wes-> ashb: n/p :)
[12:46] <Wes-> I love puzzles
[12:48] <ondras> 25
[12:48] <ondras> hmm
[12:48] <ashb> i.e. bug in ubuntu's locales i think
[12:49] <ondras> I have reports of this behaviors in opensuse and fedora as well
[12:52] <Wes-> If that's true, then glibc is not documenting things well enough for distro makers to get their locales installed and compiled properly
[13:01] <ondras> fedora and centos - both report >0 with the given C sample
[13:06] <ondras> gentoo also >0
[13:06] <ondras> solaris <0, macos <0
[13:06] <ondras> :))
[13:09] <Wes-> ondras: debian is -1
[13:09] <Wes-> This is absolutely a distro bug
[13:10] <ondras> my debian reports 25
[13:10] <ondras> Wes-: what package version should I check?
[13:10] <ondras> ii libc-bin 2.10.2-6 Embedded GNU C Library: Binaries
[13:10] <ondras> ?
[13:11] <Wes-> ondras: Good question, it's not just the package but it has to get installed properly too
[13:11] <ondras> hmhm
[13:11] <Wes-> ondras: there are collation tables which need to be compiled
[14:27] <Wes--> jorendorff: Keen observation. Ondras - the guy who originally raised this in #commonjs - observes that it is wrong on OpenSUSE and Fedora too
[14:29] <Wes--> Oops
[14:30] <ondras> .)
[14:30] * ondras is curious about your findings
[14:33] <Wes--> ondras: nothing interesting other than I read through the implement in firefox to understand it. Jorendorff pointed out that the reason it's broken is because hardly anybody knows how to use it properly, so bugs lie hidden for eons
[14:34] <ondras> :))
[14:35] <ondras> Wes--: I believe that this function is widely used, but it often compares "regular" chars (a, b, 1, 2, ?, ?) whose order is relatively well defined with respect to locale
[14:36] <ondras> actually, I am pretty sure how my own language compares "d", "?", "ch" (in this order), but I have no knowledge about comparing "." to "a" :)
[14:37] <Wes--> ondras: comparing . to a is well-defined for the POSIX locale. And other locales, you would think that they would keep the POSIX order for the characters that are in that character set (i.e. 7-bit ASCII characters)
[14:39] <ondras> yeha, I would think that
[14:41] <ondras> by the way, both opera and chrome give correct results (on the very same ubuntu where ff reports >0)
[14:59] <Wes--> ondras: What are results like for accented chars? Maybe it's just '.' that's screwy?
[15:02] <ondras> "b".localeCompare("?")
[15:02] <ondras> correct
[15:02] <ondras> "?".localeCompare("?")
[15:02] <ondras> correct
[15:02] <ondras> "%z".localeCompare("a")
[15:02] <ondras> correct
[15:02] <ondras> (-1)
[15:03] <ondras> oh shit
[15:03] <ondras> I am now trying home @ windows
[15:03] <ondras> where this always worked
[15:03] <ondras> :/
[15:07] <ondras> Wes--: so, accented characters work. the problem can be seen with punctuation etc - (._[;#$@ etc
[15:07] <ondras> they just seem to be completely ignored during comparison
[15:07] <Wes--> jorendorff: FWIW - ondras> Wes--: so, accented characters work. the problem can be seen with punctuation etc - (._[;#$@ etc; they just seem to be completely ignored during comparison
[15:08] <Wes--> oops! IRC skillz waning with old age
[15:08] <ondras> irc skills do not work like a good wine? :/
[20:31] <Dantman> Agh, there's no existing protocol to pass messages arround systems the way I wan?
[20:35] <ashb> hmmm?
[20:37] <Dantman> ashb, I took a good look at Stomp, Message Queues (JMS, AMPQ), and searched various other things... but so far I haven't found anything for delivering messages the way I need.
[20:38] <Wes--> Dantman: looked at web workers?
[20:39] <Dantman> All the methods so far I have found are either direct, or send methods with an anycast model (a random client is picked to get the message)
[20:40] <Dantman> The problem with the subscription model is I don't want messages being send to clients that are already busy doing something else.
[20:41] <Dantman> So I need a system that will accept messages from clients, hold them, and when someone requests one give it to them and allow them to block and wait for the server to send it to them.
[20:42] <Dantman> Message brokers distribute messages to random / or multiple clients... storing messages in mongo doesn't allow me to block and wait.
[20:45] <Dantman> T_T I'm probably going to have to build something custom inside of Kommonwealth
[20:47] <Wes--> or just push messages at an array and have your listeners unshift them when they're ready to process them
[20:50] <Dantman> Wes--, ^_^ that's basically what I do with my accepted Sockets and a BlockingQueue... Problem here is I'm talking about messages/jobs/queues whatever you want to call them, which are submitted by one server, and may be handled by any one of many servers.
[20:55] <Dantman> Kinda like if you were to push those messages into an array sitting in a different process on a different server, or so..
[21:28] <Dantman> ...JSGI response .body... "MUST be an object whichc responds to `forEach` and MUST only yield objects which have a toByteString (including Strings and ...Binary...)."... Hmm, this says nothing about what charset a string would be converted to (Do we all use UTF-8, do we all use US-ASCII (whatever the ISO code was), do we all try to parse the charset from the headers?)...
[21:29] <deanlandolt> Dantman: yeah, that's always been a big gaping hole in the jsgi spec :-/
[21:32] <Dantman> Course Rack doesn't have that issue; Since in Ruby there is no difference between String and Binary... your data is just served as is... If any character transcoding is done it's done in the app, not the server implementation.
[21:33] <Dantman> In fact, it's pretty much the same as if we required { status: 200, headers: { 'content-type': "text/plain; charset=UTF-8" }, body: ["Hello World!".toByteString("UTF-8")] };

 

 

Logs by date :