Help unsubscribe
-----Original Message-----
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of [EMAIL PROTECTED]
Sent: Wednesday, August 08, 2007 3:38 PM
To: [email protected]
Subject: Programming Digest, Vol 23, Issue 23

Send Programming mailing list submissions to
        [email protected]

To subscribe or unsubscribe via the World Wide Web, visit
        http://www.jsoftware.com/cgi-bin/mailman/listinfo/programming
or, via email, send a message with subject or body 'help' to
        [EMAIL PROTECTED]

You can reach the person managing the list at
        [EMAIL PROTECTED]

When replying, please edit your Subject line so it is more specific
than "Re: Contents of Programming digest..."


Today's Topics:

   1. Re: pcre question (bill lam)
   2. Re: Re: Web Service Client? (Oleg Kobchenko)
   3. Re: pcre question (Raul Miller)
   4. Re: Sharing mapped file between 64bit and 32bit J (Roger Hui)
   5. Name Resolution (Roger Hui)
   6. An Introductory Course in J (Kip Murray)
   7. Re: J gotcha [was: Standalone Error wdhandler_base_]
      (Randy MacDonald)
   8. Re: Sharing mapped file between 64bit and 32bit  J (Anssi Seppälä)


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

Message: 1
Date: Thu, 09 Aug 2007 00:00:49 +0800
From: bill lam <[EMAIL PROTECTED]>
Subject: Re: [Jprogramming] pcre question
To: Programming forum <[email protected]>
Message-ID: <[EMAIL PROTECTED]>
Content-Type: text/plain; charset=ISO-8859-1; format=flowed

Raul Miller wrote:
> Perhaps
>    '.*\((.+?)\&\([EMAIL PROTECTED]) flag'

Thank you, it works although I cannot yet understand why.

What is search pattern if it needs to count matching parenthesis, eg
('dog', 'mouse'), (('cat' ; dog)&([EMAIL PROTECTED]) flag

the group I want:  ('cat' ; dog)

-- 
regards,
bill


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

Message: 2
Date: Wed, 8 Aug 2007 09:12:59 -0700 (PDT)
From: Oleg Kobchenko <[EMAIL PROTECTED]>
Subject: Re: [Jprogramming] Re: Web Service Client?
To: Programming forum <[email protected]>
Message-ID: <[EMAIL PROTECTED]>
Content-Type: text/plain; charset=iso-8859-1

You need to be either more specific, or the
general advice is use the debuggers (J and C++)
and trace up to the offending line and observe all
the parameters carefully. This will involve a lot
of crashes and restarts, which is normal. As you
gain more handle over it, you will be constructing the
definitions and preparing parameters that will work
without crashing the first time around.

Can you privide a few representative code samples
what you are doing?


--- Yuvaraj Athur Raghuvir <[EMAIL PROTECTED]> wrote:

> Hello,
> 
> I started the implementation of my own wrapper. Now, almost all the calls
> are going fine. At the critical point when I have to establish the
> connection and send the message, there is an  Access Violation that brings
> down J environment. I am able to execute the same sequence of calls from a
> simple client application.
> 
> Now, how to debug this access violation?
> 
> 1) I have done a simple mapping of pointers to structures as integers. This
> seems to work because all I do is manage the various pointers - get it from
> one call and pass it to the other. But is this the right way?
> 
> 2) I built the engine in the VC++ Express edition. However, all I get to
> understand if that a certain call causes a access violation in j.exe and the
> second time J crashes. This is related to invoking a function pointer buried
> deep in the various pointers I manage from J.
> 
> Any clues?
> 
> Regards,
> Yuva
> 
> p.s: If you need more info on the code I have written, just let me know and
> I shall paste the code into the mail (the C/C++ working version & my J
> translation)
> 
> On 7/18/07, Yuvaraj Athur Raghuvir <[EMAIL PROTECTED]> wrote:
> >
> > Hello,
> >
> > I recently came across Axis2C - a C implementation for Web Service
> > Consumption - developed by Apache (http://ws.apache.org/axis2/c/)
> >
> > Looking at the example clients that comes with the installation, I think
> > it would be quite straight forward to provide a web service client facility
> > in J via an addon.
> >
> > Being a novice at DLL integration into J, I was wondering if someone else
> > is looking into this.
> >
> > I think adding this as another package under JAL would be quite useful.
> >
> > Let me know.
> >
> > Thanks,
> > Yuva
> >
> >
> ----------------------------------------------------------------------
> For information about J forums see http://www.jsoftware.com/forums.htm
> 



      
____________________________________________________________________________________
Park yourself in front of a world of choices in alternative vehicles. Visit the 
Yahoo! Auto Green Center.
http://autos.yahoo.com/green_center/ 


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

Message: 3
Date: Wed, 8 Aug 2007 12:56:59 -0400
From: "Raul Miller" <[EMAIL PROTECTED]>
Subject: Re: [Jprogramming] pcre question
To: "Programming forum" <[email protected]>
Message-ID:
        <[EMAIL PROTECTED]>
Content-Type: text/plain; charset=ISO-8859-1

On 8/8/07, bill lam <[EMAIL PROTECTED]> wrote:
> Raul Miller wrote:
> > Perhaps
> >    '.*\((.+?)\&\([EMAIL PROTECTED]) flag'
>
> Thank you, it works although I cannot yet understand why.

The underlying problem is that pcre works serially.  )You can
build regular expression engines that work in parallel, treating
all possibilities equally, but those make the treatment of
grouping parenthesis a somewhat significant problem in the
general case.)

