Hopbot log for 2007-09-05 - Helma IRC channel: #helma on irc.freenode.net

2007-09-05:

[0:04] <rjb> time to sleep.
[1:31] <Lonnie> I'm going to be working with Helma the new few hours. Specifically, I want to create a simple jar (using Eclipse) that provides a static function that I want to consume in Helma.
[1:33] <Lonnie> I've successfully consumed a java stringbuilder object using Helma's "Welcome" application. That was really cool. Helma seems to provide what I'd call "runtime java programming".
[1:34] <Lonnie> If Helma can do this with java, it could do it with .net / mono too.
[1:47] <Lonnie> Are there plans to unify libraries of various programming languages, so that javascript can consume objects from various programming libraries?
[1:47] <Lonnie> (and not just java)
[1:59] <midnightmonster> javascript in helma runs on rhino, which is Mozilla.org's Java-built javascript implementation. (the one in the browser is spidermonkey, a c-built implementation). Javascript on .net/mono presumably already can use the libs of those platforms, though I expect this currently works better in Rhino where it's been the recipient of much TLC and Sun has embraced it than on .net, where MS sometimes seems mostly interested in sh
[1:59] <midnightmonster> But a single javascript implementation cannot do all at once. JS on Java works with Java. JS on .net works with (I assume) .net. If Helma were written in JavaScript only, then you might suppose it could run equally on any of those platforms, but they provide different hooks into the underlying platform, and javascript-the-language doesn't specify things like how to do sockets, so those would be different on each platform.
[2:00] <midnightmonster> so it's not really unifying libs you want but unifying VMs, which seems improbable at best.
[2:00] <Lonnie> interesting
[2:02] <Lonnie> Your first comment overflowed for me. It cut off after "where MS sometimes seems mostly interested in sh".
[2:02] <Lonnie> it?
[2:02] <midnightmonster> lol
[2:02] <midnightmonster> where MS sometimes seems mostly interested in showing that they didn't implement JS as well as their languages rather than making it work better.
[2:02] <midnightmonster> just like there's ruby on C, ruby on .net, and ruby on Java, and in Ruby on C it's fairly easy to interface with C code, and in Ruby on .Net you can work with other .Net code, and in Ruby on Java you can do a lot of what JavaScript does in Rhino, and you can write ruby programs that will work in all, but no single Ruby implementation can talk to all three kinds of native or (pseduo-native)
[2:03] <midnightmonster> objects/code
[2:03] <Lonnie> I'm using GAIM as my irc reader.
[2:03] <midnightmonster> likewise (actually pidgin--latest gaim)
[2:03] <Lonnie> Perhaps it is what is causing your messages to overflow for me.
[2:04] <midnightmonster> maybe. I'm an IRC idiot, though, and since pidgin doesn't give me useful feedback (like, "Hey, bozo, stop typing!"), I may easily be doing something stupid
[2:05] <Lonnie> I haven't moved to pidgin yet, because I like GAIM to read to me vocally. That plugin isn't available in Pidgin yet. I wrote about it here:
[2:05] <Lonnie> http://www.howtoadvice.com/ListenToIM/
[2:06] <midnightmonster> the MS incident I was referring to was their silverlight demo of a javascript chess AI playing a c# chess AI.
[2:06] <Lonnie> I play chess too. Have you been to www.chessgames.com ?
[2:06] <Lonnie> Great for leaning openings.
[2:06] <Lonnie> (learning)
[2:08] <midnightmonster> hm. no, I have never put any effort into actually learning chess besides playing it occasionally. being better at something than almost everyone you know without hardly any effort is actually a terrible way to get into that something seriously.
[2:09] <midnightmonster> (because the effort/reward ratio is so much higher when you start to take it seriously)
[2:10] <Lonnie> That's cool that it comes so naturally for you, but some people out there will get you in the opening, because they are so "booked up".
[2:10] <midnightmonster> oh, yeah. I don't doubt it.
[2:10] <midnightmonster> that really wasn't bragging. just explaining why I'm not very serious about it though I like it.
[2:10] <Lonnie> The are leveraging the knowledge of chess master with their memories.
[2:12] <midnightmonster> at least I'm wise to the 7-move checkmate :-)
[2:12] <Lonnie> There's actually a two move check mate too.
[2:14] <midnightmonster> in "7" I'm counting both sides--only 4 white moves. how can you do checkmate in 2, even if your opponent is helping?
[2:15] <Lonnie> I can't remember it, but I think white gets check mated with the bishop or queen on the 2nd move. And it required white to (helpfully) extend the right kingside pawns.
[2:16] <Lonnie> http://www.chess-poster.com/english/mail/mail_2003/shortest_game_ever.htm
[2:16] <Lonnie> (found it)
[2:18] <midnightmonster> heh. as they say, though, there's no record of any actual game having gone that way.
[2:18] <midnightmonster> no one's ever tried to get me in 2
[2:18] <Lonnie> but the 4 (white) move mate is quite common. That's the one you're likely speaking of.
[2:19] <midnightmonster> yes
[2:19] <midnightmonster> my opponent attempting that is the most reliable indication that I'll win
[2:19] <Lonnie> haha, yep
[2:20] <midnightmonster> (b/c it indicates that they're reason for thinking themselves tolerably good is that they've been playing against people on whom that occasionally works)
[2:20] <midnightmonster> they're=their
[2:22] <Lonnie> Ever play chess on yahoo? http://games.yahoo.com/ch
[2:24] <Lonnie> You acquire a rating at you play. After you establish your rating, you see that people who are 100 point lower that you are easy to beat, while though 100 higher of difficult to beat.
[2:25] <Lonnie> at = as
[2:25] <Lonnie> though = those
[2:30] <midnightmonster> never played there. no way to know I'm not playing a computer
[2:31] <midnightmonster> no face-to-face psychology or misdirection
[2:32] <midnightmonster> (yes, sometimes my play is "tricky" in a completely ethical sense--I'm aware that that indicates some of the limits of my skill at chess considered abstractly)
[2:34] <Lonnie> Well, it just indicates (as you've said), that you've never taken chess seriously, yet you've been successful with the tactics you've used.
[2:44] <midnightmonster> how's the java going?
[2:45] <midnightmonster> (you might look at the source of any of the helma.whatever packages, btw--those are all javascript wrapping Java objects)
[2:46] <Lonnie> Well, I haven't been working with it much since we last spoke. I'm leveraging my familiarity c# and the .net framework to create a class library in java.
[2:46] <Lonnie> I've built a jar, but I haven't figured out how to consume it like I did the string buider (java object) in the Welcome application.
[2:47] <midnightmonster> what're you doing in your class library?
[2:47] <Lonnie> You see, I don't know what its address is from Helma.
[2:47] <midnightmonster> post the jar somewhere and I'll see if I can make sense of it?
[2:48] <midnightmonster> (with no more expertise than I've been periodically digging into Helma's guts while building with it, so no promises)
[2:49] <Lonnie> Right now, I'm simply trying to create simple static methods. I figure if I can consume one them with hemla, I can go ahead and start porting more sophisticated c# dll to java jars.
[2:49] <midnightmonster> sure. I understand. I won't expect the sistine chapel
[2:55] <midnightmonster> (I don't know enough to just tell you how to do it, but if I can poke it a bit maybe I can figure it out.)
[2:56] <Lonnie> http://helma.pastebin.com/m5df46f64
[2:56] <Lonnie> I can post the jar too.
[2:56] <midnightmonster> no Java build environment here. can you post the jar somewhere?
[2:56] <midnightmonster> yeah
[2:58] <Lonnie> But basically, you can see that I simply created one method of an object that I want to consume just to see how to do it (with custom created java jars rather than the ones helma automatically provides).
[2:58] <Lonnie> One moment.
[2:58] <midnightmonster> yes
[3:04] <midnightmonster> GIANT SHRINKING LONNIEBEST.COM was funny the first time
[3:05] <Lonnie> Yeah, I rarely get around to cosmetics it seems... kind of cheesy I guess.
[3:06] <midnightmonster> (it really was funny the first time I loaded the page. not so much when I followed a link and came back.)
[3:07] <midnightmonster> completely other thing: it sucks to pay 2.9%, but it's really nice to have payments show up instantly instead of waiting for a check then mailing that to my bank then waiting for it to clear.
[3:07] <Lonnie> ok: http://www.lonniebest.com/Lonald.jar
[3:09] <Lonnie> currently I have it placed at Helma/helma-1.6.0/lib/ext
[3:09] <midnightmonster> that
[3:09] <midnightmonster> 'd be the place
[3:10] <Lonnie> I notice, however, that helma puts all the default jars in lib, with I'm instructed to put the ones I make in lib/ext
[3:11] <midnightmonster> yeah. afaict, it actually makes no difference. I've put things in both and both work seemingly the same
[3:11] <midnightmonster> i think it's just a convention
[3:13] <Lonnie> http://helma.pastebin.com/m68abe6d2
[3:16] <midnightmonster> it's so easy you'll kick yourself
[3:16] <midnightmonster> Packages.Lonnie.talk() // returns "JavaHi from Lonnie"
[3:17] <midnightmonster> (since you made static methods, you shouldn't be instantiating anything as you seemed to be trying in your code)
[3:17] <Lonni1> huh
[3:17] <Lonni1> That's true.
[3:17] <midnightmonster> also, the java4helma bit didn't take, which I suppose is your other puzzlement
[3:18] <Lonni1> I was too closely following the stringbuffer example.
[3:18] <midnightmonster> you can do
[3:18] <midnightmonster> Lonnie = Packages.Lonnie; Lonnie.talk();
[3:20] <Lonni1> java4helma is the project name I gave in eclipse.
[3:20] <Lonni1> What is your desktop OS?
[3:20] <midnightmonster> (and if you haven't already added the helmaTools repository to your app, add it so you can use /shell and experiment without having to create throwaway actions, etc.)
[3:21] <midnightmonster> WinXP. my laptop (not main system) is getting so screwy that I'm about to jump to Ubuntu alpha, though (b/c only recent alphas support proper wireless security)
[3:21] <midnightmonster> main system can't go Linux since I need proper image editing tools.
[3:21] <Lonni1> I actually copied the Welcome app as a template that I'm modifying. So I assume those tools are included.
[3:22] <Lonni1> gimp isn't cutting it?
[3:22] <midnightmonster> besides being hideous, no, gimp isn't a serious contender.
[3:23] <midnightmonster> I don't recall if the welcome app includes it or not. you need this in apps.properties:
[3:23] <midnightmonster> myappname.repository.0 = modules/helmaTools.zip
[3:23] <Lonni1> I'm using Ubuntu, but Eclipse is a cross platform IDE, that I started in Windows XP. When I move my project files to Ubuntu, and then installed Eclipse, I was surprised and pleased that (the first time I opened eclipse) the projects came up fine.
[3:24] <Lonni1> Even the state of the ide was preserved.
[3:24] <midnightmonster> yup. I'm not surprised at all. I've been using eclipse on a couple machines for probably a few years now
[3:24] <Lonni1> (which file I had open were all tabbed up an waiting)
[3:25] <Lonni1> I like eclipse (I come from a visual stuido background though).
[3:25] <midnightmonster> random thing never to do: don't forcibly tell eclipse to treat your utf8 file as utf16. it will not convert, it will just crash, and it will remember the file is open and try to open it in the wrong mode again when you restart--and crash again. until you nuke your workspace.
[3:26] <Lonni1> (message overflow)
[3:26] <Lonni1> ouch
[3:26] <midnightmonster> ...and it will remember the file is open and try to open it in the wrong mode again when you restart--and crash again. until you nuke your workspace.
[3:27] <midnightmonster> well, just the part of the workspace that handles whichfiles are open. which is also the part that handles which views and their arrnagement etc., but not all your projects (thankfully)
[3:28] <Lonni1> Thanks for showing me how to access custom jar classes. You figured that out quick.
[3:30] <midnightmonster> I've been playing around with the java/javascript interface a bit.
[3:30] <midnightmonster> (you're welcome)
[3:31] <midnightmonster> I guess I'll need it if I ever get around to writing the helma.Database replacement I keep complaining should exist
[3:33] <Lonni1> I used photoshop before I moved to gimp. I'm not a graphics artist, but I've been able to adapt to it quite nicely. Sometime I have to hunt for how to do something, but I've found that if you type the photoshop name for something in Google, and then "gimp", you can find tutorials.
[3:40] <Lonni1> Well, that's one of the first items of business for me. I've got to create some java classes for accessing my databases. I'm going to parse the requested url to determine which record(s) to retrieve that ultimately generate a web page.
[3:40] <midnightmonster> have a look at the built-in helma orm. that's sort of one of its defining features is the way it already does that
[3:41] <Lonni1> I'll look for some documentation on that.
[3:41] <midnightmonster> it's sort of assumed throughout. try the tutorial app. it's basic and some of the things they suggest are stupid, but you get the idea of the orm
[3:42] <Lonni1> I've never been confident about automatically doing object relational mapping using a tool.
[3:42] <Lonni1> If your database is high normalized, like some of my designs are, I just don't see how it can be automated.
[3:43] <midnightmonster> you have to tell it how, but then it does a good job.
[3:43] <midnightmonster> or so it seems to me
[3:43] <Lonni1> oh, cool.
[3:48] <midnightmonster> basic concept: a db row (or the parts of it you specify) gets mapped to a (special kind of) js object. you can specify that properties of that object will be more special objects or collections of objects drawn from other tables based on the relationship you specify. for each table you can define your own object prototype that will be instantiated for the row. these objects get semi-magically mapped to urls and your proto
[3:49] <midnightmonster> (you can actually have different rows of the same table use different prototypes so long as all extend the same base prototype)
[3:50] <midnightmonster> (btw, just downloaded and was poking around gimp again. it sort of looks like maybe it would have what I need but: 1) boy, it is still one ugly program and 2) it would take me so long to get to my current level of proficiency I don't know when I'd be able to afford the time)
[3:52] <midnightmonster> e.g., my lines of code to make "http://preachingtheword.net/sermons/A+Donkey+With+A+Destiny/" automatically bring up the sermon with the title "A Donkey With A Destiny": 3
[3:52] <Lonni1> I would like to map an object model that has objects where each property in that object is an array of miscellaneous types of objects. And, those contained objects too have multiple properties that are arrays of miscellaneous types of objects.
[3:52] <Lonni1> Doable?
[3:53] <midnightmonster> maybe? I can certainly do it with the built-in object db (I'm not actually using a relational db on mine).
[3:53] <Lonni1> c#/.net calls this an ArrayList
[3:54] <Lonni1> (a construct that can hold an array of objects that are different types_
[3:54] <midnightmonster> it's just an array in JavaScript based on your description, but for the ORM they'd be Collections
[3:54] <midnightmonster> everything can hold different types in JavaScript
[3:54] <Lonni1> ture
[3:55] <Lonni1> true
[3:55] <midnightmonster> e.g., myConfusingArray = ['hi',false,35,new Bob(),new Fred(),new Etc()];
[3:55] <Lonni1> and java has a similar object as c#.... I think java calls it an ArrayList too.
[3:56] <Lonni1> So, I would map directly to javascript and java won't be an intermediary?
[3:56] <midnightmonster> when you're writing for helma using helma's features, you're writing javascript, not java.
[3:56] <Lonni1> I guess that simply optional.
[3:57] <midnightmonster> if you need to circumvent or extend helma for some reason, you can do it in javascript or java
[3:58] <Lonni1> I haven't fully decided when it is appropriate to use one or the other. I like the flexibility of javascript and the speed of java.
[3:58] <midnightmonster> I would try to learn the built-in ORM. for a certain set of things it seems to work well and fast.
[3:59] <midnightmonster> what kind of DB structure do you have, though, that it makes the most sense to map a property to an array of misc object types? I suspect you may still just be thinking too much about types in the first place
[3:59] <Lonni1> but ultimately, if you are dealing with an object, in the user interface, it makes no sense have java in there as.... wait, you need java to access the database.... No, you saying helma will do that transparently if I learn the built-in ORM.
[4:00] <midnightmonster> right
[4:01] <Lonni1> Actually, I threw that at you as a hypothetical. I like to discuss the extremes in order to get a sense of the range of possibilities.
[4:03] <midnightmonster> helma also has a very basic javascript DB SQL interface if you need to write your own arbitrary queries. it's principle weaknesses are that it doesn't do paramaterized queries, so you have to be careful using user input, and it just brings back results as an array of objects, so you have to manually make sure you only try to retrieve a reasonable amount of data at a time, so instead of writing a query that returns 1000 ro
[4:03] <Lonni1> However, I can image practical examples. Say you are creating a categorization hierarchy where you want to categorize various types of things in the same hierarchy.
[4:04] <Lonni1> image = imagine
[4:04] <Lonni1> You may have mp3, jpg, gif. html etc.
[4:04] <midnightmonster> ok...
[4:05] <midnightmonster> in what sense are those separate types, though?
[4:05] <midnightmonster> they're all files
[4:05] <Lonni1> Well, yes, but you may want particular webpage templates to display those when selected.
[4:06] <midnightmonster> ...but if we have a reasonable number of total types, we might have custom renderers for each type and want them as their own object types, even if they all fit fine in the same DB table
[4:06] <midnightmonster> no problem with the Helma ORM
[4:10] <midnightmonster> (I see we were saying the same thing) wife's going to bed, so to bed I'm going as well.. ttyl
[4:10] <Lonni1> "it doesn't do paramaterized queries" ... so you have to double double quote to prevent sql injection attacks.
[4:10] <Lonni1> gotcha.... good man
[4:10] <midnightmonster> right, except it's double-single quote
[4:11] <Lonni1> good night, thanks
[4:11] <Lonni1> (that's right)
[4:18] <Lonni1> "but if we have a reasonable number of total types, we might have custom renderers for each type and want them as their own object types, even if they all fit fine in the same DB table" -- In c#, I'd use interface inheritance to create a polymorphism where each object has a method that knows how to render itself.
[4:20] <Lonni1> But perhaps I'm now getting into the object model versus file system divide.
[4:52] <midnightmonster> (there are multiple ways to achieve such an effect in js)
[6:58] <Lonni1> After modifying a jar, I restarted the application using the manage application provided by Helma.
[6:59] <Lonni1> However, the changes are not being manifested in my Helma application.
[7:00] <Lonni1> I don't know how to restart Helma as a whole (other than restarted the computer).
[8:37] <Lonnie> Other than restarting my computer, I can't seem to restart Helma. When I restart a particular application (within Helma), this doesn't make Helma adhere to jars that have been modified.
[8:59] <Lonnie> rjb
[8:59] <rjb> hi
[9:00] <Lonnie> Hey, do you know how to restart Helma?
[9:00] <rjb> Lonnie: on Linux/Unix, to restart helma i kill its process and run start.sh again
[9:01] <rjb> a kill -TERM seems to shutdown helma gracefully
[9:01] <Lonnie> Ok, I do that now. I was having to restart my machine.
[9:01] <rjb> but i don't know what the equivalent would be on Win
[9:01] <Lonnie> (every time I modified a jar!)
[9:03] <Lonnie> It didn't work.
[9:03] <Lonnie> I remember trying that earlier, but just tried it again.
[9:03] <rjb> btw i actually run nohup ./start.sh & cause i don't want helma to exit in case i close the terminal i started helma from
[9:04] <rjb> it worked for me, though i never needed to modify any of the jars
[9:04] <rjb> oh wait i actually needed to add a mysql-connector jar
[9:04] <rjb> it wasn't seen by helma until a restart
[9:04] <Lonnie> To started Helma in Ubuntu by double clicking the start.sh script and selecting "run".
[9:05] <Lonnie> To = I
[9:05] <Lonnie> restart of helma or the server?
[9:05] <rjb> in a term, try 'ps x |grep helma'
[9:06] <rjb> restart of helma of course
[9:06] <Lonnie> ok did that grep
[9:06] <rjb> the server hasn't been restarted for 3 months or so (last kernel update)
[9:07] <rjb> the first column contains the PID of the helma process
[9:08] <rjb> you do 'kill PID' (replace PID with that number)
[9:09] <Lonnie> Now that worked.
[9:10] <Lonnie> I need to automate that. As much as I modify jars, I need to have button on my quick launch bar that kills Helma and starts it.
[9:11] <rjb> hmm actually the start.sh could (should) be beefed up so that it automatically nohups and backgrounds the helma process
[9:11] <rjb> it could also provide for a restart action
[9:12] <Lonnie> Yeah, this is basic administration. I couldn't find any documentation on restarting Helma that worked for me.
[9:12] <rjb> in fact in scripts/ there is an initscript for running helma as a unix service
[9:12] <Lonnie> This is as close as I got:
[9:12] <Lonnie> http://michi.knallgrau.at/helma-documentation/documentation.xml
[9:13] <Lonnie> It required me to set up Helma as service before the commands would work, though.
[9:13] <rjb> "Usage: /etc/init.d/helma start|stop|restart|reload"
[9:14] <Lonnie> I don't have that stuff setup. I downloaded Helma and unzipped the folder to my desktop.
[9:14] <rjb> haven't tested it yet though
[9:15] <rjb> it might require some (fairly trivial) configuration for your system
[9:15] <Lonnie> And, I actually ran it by simply double clicking the start.sh script. I will ultimately want to run Helma as service on a server, but I haven't decided if I want to do this configuration on my laptop yet.
[9:17] <Lonnie> It runs fine the way I started it, but I could figure out how to executed the commands you mentioned by running it this way. In a command prompt, I navigated to Helma's script directory an attempted "helma restart" with no luck.
[9:18] <Lonnie> Thanks for showing your method.
[9:18] <rjb> nope, that wouldn't work unless the initscript is installed in /etc/init.d
[9:18] <rjb> and helma is started by the same script
[9:19] <rjb> note that helma.conf also needs to be installed and customized, that's the configuration i mentioned
[9:19] <Lonnie> Yes, I noticed that.
[9:20] <Lonnie> in the Helma script it mentions that.
[9:21] <Lonnie> I'm rather new to Ubuntu, and I've been spoiled by its Add/Remove Applications manager.
[9:22] <Lonnie> I've never had to setup and application to be command line accessible in this manual manner.
[9:22] <Lonnie> and = an
[9:22] <Lonnie> But I don't think it will be too bad.
[9:24] <rjb> there is no ubuntu/debian package for helma afaik
[9:25] <rjb> it might be the only useful free software known to me that doesn't have one, in fact
[9:25] <rjb> oh wait, i don't think the h2 database has one, either
[9:26] <Lonnie> I just did a search; yes, it's not there.
[9:26] <Lonnie> It must be some work to make that available or it would be there already.
[9:26] <rjb> might be true of more java stuff as well
[9:27] <Lonnie> Well, isn't java open source these days?
[9:27] <rjb> java software tends to be a hassle to integrate with the os
[9:27] <Lonnie> I'm just beginning to use java, I come from a c# background.
[9:28] <rjb> debian packaging is catching up with java software pretty quickly, though
[9:28] <Lonnie> Well, I had no problem getting the virtual machine on here.
[9:31] <rjb> afaics the hassle is mostly about multiple versions and implementations of the jvm
[9:32] <rjb> testing apps for compatibility and setting up dependencies so that stuff Just Works (TM) for everybody
[9:38] <rjb> ah, i finally figured out how to successfully register a cronjob with helma
[9:38] <rjb> wasn't too hard, actually
[9:38] <Lonnie> cronjob?
[9:38] <rjb> yeah i want a derived table for my app regenerated periodically
[9:39] <Lonnie> As a caching mechanism or sorts?
[9:39] <rjb> for that i want helma to run a function i wrote at specified intervals
[9:39] <Lonnie> or = of
[9:40] <rjb> well the use case in this instance is a table of search keywords
[9:40] <Lonnie> Does helma have built in scheduler? Or are you using a setInterval to do it?
[9:41] <Lonnie> or is that just a browser-side function of window?
[9:41] <rjb> http://helma.zumbrunn.net/reference/core/app.html#addCronJob
[9:41] <Lonnie> Oh, I see.
[9:42] <Lonnie> Sorry, my javascript experience has been primarily client-side up until now.
[9:43] <rjb> i implemented a keyword search feature on my data via a mysql fulltext index
[9:43] <Lonnie> Is it quick?
[9:43] <rjb> cause i couldn't figure out quickly how to use the lucene search
[9:44] <rjb> well the dataset is rather small, so it's lightning fast
[9:44] <rjb> i don't know how it scales with data volume, though
[9:44] <Lonnie> I doubt it will scale well.
[9:45] <Lonnie> Also, how well does it handle multiple terms?
[9:46] <Lonnie> If I searched for: restart helma java
[9:46] <rjb> couldn't really say, i'm just using it as a dynamic replacement for tags
[9:46] <Lonnie> would it look for those words in any order?
[9:46] <Lonnie> I see.
[9:48] <rjb> http://dev.mysql.com/doc/refman/5.1/en/fulltext-search.html
[9:50] <Lonnie> not bad
[9:52] <rjb> i see now that in my very naive usage, entering multiple terms seem to result in a 'or' query
[9:53] <Lonnie> You could parse users entries and make their search more google-like.
[9:54] <rjb> yeah maybe i ought to tune that a little
[9:55] <rjb> the demo is at http://bobo.fuw.edu.pl/fotw
[9:57] <Lonnie> So essentially, one request may ultimately result in multiple queries.
[10:02] <rjb> it's a single db query but it effectively 'or's the search terms (afaics)
[10:05] <Lonnie> You could make a bot that scrap all those pages in their entirety, removes html tags, removes consecutive whitespace, and inserts the text into a dedicated MySQL server that simple does the full text searches. But, I guess you'd be reinventing the wheel.
[10:07] <Lonnie> The searches I performed return quality links. Nice collection.
[10:10] <rjb> the tags (the list on the right) are compiled from just the titles and descriptions, minus 'noise words'
[10:11] <rjb> that's what the cronjob is supposed to do, to ensure the list is up to date
[10:12] <rjb> such an approach certainly wouldn't scale to a reddit-size collection
[10:14] <Lonnie> I wonder if the google api allows you to create a custom search within a particular array of urls.
[10:16] <Lonnie> Ideally, they'd allow you to submit an array of urls (that you can add to and remove from), and in return you get a unique id that gets submit with any searches from your site.
[10:17] <Lonnie> Then google will only return hits if they occur within your collection.
[10:18] <Lonnie> However, who wants to be dependent on Google?
[10:38] <rjb> well i'd certainly have a problem if i tried to wean myself off of gmail
[10:58] <rjb> the reason i need this auxilliary table in the first place is, i couldn't find any way to directly query the mysql database about what are the search terms 'most relevant' to the indexed data set
[11:01] <rjb> so my ad-hoc solution is to built a list of frequently occuring words, that are not 'noise words' from the data
[11:02] <rjb> query the fulltext index for their 'scores' against the dataset, as defined by mysql's algo
[11:02] <rjb> sort by descending score, and take the top N items
[11:03] <rjb> the only way to scale this to a really large data collection would involve random sampling of data items, i think
[11:04] <rjb> to keep the procedure from taking too long to run
[11:04] <rjb> my guess is that might yield pretty good results in practice, but i haven't really tested it
[11:07] <rjb> but yeah, random sampling + incremental building of the 'relevant keywords' list could be a good solution
[13:26] <rjb> hmm, do the export and import statements work in any manner in rhino?
[19:41] <leobm> hello, can someone help me ? http://helma.pastebin.com/d2ef7f3cd
[19:41] <leobm> how can I handle links like /links/by/blahhh
[19:42] <jsp> this shows a way: http://helma.org/docs/examples/getChildElement/
[19:47] <leobm> thanks
[19:47] <jsp> another way is to mount at /links/by a collection of LinkOwner objects which maps to your users table. then LinkOwner: type.properties has _children = collection(Link) but joined on the userid
[19:47] <jsp> which, if that data is already in your db, is the way I would do it
[19:48] <jsp> unless (as I now suspect from your pasted code) you don't mean "by" in the sense of "posted by this person"
[19:52] <jsp> must do work for which someone pays, though. good luck.
[21:34] <rjb> hmm why would rhino throw an error when i tell it to parse my webpage (which validates as xhtml)
[21:35] <leobm> e4x ?
[21:35] <rjb> yep
[21:36] <rjb> aah i see now, standard html entites (such as &nbsp;) make it barf
[21:36] <leobm> yes a problem.
[21:36] <leobm> I use jala.HtmlDocument
[21:37] <rjb> well can something be done about it?
[21:37] <rjb> w/o giving up on e4x i mean
[21:37] <leobm> not sure. I have problems to with e4x
[21:37] <leobm> too
[21:42] <ismith> I think the version of Rhino in the latest Helma has a bug with e4x
[21:43] <ismith> that said, I doubt you can get a full HTML doc to validate unless you set it up as true XML
[21:43] <rjb> i'm using a newer rhino
[21:44] <rjb> and actually it would validate, except for the undefined entities
[21:44] <rjb> i tested that with another parser
[21:45] <rjb> (actually i should be saying - pass as well-formed, strictly speaking)
[21:47] <rjb> (but the w3 validator say it's valid xhtml according to the transitional DTD, too)
[22:02] <rjb> bah, it looks like the ecma for e4x mostly ignores entity references
[22:13] <rjb> arrgh
[22:14] <rjb> in fact the DOCTYPE declaration was what was triggering the exception
[22:15] <rjb> though when i remove it, i get barfs on &nbsp; too
[22:15] <rjb> summary: e4x is pretty much broken
[22:36] <rjb> ok, not all is lost: plugging in a xbean.jar, i get rid of the error thrown on <!DOCTYPE

 

 

In the channel now:

Logs by date: