entropyreduction | 1 Apr 2010 05:13

Re: sheri: ADODB demo


--- In power-pro@..., "Sheri" <sherip99 <at> ...> wrote:
>
> Had you intended to post a test ver? That too could improve the ADODB script.

comPlugin0.73_100401.zip in  
http://tech.groups.yahoo.com/group/power-pro/files/0_TEMP_/AlansPluginProvisional/

Includes script that gets and dumps a vec.  vec doesn;t seem to be working quite right...wait a minute, I may
have created it reversing rows x cols.  Can still access using 1d syntax, but 2d syntax compains...

------------------------------------

Attention: PowerPro's Web site has moved: http://www.ppro.orgYahoo! Groups Links

<*> To visit your group on the web, go to:
    http://groups.yahoo.com/group/power-pro/

<*> Your email settings:
    Individual Email | Traditional

<*> To change settings online go to:
    http://groups.yahoo.com/group/power-pro/join
    (Yahoo! ID required)

<*> To change settings via email:
    power-pro-digest@... 
    power-pro-fullfeatured@...

<*> To unsubscribe from this group, send an email to:
(Continue reading)

entropyreduction | 1 Apr 2010 05:15

getting messages from yahoo about uploads

I've got group preferences set to "web only", i.e. no email.

But recently whenever anyone uploads a file to forum, I get an e-mail alert.

Happens for several yahoo groups, so I bet yahoo has screwed something up somewhere.  If everyone else is
getting same....

------------------------------------

Attention: PowerPro's Web site has moved: http://www.ppro.orgYahoo! Groups Links

<*> To visit your group on the web, go to:
    http://groups.yahoo.com/group/power-pro/

<*> Your email settings:
    Individual Email | Traditional

<*> To change settings online go to:
    http://groups.yahoo.com/group/power-pro/join
    (Yahoo! ID required)

<*> To change settings via email:
    power-pro-digest@... 
    power-pro-fullfeatured@...

<*> To unsubscribe from this group, send an email to:
    power-pro-unsubscribe@...

<*> Your use of Yahoo! Groups is subject to:
    http://docs.yahoo.com/info/terms/
(Continue reading)

Sheri | 1 Apr 2010 08:41
Picon

Re: sheri: ADODB demo

--- In power-pro@..., "entropyreduction"
<alancampbelllists+yahoo <at> ...> wrote:
> 
> --- In power-pro@..., "Sheri" <sherip99 <at> > wrote:
> >
> > Had you intended to post a test ver? That too could improve the ADODB script.
> 
> comPlugin0.73_100401.zip in
> http://tech.groups.yahoo.com/group/power-pro/files/0_TEMP_/AlansPluginProvisional/
> 
> Includes script that gets and dumps a vec. vec doesn;t seem to be
> working quite right...wait a minute, I may have created it
> reversing rows x cols. Can still access using 1d syntax, but 2d
> syntax compains... 

I don't know if I'm supposed to have an updated Vec plugin.

I haven't tried to see what the GetRows returned array looks like in VBA but the documentation says: "Use the
GetRows method to copy records from a Recordset into a two-dimensional array. The first subscript
identifies the field and the second identifies the record number. The array variable is automatically
dimensioned to the correct size when the GetRows method returns the data."

That sounds backwards to what I'm used to with regex 2d vectors (where the first index is the row number and
the second is a column number).

In fact the Powerpro help states that 2d vectors are organized by rows.

Anyway, accessing the vector as a 1d vector it was easy enough to substitute records from your hVec into my
process (which still creates and returns a vector that uses class-style records). Haven't timed it, but
feels zippier.
(Continue reading)

entropyreduction | 1 Apr 2010 17:46

Re: sheri: ADODB demo


--- In power-pro@..., "Sheri" <sherip99 <at> ...> wrote:
> I don't know if I'm supposed to have an updated Vec plugin.

No, not needed, but the com plugin I put up had gremlins.