So, the non-greedy .+? pattern matches the shortest possible
match that works, but that doesn't say anything about where
it starts.

The .* at the begining is greedy, and matches as much as possible,
which forces the .+? sub-pattern to start as late as possible.

> What is search pattern if it needs to count matching parenthesis, eg
> ('dog', 'mouse'), (('cat' ; dog)&([EMAIL PROTECTED]) flag

Regular expressions cannot count matching parenthesis (though
hypothetically speaking a regular expression implementation can
easily include "non-regular expression features"), though you can
ennumerate the more common possibilities.

The best general approach here is probably to break your sentence up
into relevant "words" and use something that can count or use a stack
to match things up.  And note that while you want to pick your regular
expression(s) to minimize the work required by the rest of the system,
you also often wind up choosing something that "mostly works" rather
than something which is a precise fit for the requirements as you
originally imagined them.

But, here's how you might match on two of the more common possibilities:

'(([^()]+|\([^()]+\))\&\([EMAIL PROTECTED]) flag'

On the one hand, this won't match at all for a number of cases.  On
the other hand, greedy matches work just fine for the cases that it
will match.

-- 
Raul


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

Message: 4
Date: Wed, 08 Aug 2007 10:40:54 -0700
From: Roger Hui <[EMAIL PROTECTED]>
Subject: Re: [Jprogramming] Sharing mapped file between 64bit and
        32bit J
To: Programming forum <[email protected]>
Message-ID: <[EMAIL PROTECTED]>
Content-Type: text/plain; charset=iso-8859-1

Mapped files of integers can not be shared directly 
between j32 and j64, because (as you pointed out)
an integer is 4 bytes in j32 but 8 bytes in j64.
You can use the 3!:x verbs to convert between the
two types of integers.  A "limit error" is signalled
on attempting to convert a 8-byte integer to a
4-byte integer which is too large for 4 bytes.
Converting from 4 byte integers to 8 byte integers
will always succeed (space permitting).

The following examples were executed on j32.
The examples use 3!:3 for illustration. In actual
use 3!:1 with a left argument that respects the
byte order of the underlying machine would be 
more efficient.

   ] x=: 5 [EMAIL PROTECTED] 100
