[Jprogramming] I'd like to add you to my professional network on LinkedIn

2014-08-28 Thread Gary Luther
Hi, I'd like to add you to my professional network on LinkedIn. - Gary Accept: http://www.linkedin.com/blink?simpleRedirect=0Md38OdzkNejARdj8RdPAMcjARfkh9rCZFt65QqnpKqip4l5B4j4NRizRVpkJApn9xq7cCt7dBtmtvpnhFtCVFfmJB9C5QoORBt6BSrCAJt7dBtmsJr6RBfmtKqmJzon9Q9ClQqnpKimtBkClOs3Rx9DsObjpEumYMpDFEbj5Or

Re: [Jprogramming] fit conjunction

2014-08-28 Thread 'Pascal Jasmin' via Programming
u@v is one verb, and it has rank ("_1)  (!.n) is an adverb which like all adverbs would apply to the entire verb phrase preceding it.  When you selectively grow one item in a list, all of the other items get fills, and the full result of the verb includes those fills. for (f g h)!.n , this coul

Re: [Jprogramming] fit conjunction

2014-08-28 Thread Henry Rich
In the mists of memory I recall hearing of such exploits. Sorry, I have no reference. I don't have a tacit tail-recursion for quicksort, but an explicit one would look like qsort =: 3 : 0 region =. 0 , <: #y NB. The region being sorted here while. there is data do. choose pivot; NB. par

Re: [Jprogramming] fit conjunction

2014-08-28 Thread 'Pascal Jasmin' via Programming
In the case of quicksort, some implementations try to be clever/"efficient" by using the first or last item as the pivot point (instead of a random element). The evil people is most often yourself in this case as a previously sorted data (say in an other routine that needed it sorted) results in

Re: [Jprogramming] fit conjunction

2014-08-28 Thread 'Pascal Jasmin' via Programming
/:~ is much faster than quicksort, but there is beauty to the algorithm, but it also contains a generalizable pattern of controlled subdata recursion.  You can replace the word recursion with "depth first subdata processing".  We can note that depth first (as opposed to breadth first) in this ca

Re: [Jprogramming] fit conjunction

2014-08-28 Thread Raul Miller
That's a valid point. Of course, that's also a valid reason to avoid quicksort. (And worst case analysis for using unboxed arrays in a parallel quicksort suggests some memory bound problems.) Thanks, -- Raul On Thu, Aug 28, 2014 at 9:18 PM, Henry Rich wrote: > On the contrary, stack depth

Re: [Jprogramming] fit conjunction

2014-08-28 Thread Henry Rich
You would need another conjunction, not !. . Consider (u@v)!.f What verb would the !.f apply to? Answer: u@v. Should the !.f apply to u and v also? Answer: no (consider (f g h)!.f). But what about verbs that have rank but already use !.? Example: {.!.f Would the !.f apply to the {. or to

Re: [Jprogramming] fit conjunction

2014-08-28 Thread Thomas Costigliola
Henry, out of sheer curiosity, if you have a story of such evil follies I would be delighted to hear it. More seriously, do you have a tacit tail recursive verb for quicksort to share ? This is related to this post http://www.jsoftware.com/pipermail/programming/2014-August/039023.html On Thu, Au

Re: [Jprogramming] fit conjunction

2014-08-28 Thread robert therriault
Hi Pascal, I love how you are pushing the envelope on this. I guess that I would usually try something like this, (,&'*')`(,&'d')@.('c'={.)"1 ] 3 2 $ 'abc' ab* cad bc* which feels like it is a step removed from the metal compared to allowing fills to be part of defined verbs Cheers, bob

Re: [Jprogramming] fit conjunction

2014-08-28 Thread Henry Rich
On the contrary, stack depth is a killer for quicksort. In the worst case, the stack depth is the number of items, as each partitioning gives a partition of just one element. Tail recursion solves this problem. Not likely, you say? If your code is deployed somewhere important, Evil People w

Re: [Jprogramming] fit conjunction

2014-08-28 Thread 'Pascal Jasmin' via Programming
The problem is getting fills on functions that cause fills in the other items processed by that function    ,(!.'*')&'d'^:('c'={.)"1 ] 3 2 $ 'abc' ab cad bc if !. could apply to fills of any function then it could be written like this (without a domain error):    ,&'d'^:('c'={.)"1(!.'*')  

Re: [Jprogramming] fit conjunction

2014-08-28 Thread Raul Miller
I guess I'd like to see your code to better understand how you are thinking. You might have a good point. You might be overlooking something. But I do not know yet. (This sounds fun, but stack depth is unlikely to be a problem for quicksort. Also, quicksort is often overkill and /:~ or bare /: ar

Re: [Jprogramming] fit conjunction

2014-08-28 Thread 'Pascal Jasmin' via Programming
The idea was to replace the $: implementation of quicksort with ^: Its easiest with boxes, but a neat feature would be that gerund/ could also be used since only the odd numbered boxes/items need sorting.  It would be a breadth first instead of the depth first approach $: uses.  I recently showe

Re: [Jprogramming] fit conjunction

2014-08-28 Thread robert therriault
Hi Pascal, Would something like this not be the way to deal with trailing blanks? 8{.!.'*' 'ab' ab** My guess is that the ways you are considering its use would lead to inefficiencies if this solution was used, but I thought I'd toss the idea out anyway. Cheers, bob On Aug 28, 2014, a

Re: [Jprogramming] fit conjunction

2014-08-28 Thread Raul Miller
The quicksort implementation at http://www.jsoftware.com/help/dictionary/d212.htm does not use boxing. Null fill on strings would be interesting to play with. (But it's actually quite rare for trailing spaces to be relevant.) Thanks, -- Raul On Thu, Aug 28, 2014 at 8:05 PM, 'Pascal Jasmin' vi

Re: [Jprogramming] fit conjunction

2014-08-28 Thread 'Pascal Jasmin' via Programming
I have no idea how much work it is, but I was assuming it wasn't much.  The benefit is being able to use unboxed data when your data will not have _ in it.  That is you gain an ability to remove fills later.   As for a specific example, quicksort using power was what I would have liked to imple

Re: [Jprogramming] locating indices of string in list of strings

2014-08-28 Thread Roger Hui
E. does use Boyer-Moore. However, +./@:E. or E.i.1: exits on finding the first match so can be much faster; at the very least, they do not have to construct the boolean vector first. See Appendix B of the J dictionary. x=: 'abra' y=: 1

Re: [Jprogramming] fit conjunction

2014-08-28 Thread bill lam
There are 2 kind of fill element. One is used for padding which is always determined by J, see section IIB of J dictionary. The other is specific to each verb which may be customized with fit conjunction. For # the fit conjunction is applicable to complex number left arguments, see J dictionary ag

Re: [Jprogramming] fit conjunction

2014-08-28 Thread Raul Miller
But this is saying the feature is needed because the feature is needed. The question is: what is a compelling example of a significant problem which would be made easier by this change? (Note also that my understanding is that this change would involve a lot of work - so you can think of my questi

Re: [Jprogramming] locating indices of string in list of strings

2014-08-28 Thread Henry Rich
Remember that x +./@:E. y, x i.&1@:E. y, etc use Boyer-Moore, so potentially much faster. Henry Rich On 8/28/2014 5:52 PM, Don Kelly wrote: to complete it <: ((+./"1 'cd' E."1 arr)*>:i.# arr)-.0 1 3 5 7 9 <: ((+./"1 'ab' E."1 arr)*>:i.# arr)-.0 0 4 8 1 5 9 0 4 8{arr cd cd cd ab ab

Re: [Jprogramming] fit conjunction

2014-08-28 Thread 'Pascal Jasmin' via Programming
fills are a core part of the language or working with arrays.  Being able to fill with _ is very convenient if 0 is a normal data item that needs to be distinguished from.  Always Be Boxing avoids these issues, and so I can just keep on Always Be Boxing... Maybe there is a way to invoke # (copy

Re: [Jprogramming] fit conjunction

2014-08-28 Thread Raul Miller
I guess the issue here is: what problem would this solve? (There's a generic problem with solving tautological problems. So it's good to have some larger situation in mind, to avoid cluttering up the language with overspecialized forms of generality.) Thanks, -- Raul On Thu, Aug 28, 2014 at

Re: [Jprogramming] locating indices of string in list of strings

2014-08-28 Thread Don Kelly
to complete it <: ((+./"1 'cd' E."1 arr)*>:i.# arr)-.0 1 3 5 7 9 <: ((+./"1 'ab' E."1 arr)*>:i.# arr)-.0 0 4 8 1 5 9 0 4 8{arr cd cd cd ab ab ab now make it tacit. Don Kelly On 28/08/2014 5:44 AM, Rob Hodgkinson wrote: Joe, hope this helps to clarify… Bill was suggesting this…/Rob

Re: [Jprogramming] fit conjunction

2014-08-28 Thread 'Pascal Jasmin' via Programming
It is a domain error to place the fit conjunction elsewhere.  Perhaps a useful language enhancement would be that fit is defined for arbitrary verbs outside of the "whitelist" to be fill? - Original Message - From: Raul Miller To: Programming forum Cc: Sent: Thursday, August 28, 2014

Re: [Jprogramming] fit conjunction

2014-08-28 Thread Raul Miller
The 0 comes from the derived verb, not from # Thus: 2#^:|"+ 1 2 3 1 1 2 0 3 3 2(1+#^:|)"+ 1 2 3 2 2 3 0 4 4 So you'll have to synthesize the _ on your own. Perhaps something like this: (+_*_1&=)<:2(1+#^:|)"+ 1 2 3 1 1 2 _ 3 3 Thanks, -- Raul On Thu, Aug 28, 2014 at 1:21 PM, 'Pasc

[Jprogramming] fit conjunction

2014-08-28 Thread 'Pascal Jasmin' via Programming
          (2#(!._)])^:(2|])"0 ] 1 2 3 1 1 2 0 3 3 the fit conjunction here has no effect, is there a way to get the 0 fill to be replaced with _ -- For information about J forums see http://www.jsoftware.com/forums.htm

Re: [Jprogramming] 15!:0 and 32/64 bit architectures

2014-08-28 Thread Raul Miller
gethash currently uses libjqt rather than anything named openssl. It looks like it would be simpler for me to compile from source than figure out all the ins and outs of the openssl implementations. (I'd be done already if I'd taken that route.) Thanks, -- Raul On Thu, Aug 28, 2014 at 1

Re: [Jprogramming] 15!:0 and 32/64 bit architectures

2014-08-28 Thread bill lam
ide/qt is ignored under jconsole, getscripts_j_'ide/qt' returns empty. This should be improved, but if you only want md5 or other hash, using openssl as suggested by Pascal should be a better option. He also wrote some cover verbs in jwiki IIRC. AFAIK openssl is not used by Qt hash functions,

Re: [Jprogramming] 15!:0 and 32/64 bit architectures

2014-08-28 Thread Raul Miller
I am not going to be able to use gethash today: $ sudo ijconsole install'all' Updating server catalog... Installing 1 package Downloading base library... Installing base library... Done. Installing JQt binaries... Finished install of JQt binaries. $ ijconsole load 'ide/qt' gethash 'md5';'

Re: [Jprogramming] locating indices of string in list of strings

2014-08-28 Thread Devon McCormick
A variant on what Rob suggested: 'ab' +./ . E."1 arr 1 0 0 1 0 0 1 0 0 1 On Thu, Aug 28, 2014 at 9:35 AM, 'Pascal Jasmin' via Programming < programm...@jsoftware.com> wrote: > Raul's code is there to mostly handle strings of variable size. It can be > generalized though: > >'abc' (] -:"

Re: [Jprogramming] SQLite

2014-08-28 Thread Alex Giannakopoulos
Many thanks for that Bill! On 28 August 2014 14:09, bill lam wrote: > Please elaborate how the shader demo in qt demo of j802 failed. > It didn't! I have just seen it and it seems to work fine, Pleased about that - at least I've got something to go on now. > opengl 1.x had been decommitted.

Re: [Jprogramming] 15!:0 and 32/64 bit architectures

2014-08-28 Thread 'Pascal Jasmin' via Programming
md5 and other hashes were recently added to J802 (gethash) , and Jqt ships with the openssl libraries if you want to use a 5x faster version. - Original Message - From: Raul Miller To: Programming forum Cc: Sent: Thursday, August 28, 2014 9:49:02 AM Subject: Re: [Jprogramming] 15!:0 a

Re: [Jprogramming] 15!:0 and 32/64 bit architectures

2014-08-28 Thread Raul Miller
I was hoping to reuse libmd5.so (https://github.com/rdm/libmd5.so) built for 32 bit J on 64 bit J. It's looking lie that will not be possible. So I guess I need to add a -m64 build. Thanks, -- Raul On Thu, Aug 28, 2014 at 9:28 AM, bill lam wrote: > I don't understand what your problem is.

Re: [Jprogramming] locating indices of string in list of strings

2014-08-28 Thread 'Pascal Jasmin' via Programming
Raul's code is there to mostly handle strings of variable size. It can be generalized though:    'abc' (] -:"1 ,:@:{:@:$@:] {. [) 'abd','abc' ,: 'yyy' 0 1 0    'abc' (] *./"1@e. ,:@:{:@:$@:] {. [) 'abd','abc' ,: 'yyy' 0 1 0 if your search array has no padding/fills or you know the fixed len

Re: [Jprogramming] 15!:0 and 32/64 bit architectures

2014-08-28 Thread bill lam
I don't understand what your problem is. Would you mind give more detail. On Aug 28, 2014 9:19 PM, "Raul Miller" wrote: > http://www.jsoftware.com/help/user/call_procedure.htm does not seem to > give a way for a 64 bit J to access a *c in a 32 bit target. > > How best to deal with this? > > Than

Re: [Jprogramming] 15!:0 and 32/64 bit architectures

2014-08-28 Thread Joe Bogner
I thought I wasn't even able to have 64 bit call a 32 bit targets, on windows at least. I haven't tried lately, but MSDN suggests it's not possible: "On 64-bit Windows, a 64-bit process cannot load a 32-bit dynamic-link library (DLL)" http://msdn.microsoft.com/en-us/library/windows/desktop/aa3842

[Jprogramming] 15!:0 and 32/64 bit architectures

2014-08-28 Thread Raul Miller
http://www.jsoftware.com/help/user/call_procedure.htm does not seem to give a way for a 64 bit J to access a *c in a 32 bit target. How best to deal with this? Thanks, -- Raul -- For information about J forums see http://www.js

Re: [Jprogramming] SQLite

2014-08-28 Thread bill lam
Please elaborate how the shader demo in qt demo of j802 failed. opengl 1.x had been decommitted. ddsqlite was documented in jwiki, please use the search box. No one maintains data/sqlite, so it was removed. On Aug 28, 2014 8:42 PM, "Alex Giannakopoulos" wrote: > On 28 August 2014 13:26, Raul M

Re: [Jprogramming] locating indices of string in list of strings

2014-08-28 Thread Rob Hodgkinson
Joe, hope this helps to clarify… Bill was suggesting this…/Rob arr=:10 $ > ;: 'ab cd yyy jcd' arr ab cd yyy jcd ab cd yyy jcd ab cd 'cd' E."1 arr 0 0 0 1 0 0 0 0 0 0 1 0 0 0 0 1 0 0 0 0 0 0 1 0 0 0 0 1 0 0 +./"1 'cd' E."1 arr 0 1 0 1 0 1 0 1 0 1 On 28 Aug 2014, at 10:12 pm, Joe

Re: [Jprogramming] SQLite

2014-08-28 Thread Alex Giannakopoulos
On 28 August 2014 13:26, Raul Miller wrote: > Something that "works out of the box" and "linux" is unlikely given > the current state of things. > Too true, too often... Hope everything turns out OK. -- For information about J f

Re: [Jprogramming] SQLite

2014-08-28 Thread Raul Miller
Something that "works out of the box" and "linux" is unlikely given the current state of things. We are experiencing a rather massive attack on our computing infrastructure (including the people involved) at the moment, on a variety of levels of abstraction and it's really hard to anticipate just

Re: [Jprogramming] locating indices of string in list of strings

2014-08-28 Thread Joe Bogner
Tracy - symbols are a good way to go. Thanks for reminding me of them. Raul - that's what I was missing... I needed to use e. with the same shape: eg. arr e. (1 3 $ 'ab ')... Thank you. Your examples are nice and generic and faster than -:"1 ( I have a 68 million row memory mapped table of 8 ch

Re: [Jprogramming] SQLite

2014-08-28 Thread Alex Giannakopoulos
Thanks Raul. Yeah, OpenGL SORT OF worked for me under 7 too, can't remember details, I got too frustrated and dumped the whole thing in disgust, I seem to remember it was working (partially) under Linux32, OKish under Windows64 (but I don't want to have to use Windows), and I think it worked very

Re: [Jprogramming] locating indices of string in list of strings

2014-08-28 Thread Henry Rich
One problem is, the string 'ab' does not exist in arr. When you opened arr you padded the strings to a common length. 'ab ' would be in arr, but you have the arguments to i. reversed. x is the search space, y is the value you are looking for. Henry Rich On 8/28/2014 6:58 AM, Joe Bogner wro

Re: [Jprogramming] SQLite

2014-08-28 Thread Raul Miller
On Thu, Aug 28, 2014 at 7:23 AM, Alex Giannakopoulos wrote: > I have to say that one of my greatest frustrations with J is that a lot of > good work of the past seems to get lost in the process of updates. > E.g. I was really looking forward to doing some OpenGL work with J, yet > this does not se

Re: [Jprogramming] locating indices of string in list of strings

2014-08-28 Thread Björn Helgason
'ab' I. arr __---_ https://groups.google.com/forum/m/#!forum/havaogskulamal On 28 Aug 2014 10:58, "Joe Bogner" wrote: > Apologies for the extremely basic question, but I am struggling with > this after searching NuVoc and the dictionary. > > How do I locate all the indices of 'ab

Re: [Jprogramming] locating indices of string in list of strings

2014-08-28 Thread bill lam
perhaps E. will be useful. On Aug 28, 2014 6:58 PM, "Joe Bogner" wrote: > Apologies for the extremely basic question, but I am struggling with > this after searching NuVoc and the dictionary. > > How do I locate all the indices of 'ab' in arr? > > arr=:10 $ > ;: 'ab cd yyy' > > surely this isn't

Re: [Jprogramming] locating indices of string in list of strings

2014-08-28 Thread Raul Miller
Here's a few variants that should get you near where I think you want to be: arr e. ,:({:$arr){.'ab' 1 0 0 1 0 0 1 0 0 1 I.arr e. ,:({:$arr){.'ab' 0 3 6 9 I.arr e. (0#arr),'ab' 0 3 6 9 arr ([ I.@e. ] ,~ 0 # [) 'ab' 0 3 6 9 Thanks, -- Raul On Thu, Aug 28, 2014 at 6:58 AM, Joe Bogner

Re: [Jprogramming] locating indices of string in list of strings

2014-08-28 Thread Tracy Harms
Hi, Joe, I haven't gone through your code in detail but it looks to me like a fine opportunity to use symbols. I'm quick to turn to symbols, maybe too quick, but if you're looking to treat sequences of characters (of varying lengths) as atoms, that's your ticket. -- T On Aug 28, 2014 6:58 AM, "Jo

[Jprogramming] SQLite

2014-08-28 Thread Alex Giannakopoulos
Does anyone know what the current state of play is with regard to SQLite support? The documentation under jwiki/Addons/data/sqlite is not valid anymore, and PacMan only offers a data/ddsqlite, which however does not seed to be documented anywhere. I have to say that one of my greatest frustratio

Re: [Jprogramming] locating indices of string in list of strings

2014-08-28 Thread Joe Bogner
That wouldn't work anyways with non-unique characters perhaps this: ('yyy' -:"1 arr) # arr yyy yyy yyy On Thu, Aug 28, 2014 at 6:58 AM, Joe Bogner wrote: > Apologies for the extremely basic question, but I am struggling with > this after searching NuVoc and the dictionary. > > How do I locate

[Jprogramming] locating indices of string in list of strings

2014-08-28 Thread Joe Bogner
Apologies for the extremely basic question, but I am struggling with this after searching NuVoc and the dictionary. How do I locate all the indices of 'ab' in arr? arr=:10 $ > ;: 'ab cd yyy' surely this isn't the best way: ] (3 = +/"1 'ab' i. arr) # arr ab ab ab ab I have been primarily deali