> I haven't tried to see what the GetRows returned array looks like in VBA but the documentation says: "Use
the GetRows method to copy records from a Recordset into a two-dimensional array. The first subscript
identifies the field and the second identifies the record number. The array variable is automatically
dimensioned to the correct size when the GetRows method returns the data."
> 
> That sounds backwards to what I'm used to with regex 2d vectors (where the first index is the row number and
the second is a column number).
> 
> In fact the Powerpro help states that 2d vectors are organized by rows.

Yeah.  In fact to make 2d work for this particular case I've swapped dimensions in 

comPlugin0.73_100401_2noRefCounting.zip

which includes a script using getRows.  

But not sure whether it might be better to always just copy into a 1D vec, cause there's no reason to assume
ever SAFEARRAY with 2 dimensions will organise stiff in the same way (BTW I'm not fussing with subscripts
when extracting data from SAFEARRAY; I jsut grab the whole block of data with SafeArrayAccessData and
convert each item
in the block I get back into a string.

Oops, I think I should have called SafeArrayDestroy, so there's probably a leak, and maybe problem
disconnectiong from database, though no apparent problem in my short sample script.
(Continue reading)

entropyreduction | 1 Apr 2010 17:59

Bruce: ref counting

Hi Bruce,

all okay so far wilth com using ref counting (comPlugin0.73_100401_2RefCounting.zip in my usual folder
http://tech.groups.yahoo.com/group/power-pro/files/0_TEMP_/AlansPluginProvisional/)

Some questions:

for each objFile  in objFolder.Files
  win.debug("   unicode handle: " ++ objFile.Name ++ " = " ++ objFile.Name.ascii) ;; should be returned as
handle to unicode string
; NOT necessary to release objects 
; objFile.release
endfor

Seem to work okay without release.  hanlde always the same, which suggests the for/each mechanism is doing
the right thing.  I'll step through it in debugger at some point to make sure.

My decrementRef callback function, it it's passed an invalid handle, does nothing.  That seems right,
because might happen if e.g. user
DID release a handle explicitly before your code (e.g. for/each code) tried to.  That sounds right.

Also: if I do this:

hVec[1] = hanToComObj

I assume your code bumps up the ref count via my incrementing callback.  But if I do something like that in my
code within some plugin, I'd better bump up the ref code myself?  Suppose I do it via the VECSERVICES
interface, which calls your code in vec.c.  Don't see anything in there examining assigned values for
handlish nature.
I pet ppsv->CallPlugin doesn't do anything about it either.  Assume your code handling assignment is where
(Continue reading)

brucexs | 1 Apr 2010 21:41
Picon
Favicon

Re: Bruce: ref counting


> Some questions:
> 
> 
> for each objFile  in objFolder.Files
>   win.debug("   unicode handle: " ++ objFile.Name ++ " = " ++ objFile.Name.ascii) ;; should be returned as
handle to unicode string
> ; NOT necessary to release objects 
> ; objFile.release
> endfor
> 
> 
> Seem to work okay without release. 

There is a bug in foreach unless you have the latest exe (it is fixed in that exe which provides to callplugin
service).  But if you have that latest exe, then foreach should work correctly, ie

1.  objFile will be allocated and treated as local if it is not allocated before the for each.

2.  each time objfile is assigned, the ppsv->ChangeRefHandle (terrible name!) service is called which
will call any reference counter for the object, as per the help (in vec, I called it changeifhandle in the
pproservices typedef  but it is same function)

Fomr the help:
ppsv->ChangeRefHandle is used in assignments.  First  the plugin calls it with second argument 1 to add a new
reference for the new value.  Then it is called again with second argument 0 on the value which is being
overwritten by the assignment (if any) to decrement the reference count for that value, it if is an object.

-------------------

(Continue reading)

Sheri | 1 Apr 2010 23:53
Picon

Re: getting messages from yahoo about uploads

--- In power-pro@..., "entropyreduction"
<alancampbelllists+yahoo <at> ...> wrote:
>
> I've got group preferences set to "web only", i.e. no email.
> 
> But recently whenever anyone uploads a file to forum, I get an
> e-mail alert.
> 
> Happens for several yahoo groups, so I bet yahoo has screwed
> something up somewhere. If everyone else is getting same.... 

Seems you may have been randomly selected to test that "feature".

<http://www.ygroupsblog.com/blog/2010/03/24/updates-in-your-groups/>

------------------------------------

Attention: PowerPro's Web site has moved: http://www.ppro.orgYahoo! Groups Links

<*> To visit your group on the web, go to:
    http://groups.yahoo.com/group/power-pro/

<*> Your email settings:
    Individual Email | Traditional

<*> To change settings online go to:
    http://groups.yahoo.com/group/power-pro/join
    (Yahoo! ID required)

<*> To change settings via email:
(Continue reading)

entropyreduction | 2 Apr 2010 05:25

Re: Bruce: ref counting


--- In power-pro@..., "brucexs" <brucexs <at> ...> wrote:
> Can I suggest you implement some kind of global debugging services for any object like
> obj.__refs__
> or some such which returns your internal ref count for the object.  Then win.debug counts as your go through
for loops. 

Good idea, will do.

> I suspect the release should do nothing if you implement reference counting.  Note that this is no release
function for class-plugin objects and no localcopy.  If you get an invalid handle, it should be a bug in your
code or mine.

I can imagine times when scripter would want to let go of a com resource before end of script.  I suppose could
do that by

  myHandle = ""

if that reduces ref count to zero; that's how you do it in VB/VBS 
with

  set myHandle = Nothing

OTOH Removing release breaks existing code...

I can certainly recommend myHandle = "" as preferred way of releasing an object.

> >and I have to do the same anywhere I copy a handle

> If you are copying a handle, you should use changerefhandle both on the assigned object and on any object
(Continue reading)

brucexs | 2 Apr 2010 12:41
Picon
Favicon

Re: Bruce: ref counting


> I can imagine times when scripter would want to let go of a com resource before end of script.  I suppose could
do that by

There is nothing wrong with keeping release if you like.  But it can lead to dangling references.

obj1  = com.create
//...
obj2 = obj1
//...
obj1.release

Now obj2 is meaningless.  But if scripters are willing to live with that, then fine.  No need for special
syntax for release.

------------------------------------

Attention: PowerPro's Web site has moved: http://www.ppro.orgYahoo! Groups Links

<*> To visit your group on the web, go to:
    http://groups.yahoo.com/group/power-pro/

<*> Your email settings:
    Individual Email | Traditional

<*> To change settings online go to:
    http://groups.yahoo.com/group/power-pro/join
    (Yahoo! ID required)

<*> To change settings via email:
(Continue reading)

brucexs | 2 Apr 2010 13:41
Picon
Favicon

Re: Bruce: ref counting


--- In power-pro@..., "brucexs" <brucexs <at> ...> wrote:
>
> 
> > I can imagine times when scripter would want to let go of a com resource before end of script.  I suppose
could do that by
> obj = ""

I should have mentioned that this will work now out of the box, assuming obj hold the only reference to a com object.

The variable assignment stuff in PowerPro gets used (since "" is not a handle), but it calls
changerefhandle, which sees that obj has a release call back, and so that will get called.  You can then free
the object.

I also wanted to draw attention to the fact that you should create new objects with a reference count of zero
in case they are never assigned.  It is when they are assigned that you get called to increment ref count.  Or
if they are just temps that are not assigned, you get refcallback(...,0) to delete them.

------------------------------------

Attention: PowerPro's Web site has moved: http://www.ppro.orgYahoo! Groups Links

<*> To visit your group on the web, go to:
    http://groups.yahoo.com/group/power-pro/

<*> Your email settings:
    Individual Email | Traditional

<*> To change settings online go to:
    http://groups.yahoo.com/group/power-pro/join
(Continue reading)


Gmane