63 92 51 92 39
   ] t64=: 2 (3!:3) x
e200000000000000
0000000000000004
0000000000000005
0000000000000001
0000000000000005
000000000000003f
000000000000005c
0000000000000033
000000000000005c
0000000000000027
   3!:2 t64
63 92 51 92 39
   ] t64a=: 'f' (<8;0)}t64
e200000000000000
0000000000000004
0000000000000005
0000000000000001
0000000000000005
000000000000003f
000000000000005c
0000000000000033
f00000000000005c
0000000000000027
   3!:2 t64a
|limit error
|       3!:2 t64a



----- Original Message -----
From: Anssi Seppälä <[EMAIL PROTECTED]>
Date: Tuesday, August 7, 2007 23:19
Subject: [Jprogramming] Sharing mapped file between 64bit and 32bit J
To: Programming forum <[email protected]>

> I am studying methods to share data between 32 and 64 bit J. The 
> jfiles seem to work fine, but mapped files are different because 
> the 
> intergers are 4 and 8 bytes. I wonder it is possible to  
> convert in a 
> 64 bit J integers to 32 bit representation and write to a mapped 
> file 
> and vice versa. I wonder if this reasonable idea and how the 
> conversion is best to do?


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

Message: 5
Date: Wed, 08 Aug 2007 11:24:07 -0700
From: Roger Hui <[EMAIL PROTECTED]>
Subject: [Jprogramming] Name Resolution
To: Programming forum <[email protected]>
Message-ID: <[EMAIL PROTECTED]>
Content-Type: text/plain; charset=us-ascii

I have written an essay on the name resolution mechanism in J:
http://www.jsoftware.com/jwiki/Essays/Name_Resolution

If  you think that there is some behavior that can not be
explained by the rules as described, please say so in the
commentary section at the end of the essay.



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

Message: 6
Date: Wed, 8 Aug 2007 13:25:34 -0500 (CDT)
From: Kip Murray <[EMAIL PROTECTED]>
Subject: [Jprogramming] An Introductory Course in J
To: Programming forum <[email protected]>
Message-ID: <[EMAIL PROTECTED]>
Content-Type: TEXT/PLAIN; charset=US-ASCII

I am trying to understand Chapter 3 Rank of Verbs in Henry's lab An 
Introductory Course in J.  Here one of his examples:

   ] array =: 2 3 4 $ 'abcdefghijklmnopqrstuvwx'
abcd
efgh
ijkl

