Thank you for that trick, Chris.  Solves my main concerns.

  gethash @ ('sha1'&;) &> 'asdf';'as' 
3da541559918a808c2402bba5012f6c60b27661c 
df211ccdd94a63e0bcb9e6ae427a249484a49d60

with that said, it may be early enough to change to dyad, since the trick is 
not as user friendly as not having to use the trick?


----- Original Message -----
From: chris burke <[email protected]>
To: Programming forum <[email protected]>
Cc: 
Sent: Monday, August 4, 2014 5:23:29 PM
Subject: Re: [Jprogramming] New JQt binaries

Thanks. There are two arguments, so it would have been better to define
gethash as a dyad.

However, I think this is a minor point, since it is always easy to apply a
J function to each element of an array, e.g. as

  gethash @ ('sha1'&;)

Each item of the array has its own cd call, so there is little difference
in efficiency.

Also, you are free to define your own gethash function.



On Mon, Aug 4, 2014 at 1:58 PM, 'Pascal Jasmin' via Programming <
[email protected]> wrote:

> may I recommend the following alternative gethash definition:
>
>    gethashA =: 1 : 0
> y=. ,y
> c=. '"',libjqt,'" gethash ',(IFWIN#'+'),' i *c *c i * *i'
> 'r m y w p n'=. c cd (tolower m);y;(#y);(,2);,0
> res=. memr p,0,n
> if. r do.
>   res (13!:8) 3
> end.
> res
> )
>
> The benefit of this definition is that it becomes possible to hash an
> array of strings.  A dyadic definition could also be used instead, with the
> line x =. boxopen x.  An advantage of a dyadic definition would be minor,
> but include the possibility of obtaining multiple hash algorithms for one
> argument.
>
>    'sha1' gethashA &> 'asdf';'as'
> 3da541559918a808c2402bba5012f6c60b27661c
> df211ccdd94a63e0bcb9e6ae427a249484a49d60
>
> ripemd160 not part of qt library yet, but is in libea32.
>
> An advantage of the adverb definition is that it would allow for a
> compatible definition to my much faster direct bindings to the openssl
> library, if for some reason the direct bindings don't work on a system.
>
>
>
>
>
>
> ----- Original Message -----
> From: chris burke <[email protected]>
> To: Programming forum <[email protected]>
> Cc:
> Sent: Saturday, August 2, 2014 10:18:41 AM
> Subject: [Jprogramming] New JQt binaries
>
> New JQt binaries for J802 have been released. This is a minor upgrade, see
> http://www.jsoftware.com/jwiki/System/ReleaseNotes/J802 .
>
> To upgrade:
>
> 1. In J, use pacman to update to the latest addons (essential are the base
> library and ide/qt addons).
>
> 2. close J (all J sessions) and run the updatejqt.cmd (Windows) or
> updatejqt.sh (Mac/Linux) scripts, or equivalently, load J console and run:
>
>   install 'qtide'
> ----------------------------------------------------------------------
> For information about J forums see http://www.jsoftware.com/forums.htm



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

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

Reply via email to