Re: [Jprogramming] making rotation matrices

2016-07-10 Thread Dan Bron
I wrote: > Bearing in mind that I have no idea what I’m doing .. > > load’trig' > PROJ =: 2 3 0 , 4 2 0 ,: 0 0 1 > > rotate =: [: +/ .*/ 0 1 0 eul2rot"0 +&0 0 0 > eul2rot =: rotM proj { f >rotM =: (2 # [) |. ] >f =: 0:, 1:, cos, sin, -@sin > … > > One may also consider d

Re: [Jprogramming] making rotation matrices

2016-07-10 Thread Dan Bron
Bearing in mind that I have no idea what I’m doing, and just looked up some various definitions of “Euler angles” and rotating them, here’s what I came up with: load’trig' PROJ =: 2 3 0 , 4 2 0 ,: 0 0 1 rotate=: [: +/ .*/ 0 1 0 eul2rot"0 +&0 0 0 eul2rot =: rotM proj { f rotM

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

2016-06-13 Thread Dan Bron
Louis wrote: > There was some talk a while ago about the ambiguity of the dictionary about > the direction of gerund insertion. Reading through the first pages of > Iverson's Concrete Math Companion, I stumbled on a snippet of J that dates > back to 2002 and was written by Iverson at the bottom

Re: [Jprogramming] key misunderstanding?

