2007-08-06:
[6:17] <midnightmonster> zumbrunn, if/when you get a chance, could you summarize if there was any widely useful information in the German-language discussion ~14 hrs ago?[7:46] <zumbrunn> midnightmonster, decke reported a bug where the nested macro <img src="<% this.href type=<% param.type %> %>" /> hangs and eventually throws an exception. He says after restarting the app, the macro initially works fine, but after an image upload the behavior changes and the macro hangs. He'll try to reduce it to a demo app that reproduces the problem and/or file a bug with the stack trace.[7:47] <midnightmonster> weird.[7:48] <midnightmonster> other than the ecma spec, I can't find any [even half-way] comprehensive e4x documentation on the web--can you?[7:53] <midnightmonster> (I'm actually doing ok with the spec--the PDF has useless bookmarks, but searching for, e.g., "XML.prototype" in Adobe Reader's full search thing gets a quick and dirty API listing for XML--but something both approachable and comprehensive would be useful for popularizing it.)[7:55] <zumbrunn> yep, I agree[7:55] <zumbrunn> something for our todo list, maybe[7:58] <midnightmonster> I registered e4xtra.com. if I make time, that's where my take will go. I want a way to include code samples in documentation but also have them automatically work as a test suite. that would help avoid the common problem of code samples being just wrong or out of date and also provide something of value for e4x implementations/users so things like the dynamic attribute bug don't go unnoticed for months (as it did).[7:58] <midnightmonster> does something like that already exist?[7:58] <midnightmonster> (I mean a way to mash tests/samples and documentation together)[8:01] <zumbrunn> I thought about this too for the helma docs in general[8:01] <zumbrunn> one idea was to simply write all the examples as tests[8:02] <zumbrunn> usually a test is the easiest way to see what the code is intended to do[8:03] <zumbrunn> the current docs could be extended in that direction, but I didn't go down that route yet[8:03] <midnightmonster> I have zippo experience with the whole unit testing thing. still trying to understand the how and what to test wrt web dev[8:05] <midnightmonster> hey--I bet it should look kinda like this: http://javascript-reference.info/[8:06] <midnightmonster> (but with more english/human language of choice)[8:06] <zumbrunn> yes, that's kind of what I had in mind[8:06] <zumbrunn> another approach would be using http://dev.orf.at/trac/jala/wiki/JalaUtil/Test[8:15] <midnightmonster> I seriously haven't been this excited about code in years. I can't sleep at night (like now!) b/c I'm thinking of JavaScript.[8:15] <zumbrunn> :-)[8:15] <midnightmonster> but I think I better try to sleep again, or I won't be able to write much tomorrow [today].[17:52] <midnightmonster> warning: you can set properties named like this.__property on a HopObject and read/write them afterward, but they are not persisted to the built-in db even if you explicitly call this.persist().[17:53] <midnightmonster> you might lose a lot of work that way.[17:53] <midnightmonster> (ask how I know)[17:53] <zumbrunn> oops[17:53] <zumbrunn> that's because of the property name?[17:53] <midnightmonster> apparently.[17:54] <zumbrunn> not because it was an Object or Array?[17:54] <midnightmonster> this.__testing = this.testing = 'test'; in shell, then reload the shell page and you'll see them both there.[17:54] <midnightmonster> restart the app and load the shell page again, only this.testing remains[17:54] <zumbrunn> hmm[17:55] <zumbrunn> now that we know, thanks to you painfully finding out, I wonder whether we should consider this a feature instead of a bug[17:56] <zumbrunn> maybe it always was a feature and I just didn't know[17:56] <midnightmonster> I can't think of why I'd need that 'feature'[17:57] <midnightmonster> since we have HopObject.cache for stuff that shouldn't be persisted[17:57] * zumbrunn is still wondering[17:57] <zumbrunn> anyway, it needs to be reported as a bug[17:58] <zumbrunn> either Hannes has to change it or I have to document it[17:58] <midnightmonster> and saving or not saving my data depending on the characters in the property name is not only very-non-scripty, it's pretty much insane[17:58] <midnightmonster> lol, yeah[17:59] <zumbrunn> well, _ and __ prefixes are known to be kind of "magic" in the Javascript world[17:59] <midnightmonster> they're not magic, they're just conventional[17:59] <zumbrunn> (and beyond it, of course)[18:00] <zumbrunn> true[18:00] <zumbrunn> same thing ;-)[18:00] <midnightmonster> :-P[18:01] <decke> erm sorry for disturbing...[18:01] <decke> my problem from yesterday...[18:01] * wobarcbot archiving bot says - this channel is archived at http://archive.arcsystemdesign.co.uk/[18:01] <decke> i have debugged it a bit more and found out it has nothing to do with nested macros...[18:01] <decke> that's the good part of it...[18:02] <midnightmonster> wobarcbot, you are rather superfluous, as hopbot's been on that for a long time[18:02] <decke> the bad... it's: <% param.type %> that's causing something like a "deadlock" or something similar..[18:03] <decke> sounds stupid, doesnt it?[18:04] <midnightmonster> zumbrunn, it's all properties with _ as first character that are not persisted, not only __[18:04] <midnightmonster> which makes a little more sense, but still seems like overkill to protect id/parent/prototype[18:06] <midnightmonster> decke, problem goes away if you name it something other than .type?[18:06] <decke> good question...[18:07] <decke> one second... will try that...[18:07] <decke> you think of another "magic" thing?[18:07] <midnightmonster> ?[18:08] <midnightmonster> (you mean besides _whatever?)[18:08] <zumbrunn> so the _thing probably *is* a "feature"[18:08] <zumbrunn> or convention ;-)[18:09] <midnightmonster> still reporting it, 'cause it shouldn't be that way, and if it has to be for some reason, it definitely needs to be documented[18:09] <decke> no param.voeslauer also causes the same behaviour...[18:09] <decke> which is "Request timed out" ..[18:09] <midnightmonster> ok. I've no idea what a voeslauer is, but I'm sure it's not a reserved word[18:10] <zumbrunn> lol[18:10] <decke> that's a mineral water from austria...[18:10] <decke> standing in front of me...[18:10] <midnightmonster> lol[18:12] <midnightmonster> I don't actually use the skins, so pardon my silly question, but where does param come from?[18:13] <zumbrunn> decke, does it matter whether you actually pass the parameter to the renderSkin function?[18:13] <decke> var param = {type: type};[18:13] <decke> return this.renderSkinAsString("test", param);[18:13] <decke> this works okay if i restart the app...[18:13] <midnightmonster> methinks there's a mistake there[18:13] <decke> then after adding a new helmaobject ...[18:13] <decke> and recalling this page[18:13] <decke> it hangs...[18:14] <decke> i don't have a clue why or what causes this behaviour[18:14] <decke> but i now have a test app that uses 3 prototypes[18:14] <decke> and has about 50 lines of code[18:14] <zumbrunn> what's the value of type in var param = {type: type}; ?[18:14] <decke> and i can reproduce it very good..[18:14] <decke> string... "small"[18:16] <decke> and i have a lot of other code segments that work exactly the same[18:16] <decke> but don't have this bug...[18:17] <decke> i will debug it further or maybe someone is interested in wasting time with it (don't recommend it)[18:19] <midnightmonster> would like to, but can't justify it atm[18:20] <zumbrunn> decke, are you sure that line of code reads var param = {type: type};[18:20] <zumbrunn> because that would mean you are setting the property "small" not "type"[18:20] <decke> no it actually is ...[18:20] <decke> function render(type){[18:20] <decke> var param = {[18:20] <decke> type: type[18:20] <decke> };[18:20] <decke> [18:20] <decke> return this.renderSkinAsString("test", param);[18:20] <decke> }[18:20] <decke> and called obj.render("small");[18:21] <zumbrunn> what happens of you use var param = {'type': type};[18:21] <zumbrunn> ?[18:21] <midnightmonster> zumbrunn, it doesn't work that way[18:21] <zumbrunn> it doesn't?[18:22] <midnightmonster> var q ='hi';[18:22] <midnightmonster> b = { q: q };[18:22] <midnightmonster> b == { 'q':'hi' }[18:22] <zumbrunn> hmm, I stnd corrected, then[18:22] <zumbrunn> stand[18:22] <zumbrunn> yes, of course[18:22] <decke> no does not make a difference....[18:22] <midnightmonster> the only time you have to quote attribute name in obj literals is if they're reserved words--otherwise quoted vs unquoted is the same[18:22] <decke> but "flush" in the manage app helps...[18:23] <decke> and restarting too...[18:25] <decke> it definitely has something to with other object references... seems like it's a pretty complex bug...[18:29] <zumbrunn> can't reproduce it so far[18:29] <decke> *g* i can give you my app if you like...[18:29] <decke> but i don't expect that param is needed...[18:30] <decke> my last test also worked with this.href[18:30] <zumbrunn> which version of helma are you using?[18:30] <zumbrunn> (just so I asked)[18:30] <decke> snap vom yesterday[18:30] * wobarcbot archiving bot says - this channel is archived at http://archive.arcsystemdesign.co.uk/[18:31] <decke> oh yea... he is smart...[18:32] <decke> hm...[18:32] <zumbrunn> but the interface isn't very easy to navigate[18:32] <zumbrunn> (http://archive.arcsystemdesign.co.uk/)[18:33] <decke> hm... macros work okay... this.me is no problem at all...[18:39] <decke> if you want to take a look... http://home.bluelife.at/bugs/c3kcom_debug.tar[18:40] <decke> i will open a bug report once i know where it is exactly...[18:46] <midnightmonster> (filed my _property bug report)[19:12] <midnightmonster> random: myHopObject.forEach(function(c){ c.remove() }) doesn't function as expected. it only removes every other child since get() indices shift down as children are removed[19:14] <midnightmonster> this is a difference from Array.forEach, b/c array indices are preserved when elements are deleted in JavaScript arrays[19:14] <midnightmonster> but it couldn't really be fixed without performance concerns[19:14] <zumbrunn> is that with your forEach code or the one currently in cvs or both?[19:14] <midnightmonster> with mine. I'll look at the other, but I'm pretty sure it'll be the same[19:15] <midnightmonster> you could only fix it by hooking into child.remove (ugly) or getting them all as an array first (potentially slow)[19:16] <midnightmonster> and the code I remember from the CVS isn't long enough to be the first, or short enough to be the second :-)[19:16] <zumbrunn> ;-)[19:17] <midnightmonster> yeah, the same would happen with the existing code[19:18] <zumbrunn> ok[19:20] <midnightmonster> (so naturally while I stepped away from the computer for a moment, my mind unbidden wrote a version of forEach that would function as desired by hooking into child.remove. but I really don't think it's worth two property assignments and one property delete per child just to fix that edge case)[19:21] <midnightmonster> I think it would be good to document that deleting or reordering children in forEach will result in odd and useless behaviors[19:42] <midnightmonster> (just noticed that clicking on the property name of simple-type properties in shell gives you a text box to edit them. rather nice.[19:50] <midnightmonster> this.testing_ works fine, though, so that's my new naming convention[19:56] <midnightmonster> zumbrunn, do you know if there's a way to flush res output?[19:56] <midnightmonster> i.e., send the content as it's generated instead of after the full document is done?[19:57] <midnightmonster> (thinking of the several things that would not work as expected if you did, I'm guessing no)[19:59] <technomancy> is there a command-line shell for helma?[20:00] <technomancy> entering stuff in the browser is sometimes convenient, but not very helpful for scripting[20:00] <midnightmonster> helma can be embedded in other java apps, so it's presumably possible[20:00] <midnightmonster> out of curiosity, what do you need to do?[20:00] <technomancy> midnightmonster: eventually I'd like to hook up a SLIME-style emacs integration mode[20:00] <technomancy> for now i just want to be able to scp some html to my server, run a command and have it imported into my blog[20:00] <midnightmonster> (helma has its own cron clone, so you can run scripts regularly from within it--which I see is not what you're interested in)[20:00] <technomancy> i just want to be able to enter the REPL from bash[20:01] <midnightmonster> you could just have an /importTheHtmlIJustScped action and HTTP request it[20:01] <technomancy> yeah, i could. but i'd much rather be able to enter arbitrary commands in the repl[20:01] <midnightmonster> this wouldn't be that hard to hook up, I think.[20:02] <technomancy> it seems extremely strange that there isn't something like that already in helma.[20:02] <midnightmonster> not that I would know how, knowing total about a week's worth of Java[20:02] <technomancy> ah, ok. it must be in there, just hard to find.[20:04] <technomancy> i don't know any java either, but it seems to me that the general culture surrounding it is unhealthily attached to guis.[20:04] <midnightmonster> to me the unhealthiest-looking thing about Java [culture] is how much boilerplate every daggum piece of code has.[20:04] <technomancy> heh[20:05] <midnightmonster> someone noticed: hey, we type the same thing with minor variations over and over for everything we try to do. and the solution they came up with was: lets build tools to write and understand all this boilerplate for us! when I feel like, couldn't we just do without all this?[20:06] <technomancy> you'd think folks with a strong lisp grounding would know better, but those parts of java must have been designed when gosling and steele were on vacation.[20:07] <technomancy> or maybe just steele, given the crappiness of gosling's emacs implementation[20:07] <midnightmonster> I'm afraid that the standard jab against java is true--that it was designed in an attempt to keep mediocre programmers from doing stupid things.[20:07] <technomancy> it's a good thing we have JS. =)[20:08] * technomancy waits for the #helma regulars to come in and chastise us for knocking Java...[20:08] <midnightmonster> regulars==['zumbrunn'] as far as I can tell[20:09] <midnightmonster> re:java and boilerplate, http://blog.onlysimpler.com/entries/excellent_interview_question.html and then http://blog.onlysimpler.com/entries/excellent_interview_question_part_2.html (javascript solution in 2nd is mine)[20:12] <technomancy> wow, the java one is long[20:13] <technomancy> hm; i hadn't seen x || (x=0) as a workaround for the lack of default argument values; that's nice[20:13] <technomancy> yay for recursion. =)[20:13] <technomancy> great interview question though.[20:15] <midnightmonster> obviously the x || (x=0) workaround only works if you're setting the variable to something falsey or all falsey values should be treated the same[20:16] <midnightmonster> e.g., if false and 0 were both valid and different-meaning arguments, that would clobber false[20:16] <technomancy> right. i always forget what values are false in JS.[20:16] <midnightmonster> '', 0, false, undefined[20:17] <midnightmonster> NaN is super-falsey in that it also doesn't equal anything[20:20] <midnightmonster> x!=undefined || (x=0) would work, but it's less pretty[20:22] <midnightmonster> oops. make that !== or it still clobbers other falsey values[20:22] <midnightmonster> er... no it doesn't[20:22] <midnightmonster> that's weird[22:58] <zumbrunn> midnightmonster, regarding flushing res output...[22:58] <zumbrunn> depends on what it is you want to do[22:58] <zumbrunn> http://helma.zumbrunn.net/reference/res.html#pop[22:58] <zumbrunn> http://helma.zumbrunn.net/reference/res.html#popBuffer[22:59] <midnightmonster> that's sort of the opposite of what I want to do[22:59] <zumbrunn> are you sure?[22:59] <midnightmonster> pretty sure.[23:01] <midnightmonster> I want to do:[23:01] <midnightmonster> while(eachIteratonTakesALongTime){ res.writeln('did thing '+x); res.sendThatLastLineDirectlyToTheClientSoTheyKnowSomethingIsHappening() }[23:01] <zumbrunn> oh, ok[23:01] <zumbrunn> don't know then[23:02] <midnightmonster> I'm pretty sure it's impossible. all sorts of things like the contentType being a property and not a method suggest that the whole concept is to send the whole thing at once[23:03] <technomancy> midnightmonster: i found a CLI invocation: http://helma.org/pipermail/helma-dev/2003-December/000765.html[23:03] <zumbrunn> well, it's a getter/setter, actually[23:03] <technomancy> unfortunately it's not interactive[23:03] <technomancy> zumbrunn: do you know of a way to get at the REPL from the command-line?[23:03] <zumbrunn> there are JavaBean methods for getContentType and setContenType[23:04] <zumbrunn> I'm pretty sure its possible[23:04] <technomancy> i asked on the list a few months ago; no response[23:04] <zumbrunn> I remember that, but never used it myself[23:04] <technomancy> but i would be very surprised if it didn't exist[23:04] <midnightmonster> (in PHP you can buffer output or not, and if at any point you send some data to the client, the functions to send headers stop working)[23:05] <zumbrunn> I'm trying to think of where/when I could have read that[23:05] <midnightmonster> (otherwise the headers are 'buffered' too and setting the same header twice overwrites the last)[23:05] <zumbrunn> (or what to google for)[23:06] <zumbrunn> midnightmonster, that's something for the mailing list, I think[23:06] <zumbrunn> it might already be possible[23:07] <zumbrunn> or we might agree that it should be added[23:08] * zumbrunn thinks it should already be possible, since it's a pretty basic part of the http protocol, but has never used it himself yet[23:09] <midnightmonster> it's not actually critical to me atm. the only long-running thing I'm doing is an admin data import thing, and I probably will never have to do it in production, so I can just write to the stdout[23:09] <midnightmonster> how do you do the action things? (like your last message)[23:10] <zumbrunn> slash me ...[23:10] * midnightmonster wonders if this will work[23:11] * midnightmonster never got into irc as a teenager and is slightly surprised to find as an adult that it's a communication channel of choice for lots of FLOSS projects[23:11] <midnightmonster> oh... how do I get the dump if I get a stack overflow error?[23:12] <zumbrunn> stack trace?[23:12] <zumbrunn> that should be in the event log of your app[23:12] <zumbrunn> it doesn't generate a stack trace?[23:13] <midnightmonster> it might be... where would I find the event log?[23:14] <zumbrunn> also, if you know where it happens, you could set a break point in the rhino debugger[23:14] <zumbrunn> in the log dir[23:14] <midnightmonster> found it[23:19] <zumbrunn> helma from commandline:[23:19] <zumbrunn> http://helma.org/pipermail/helma-dev/2003-December/000765.html[23:20] <zumbrunn> technomancy, ping[23:22] <midnightmonster> looking at the stack trace, it appears that in some circumstances my clever hack to override getOrderedView ends up calling itself forever and causing a stack overflow[23:22] <midnightmonster> ahah.[23:23] <zumbrunn> what did yours do different?[23:23] <zumbrunn> can't remember[23:23] <midnightmonster> http://helma.pastebin.com/m35378a27 because the chunk of code gets executed more than once (for whatever reason), and the original method is lost, so it calls itself over and over[23:26] <zumbrunn> you could instead add a method that does directly what you are after and call it forEachInOrderedList[23:27] <midnightmonster> but that would be ugly.[23:27] <midnightmonster> this should do the trick: http://helma.pastebin.com/m71c4d2dc[23:47] <technomancy> zumbrunn: pong[23:47] <technomancy> zumbrunn: oh; i see[23:47] <zumbrunn> :-)[23:47] <technomancy> i found that link. looks useful, but i'm looking for something interactive.[23:48] <zumbrunn> don't remember anything like that
In the channel now:
Logs by date: