Re: [Jprogramming] J on Jupyter progress

2016-02-09 Thread Pascal Jasmin
to run on windows, wrapper.py lines to change are: binpath = "D:/j64-804/bin" self.libj = get_libj(binpath + "/j.dll") kernel.json change: 'python3' to 'python' if installing python through anaconda, here is my path for putting the kernel files, D:\Users\Pascal\Anaconda3\share\jupyter\kernel

Re: [Jprogramming] Nested structures. Idioms? Combinators?

2016-02-10 Thread Pascal Jasmin
Note that there is a cover for 128!:2 apply 128!:2 in terms of modifying "., in my opinion, a more useful interpretation of a boxed parameters would be locales, and ". would operate within the locale list provided: A poorly chosen definition in profile, do ". What makes it a poor decis

[Jprogramming] an inverse to oblique

2016-02-17 Thread Pascal Jasmin
http://www.jsoftware.com/forums.htm

Re: [Jprogramming] an inverse to oblique

2016-02-17 Thread Pascal Jasmin
< (1 0 ; 0 1) - Original Message ----- From: Pascal Jasmin To: Programming Forum Sent: Wednesday, February 17, 2016 11:40 AM Subject: [Jprogramming] an inverse to oblique http://www.jsoftware.com/forums.htm -- For information abo

Re: [Jprogramming] an inverse to oblique

2016-02-17 Thread Pascal Jasmin
k > the original question is easier more flexible. I can't think of a better > way than to generate indexes, > > (< 0 0) ,&< (1 0 ; 0 1) > > > > > - Original Message - > From: Pascal Jasmin > To: Programming Forum > Sent: Wednesday,

Re: [Jprogramming] an inverse to oblique

2016-02-17 Thread Pascal Jasmin
The reason I asked, was to make this seemingly useful adverb that lends well to J patterns. The pattern is applying a verb 8 distinct directions across a table (rows cols 2 diagonals front and back) unoblique =: 4 : ' (;y) (; x)} (x $ 0)' eightdirs =: 1 : '[: |:@:(|."1) $ unoblique [: u&.|.

Re: [Jprogramming] an inverse to oblique

2016-02-18 Thread Pascal Jasmin
how I approached that problem when I last implemented something vaguely similar... Thanks, -- Raul On Wed, Feb 17, 2016 at 6:24 PM, Pascal Jasmin wrote: > The reason I asked, was to make this seemingly useful adverb that lends well > to J patterns. The pattern is applying a verb

Re: [Jprogramming] Qt dlls in the J64-804 bin directory

2016-02-20 Thread Pascal Jasmin
They are .so files on android, and maybe located elsewhere (openssl libraries are anyway). A C api is easier for J to call than C++. - Original Message - From: Robert Herman To: programm...@jsoftware.com Sent: Saturday, February 20, 2016 10:15 AM Subject: [Jprogramming] Qt dlls in th

Re: [Jprogramming] Am I understanding m/y ?

2016-02-22 Thread Pascal Jasmin
I too expected what you did, but found the behaviour to be what it is. Everyone before us, perhaps found the same. Its not a crazy implementation. A better example of a surprise is with 4 items. But the root of all of this lies in what to do with 2 items. +`*/3 4 5 2 31 +`*`-/3 4

Re: [Jprogramming] Am I understanding m/y ?

2016-02-23 Thread Pascal Jasmin
nice... maybe small cleanup, ".@; every ([,(<'+'),])`([,(<'*'),])/&.|.each ": each each<\. 1 2 3 4 5 6 7 There is this way too, (< +`*) (|.each@:|.@:($~ each 1 >. <:) 4 : 'x/ y' every <\.@]) 1 2 3 4 5 6 7 209 209 207 69 65 13 7 - Original Message - From: Brian Schott To: Programmin

Re: [Jprogramming] Am I understanding m/y ?

2016-02-23 Thread Pascal Jasmin
.6 1.7 0.3 9 _5 _1 7 Step-by-step: 1%2-3%4-5%6-7 0.6 2-3%4-5%6-7 1.7 3%4-5%6-7 0.3 4-5%6-7 9 5%6-7 _5 6-7 _1 7 7 Skip Cave Cave Consulting LLC On Tue, Feb 23, 2016 at 6:27 PM, Pascal Jasmin wrote: > nice... maybe small cleanup, > > ".@; ever

Re: [Jprogramming] Am I understanding m/y ?

2016-02-24 Thread Pascal Jasmin
#x27; every <\.@]) ] > fn =: <@|.@[ (|.each@:|.@:($~ each 1 >. i.@#) 4 : 'x/ y' every <\.@]) ] > > On Tue, Feb 23, 2016 at 10:51 PM, Pascal Jasmin > wrote: > > > fn =: <@|.@[ (|.each@:|.@:($~ each 1 >. <:) 4 : 'x/ y' every <\.@

[Jprogramming] problem with ". (numbers)

