[Jprogramming] adventofcode day 4

Henry Rich henryhrich at gmail.com
Sat Dec 5 02:07:37 UTC 2015


Also see http://code.jsoftware.com/wiki/Vocabulary/hatco#DoWhile

Henry Rich

On 12/4/2015 9:04 PM, Alex Shroyer wrote:
> Thanks for posting that.  I've wondered several times how to do an
> "increment argument until condition" using the power conjunction and your
> example clarified it for me.
>
> I think it's the parentheses making the difference here:
>
> *(u^:(v))^:_ y*
>
> versus
>
> *(u)^:(v)^:_ y*
>
> On Fri, Dec 4, 2015 at 12:46 PM, Joe Bogner <joebogner at gmail.com> wrote:
>
>> here was mine:
>>
>> (>:^:(0='00000' -: 5&{.@([: gethash_jqtide_ 'md5' ; 'bgvyzdsv' ,
>> ":&])))^:_ (0)
>>
>>
>>
>> On Fri, Dec 4, 2015 at 12:42 PM, 'Pascal Jasmin' via Programming
>> <programming at jsoftware.com> wrote:
>>> in j803+ gethash is dyadic
>>>
>>> 'MD5'&gethash 'asdf'
>>>
>>>
>>>
>>>
>>> A neat trick for simulating "break." tacitly with power is to modify the
>> shape of input on success/break condition.  I.@(boolexp) returns 0 if
>> true, or null if not, and appending the result of I@:f, to next y can
>> signal break with a cheap test.
>>>
>>> <:@{: 'bgvyzdsv' (>:@] ,~ I.@:('00000' -: 5 {. 'MD5'&gethash)@,&":)^:(0
>> < {.@])^:(_) 1
>>>
>>> ----- Original Message -----
>>> From: Joe Bogner <joebogner at gmail.com>
>>> To: programming at jsoftware.com
>>> Sent: Friday, December 4, 2015 12:05 PM
>>> Subject: Re: [Jprogramming] adventofcode day 4
>>>
>>> md5 addon doesn't work correctly on j64
>>>
>>> gethash_jqtide_ 'md5';'abcdef609043'
>>>
>>> 000001dbbfa3a5c83a2d506429c7b00e
>>>
>>> On Fri, Dec 4, 2015 at 12:03 PM, David Lambert <b49p23tivg at gmail.com>
>> wrote:
>>>> Test case in python and in j, am I misusing the j md5?
>>>>
>>>>     load'/usr/share/j/8.0.4/addons/convert/misc/md5.ijs'
>>>>     md5'abcdef609043'
>>>> a26563da313447e282c8212455525f33
>>>>
>>>>
>>>>>>> import hashlib
>>>>>>> hashlib.md5(b'abcdef609043')
>>>> <md5 HASH object @ 0x7f6261e02d00>
>>>>>>> hashlib.md5(b'abcdef609043').hexdigest()
>>>> '000001dbbfa3a5c83a2d506429c7b00e'
>>>> ----------------------------------------------------------------------
>>>> 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
>>
> ----------------------------------------------------------------------
> For information about J forums see http://www.jsoftware.com/forums.htm
>



More information about the Programming mailing list