2004/09/17
IRC [01:36] *** zoro2 joined the chat.
IRC [02:31] *** brunom joined the chat.
IRC [02:36] *** brunom parted the chat.
IRC [02:55] *** zoro2 parted the chat.
IRC [03:11] *** tekbasse joined the chat.
IRC [04:41] *** tekbasse parted the chat.
IRC [07:59] *** zione joined the chat.
IRC [08:29] *** frankie joined the chat.
IRC [08:29] <jcollins> hi frankie
IRC [08:29] <frankie> hi
IRC [08:33] *** zoro2 joined the chat.
IRC [08:36] <Dossy> Morning.
IRC [08:39] <zoro2> thello
IRC [08:41] <jcollins> hi
IRC [08:41] <jcollins> been thinking about bind variables dossy
IRC [08:42] <jcollins> but still having trouble formulating an email =\
IRC [08:44] <jcollins> there are so many things i hate about the ns_db interface it's hard to focus on just bind variables :)
IRC [08:49] <Dossy> heh
IRC [08:49] <Dossy> :)
IRC [08:49] <Dossy> me too.
IRC [08:49] <Dossy> however, I don't have sufficient bandwidth to rewrite the entire DB API now.
IRC [08:50] <Dossy> but, adding bind-variables is a short-term change that's compatibility-preserving and would benefit users.
IRC [08:50] <jcollins> true
IRC [08:50] <Dossy> and I could implement it inside of a day or two
IRC [08:50] <jcollins> how would the C api change?
IRC [08:50] <jcollins> Ns_DbSelect and friends
IRC [08:50] <jcollins> no the driver part
IRC [08:51] <jcollins> s/no/not
IRC [08:51] <Dossy> Hmm -- good question.
IRC [08:51] <Dossy> I was really hoping no one was using the C API ... :P
IRC [08:51] <jcollins> also, adding a Tcl_Interp *interp to the Ns_DbHandle struct would help
IRC [08:51] <jcollins> or passing it in
IRC [08:52] <jcollins> we use the C API :)
IRC [08:52] <Dossy> "we"? who/what?
IRC [08:52] <jcollins> my company
IRC [08:52] <Dossy> Oh. Poop.
IRC [08:52] <jcollins> use the Ns_Db* C API
IRC [08:52] <Dossy> well, then I'd extend it with a Ns_DbSelectWithParams()
IRC [08:53] <Dossy> and have Ns_DbSelect() call Ns_DbSelectWithParams() passing no params.
IRC [08:53] <Dossy> To keep things compatibility-preserving.
IRC [08:53] <jcollins> i guess the db driver decides what "args" means?
IRC [08:53] <jcollins> for instance
IRC [08:54] <Dossy> ?
IRC [08:54] <jcollins> "value value value ..." or "key value key value ..."
IRC [08:54] <jcollins> positional vs. named
IRC [08:54] <Dossy> oh -- I was thinking of just positional
IRC [08:54] <jcollins> hrm, we only used named :)
IRC [08:54] <Dossy> "select foo from bar where baz = ?"
IRC [08:54] <jcollins> but if you pass the interp along that can "Just Work"
IRC [08:55] <Dossy> how do you figure?
IRC [08:55] <Dossy> variables in the global scope? eek
IRC [08:55] <jcollins> no, local scope
IRC [08:55] <jcollins> of the ns_db call
IRC [08:55] <jcollins> ns_ora already uses this and its awesome
IRC [08:56] <Dossy> how do you pass tcl_interp and the scope along?
IRC [08:56] <Dossy> i guess it keeps track -- ok
IRC [08:56] <jcollins> yeah
IRC [08:57] <Dossy> it's a scary thought of using bind vars that way
IRC [08:57] <jcollins> but if i recall the ns_db driver api doesn't give you the interp
IRC [08:57] <Dossy> do you also use out bind vars?
IRC [08:57] <jcollins> yes
IRC [08:57] <Dossy> "select x into :fooey from tbl"
IRC [08:57] <Dossy> where tcl var "fooey" gets created ?
IRC [08:57] <jcollins> well not on selects but on plsql
IRC [08:57] <jcollins> but yup
IRC [08:57] <Dossy> fearsome.
IRC [08:57] <jcollins> haha
IRC [08:57] <jcollins> it'ss *ALSOME*
IRC [08:58] <Dossy> perhaps ...
IRC [08:58] <jcollins> have you seen the nsoracle 2.8 driver's plsql.tcl?
IRC [08:58] <Dossy> nope
IRC [08:58] <jcollins> it freaking magical
IRC [08:58] <Dossy> heh
IRC [08:58] <jcollins> seriously
IRC [08:58] <Dossy> I'll have to look.
IRC [08:58] <jcollins> plsql::init my_oracle_proc
IRC [08:58] <jcollins> then
IRC [08:58] <jcollins> just called it from tcl
IRC [08:58] <jcollins> my_oracle_proc arg1 arg2 out1 out2
IRC [08:58] <jcollins> and it Just Works
IRC [08:59] <Dossy> plsql::init creates a tcl proc? interesting.
IRC [08:59] <jcollins> yup
IRC [08:59] <jcollins> it describes the plsql using oci
IRC [08:59] <jcollins> to get all the args and whatnot
IRC [09:00] <jcollins> it won't work on 100% of plsql procs, for instance you cannot pass/return objects but for basic types it works like a champ
IRC [09:00] <jcollins> oh and plsql::init will work with packages as well
IRC [09:01] <jcollins> and the tcl procedure it creates also accepts -handle option if you need to be fancy and provide your own handle, otherwise it grabs one for itself
IRC [09:02] <jcollins> one of the python oracle drivers does something similar to this but I don't think it is nearly as robust as our implementation
IRC [09:03] <jcollins> So anyway, back to bind variables, your suggestion seems like a good incremental improvement to ns_db api and I don't see any glaring issues with it. We'll continue to use the ns_ora command here so these changes won't really affect us much.
IRC [09:05] <jcollins> ns_zlib needs deflate/inflate commands
IRC [09:06] <jcollins> Unless I'm missing something on how to use it. I'm trying to compress something with ns_zlib and decompress it with the zip command in a Tclkit.
IRC [09:20] <Dossy> i think ns_zlib as implemented doesn't write the necessary file header info
IRC [09:22] *** zione parted the chat.
IRC [09:24] <jcollins> hrm
IRC [09:28] <zoro2> is ns_zlib an equivalent of zlib.c in tclkit sources?
IRC [09:28] <zoro2> that is 'zlib compress' / 'zlib deflate' and so on?
IRC [09:28] <jcollins> no
IRC [09:28] <jcollins> zlib has deflate/inflate
IRC [09:28] <jcollins> ns_zlib has compress/decompress
IRC [09:28] <jcollins> not sure what the diff is
IRC [09:29] <zoro2> zlib has both deflate and compress
IRC [09:29] <zoro2> deflate is no headers, compress is with headers
IRC [09:29] <zoro2> zip command is emulated in vfslib.tcl
IRC [09:29] <jcollins> hmmm, ok makes sense
IRC [09:29] <zoro2> and zip -mode compress is equal to zlib deflate
IRC [09:29] <zoro2> if {[llength $args] > 2 && [lrange $args 0 1] == "-nowrap 1"} {
IRC [09:29] <zoro2> which reminds me I had to switch to deflate from compress
IRC [09:30] <jcollins> ok, i'll look at that some more
IRC [09:31] <zoro2> done
IRC [09:31] * zoro2 is writing a synchronization protocol for files - both to my cell phone (compression is a bless over gprs :) and over the network
IRC [09:31] <zoro2> it's really hard to make java and tcl work together :)
IRC [09:32] <zoro2> and so I learnt a bit on deflate/compress issues and how to find counterparts in java
IRC [09:33] <jcollins> I'll have to try it some more.
IRC [09:43] <zoro2> how the fuck do I copy byte[] into a byte[] in java?
IRC [09:43] <jcollins> I guess nszlib doesn't do the headers right because a compress in nszlib doesn't decompress in zlib
IRC [09:45] <zoro2> I'm going to get mad in a second!
IRC [09:45] <zoro2> who the fuck wrote Java?
IRC [09:45] <jcollins> haha
IRC [09:45] <jcollins> The real question is why is it so popular?
IRC [09:46] <zoro2> :)
IRC [09:46] <zoro2> ok it even has arraycopy
IRC [09:46] <zoro2> the question is really good
IRC [09:47] <zoro2> but I guess it doesn't work same as memcpy
IRC [09:47] <jcollins> this zlib thing is driving me mad
IRC [09:48] <zoro2> now this is a joke of the week
IRC [09:48] <zoro2> arraycopy sometimes works and sometimes doesn't
IRC [09:49] <zoro2> ok it works
IRC [09:50] <zoro2> now this is nice
IRC [09:50] <zoro2> if I send a text document, I can save up to 80% of the bandwidth
IRC [09:51] <zoro2> at the cost of eating up 200kB of memory - this is not so bad
IRC [10:36] *** frankie parted the chat.
IRC [10:37] *** frankie joined the chat.
IRC [11:12] *** frankie parted the chat.
IRC [11:14] <Dossy> yay. more bugs in aolserver found ...
IRC [11:19] <jcollins> what bugs?
IRC [11:41] *** rubick joined the chat.
IRC [12:11] <Dossy> SF Bug #1029918, SF Bug #1029512.
IRC [12:12] <Dossy> fixed them already ...
IRC [12:12] <Dossy> causing some production problems at AOL
IRC [13:02] <jcollins> hey dossy how do i ns_write binary data from aolserver 3.5.x?
IRC [13:02] <Dossy> Good question ...
IRC [13:02] <Dossy> Does 3.5.x have [ns_conn channel] or whatever it is?
IRC [13:02] <jcollins> don't think so
IRC [13:03] *** bartt joined the chat.
IRC [13:03] <Dossy> [ns_conn sock] - that's it
IRC [13:04] <Dossy> no, that's not going to help you ...
IRC [13:04] <jcollins> nope
IRC [13:04] <Dossy> yeah, I think your only bet is ns_connsendfp
IRC [13:05] <jcollins> or maybe Ns_ConnReturnData and a nice C wrapper?
IRC [13:06] <Dossy> Doesn't ns_write do that?
IRC [13:06] <jcollins> it uses Ns_ConnPuts
IRC [13:07] <jcollins> i think the key is getting the data into the ns_write proc as raw bytes
IRC [13:07] <Dossy> Oh, poop.
IRC [13:07] <Dossy> ns_write works as long as there are no embedded NULLs
IRC [13:08] <jcollins> i'll just write a simple wrapper and see if that works
IRC [13:08] <Dossy> did you try ns_write?
IRC [13:08] <jcollins> yeah, it doesn't work
IRC [13:08] <Dossy> what doesn't it do?
IRC [13:09] <Dossy> ns_write [encoding convertto identity $data] ?
IRC [13:09] <jcollins> what'll that do?
IRC [13:09] <Dossy> should convert to binary from utf8
IRC [13:09] <jcollins> hrm let me try
IRC [13:13] <jcollins> man, i just don't know what the deal is
IRC [13:13] <jcollins> now i cannot even write to a file and get valid data
IRC [13:13] <jcollins> ugh
IRC [13:18] <Dossy> heh
IRC [13:35] <jcollins> awesome
IRC [13:35] <jcollins> Ns_ConnReturnData works like a champ
IRC [13:40] <Dossy> HEH
IRC [13:40] <Dossy> Tcl_Obj command?
IRC [13:41] <Dossy> you could just fixup ns_return* to speak Tcl_Obj's --
IRC [13:41] <Dossy> but then I ask: why are you still in 3.5? :)
IRC [13:41] <jcollins> Because our site was not 100% working on it last time
IRC [13:41] <jcollins> subtle differences in the adp parser
IRC [13:42] <jcollins> there were some other reasons that escape me
IRC [13:46] <jcollins> I'm curious why PyWX is written how it is.
IRC [13:46] <jcollins> With thread/interp pools.
IRC [13:47] <Dossy> beats me --
IRC [13:47] <Dossy> i have not looked at PyWX ever, and it seems it's been abandoned/orphaned
IRC [13:48] <jcollins> yeah
IRC [13:54] <jcollins> No good Python web environments
IRC [13:54] <jcollins> best thing i've found is Draco
IRC [14:02] <Dossy> Zope
IRC [14:02] <Dossy> ?
IRC [14:02] <Dossy> that's the popular one, at least
IRC [14:03] <jcollins> Yeah, Zope ... ick
IRC [14:03] <jcollins> My mind is tainted with AOLserver
IRC [14:04] <jcollins> + our homegrown environment
IRC [14:04] <jcollins> So it's hard to like other environments ... I'm going to give each a good try/look before I decide I hate them all :)
IRC [14:11] <Dossy> yeah
IRC [14:12] <Dossy> what do you use aolserver for? what company do you work for?
IRC [14:13] *** frankie joined the chat.
IRC [14:14] <jcollins> i work for placemark investments
IRC [14:14] <jcollins> we use aolserver for our investment advisor application
IRC [14:56] *** frankie parted the chat.
IRC [15:27] *** tekbasse joined the chat.
IRC [15:55] <Dossy> oh yeah - duh, you've told me that before :) :)
IRC [16:00] <jcollins> yup
IRC [16:03] <Dossy> looks like we MAY be rushing 4.0.9a into production next week. hee
IRC [17:19] *** tekbasse parted the chat.
IRC [17:27] *** zoro2 parted the chat.
IRC [18:07] <jhavard> later all
IRC [20:01] *** rubick parted the chat.
IRC [20:04] <Dossy> must be the weekend.
IRC [22:30] *** aolserver-scribe parted the chat.