Ringobot log - RingoJS IRC channel: #ringojs on irc.freenode.net
2010-08-04:
[8:19] <hannesw> added page about http parameter parsing: http://ringojs.org/wiki/HTTP_parameter_parsing/[8:28] <anh> I realize Demo Main Page menu doesn't contains examples like continuation, param etc. I can append those examples directly after demo/
[8:29] <hannesw> anh the continuation thing is kind of outdated
[8:29] <hannesw> are you using it?
[8:31] <anh> I'm just exploring ringo applications and found them still available inside git repo
[8:32] <hannesw> yes
[8:37] <anh> I'm learning stuffs inside modules, reading httpclient Cookie, Exchange obj to see how you guys script java
[8:38] <anh> thing like Object.defineProperty is from rhino or ringo core?
[8:38] <oberhamsi> should we remove ringo/webapp/continuation? not very cool imo and confusing if you expected jetty continuations
[8:38] <oberhamsi> anh, that's rhino
[8:40] <anh> oberhamsi, where can I get docs/guide about that?
[8:40] <oberhamsi> anh, some of the more modern stuff in rhino is explained here http://ringojs.org/wiki/Modern_JavaScript_Support/
[8:40] <oberhamsi> try the "what's new in .. " links!
[8:42] <hannesw> oberhamsi yes, i'm tending towards removing it too
[8:56] <anh> thanks oberhamsi, look good
[9:06] <ringostarr> e41959f Hannes Walln?fer: Rewrite ringo/webapp/env to use a java threadlocal for storing the current request
[9:41] <ringostarr> b8999b7 Hannes Walln?fer: Finish and fix rewrite of ringo/webapp/env
[9:48] <hannesw> oberhamsi the intern is just going through the tutorial, and found a few problems
[9:49] <hannesw> the biggest one obviously core/date no more existant in ringo master
[9:49] <hannesw> how should we go about fixing them?
[9:49] <hannesw> i think you're mainly writing the tutorial via gist?
[10:14] <oberhamsi> i'm fixing it right now.. wait i'll dump it into wiki
[10:15] <oberhamsi> hannesw, i "deployed" most recent tutorial... always fix in gist, i ignore wiki hist
[10:16] <oberhamsi> and i want to split it into multiple pages.. not sure how far i get this week
[10:20] <hannesw> oberhamsi ok, great
[10:21] <hannesw> i think this is another case where git-based content would be great
[10:21] <hannesw> maybe I'll fork ringowiki to just hack in file based content
[13:23] <emilis_info> I'm afraid to use Strings and REgExps anymore
[13:30] <earl> how so :) ?
[13:32] <emilis_info> str.replace(/\s+/g, " ")
[13:32] <emilis_info> str.length > 200000
[13:32] <emilis_info> takes ~20s
[13:32] <emilis_info> in php it takes < 10ms
[13:42] <hannesw> emilis_info rhino's regexp implementation is not so great
[13:42] <hannesw> it's really one of the sore spots
[13:51] <emilis_info> hannesw, are there any Java alternatives I could use?
[13:52] <hannesw> yes, you could use java.util.regex package
[13:52] <hannesw> there are also other regexp implementations for java available
[13:53] <hannesw> http://download.oracle.com/javase/6/docs/api/java/util/regex/package-summary.html
[13:53] <hannesw> there's a bug to replace the rhino regexp implementation with java.util.regex
[13:53] <hannesw> and I've done some initial work on it
[13:54] <hannesw> emilis_info can you please let me know if java.util.regex fares better with your particular string operation?
[13:54] <emilis_info> hannesw, I will need to RTFM how to use this java.util.regex first
[13:55] <hannesw> wait, i'll help you, i'm just too curious :)
[13:57] <botic> (3rd party regex) we used oro in one of our last projects: http://jakarta.apache.org/oro/index.html but i have no idea why we ignored java.util.regex... maybe some dependencies in other libs
[13:59] <hannesw> the jruby guys used java.util.regex at some point, but ended up writing their own (actually port from c-ruby)
[14:00] <hannesw> emilis_info this code should be the equivalent of what you posted above:
[14:00] <hannesw> http://ringojs.pastebin.com/wXnKi70E
[14:03] <hannesw> emilis_info yes, rhino's regexp is very slow, and java.util.regexp is nearly instantanous
[14:03] <emilis_info> I am now running it on an already fixed string
[14:05] <hannesw> java.util.regex takes 15 millis where rhino's regex takes 30 secs. :/
[14:06] <emilis_info> >> timer(function() { s1(html); }); 18182 millis
[14:06] <emilis_info> >> timer(function() { s2(html); }); 95224 millis
[14:06] <emilis_info> >> timer(function() { s3(html); });107 millis
[14:06] <emilis_info> s1 is str.replace(/\s+/g), s2 is using while(str.indexOf(" ")), s3 is java.util.regex
[14:07] <hannesw> on my laptop the difference is even bigger, maybe because I'm using hotspot server vm
[14:07] <hannesw> ok, next thing i'll work on after ringo 0.6 will be this:
[14:07] <hannesw> https://bugzilla.mozilla.org/show_bug.cgi?id=390659
[14:10] <emilis_info> you will be an hero
[14:10] <emilis_info> :)
[14:10] <hannesw> yeah, a slow one :)
[15:27] <hannesw> oberhamsi just saw your ringo-tutorial-demoblog repository
[15:27] <hannesw> we have a list of issues with the tutorial i was about to send you :)
[15:27] <oberhamsi> and missing repo was on the list? :)
[15:28] <hannesw> nope
[15:28] <hannesw> one thing is the Post.getById() - no need to use a query for that
[15:28] <hannesw> there's a "native" Post.get(id)
[15:29] <oberhamsi> ah i see, did that get updated recently? http://ringojs.org/wiki/Store_API/
[15:29] <hannesw> one major problem we had was a cyclic module dependency
[15:29] <hannesw> no, i think this has been around forever
[15:31] <oberhamsi> cyclic module dependency, i do that? *checking code*
[15:31] <hannesw> hm, no
[15:31] <hannesw> david had a require("./actions") in the config.js urls array
[15:32] <hannesw> and that caused dependency config.js -> actions.js -> model.js -> config.js
[15:32] <daian> those are fun
[15:32] <hannesw> which would only work if config exported "store" before "urls"
[15:32] <oberhamsi> hm i see. what to do? setup store in model.js maybe?
[15:33] <daian> export 'store' first?
[15:35] <oberhamsi> (fixed get(id) )
[15:37] <oberhamsi> gotta run, i'll be online later...