2016-04-22 Thread Dan Bron
Pascal wrote: > 0 0 1 1 1 (2 <\ ])\. i.5 Then: > sorry, key is /. not \. Yep! But to address this: > Something else happens. (called 5 times, in pattern that is hard to > understand). The tally of 0 0 1 1 1 (i.e. # 0 0 1 1 1) is 5, and the dyad f\. has a left rank of 0, so (2 <\ ]) is invoke

Re: [Jprogramming] ABRACADABRA

2016-04-12 Thread Dan Bron
Raul wrote: > I get > #5!:5<'v' > 25 > > for [Marshall’s] expression here, and 27 characters for Dan's current > expression. Linear representation doesn’t necessarily minimize the resulting expression (it can contain “superfluous” space characters, for example, and “unnecessary” parentheses)

Re: [Jprogramming] ABRACADABRA

2016-04-12 Thread Dan Bron
I wrote: > I guess I’ll take your original and see if I can re-phrase it along these > lines. Oh, this case was particularly simple. v 'Sneaky sneaky sneaky!' S n e a k y s n e a k y s n e a k y ! S n e a k y s n e a k y s n e a k y S n e a k y s n e a k y s n e a k S

Re: [Jprogramming] ABRACADABRA

2016-04-12 Thread Dan Bron
Raul wrote: > This? > > v 'J double-entrende’ That’s neat, but I prefer the “sneakiest” solution I can find. Put another way: the most implicit expression, where the notation does most of the work for me, and I provide the smallest number of possible explicit instructions; the new conjunct

Re: [Jprogramming] ABRACADABRA

2016-04-12 Thread Dan Bron
Raul wrote: > Here's a variant on mine which only uses J primitives: Ah, I love the power of that approach. We’ll make a F^4 convert of you yet. Now, the stupid-J-tricks fan in me wonders if we could have a version which derives its power from a different primitive, as a kind of bilateral bond

Re: [Jprogramming] Adverbial Tacit Jym

2016-04-12 Thread Dan Bron
Pepe wrote: > [0] [Jprogramming] Tacit adverb definitions? >http://www.jsoftware.com/pipermail/programming/2006-July/002627.html > Ha, I’d forgotten about that. I remember having fun with it at the time. Not having to pare

Re: [Jprogramming] ABRACADABRA

2016-04-12 Thread Dan Bron
I wrote: > v =: ... i.@# ... Oh, I suppose if you replace this i@# with \: , the solution reduces to 30 (necessary) characters. I mean, I wouldn’t recommend that in any actual code, given the cost of \: vs i.@#, but the relevant metrics change if we’re playing Jolf (are we?). -Dan

Re: [Jprogramming] ABRACADABRA

2016-04-12 Thread Dan Bron
Raul wrote: > If it's a puzzle, ... my first implementation of v had 30=#5!:5<‘v’ > and used a proverb. Mine had 32 (necessary) chars, was tacit, and used only J primitives. I’m sure it can be improved, it was fairly naive (given in the postscript after spoiler space). -Dan v 'Don''t loo

Re: [Jprogramming] Adverbial Tacit Jym

2016-04-12 Thread Dan Bron
Pascal wrote: > for clarity, the answer is, No hints, please! Anyone who wants to know the answer can just scroll down in Raul’s original message. -Dan -- For information about J forums see http://www.jsoftware.com/forums.htm

Re: [Jprogramming] Adverbial Tacit Jym

2016-04-12 Thread Dan Bron
Raul wrote: > a1x1=: ?? That’s really cute! See? It’s a fun game. -Dan -- For information about J forums see http://www.jsoftware.com/forums.htm

Re: [Jprogramming] Adverbial Tacit Jym

2016-04-04 Thread Dan Bron
]\. 'beware spoilers' beware spoilers eware spoilers ware spoilers are spoilers re spoilers e spoilers spoilers spoilers poilers oilers ilers lers ers rs s In addition to Raul’s suggested (`:3), which I take to be against the spirit of the challenge, how about: a1x1 =. ( ^:((] {.)`1:`(]

Re: [Jprogramming] finally a j programmer?

2016-03-25 Thread Dan Bron
Every time I learn a new programming language, I spend about 2 days implementing utilities directly inspired (read: stolen) from J. Not so much hook / fork or other composition functions, but things like /. (key) and #: (antibase) and so on, which are unreasonably effective in the actual prac

Re: [Jprogramming] Adverbial Tacit Jym

2016-03-19 Thread Dan Bron
Pepe wrote: > Instructors (Dan, Thomas et al. are you listening?), I always listen when you speak, Sensei. Though in recently years my review of J Forum traffic has been more sporadic. > a1 =:(`{.)(`{:)(@.1 0 2) Hey, I never thought of doing a1 in that fashion. Neat approach. Personall

Re: [Jprogramming] Unbox request for requests

2016-03-19 Thread Dan Bron
This issue has frustrated me more than once, especially as I’ve gotten into more abstract coding and writing general tooling. I think it stands out as one of the primary design questions I would reconsider if I were to write a J clone or derivative. > On Mar 15, 2016, at 2:03 PM, Thomas Cost

Re: [Jprogramming] Adverbial Tacit Jym

2016-03-19 Thread Dan Bron
Pepe wrote: > Let us add another twist, courtesy of David Lambert, to the Exercise 1: All these puzzles are interesting, but ever since you posted the “holy grail”, the “write a tacit adverb to do X” challenges have been reduced (in principle) to “write a tacit verb to do X”, and given you sent

Re: [Jprogramming] Tail recursion (bug hijack)

2016-03-19 Thread Dan Bron
Louis wrote: > The problem is that u^:v^:_ y terminates > either when 0 = v y OR when y -: u y . Yeah, this has bitten us all at one time or another. The traditional solution is to add a little tag to the data structure which you mutate (along with the normal processing) at every iteration. Most

Re: [Jprogramming] symbol index origin

2016-03-19 Thread Dan Bron
Pascal wrote: > 6 s:s:'`' NB. Oh! The fill symbol hides. > 0 Yes, symbol 0 is reserved (unsurprisingly) for the empty symbol, the symbolic equivalent of ‘’, which is the literal equivalent of … 0 (and not just in J, but broadly recognized as such in information theory and the discipline of f

Re: [Jprogramming] Style guide

2016-03-18 Thread Dan Bron
Pascal wrote: > Anyway, does anyone have a style guide they could share, or point me to one > in the wiki? I can point you at: http://code.jsoftware.com/wiki/PersonalTaste and http://code.jsoftware.com/wiki/User:Dan_Bron/Style

Re: [Jprogramming] J on Jupyter progress

2016-02-08 Thread Dan Bron
Pascal wrote: > Its easy to publish the results of an interactive session though. github > will preview them for example. > > > https://github.com/adrian17/jkernel/blob/master/sample_edge_detect.ipynb > After seeing this preview, I am *really* excited to see the final product here. I think b

Re: [Jprogramming] J on Jupyter progress

2016-02-08 Thread Dan Bron
Pascal wrote: > J on Jupiter progress > https://puu.sh/n0INU/f943972e70.mp4 > > code > https://github.com/adrian17/jkernel Wow, that’s exciting stuff! Does Jupyter also host the engine? Or is that up to the user to set up? This looks a great way to bring J into the 2010s world of web applicatio

Re: [Jprogramming] Type conversion tool

2016-02-06 Thread Dan Bron
I just glanced over this briefly, I need to read it in detail, but even at a glance I can tell you I approve of the coding style, particularly the table-driven approach to defining the conversion verbs. Also good documentation. -Dan > On Feb 6, 2016, at 4:38 PM, Marshall Lochbaum wrote: > > B

Re: [Jprogramming] k programming challenge

2016-02-04 Thread Dan Bron
Linda wrote: > words3=: 13 : ';:'' ''(([: I. tolower = toupper) y)}tolower y' Please note: words3=: 13 : ';:'' ''(([: I. tolower = toupper) y)}tolower y’ words3 3 : ';:'' ''(([: I. tolower = toupper) y)}tolower y' That is, 13 : is incapable of converting the verb, as you ha

Re: [Jprogramming] When a <. _ is less than a

2016-02-03 Thread Dan Bron
I know we have yet to organize a formal process for building and disseminating a community-driven implementation of J, but in anticipation of that day’s arrival, perhaps we can start collecting community-driven proposals for enhancements? One such enhancement could be special code that detects

Re: [Jprogramming] Joining lists

2016-01-31 Thread Dan Bron
What type are the atoms in the list? -Dan > On Jan 31, 2016, at 5:21 PM, Henry Rich wrote: > > You have 3 large lists a, b, c (100 atoms each). You want to join them > into one long list. What is the best way to do this? > > Henry Rich > -

Re: [Jprogramming] k programming challenge

2016-01-27 Thread Dan Bron
Brian wrote: > ;:'Though of course, it''s possible to format that result differently.' > |open quote > | Though of course, it's possible to format that result differently. > | ^ > | ;:'Though of course, it''s possible to format that result > differently.’ So ;: is t

Re: [Jprogramming] Monday Morning Wake Up Exercise

2016-01-26 Thread Dan Bron
Linda wrote: > I thought a 1 result meant the two images are the same. The first comparison > I thougth confirmed that the two images that look alike to me really are the > same. The colors seem ok but I wasn't sure. In J, all verbs (as well as adverbs and conjunctions) produce a result, an o

Re: [Jprogramming] Monday Morning Wake Up Exercise

2016-01-26 Thread Dan Bron
Linda wrote: > (Y viewmat i.4)-:Y4 viewmat i.4 > (Y4 viewmat i.5)-:Y5 viewmat i.5 > Or maybe this should be: > (Y viewmat i.5)-:Y5 viewmat i.5 I’m not sure what you’re trying to test with those -:s, but note that in the standard J IDEs, the result of viewmat (of any input) is always the same; s

Re: [Jprogramming] @ and @: (atop and at)

2016-01-25 Thread Dan Bron
Pepe wrote: > Regarding @ and @:, sometimes I wonder how often users would had used @: > instead of @ if their definitions had been swapped (and &: instead of &, > etc.). Switching the semantics of @: vs @ (and & vs &: and &. vs &.:) would be top of my list if I had a time machine (well, a time

Re: [Jprogramming] @ and @: (atop and at)

2016-01-25 Thread Dan Bron
27;I' following 'and'. Ken thought > that if a user learned J from use, as a child acquires a natural language, > they would pick it up naturally. This topic refutes that notion IMO.] > > Your point 2. is a very good idea. > > Henry Rich > > On 1/25/201

Re: [Jprogramming] @ and @: (atop and at)

2016-01-25 Thread Dan Bron
Linda wrote: > But, it doesn't mean f@g and [:f@g can't be equivalent. I think you meant f@g and [: f g can sometimes be equivalent (not [: f@g, which always produces a domain error, because you’re trying to execute [:, which cannot be executed). Two points about that: 1. f@g and [: f g ar

Re: [Jprogramming] Definition: Frame of an argument

2016-01-20 Thread Dan Bron
Roger wrote: > "Empty frame" made sense when a frame was the axes of an array left over > after you've accounted for the cell. I don’t remember who introduced me to the idea, but I was first encountered them, enchanted by the definitions: - Axis: index in the shape of an array - Dimension

Re: [Jprogramming] Definition: Frame of an argument

2016-01-20 Thread Dan Bron
Raul wrote: > I think the maximal cell would be the entire array? Maybe. Or maybe the terminology was introduced to cover degenerate cases*. In general, a verb of rank N (as a non-negative integer) can never see a noun with rank greater than N, but it is certainly possibly for it to see nouns

Re: [Jprogramming] A Different Less?

2016-01-20 Thread Dan Bron
Linda wrote: > Interesting... I always wondered if "special code" always works or justs > sometimes in specific situations? If the special code always works when > encountered, then [:/:/: sould be equivalent to /:@/: as they are otherewise > equivalent. Well, x * y and x +&^. y are “otherwi

Re: [Jprogramming] Definition: Frame of an argument

2016-01-18 Thread Dan Bron
Terminology aside, whether you call it “frame” or “outer shape” or anything else, it is the part of the noun’s shape to the left of the line. The “cell” or “inner shape” or whatever you want to call the part of the noun’s shape to the right of the line. What’s the line? The verb’s rank, of cou

Re: [Jprogramming] Roll (?) produces domain error on large input

2016-01-12 Thread Dan Bron
Eddie Bracho wrote: > shuffle =: 3 : '(?~#y){y’ > > shuffle p: i.7 > 17 2 7 13 11 3 5 To return to the idea of using !, if you really wanted to: anagrait =: verb def 'y A.~ ?! x: # y' anagrait p: i. 7 5 7 3 17 2 11 13 Summary: dyad A. takes a list (in the abstract sense o

Re: [Jprogramming] a performance quirk

2016-01-04 Thread Dan Bron
gt; timespacex ']`+:@.(2&|) every i.1000' > 0.000423359 20736 > > > there is a large space difference with each but not with every. > > > - Original Message - > From: Dan Bron > To: J Programming > Sent: Monday, January 4, 2016 12:13 PM &

Re: [Jprogramming] a performance quirk

2016-01-04 Thread Dan Bron
Performance analysis requires a kind of triage. The first thing that sticks out about both expressions is that “0 . We need to excise that first: J is a language that expects and rewards thinking big. (;:'Verb TimeX SpaceX') , V ,. '0.2' 8!:0 (%"1 <./) Q=:100 timespacex&> ' D' ,L:0~ V=: '+

Re: [Jprogramming] Tacit Toolkit (was dyadic J)

2015-12-15 Thread Dan Bron
> Against my best judgement :), a purist version of Adv follows, > assert 1 4 9 -: 1 2 3 *: av That’s so cool :) At some point we’re going to have to put our heads together and create a JAL addon to collect all these utilities. Named F^4, of course. -Dan ---

Re: [Jprogramming] Tacit Toolkit (was dyadic J)

2015-12-15 Thread Dan Bron
Raul wrote: > Yeah... personally, I consider explicit code to be a subset of tacit code. I think of explicit and tacit as two distinct but related languages. That “:” is tacit doesn’t mean the programs written in it are tacit: I could (theoretically) write a tacit Lisp interpreter, but that does

Re: [Jprogramming] Tacit Toolkit (was dyadic J)

2015-12-15 Thread Dan Bron
ation of u) >> - This new atomic representation is the result (output) of Dam >> >> In re: converting the atomic rep back into a verb: I can handle that myself; >> there may be multiple layers / applications of Am, so I’d prefer the result >> to be an a.r

Re: [Jprogramming] dyadic J

2015-12-14 Thread Dan Bron
, for example, or a conjunction or a noun, etc. -Dan > On Dec 14, 2015, at 3:52 PM, Raul Miller wrote: > > On Mon, Dec 14, 2015 at 10:58 AM, Dan Bron wrote: >> What I’d really like is a general adverb that >> >> - Accepts a verb as input, deriving another adverb

Re: [Jprogramming] dyadic J

2015-12-14 Thread Dan Bron
Pepe wrote: > This is a puzzle for adverbial tacit writing fans: Write a purist tacit > adverb (sf1) such that, for example, > > (v0 v1 v2)sf1 > v0@[ v1 v2@] > > 3 4 (+: + -:)sf1 2 4 > 7 10 I’m sure your solution is more elegant, but I haven’t looked yet, so here’s my attempt: L

Re: [Jprogramming] Jconsole : printing the complete content of a J object (no ...) ?

2015-12-03 Thread Dan Bron
akakim...@gmail.com wrote: > Is there a way to ask Jconsole to print the complete content of a J object ? You can set the output control parameters using 9!:37 [1]. For example, on my system: 9!:36 ‘' 0 256 0 222 J will truncate the display of any object wider than 256 chars or taller than

Re: [Jprogramming] if "_1 is item ...

2015-12-01 Thread Dan Bron
Tabulation (table of “something”, where “something” can be of arbitrary rank). -Dan > On Dec 1, 2015, at 10:21 AM, 'Pascal Jasmin' via Programming > wrote: > > What would be a name for "_2 ? could it be item of items? > -- > F

Re: [Jprogramming] dyadic J

2015-11-24 Thread Dan Bron
It would be interesting and helpful to see some motivating examples — code that is shorter, clearer, less error-prone, whatever, using “dyadic J” than the original “standard J”. Would also be helpful to describe the intended audience. For example, are the motivating examples shorter, clearer, l

Re: [Jprogramming] Simple and effective spelling corrector

2015-11-23 Thread Dan Bron
nd that is what I used. > > Thanks, > > -- > Raul > > > On Mon, Nov 23, 2015 at 12:21 PM, Dan Bron wrote: >> Oh, interesting; I’m going to have to study this in more detail. Thank you. >> >> What did you use for your corpus? (big.txt) >> >

Re: [Jprogramming] Simple and effective spelling corrector

2015-11-23 Thread Dan Bron
> e2=. ;edits each e > if. 1 e. e2 e. words do. best e2 return. end. > w > ) > > countbigwords'' > > Seems plausible enough on a few simple tests. > > Example use: > > correct 'thatl' > ++ > |that| > ++ > > Tha

Re: [Jprogramming] Crash calculating large hyper operations

2015-11-20 Thread Dan Bron
Pascal wrote: > no crash though j802 win64 Brian Schott wrote [offline]: > I do not get a crash. > JVERSION > Engine: j803/2014-10-19-11:11:11 > Library: 8.04.13 > Platform: Darwin 64 Hmm, I should have been more thoughtful and careful about my bug report. I got it in J8-64 on OSX. I don't have

[Jprogramming] Crash calculating large hyper operations

2015-11-19 Thread Dan Bron
The notion of “hyper operation” extends the intuition that multiplication is repeated addition, exponentiation is repeated multiplication, tetration is repeated exponentiation, and so on. Hyperoperation can be defined piecewise (per Wikipedia) as: / b+1 if n = 0 | a if n

[Jprogramming] Simple and effective spelling corrector

2015-11-19 Thread Dan Bron
Peter Norvig has a blog entry on how to write a fairly effective spelling corrector (75-90%) in very little code, using some Bayesian analysis: http://norvig.com/spell-correct.html A worthwhile read. I’m using this program as an exercise in learning

Re: [Jprogramming] essay: toy byte code interpreter

2015-11-10 Thread Dan Bron
In re: performance, probably the biggest bang for your buck would come from using integers in place of boxes. From the examples on that page, it appears that stack elements can either be integers (“ADD 5 2”, “LABEL 100”) or opcodes (“ADD”, “LABEL”). So you could modify the parse function to con

Re: [Jprogramming] Executing Locked Scripts from Nouns

2015-10-22 Thread Dan Bron
I reported this as a bug years ago. No rationale I can think of, except perhaps “unlocking” is done by the frontend, as opposed to the engine? -Dan > On Oct 22, 2015, at 12:40 PM, Thomas Costigliola wrote: > > Attempting to run a locked script from a noun doesn't work: > > 0!:1]3!:6 'sum=:

Re: [Jprogramming] problem using ,:`]@.

2015-10-05 Thread Dan Bron
A long while back I did a writeup on ` (tie) and its relationship to gerunds, and tried to briefly define what a “gerund” is: http://code.jsoftware.com/wiki/User:Dan_Bron/backtick -Dan > On Oct 5, 2015, at 7:10 AM, Raul Miller wrote: >

Re: [Jprogramming] Sender = "Programming Forum"

2015-09-29 Thread Dan Bron
> This discussion belongs in the chat forum. I believe administrivia is supposed to be directed to the General forum. > Also, if you could give an example other than yourself of someone > whose name is handled properly, it would be easier to study the issue. > (Mail client software might have sp

Re: [Jprogramming] Sender = "Programming Forum"

2015-09-29 Thread Dan Bron
I’m seeing the same thing on my end, particularly for Pascal’s messages. I’m using the Apple mail client on a Mac (though I also saw it in the very lightweight mail client “popcorn” on Windows 7), so I don’t think this is a client-side configuration issue. -Dan > On Sep 29, 2015, at 3:36 AM,

Re: [Jprogramming] Changing the text of a menu item

2015-09-15 Thread Dan Bron
Ian wrote: > A properly designed menu system is a huge help for a novice user. Tangentially related: I ignore menus as often as I can. On websites, for example, I universally opt to use the search feature. And if the search feature is absent, or sucks, I use a site-specific search in Google. I

Re: [Jprogramming] Lousy documentation

2015-09-10 Thread Dan Bron
Henry wrote: >> I ended up with the thought that documentation is hard to read whenever the >> topic is unfamiliar. I responded: > I think this is a universal truth, though you’ve packaged it quite pithily > here. Knew I’d seen this sentiment somewhere before. Check out the first sentence of

Re: [Jprogramming] Lousy documentation

2015-09-09 Thread Dan Bron
> I ended up with the thought that documentation is hard to read whenever the > topic is unfamiliar. I think this is a universal truth, though you’ve packaged it quite pithily here. Everything has a curve, and the curve is front-loaded. Success builds on success, wealth builds on wealth, knowl

Re: [Jprogramming] A good remix

2015-09-08 Thread Dan Bron
16 7 22 66 17 7 1 16 7 22 >>> >>> XOR decr:a Top Secret secret >>> >>> MOD encr:68 98 55 82 83 98 54 72 70 85 72 87 98 86 72 70 85 72 87 >>> >>> MOD decr:a Top Secret secret >>> >>> >>> The message has 19

Re: [Jprogramming] Read JPEG files with graphics addon

2015-09-04 Thread Dan Bron
Have you tried applying the verb jpath_z_ to the filenames before passing them to readjpeg ? J system libraries often implicitly apply jpath, but that isn’t necessarily true of Addons or other codebases. Also bear in mind that when you say ‘~’ in J, it is J and its libraries which are expandin

Re: [Jprogramming] A good remix

2015-09-04 Thread Dan Bron
Michal Wallace wrote: > I don't know whether or not this produces the correct results because I > don't have any test data, but... Yeah, that is troublesome. Unfortunately, it’s the same catch-22 I’m in. I’m transliterating the C code here: http://rosettacode.org/wiki/The_ISAAC_Cipher#C

[Jprogramming] A good remix

2015-09-04 Thread Dan Bron
Periodically I review the list of open J tasks on RosettaCode [1]. Today I came across an obscure but (if you believe the task description) meritorious cipher, called ISAAC ("Indirection, Shift, Accumulate, Add, and Count”). I understand the basic concepts of cryptography, but am generally unver

Re: [Jprogramming] ic/ 3!:4 on osX

2015-08-25 Thread Dan Bron
Can you provide a conceptual mapping from “right endian” and “wrong endian” to “big endian”, “little endian” and possibly “middle endian”? -Dan > On Aug 25, 2015, at 10:54 AM, 'Pascal Jasmin' via Programming > wrote: > > Thank you everyone. I was asking due to my assumption that OSX used wro

Re: [Jprogramming] JAL svn account?

2015-08-21 Thread Dan Bron
Awesome, thanks. -Dan > On Aug 21, 2015, at 12:17 PM, chris burke wrote: > > Dan > > You can use the same account for the addons repo (as well as public). > Nothing else is needed, thanks. > > Chris > > On 21 August 2015 at 08:20, Dan Bron wrote: > &

[Jprogramming] JAL svn account?

2015-08-21 Thread Dan Bron
I’m considering creating Addons. I have an SVN account which permits me to checkin/checkout of my own personal repo, jsoftware.com/svn/DanBron . Do I need another account or special permissions to check into the JAL repo? -Dan

Re: [Jprogramming] Bitwise operations utility

2015-08-13 Thread Dan Bron
Pascal wrote: > |.!.0 NB. unsigned > |.!.1 NB. signed Ah, this is helpful. Thanks. These definitions will allow me to simplify some of the normalization functions. > signed_shift is undefined, That’s because I didn’t know how to define it, until now ;) > an extra that would be cool is version

[Jprogramming] Bitwise operations utility

2015-08-13 Thread Dan Bron
I’ve been fiddling with J internals recently, and finding the need to twiddle bits. I have a hard time maintaining the numeric b. codes in head, so I threw together a little utility that lets you say things like: 2b1000 +. bw 2b0111 255 2b1000 *. bw 2b1

Re: [Jprogramming] unlock.ijs

2015-08-11 Thread Dan Bron
Raul wrote: > After chasing down some of the references from the responses to your > question, I noticed this thread in comp.lang.c: > https://groups.google.com/forum/#!topic/comp.lang.c/Z0mycsYvPyI/discussion I’m not quite sure how you found that comp.lang.c thread, but the ideas presented there

Re: [Jprogramming] unlock.ijs

2015-08-11 Thread Dan Bron
Pascal wrote: > just wanted to add that your custom security level suggestions are well > thought out. Thanks, if I can ever get my head wrapped around the structure of the J source, I might be able to contribute to making such ideas a reality. In that vein, having not used C in eons, I was con

Re: [Jprogramming] unlock.ijs

2015-08-11 Thread Dan Bron
I wrote: > The subsequent six values in the original arrays, > >> 0 0 0 9223372036854775807 9223372036854775807 9223372036854775807 > > have been the same in all verbs I’ve inspected so far, and look like > sentinels to me (3 3 # 0, 2^64-1): three pairs of mins and maxes? Ok, the 92233720368

Re: [Jprogramming] unlock.ijs

2015-08-11 Thread Dan Bron
> Btw, the only secret I want to keep safe is the noun 'password' by embedding > it in a locked verb If you’re really concerned about the security of this password, it should not appear in memory in cleartext at all. You should only deal in hashes and comparing hashes. > that is set at run

Re: [Jprogramming] unlock.ijs

2015-08-10 Thread Dan Bron
REB wrote: > No, Dan made a typo, he wrote /wsvn/ instead of /svn/ Blasphemy. Dan does not make mistakes ;) In this case, I had used the recommended best practice of MoinMoin interwiki links: I never typed wsvn or svn at all; instead, what I had written was: [[JSvn:DanBron/trunk/general/u

Re: [Jprogramming] twos complement

2015-07-27 Thread Dan Bron
I wrote: > >:@<.@^. 1 >. >./@:|@, Raul responded: > Personally, I prefer the fork 1 + u over the perhaps more obvious >:@u In general I agree with you, but in this case I like the sequence of inflected arrows*: >: @ <. @ ^. It’d be cuter if >: happened to be spelled >. but I still like it

Re: [Jprogramming] twos complement

2015-07-27 Thread Dan Bron
Raul wrote: > twosC=: #:~ 2 #~ 1 + {:@$@#: The clause {:@$@#: does a lot of work (computationally speaking, not notationally speaking) to determine the number of bits required. There is a cheaper way. But the problem with “cheaper ways” is I always have to come up with them and then teach J

Re: [Jprogramming] html screen scraping

2015-07-15 Thread Dan Bron
ote: > > But that only works on 32 bit j602, because of limitations in our > support for the xml/sax addon. > > I think it also only works for xhtml? > > Thanks, > > -- > Raul > > On Tue, Jul 14, 2015 at 2:00 PM, Dan Bron <mailto:j...@bron.us>> wro

Re: [Jprogramming] html screen scraping

2015-07-14 Thread Dan Bron
This RosettaCode solution is relevant; it demonstrates how to use J & the JAL to scrape websites in a particularly functional/declarative/lazy way: http://rosettacode.org/wiki/Rosetta_Code/Rank_l anguages_by_popularity#J

Re: [Jprogramming] home page update and Jd release

2015-05-12 Thread Dan Bron
Are there any current plans to enhance the language proper, as opposed to the environment, tools, and apps built on top of the language? Also, what's JSoftware's stance on a proper language fork: including forking the dictionary, the source code, and possibly creating a site parallel to jsoftware.

Re: [Jprogramming] Random distribution

2015-05-08 Thread Dan Bron
;t necessary for comb even though it is for (?), > so the solution can be reduced to (N (] (2 -~/\ _1 , ,~)"_1 comb)&<: Q)) > The part that's applied with rank _1 takes a combination and Q and > produces the appropriate composition of Q. So given the i'th element

Re: [Jprogramming] Random distribution

2015-05-08 Thread Dan Bron
Marshall wrote: > V =: N (2 -~/\ _1 , /:~@:? , ])&<: Q BINGO. Thank you! So you're creating an ordered list of <:N unique numbers less than <:Q, bookended with _1 and <:Q, and taking the *gaps between these numbers* as the vector V. I have a vague intution of why the sum of any such bookend

Re: [Jprogramming] Random distribution

2015-05-08 Thread Dan Bron
I wrote: > V is a vector of POSITIVE integers with shape N whose sum is Q. Minor correction "... with length N ... " (obviously shape is always a vector, so the shape would be ,N). > If we knew the number ZFNP of possible 0-free N-partitions > an integer Q, then we'd only have to roll ?ZFNP an

Re: [Jprogramming] Random distribution

2015-05-08 Thread Dan Bron
Joe Bogner wrote: > +/ every ( (([: /:~ [: ? N&#) I. i.) The interpretation of the original problem that I would use is: > V is a vector of nonnegative integers with shape N whose sum is Q. Thanks Marshall. The actual specification is V is a vector of POSITIVE integers with shape N whos

Re: [Jprogramming] Random distribution

2015-05-08 Thread Dan Bron
mming" Date: Fri, 8 May 2015 16:27:33 + (UTC) To: "programm...@jsoftware.com" For Q = 3, only 1 1 1 would match your criteria for Q = 4, 2 2 would not be N=#V 1 1 1 1 again appears to be the only match I see. ----- Original Message - From: Dan Bron To: programm

[Jprogramming] Random distribution

2015-05-08 Thread Dan Bron
I have a quantity Q and I want to divide it into a vector V of N randomly-sized chunks, such that N=#V and Q=+/V . Ideas? -Dan -- For information about J forums see http://www.jsoftware.com/forums.htm

Re: [Jprogramming] More documentation on GUI's made with J

2015-04-23 Thread Dan Bron
Out of interest: aren't almost all user interfaces these days web-based? - Original Message --- Subject: [Jprogramming] More documentation on GUI's made with J From: Ivann Ruiz Date: Thu, 23 Apr 2015 16:26:30 + To: Programming forum To whom it may concern, I

Re: [Jprogramming] Can whatever be written tacitly?

2015-02-23 Thread Dan Bron
Raul wrote: > I would still advise care, when using $: (or even ^:_), because > sometimes you'll need to shut down J (or sometimes even reboot your > machine) to deal with the resulting resource consumption. Agreed; and it's worth quoting this just to say "I agree!" because it's worth people re

Re: [Jprogramming] Source of frustration

2015-02-12 Thread Dan Bron
Absolutely agreed. For example, the use of "preferred J version" appears imperfect to me, as does the word "issue" applied to the observations quoted. -Dan Please excuse typos; sent from a phone. On Feb 12, 2015, at 4:22 AM, R.E. Boss wrote: >> On Behalf Of Raul Miller >> Sent: donderdag 12

Re: [Jprogramming] Project Euler 85, Python and J

2014-10-10 Thread Dan Bron
First, a few caveats: - I didn't read the original question of the problem as stated on Project Euler - The J code is a essentially mechanical transliteration of your Python code - It's also effectively untested - If you try it on your end, and it appears useful, I can write a detailed explan

Re: [Jprogramming] Weekend Puzzle - Age of Groundhog born 2002 2 2

2014-09-20 Thread Dan Bron
The obnoxiously technical answer to this question is there are multiple definitions of both "year" and "day", and how long *anything* is also depends on the length of your ruler. That's not helpful for your exercise, I know, but it's worth bearing in mind for this meta-debate. -Dan Please ex

Re: [Jprogramming] OOJ and calling a verb from another locale

2014-09-17 Thread Dan Bron
Raul wrote: > The concept of tacit is slippery enough that it's probably worth > quoting the definition you are using, and describing what it is about > the context that makes "tacit" a relevant concept whenever we talk > about it. Though we all "know what it means", it turns out when you rea

Re: [Jprogramming] OOJ and calling a verb from another locale

2014-09-17 Thread Dan Bron
John Hough wrote: > But for my specific problem OOP is the way to go I think. Raul wrote: > Out of curiosity, why? John responded: > Well, maybe I don't. But > I have half a dozen variables I want to tie together. Fair enough, but this just pushes the question back, a bit. Ultimately, J pro

Re: [Jprogramming] OOJ and calling a verb from another locale

2014-09-15 Thread Dan Bron
If this was StackOverflow, I'd be able to give this post a +1. As it is, however, the best I can do is clutter up the list by vehemently agreeing with you :) -Dan - Original Message --- Subject: Re: [Jprogramming] OOJ and calling a verb from another locale From: Devon McCormic

Re: [Jprogramming] rpn calculator

2014-09-12 Thread Dan Bron
Brian Schott wrote: > 1 A. b transposes the last two items of b A. is really cool. The problem with using it is coming up with the correct left-hand argument (code) for the permutation you want. A few special ones are easy to remember (particularly 0 for "do nothing", _1 for "reverse", and 1 for

Re: [Jprogramming] rpn calculator

2014-09-12 Thread Dan Bron
Kip wrote: > NB. swap? Oh, I meant to mention, the most fun way to swap things in J is using C. : (<0 1) C. 'AbCdEfGhI' bACdEfGhI (<4 5) C. 'AbCdEfGhI' AbCdfEGhI -Dan -- For information

Re: [Jprogramming] rpn calculator

2014-09-12 Thread Dan Bron
Kip, The adverb is what you think it is, except you need to use a little trick to workaround some limitations in the interpreter. Thus: op1Arg =: adverb def 'y],.STACK =: (_1 }. STACK), u _1 {. STACK' op2Arg =: adverb def 'y],.STACK =: ( _2 }. STACK), u/ _2 {. STACK'

Re: [Jprogramming] Replace one item of a list

2014-09-11 Thread Dan Bron
f y" >> >> So, if there is no "between items of y" inserts nothing and y remains >> unchanged; but, it seems to me that the Dictionary could be more assertive >> in this instance. >> >> >>> On Thu, Sep 11, 2014 at 2:13 PM, Dan Bron wro

Re: [Jprogramming] Replace one item of a list

2014-09-11 Thread Dan Bron
is: > "m/y inserts successive verbs from the gerund m between items of y" > > So, if there is no "between items of y" inserts nothing and y remains > unchanged; but, it seems to me that the Dictionary could be more assertive > in this instance. > > > On Thu, Sep

Re: [Jprogramming] Replace one item of a list

2014-09-11 Thread Dan Bron
Pepe wrote: > My only question is: Does the Dictionary support this behavior? > Raul responded: > Yes, it does. I replied: > I am intrigued. Can you elaborate? Thomas followed-up: > I assumed that by not mentioning it, the implementation > is free to do what it chooses. It could be anythi

  1   2   3   4   5   >