2016-02-24 Thread Pascal Jasmin
this is good, _1 ". '44x' 44 _ ". '44' 44 _ ". '3 ' 3 problem1 _ ". '44x' _ problem2 0 ". ' ' (empty) workarounds, notanumber =: _1&([ = [ ". 'x' ,~ dltb@]) -- For information about J forums see http://www.jsoftw

[Jprogramming] reduce revisited

2016-02-25 Thread Pascal Jasmin
a couple of implementations I have posted before for u/ when x items and initial y are of different shape. reduce =: 1 : '<"_1@[ ([: u (&.>)/(>@:) ,) <@:]' reducE =: 1 : (':'; 'o=. y for_i. x do. o =. i u o end.') reducE is explicit, and left to right. reduce boxes each side, and uses the same

Re: [Jprogramming] reduce revisited

2016-02-25 Thread Pascal Jasmin
But wouldn't timings involving reduce-with-fill depend on how much fill needs to get generated? Thanks, On Thu, Feb 25, 2016 at 4:51 PM, Pascal Jasmin wrote: > a couple of implementations I have posted before for u/ when x items and > initial y are of different shape. > > re

Re: [Jprogramming] reduce revisited

2016-02-25 Thread Pascal Jasmin
two of the four timings can be meaningfully compared. -- Raul On Thu, Feb 25, 2016 at 5:49 PM, Pascal Jasmin wrote: >> 5 timespacex ' +/ (i. 25 4), 1 2 3 4' >> 0.0200582 2.51692e7 >> 5 timespacex '(i. 25 2) + reduceS 1 2 3 4' >> 0.0205952

Re: [Jprogramming] Inverses

2016-03-02 Thread Pascal Jasmin
You may already know that you can define your own inverses. Verbs have them. Not modifiers. But you can make a verb from a common modifier use. example: cut1 =: <;.1 :. ; (,~ -@:(+/))each&.cut1 0 1 1 1 0 1 0 1 1 _3 0 1 1 1 _1 0 1 _2 0 1 1 for cut_1, we can't really know an inverse for th

Re: [Jprogramming] J Challenge