mnop
qrst
uvwx
   {."1 array  NB. Select first item of each 1-cell
aei
mqu

Why isn't the result displayed as

a
e
i

m
q
u

?

The answer is that J always displays vectors horizontally, other arrays 
vertically.  An impractical but consistent display is provided by

   showlist =: [: ": ,."1

which displays all arrays vertically:

   showlist array
a
b
c
d

e
f
g
h

i
j
k
l


m
n
o
p

q
r
s
t

u
v
w
x

The array is a list of two tables, each a list of three vectors (here 
displayed vertically), each a list of four letters.

   showlist {."1 array
a
e
i

m
q
u

The result is a list of two vectors (here displayed vertically), each a 
list of three letters.  In the standard display, the vectors are 
horizontal:

   {."1 array
aei
mqu

By consistently showing lists vertically, verb showlist helps me 
understand examples in Henry's Chapter 3.

Kip Murray

[EMAIL PROTECTED]
http://www.math.uh.edu/~km


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

Message: 7
Date: Wed, 08 Aug 2007 15:45:14 -0300
From: Randy MacDonald <[EMAIL PROTECTED]>
Subject: Re: [Jprogramming] J gotcha [was: Standalone Error
        wdhandler_base_]
To: Programming forum <[email protected]>
Message-ID: <[EMAIL PROTECTED]>
Content-Type: text/plain; charset=ISO-8859-1; format=flowed

Hello Roger;

> The interpreter works as expected.

As the author of the interpreter, that statement is a tautology.  I 
prefer useful statements myself.

Another statement, from 
http://www.jsoftware.com/help/dictionary/dicti.htm, states:

    indirect locative abc__xy refers to abc in the locale whose name is 
the current value of xy.

The statement could use the caveat that xy must be a boxed character list.

-- 
------------------------------------------------------------------------
|\/| Randy A MacDonald       | APL: If you can say it, it's done.. (ram)
|/\| ramacd <at> nbnet.nb.ca |
|\ |                         | The only real problem with APL is that
BSc(Math) UNBF'83            | it is "still ahead of its time."
Sapere Aude                  |     - Morten Kromberg
Natural Born APL'er          |
-----------------------------------------------------(INTP)----{ gnat }-





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

Message: 8
Date: Wed, 08 Aug 2007 23:52:06 +0300
From: Anssi Seppälä <[EMAIL PROTECTED]>
Subject: Re: [Jprogramming] Sharing mapped file between 64bit and
        32bit  J
To: Programming forum <[email protected]>
Message-ID: <[EMAIL PROTECTED]>
Content-Type: text/plain; charset="iso-8859-1"; format=flowed

Thank you,
That is a clear and flexible solution. First I thought that I could 
write a 32 bit mapped file from 64 bit system to be directly shared 
by 32 bit J. However this is sufficient for me, to transport data 
between 32bit and 64bit..
Anssi

At 20:40 8.8.2007, you wrote:
>Mapped files of integers can not be shared directly
>between j32 and j64, because (as you pointed out)
>an integer is 4 bytes in j32 but 8 bytes in j64.
>You can use the 3!:x verbs to convert between the
>two types of integers.  A "limit error" is signalled
>on attempting to convert a 8-byte integer to a
>4-byte integer which is too large for 4 bytes.
>Converting from 4 byte integers to 8 byte integers
>will always succeed (space permitting).
>
>The following examples were executed on j32.
>The examples use 3!:3 for illustration. In actual
>use 3!:1 with a left argument that respects the
>byte order of the underlying machine would be
>more efficient.
>
>    ] x=: 5 [EMAIL PROTECTED] 100
>63 92 51 92 39
>    ] t64=: 2 (3!:3) x
>e200000000000000
>0000000000000004
>0000000000000005
>0000000000000001
>0000000000000005
>000000000000003f
>000000000000005c
>0000000000000033
>000000000000005c
>0000000000000027
>    3!:2 t64
>63 92 51 92 39
>    ] t64a=: 'f' (<8;0)}t64
>e200000000000000
>0000000000000004
>0000000000000005
>0000000000000001
>0000000000000005
>000000000000003f
>000000000000005c
>0000000000000033
>f00000000000005c
>0000000000000027
>    3!:2 t64a
>|limit error
>|       3!:2 t64a
>
>
>
>----- Original Message -----
>From: Anssi Seppälä <[EMAIL PROTECTED]>
>Date: Tuesday, August 7, 2007 23:19
>Subject: [Jprogramming] Sharing mapped file between 64bit and 32bit J
>To: Programming forum <[email protected]>
>
> > I am studying methods to share data between 32 and 64 bit J. The
> > jfiles seem to work fine, but mapped files are different because
> > the
> > intergers are 4 and 8 bytes. I wonder it is possible to
> > convert in a
> > 64 bit J integers to 32 bit representation and write to a mapped
> > file
> > and vice versa. I wonder if this reasonable idea and how the
> > conversion is best to do?
>----------------------------------------------------------------------
>For information about J forums see http://www.jsoftware.com/forums.htm



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

----------------------------------------------------------------------
For information about J forums see http://www.jsoftware.com/forums.htm

End of Programming Digest, Vol 23, Issue 23
*******************************************
----------------------------------------------------------------------
For information about J forums see http://www.jsoftware.com/forums.htm

Reply via email to