2016-03-04 Thread Pascal Jasmin
sorry if this has been answered already, >@(~.@[ ; each To: programm...@jsoftware.com Sent: Friday, March 4, 2016 4:34 AM Subject: Re: [Jprogramming] J Challenge I don't think for a minute that this will be the most terse or most elegant but this is what I got: animals =: 'bird';'cow';'cow';'

Re: [Jprogramming] Fractions challenge

2016-03-06 Thread Pascal Jasmin
an alternate pm pm =: 1 : '(% +./)@((u/@:* |.) , */@])"1' From: Louis de Forcrand To: programm...@jsoftware.com Sent: Sunday, March 6, 2016 12:31 PM Subject: [Jprogramming] Fractions challenge Try to write a verb or adverb(s) that can add, subtract, multiply

Re: [Jprogramming] Replace Items

2016-03-09 Thread Pascal Jasmin
moving around the m term to be the "searched". There's probably a better version that doesn't box. ritem =: 1 : '(m -:"_ _1 ]) >@:({"0 1) (,&<~"_ _1)' (2 4 $ 0) (16+i.2 4) ritem i. 3 2 4 - Original Message - From: Kip Murray To: "programm...@jsoftware.com" Sent: Wednesday, March 9

Re: [Jprogramming] Unbox request for requests

2016-03-10 Thread Pascal Jasmin
This idea has a lot of promise. Converting to and from C structures would be big, though C doesn't have (AFAIK) a heterogeneous array format, and some standard representation for a dictionary would be needed. C JSON libraries all seem to do something different. The missing structure in C is

Re: [Jprogramming] Unbox request for requests

2016-03-13 Thread Pascal Jasmin
A feature that is a lot bigger than it looks, and something I think is a bug: For modifiers that return modifiers, errors are generated when a modifier train is saved (used as a name) or parenthesized + - (1 : '`u') `:6 + - + - (((1 : '`u')) (`:6)) |syntax error This error is overcommab

Re: [Jprogramming] Adverbial Tacit Jym

2016-03-13 Thread Pascal Jasmin
a0 =: "_ a1 =:(`{.)(`{:)(@.1 0 2) From: Jose Mario Quintana To: Programming forum Sent: Sunday, March 13, 2016 10:59 PM Subject: [Jprogramming] Adverbial Tacit Jym Welcome to the Adverbial (and Conjunctional) Tacit Jymnasium :) Orthodox and wicked routines

Re: [Jprogramming] Unbox request for requests

2016-03-15 Thread Pascal Jasmin
Yes that is it. >I think it's confusing because X (a0 a1) in this case is not the same as (X a0) a1 and not the same as (the implied parentheses created that usually work): X a0 a1 The workarounds are to use a linear representation of the adverb train and another adverb that combines

Re: [Jprogramming] Unbox request for requests

2016-03-15 Thread Pascal Jasmin
except X (a0 a1) (X a0) a1 X a0 a1 are all normally equivalent (unless a0 returns a modifier). In which case it returns syntax error for first expression, even though 3rd expression is both intuitive and likely intent (2nd expression equivalent to 3rd). Btw a1 can return a modifier without

Re: [Jprogramming] Unbox request for requests

2016-03-15 Thread Pascal Jasmin
We haven't explicitly mentioned it, but to be clear, the point of (a a) is to save an adverb train to a name for application later. I wasn't around when (c a) or (a c) was a thing, but if it was supposed to be equivalent to (u c v) a and u a (c v) then these can be implemented with double adve

Re: [Jprogramming] Adverbial Tacit Jym

2016-03-15 Thread Pascal Jasmin
not seen Pascal's solution for a1... 7 6 5 4 3 2 1 0 Produce a1 without involving @. in the code. Remember: "Spoiler alerts by instructors and patrons will be appreciated." On Mon, Mar 14, 2016 at 3:43 PM, wrote: > Pascal Jasmin wrote: > > a0 =: > > a1 =: >

Re: [Jprogramming] Unbox request for requests

2016-03-19 Thread Pascal Jasmin
y) was passed, as the argument, to a. Furthermore, the interpreter > (mistakenly) allowed to pass adverbs and conjunctions to the adverb a > (again, if I recall correctly). > > On Wed, Mar 16, 2016 at 11:21 AM, Pascal Jasmin > wrote: > >> Could someone remind me what >

Re: [Jprogramming] Unbox request for requests

2016-03-19 Thread Pascal Jasmin
. This would allow for both orthodox and (indirectly) wicked complete conjunctional programming (one could write the pro-adverb conj the counterpart the Tacit Toolkit pro-adverb adv. Thomas, That would be my request, bring back those two tridents. On Wed, Mar 16, 2016 at 1:12 PM, Pascal Jasmi

Re: [Jprogramming] Unbox request for requests

2016-03-19 Thread Pascal Jasmin
Could someone remind me what (a c) and (c a) used to do as trains? (in J5) was (c c) ever allowed? (sorry this is difficult to search) - Original Message - From: "neit...@gaertner.de" To: programm...@jsoftware.com Sent: Wednesday, March 16, 2016 10:12 AM Subject: Re: [Jprogramming

Re: [Jprogramming] Adverbial Tacit Jym

2016-03-19 Thread Pascal Jasmin
spoiler answer at bottom, - Original Message - From: Jose Mario Quintana To: Programming forum Sent: Thursday, March 17, 2016 7:00 PM Subject: Re: [Jprogramming] Adverbial Tacit Jym Let us add another twist, courtesy of David Lambert, to the Exercise 1: Produce a variant of a1, say

Re: [Jprogramming] Tail recursion (bug hijack)

2016-03-19 Thread Pascal Jasmin
to make a slightly off topic reply, this will crash J (win 64) (using the definitions in replied post) vr =: ($:@v0) recursive2=: vr`v1@.v2 recursive i.20 I can accept that I am using $: wrong, but if vr is defined as what appears to be equivalent: vr =: $:@v0 then recursive2 -: recursive (

Re: [Jprogramming] Tail recursion

2016-03-19 Thread Pascal Jasmin
There is a non recursive solution to your example problem which distracts from addressing the ^: transformation part (-. 0 -.~ ~.@:,@:(}:@divisors"0)) i.20 0 10 11 12 13 14 15 16 17 18 19 Your question is good. I've explored similar thoughts. I have several tools/tricks which could be improv

Re: [Jprogramming] A clever way to find the maximum possible integer

2016-03-19 Thread Pascal Jasmin
They fail. This library uses openssl bindings (available on all platforms and ships with recent Js) https://github.com/Pascal-J/BN-openssl-bindings-for-J I don't remember if I implemented all boolean functions but it's straightforward to define any missing ones using one as template. The ot

Re: [Jprogramming] Tail recursion (bug hijack)

2016-03-19 Thread Pascal Jasmin
stack size of windows jqt.exe should had already increased since this February. Сб, 19 мар 2016, Pascal Jasmin написал(а): > to make a slightly off topic reply, this will crash J (win 64) (using the > definitions in replied post) > > > vr =: ($:@v0) > recursive2=: vr`v1@.v2 &

Re: [Jprogramming] Tail recursion (bug hijack)

2016-03-21 Thread Pascal Jasmin
Can't think of a reason why we wouldn't want this in the official interpreter - Original Message - From: Jose Mario Quintana To: Programming forum Sent: Monday, March 21, 2016 9:54 AM Subject: Re: [Jprogramming] Tail recursion (bug hijack) Right, I never saw or found a satisfactory c

Re: [Jprogramming] Help, please - crash after suspension in J64

2016-03-21 Thread Pascal Jasmin
Is there a link to the source code behind ctrl-K. I think the last time someone complained about it having a bug, the feature was removed for 4 months :P It appears as though the bug would be in what should be a relatively short bit of code? - Original Message - From: Henry Rich T

Re: [Jprogramming] Tail recursion (bug hijack)

2016-03-22 Thread Pascal Jasmin
;>> determine automatically if it is. Jx is not for the faint of heart and >>> will stay there but I am not sure about J Unbox or the official >>> interpreter. >>> >>> On Mon, Mar 21, 2016 at 6:21 PM, Pascal Jasmin >>> wrote: >>> >>

Re: [Jprogramming] maybe a bug in short circuiting. Help with a guard structure

2014-01-15 Thread Pascal Jasmin
(2 : (':'; '(u@:[)^: (v y) 1')) * --- 2 Dyad --- 2 (2 = sideff__) (2 : (':'; '(u@:[)^: (v y) 1')) * 1   --   3 : 'a=: +/ y'   1   1   == 0 == 0 On W

Re: [Jprogramming] maybe a bug in short circuiting. Help with a guard structure

2014-01-15 Thread Pascal Jasmin
, 2014 at 11:26 AM, Pascal Jasmin wrote: > I see the problem with guard now.  Its related to dyadic ^: having a weird > static optimization by doing (x&u) > > so even though guard asks for (u@:[) it passes the 1 at the far end of guard.  > Basically the u side of ^: is always

Re: [Jprogramming] Adverb each rank

2014-01-17 Thread Pascal Jasmin
its the magic of each or & and &. as a dyad, which has a fork like expansion of (v x) u v y. some distracting workarounds include:    '=:' splitstring "1 'a=:b',:'c=:d' ┌─┬─┐ │a│b│ ├─┼─┤ │c│d│ └─┴─┘ or    (<'=:') splitstring S:1   ;: each 'a=:b';'c=:d' or    (<'=:') splitstring "1   ;: &> '

Re: [Jprogramming] more fork examples

2014-01-21 Thread Pascal Jasmin
most useful fork I know personally: inl =: (cocurrent@] ".@] [)"1 0 'code to run in locales' inl loc1;loc2;loc3 the neat parts about it: the left verb is sideeffects only. the pivot verb is monadically applied to right verb result the locale list is usually a list of numeric object instances.

[Jprogramming] BIGNUM c struct and bindings to openssl

2014-01-25 Thread Pascal Jasmin
Does anyone have example code for dealing with either BIGNUM structs from c, and/or ideally some J bindings to openssl? guidelines for bignums or structs in general are appreciated too. thank you. -- For information about J foru

Re: [Jprogramming] BIGNUM c struct and bindings to openssl

2014-01-25 Thread Pascal Jasmin
t an expert at it. I just did trial and error to modify what was included in task.ijs so I have a basic understanding On Sat, Jan 25, 2014 at 1:39 PM, Pascal Jasmin wrote: > Does anyone have example code for dealing with either BIGNUM structs from c, > and/or ideally some J bindings to opens

Re: [Jprogramming] An RSA encryption implementation

2014-01-28 Thread Pascal Jasmin
J has been able to encrypt/decrypt (verify/sign) rsa signatures for some time, with special code. http://www.jsoftware.com/jwiki/PascalJasmin/RSA%20native%20and%20openssl%20control includes code to generate and retrieve key parameters by spawning openssl commanline tools.  The first line of s

Re: [Jprogramming] An RSA encryption implementation

2014-01-28 Thread Pascal Jasmin
nice. Thanks, -- Raul On Tue, Jan 28, 2014 at 8:53 AM, Pascal Jasmin wrote: > J has been able to encrypt/decrypt (verify/sign) rsa signatures for some > time, with special code. > > http://www.jsoftware.com/jwiki/PascalJasmin/RSA%20native%20and%20openssl%20control > > &g

Re: [Jprogramming] An RSA encryption implementation

2014-01-28 Thread Pascal Jasmin
mruJfgd0RG' newandgetrsa 'pascaljasmin.txt' |index error: nkec |  privh=.,>}:^:(':'={:)each(#~0,@:-.@:=$&>),;:>2 3 4    {l I am also wondering about those blank lines I am seeing. (And, yes, that is a random and arbitrary example password - one which I hav

Re: [Jprogramming] An RSA encryption implementation

2014-01-28 Thread Pascal Jasmin
ade sure the path was absolute, and it still fails for me. Here's J6:   'd n'=: 'mruJfgd0RG' newandgetrsa jpath '~temp\pascaljamin' |index error: nkec |  privh=.,>}:^:(':'={:)each(#~0,@:-.@:=$&>),;:>2 3 4    {l That's the same error I w

Re: [Jprogramming] An RSA encryption implementation

2014-01-28 Thread Pascal Jasmin
also, I should mention that nkec is not needed at all for rsa, and the call in newkeys (last line in proc above it) can be changed to: p nkrsa y - Original Message - From: Pascal Jasmin To: "programm...@jsoftware.com" Cc: Sent: Tuesday, January 28, 2014 5:17:39 PM S

Re: [Jprogramming] An RSA encryption implementation

2014-01-28 Thread Pascal Jasmin
to the left of ',y and > to the right of .pem > > And, as I displayed in my previous messages, my smoutput lines were blank. > > Thanks, > > -- > Raul > > > On Tue, Jan 28, 2014 at 5:17 PM, Pascal Jasmin wrote: >> in nkec, check that the following 3 li

Re: [Jprogramming] An RSA encryption implementation

2014-01-28 Thread Pascal Jasmin
also, for the procedures nkec and nkrsa, you can take the individual lines with _1 fork, and paste them into console using spawn instead. you can set y as local variable without a path, and files will be created in ssl/bin folder - Original Message - From: Pascal Jasmin To: "pro

[Jprogramming] math requests

2014-01-29 Thread Pascal Jasmin
With all of the mathematicians on this list, these functions have likely been implemented before in J. elyptic curve point add, multiplication and double a python reference implementation:  https://github.com/warner/python-ecdsa/blob/master/ecdsa/ellipticcurve.py the functions are: __add__  __

Re: [Jprogramming] math requests

2014-01-29 Thread Pascal Jasmin
tinvmod )"0  ] 3x' 2.74558/sec 3.14547MB    ts '(14114588 +i.1) (invmod )"0  ] 3' 2.96905/sec 3.26822MB - Original Message - From: Pascal Jasmin To: "programm...@jsoftware.com" Cc: Sent: Wednesday, January 29, 2014 11:35:19 AM Subject: [Jprogrammin

Re: [Jprogramming] math requests

2014-01-29 Thread Pascal Jasmin
ve stuff; I think there is a +1 error that Roger Hui noticed in the factorization method. http://archive.vector.org.uk/art10007270 http://archive.vector.org.uk/art10007280 Best, Cliff On 1/29/2014 11:35 AM, Pascal Jasmin wrote: > > With all of the mathematicians on this list, these funct

[Jprogramming] setting rank to a conjunction

2014-01-29 Thread Pascal Jasmin
Is there a way to set the rank of the resulting verb of a conjunction?  A bit surprisingly, this workaround does not work: t=:  2 : '(u@:v)"1'    ] t+/ 3 3 $ i.9 9 12 15 result desired:    ]@:+/"1 ] 3 3 $ i.9 3 12 21 Ideally, it should be possible to set rank like: t =: 2 : 0 ("1) ... ) I g

Re: [Jprogramming] math requests

2014-01-29 Thread Pascal Jasmin
35 AM, Pascal Jasmin wrote: > > With all of the mathematicians on this list, these functions have likely been > implemented before in J. > > elyptic curve point add, multiplication and double > a python reference implementation: > https://github.com/warner/python-ecdsa/blob/mas

Re: [Jprogramming] math requests

2014-01-30 Thread Pascal Jasmin
tiplying a Point and an integer, nor have I seen any constructor for constructing a Point from an integer. Before I spend too much time chasing down rabbit holes (I really should be working on some other issues), can someone explain to me what is supposed to happen here? Thanks, -- Raul On Wed, J

Re: [Jprogramming] math requests

2014-01-30 Thread Pascal Jasmin
m...@jsoftware.com Cc: Sent: Wednesday, January 29, 2014 3:32:21 PM Subject: Re: [Jprogramming] math requests Some elliptic curve stuff; I think there is a +1 error that Roger Hui noticed in the factorization method. http://archive.vector.org.uk/art10007270 http://archive.vector.org.uk/art1000728

Re: [Jprogramming] math requests

2014-01-31 Thread Pascal Jasmin
1 ([ isCurvePoint stdPoint) 1943424321543223423423422342342343x (23 1 1 ecm )"0 1] 3 10 1x 1 where stdpoint and iscurvepoint stdPoint =: 4 : 'x | (xx, yy)* x | 2 3 ^~ x invmod z [ x=. {.x[ ''xx yy z'' =. y '"_ 1 isCurvePoint=: 4 : '0=p| (*:@{: - b + (a

Re: [Jprogramming] math requests

2014-01-31 Thread Pascal Jasmin
nderstanding of the math can explain to me how to think about this. Or, I am hoping that someone with a fresher set of eyes can see my mistake. (And, I should probably have capitalized the name negativeSelf for consistency.) Thanks, -- Raul On Wed, Jan 29, 2014 at 11:35 AM, Pascal Jasmin wro

Re: [Jprogramming] math requests

2014-01-31 Thread Pascal Jasmin
ementation either. Consider:     y3 = ( l * ( self.__x - x3 ) - self.__y ) % p Thanks, -- Raul On Thu, Jan 30, 2014 at 10:41 PM, Pascal Jasmin wrote: > Hi Cliff, > I don't understand how to go from xyz back to xy coordinates. > > > At any rate, here is the affi

Re: [Jprogramming] math requests

2014-02-02 Thread Pascal Jasmin
't really all that different. > But I sort of like the way this expression looks. > > Thanks, > > -- > Raul > > On Wed, Jan 29, 2014 at 3:02 PM, Pascal Jasmin wrote: >> Here is the first invmod method >> >> invmod=: 4 : 0 >> NB. inverse of y mod x (x|y)

Re: [Jprogramming] problem matching boxed string

2014-02-03 Thread Pascal Jasmin
I like this.  If this may one day be included in jhs itself, I would prefer the display were smaller, and that a line may be copied as plain text. In terms of array display, probably the most useful feature would be distinguing between 1 6 $ i.6 and 6 $ i.6. - Original Message - From:

Re: [Jprogramming] problem matching boxed string

2014-02-03 Thread Pascal Jasmin
same. That is before you try distinguish between 0 6 $ i.6 and 0 1 $ i.6 etc. It has been a fun exercise, although as Raul has said, it can also be maddening. Cheers, bob On Feb 3, 2014, at 11:11 AM, Pascal Jasmin wrote: > I like this.  If this may one day be included in jhs itself, I woul

Re: [Jprogramming] 'if' and 'else' operators

2014-02-04 Thread Pascal Jasmin
There is:    '0><' {~ * i:5 <0> and the verb: ([ {~ *@]) could be called selectnounfrom01_1 When selecting among expressions you should look at @. for if. do. u else. v , and ^:boolean for if. do.u else y I can think of syntactic sugar for if else as you put it to verbs/expressions, b

Re: [Jprogramming] 'if' and 'else' operators

2014-02-04 Thread Pascal Jasmin
;<'"_) if (0>])else ('>'"_) if (0<])"0 i:5 <<<<<0>>>>> - Original Message - From: Pascal Jasmin To: "programm...@jsoftware.com" Cc: Sent: Tuesday, February 4, 2014 7:39:32 AM Subject: Re:

Re: [Jprogramming] 'if' and 'else' operators

2014-02-04 Thread Pascal Jasmin
the :. trick from Michal is cute. Here is how I would like to be able to call the code (note this produces incorrect results): if =: 2 : '((u"_) :. ])^:([: -. [: +: [: -. v)"0' else =: 2 : '(u"_):.(v"_)'    3 if (0<]) i:5 _5 _4 _3 _2 _1 0 3 3 3 3 3    +: else 3 if (0<]) i:5 _5 _4 _3 _2 _1 0

Re: [Jprogramming] 'if' and 'else' operators

2014-02-04 Thread Pascal Jasmin
Also allows if without an else:     +: if (0<]) i:5 _5 _4 _3 _2 _1 0 2 4 6 8 10    -:`+: if (0<]) i:5 _2.5 _2 _1.5 _1 _0.5 0 2 4 6 8 10    -: else +: if (0<]) i:5 _2.5 _2 _1.5 _1 _0.5 0 2 4 6 8 10    -: else 3 if (0<]) i:5 _2.5 _2 _1.5 _1 _0.5 0 3 3 3 3 3    2 else ] if (0<]) i:5 2 2

Re: [Jprogramming] Re {programming] setting rank to a a conjunction

2014-02-05 Thread Pascal Jasmin
And conjunctions are deprived of that opportunity. An example from the other thread, the conjunction: else =: 2 : '(u"_)`(v"_)' seems like a useful replacement to tie if you want eye candy for "verbifying" any of its arguments, but it doesn't actually work for multiple applications:    3"_`+:

Re: [Jprogramming] Re {programming] setting rank to a a conjunction

2014-02-05 Thread Pascal Jasmin
rogramming] Re {programming] setting rank to a a conjunction Can you explain what result you want to achieve here? Thanks, -- Raul On Wed, Feb 5, 2014 at 9:09 AM, Pascal Jasmin wrote: > And conjunctions are deprived of that opportunity. > > An example from the other thread

Re: [Jprogramming] Re {programming] setting rank to a a conjunction

2014-02-05 Thread Pascal Jasmin
you using 'else' without 'if'? As near as I can tell, you are trying to construct a gerund, why use 'else' at all in this case? Thanks, -- Raul On Wed, Feb 5,

Re: [Jprogramming] Re {programming] setting rank to a a conjunction

2014-02-05 Thread Pascal Jasmin
Also, of course, there are some cases where it's important to preserve the original rank of a verb. But that's a different context.) Thanks, -- Raul On Wed, Feb 5, 2014 at 10:31 AM, Pascal Jasmin wrote: > The purpose is syntax sugar for mixing and matching verb and nouns into a

Re: [Jprogramming] k's for each, for each left, for each right in j

2014-02-07 Thread Pascal Jasmin
A bit of an explanation to the answer     ":"0 i.4 0 1 2 3 converts numbers to text representation.  'm'(,":)"0  i.4 or  'm' ,"0 1 ": "0  i.4 will provide the same answer Raul gave. - Original Message - From: Raul Miller To: Programming forum Cc: Sent: Friday, February 7, 2014

Re: [Jprogramming] JHS webgl

2014-02-10 Thread Pascal Jasmin
works with j8's jhs from update all and chrome on windows8. A quick in jhs though is that, in jijx, ctrl-shift up and down to scroll command history causes some weird flashing highlighting that I don't remember occurring before. - Original Message - From: Eric Iverson To: Programming

Re: [Jprogramming] J801 released!

2014-02-10 Thread Pascal Jasmin
great news.  Thank you all that worked on release. An issue is that avast thinks that j801_win64.exe is infected with  win32:malware-gen . - Original Message - From: Eric Iverson To: Programming forum Cc: Sent: Monday, February 10, 2014 7:39:13 PM Subject: [Jprogramming] J801 released

[Jprogramming] QT websockets

2014-02-10 Thread Pascal Jasmin
demos work fine. (and avast makes no complaints about the zip version of J8) I notice that sdgetpeername and sdgetsockname do not work on websockets (understandable if they are not sockets) and there is no QT equivalent for the functions. Is that something not implemented by QT, or not implemen

Re: [Jprogramming] QT websockets

2014-02-11 Thread Pascal Jasmin
se globals will not cause any trouble. A handler can erase them if they are no longer used. Anyways, IMO, to compare socket with websocket is analogous to compre an apple with an pineapple. Пн, 10 фев 2014, Pascal Jasmin писал(а): > demos work fine. (and avast makes no complaints about the zip

Re: [Jprogramming] QT websockets

2014-02-11 Thread Pascal Jasmin
gt; Since J is single thread, those globals will not cause any > > trouble. A handler can erase them if they are no longer used. > > > > Anyways, IMO, to compare socket with websocket is analogous > > to compre an apple with an pineapple. > > > > Пн, 10 фев 2014

Re: [Jprogramming] problem matching boxed string

2014-02-11 Thread Pascal Jasmin
I like it. I'll restate my preference for simpler css.  Using colour only if boxes aren't completely necessary (datatype). I understand the desire to deal with leading 0 shapes, but I think leading 1 shapes are what byte people/beginers the most.  For instance assuming that }. and {: produce i

[Jprogramming] Qt websockets and doevents

2014-02-12 Thread Pascal Jasmin
A minor wierdness with websockets is that connect returns a string socket, whereas the event handlers have integer sockets. I was hoping that 6!:2 allowed for event handlers to process messages, but it doesn't appear to.  Does such a command exist?  A bit like the old vb windows 3.1 doevents()/

Re: [Jprogramming] Qt websockets and doevents

2014-02-12 Thread Pascal Jasmin
code in the 'z' locale. Why not use some other locale? Also, I am not clear what you are asking for, with the event handler, but clearly you can call it yourself if you wish to do so (and you could maintain your own queue of commands to feed it, if you want that). Thanks, -- Raul On

Re: [Jprogramming] Qt websockets and doevents

2014-02-12 Thread Pascal Jasmin
'ws query 1' ) cocurrent 'z' deleteitem_z_ =:  {. , >:@[ }. ] defaults1 =: ([`]@.(0=#@>@[)) defaults =: defaults1"0 0 f. fixlenx =: 1 : (':';'((#y) {. x) u y') iorinf =: (#@[ _:^:= i.) inl_z_ =: (cocurrent@] ".@] [)"1 0 pD_z_ =:  1!:2&2

Re: [Jprogramming] Qt websockets and doevents

2014-02-12 Thread Pascal Jasmin
k fine. (but they would fail in a script) - Original Message - From: Raul Miller To: Programming forum Cc: Sent: Wednesday, February 12, 2014 10:43:23 PM Subject: Re: [Jprogramming] Qt websockets and doevents Are you looking for http://www.jsoftware.com/jwiki/Scripts/WindowsTimer? Tha

Re: [Jprogramming] Qt websockets and doevents

2014-02-12 Thread Pascal Jasmin
7; |value error: fixlenx | 'socket conntype commands auth'=:y defaults fixlenx a:;'client';'testcommands';'authserver' Do you intend for the client and the server to be the same instance of J? If so, why would you want that? If not, which parts go where?

Re: [Jprogramming] Qt websockets and doevents

2014-02-13 Thread Pascal Jasmin
ommand will return as soon as after sending request to server without waiting for the reply. The connection is not guaranteed to be successful. Therefore you need to wait for the onOpen event before sending any data. On Thu, Feb 13, 2014 at 1:05 PM, Pascal Jasmin wrote: > Something like that

Re: [Jprogramming] Qt websockets and doevents

2014-02-13 Thread Pascal Jasmin
y is incorrect for client mode, some of those socket may be not yet connected to ther remote server. Чт, 13 фев 2014, Pascal Jasmin писал(а): > The problem is that it appears to be impossible to wait for the onOpen event > while running code.  Inserting a delay does not work anyway. >

Re: [Jprogramming] Qt websockets and doevents

2014-02-13 Thread Pascal Jasmin
. httpconn y do. {.sk return. end.   x httpsend sk=. {:sk   (sdclose]httprecvall) sk ) httpconn=: 3 : 0   'host port'=. y   if. 0~:s=. >{.x=. sdgethostbyname host do. s return. end.   s=. >{.sdcheck sdsocket''   sdconnect s;(}.x),{.sdcheck sdselect y;'';'&

Re: [Jprogramming] Qt websockets and doevents

2014-02-14 Thread Pascal Jasmin
Another issue I've uncovered in single application client and server communication, also applies to separate applications. It appears that the server receives the connect (onOpen) event first (before client), but even though the server is connected, it is not safe for it to send yet. For insta

Re: [Jprogramming] awk-like J sentences?

2014-02-14 Thread Pascal Jasmin
  ]data =. '1;2;3;4;5;' ,: '6;7;8;9;0;' 1;2;3;4;5; 6;7;8;9;0;    <;._2"1 a ┌─┬─┬─┬─┬─┐ │1│2│3│4│5│ ├─┼─┼─┼─┼─┤ │6│7│8│9│0│ └─┴─┴─┴─┴─┘    2{."1 <  ;._2"1 a ┌─┬─┐ │1│2│ ├─┼─┤ │6│7│ └─┴─┘ if data is already structured:    i. 2 5  0 1 2 3 4 5 6 7 8 9    2{."1 i. 2 5 0 1 5 6 - Original Mes

Re: [Jprogramming] awk-like J sentences?

2014-02-15 Thread Pascal Jasmin
"string manipulation in J is non-trivial..." The scary code from Raul was trying to replace a default space as a fill character. 'hi' ,: 'there' produces a list of 2 5 long strings 'hi   ' 'there' "Passing 3 or more parameters to a verb" an explicit verb can have its first line be: 'a b c' =

Re: [Jprogramming] a: is not <$0

2014-02-15 Thread Pascal Jasmin
this is scary    a: -: <$0 1    a: = <$0 1    a: -: &> <$0 1    a: -: each <$0 ┌─┐ │1│ └─┘ - Original Message - From: Henry Rich To: Programming forum Cc: Sent: Saturday, February 15, 2014 12:28:06 PM Subject: [Jprogramming] a: is not <$0 The Dictionary defines a: as <$0, but in fa

Re: [Jprogramming] problem matching boxed string

2014-02-15 Thread Pascal Jasmin
ng for in addition to the 'different things >>> should display differently') >>> >>> I have attached the script of the simple test page to the wiki at >>> >>> http://www.jsoftware.com/jwiki/http%3A/www.jsoftware.com/jwiki/BobTherriault/Visualize?

Re: [Jprogramming] J in 5 minutes

2014-02-16 Thread Pascal Jasmin
I think this effort, and Bob's nice JHS app displaying datatype and rank hints of results are worthwhile.  We could make J harder by enforcing only ascii numeric data, and deleting all of its documentation, but if that seems an obviously poor choice, then so would discouraging attempts to enhanc

Re: [Jprogramming] J in 5 minutes

2014-02-16 Thread Pascal Jasmin
In terms of spreadsheets, J is an excellent replacement, but usually using the grid is not necessary. For instance figuring out the loan balance of say a $10k loan at 5% interest with payment schedule p, where payments are made at end of period (so interest is calculated on balance right before

Re: [Jprogramming] J in 5 minutes

2014-02-16 Thread Pascal Jasmin
imidated to try). > > >Thanks, > > >-- > >Raul > > > > >On Sun, Feb 16, 2014 at 1:41 PM, Pascal Jasmin wrote: > >> In terms of spreadsheets, J is an excellent replacement, but usually using >> the grid is not necessary. >> >> For ins

Re: [Jprogramming] Qt websockets and doevents

2014-02-16 Thread Pascal Jasmin
1 ro 2 arguments for send. either "send socket" or "send socket data" try this   wd 'ws send ', (": sk) , ' hello' or   wd 'ws send ', (": sk) , ' "hello client, username:"' or   wd 'ws send ', (

Re: [Jprogramming] Qt websockets and doevents

2014-02-17 Thread Pascal Jasmin
Also QtWebsocket may interpret and convert data as utf8 text but a. is not a legal utf8 string. I guess neither will other websockt server/client, eg javascript, will handle raw binary data in the same manner as J. They either use equivelent of sendb or encode binary to plain text such as base64 in ord

Re: [Jprogramming] calculating % change over an array

2014-02-17 Thread Pascal Jasmin
insert does take planning to design for, but remember its simple definition for verb v, v/ 1 2 3 4 is: 1 v 2 v 3 v 4 which is: 1 v (2 v (3 v 4)) so that wont work here (because y argument to dyadic v gets modified to be the result of rightmost reduction), but dyadic \ I think does:    2 (1-%

Re: [Jprogramming] Qt websockets and doevents

2014-02-17 Thread Pascal Jasmin
Is there a a thought that base64 should be applied before J code?  If base 128 or base 196 is possible, then that would be an argument not to, because there's no way to know what encoding the other side might be using.  An alternative to 'text' or 'binary' for the 2nd parameter could be 'text',

Re: [Jprogramming] Qt websockets and doevents

2014-02-17 Thread Pascal Jasmin
et protocol means utf8 encoding.  Older websocket spec did not allow binary data so that binary data have to be encoded to plain text at that time. Current websocket spec (rfc 6455) allows binary data and there is no more need to encode. * https://tools.ietf.org/html/rfc6455 Пн, 17 фев 2014, Pasc

  1   2   3   4   5   6   7   8   9   10   >