Re: [Jprogramming] J in 5 minutes

2014-02-21 Thread Björn Helgason
Talking about present value or getting a promise of something in the future. It is not just interest rate but also inflation you need to think about. Not to mention broken promises and not paying back in the future. Bring in the value of a hamburger now or in the future or a painting or gold. I

Re: [Jprogramming] J in 5 minutes

2014-02-21 Thread Brian Schott
Pascal, I just inserted a new start to the essay as sort of subheading, "*Don't make the mistake of thinking this essay is about finance. It's about the beauty, eccentricities, and power of J". * Your comments seem to suggest the opposite: that the essay needs to be about compound interest. If yo

Re: [Jprogramming] J in 5 minutes

2014-02-21 Thread Don Guinn
Looking at the J expression to calculate would not make any sense to someone who does know J. Giving a reference or even putting the original expression using traditional mathematical syntax and showing their similarity would show how J is not that hard to read. On Fri, Feb 21, 2014 at 7:02 PM, P

Re: [Jprogramming] J in 5 minutes

2014-02-21 Thread Pascal Jasmin
Even if spreadsheets are streets behind (unhip), I think people still want to make calculations, and J is both quicker than any other language, and much quicker than spreadsheets.  A key benefit to powerful one liners is interactively obtaining answers. The way I would enhance the original exam

Re: [Jprogramming] J in 5 minutes

2014-02-21 Thread Don Guinn
Years ago I was in a class where the day's topic was the present value and future value of money. The teacher asked for a volunteer. As you know, kids are reluctant to volunteer. He finally got a volunteer. The student came up, he gave the student a dollar and said thanks for volunteering and he co

Re: [Jprogramming] simple time series (lag)

2014-02-21 Thread Raul Miller
d=: (1+(i.4)),(1.25+(i.4)) (4 }. d) % _4 }. d Or, abstracting that. 4 (}. % (-@[ }. ])) d 1.25 1.125 1.08333 1.0625 Here's how I think I would define lag: lag=: 1 :0 }. u -@[ }. ] ) Or, if you prefer: lag=: 1 :0 : (x }. y) u (-x) }. y ) That said, if shift works fo

Re: [Jprogramming] simple time series (lag)

2014-02-21 Thread Joe Bogner
Brian, thank you! That is exactly what I needed. (] %~ 4 |.!.0 ]) (1+i.4),(1.25+i.4) 1.25 1.125 1.08333 1.0625 0 0 0 0 I should have thought of that. I was thinking of it as a selection solution and not an array solution. I used shift the other day with my line detection logic. I have a well wor

Re: [Jprogramming] simple time series (lag)

2014-02-21 Thread Brian Schott
Joe, I think you are looking for shift as discussed here. http://jsoftware.com/help/dictionary/d231.htm If you think I am right and want more, let me know. On Fri, Feb 21, 2014 at 5:58 PM, Joe Bogner wrote: > is there a better way to do this? Calculate change over the 4th or Nth > previous c

Re: [Jprogramming] J in 5 minutes

2014-02-21 Thread Brian Schott
Don, My intent was not to make the essay a financial tutorial, but to highlight the beauty and uniqueness of J code, so some of those details seem inappropriate. I need another introductory sentence/statement or else I need to change the example. Thanks for you help, On Fri, Feb 21, 2014 at 4:5

Re: [Jprogramming] J in 5 minutes

2014-02-21 Thread Brian Schott
Raul, I'll think about how to start more concisely. Maybe others have a better introductory sentence for me. I'll added links to wikipedia regarding interest rates. I fear I lack much skill in written or oral humor, but I get your point. I agree that a financial formula will not attract many youn

Re: [Jprogramming] simple time series (lag)

2014-02-21 Thread Pascal Jasmin
didn't look totally at what you are trying to do, but    (1+(i.4)),(1.25+(i.4)) 1 2 3 4 1.25 2.25 3.25 4.25     5 ({: - {.)\ 1 2 3 4 1.25 2.25 3.25 4.25 0.25 0.25 0.25 0.25 \ used dyadically using overlapping groups of length 5 in this case. - Original Message - From: Joe Bogner To: p

[Jprogramming] simple time series (lag)

2014-02-21 Thread Joe Bogner
is there a better way to do this? Calculate change over the 4th or Nth previous cell? d=.(1+(i.4)),(1.25+(i.4)) d %~ ((# d) {. _4 {. d) 1.25 1.125 1.08333 1.0625 0 0 0 0 Here's how it's done in R > d<-ts(c(1:4, c(1:4)+0.25)) > d/lag(d,k=-4) Time Series: Start = 5 End = 8 Frequency =

Re: [Jprogramming] J in 5 minutes

2014-02-21 Thread Brian Schott
Thank you, Vijay, and others who pointed out this error. I had originally done the calcs with 10 years, not 3 years, and copied the wrong info into jwiki. I have fixed that now. On Fri, Feb 21, 2014 at 1:20 PM, Vijay Lulla wrote: > Brian, > I think there's error in a couple of places. When I tr

Re: [Jprogramming] J in 5 minutes

2014-02-21 Thread Raul Miller
(1*1.05^3)-1000*(1-~1.05^3)%0.053711.05 That is: 1 dollars with three years interest applied to it (as if no payment had been made for three years), minus 20 times a single 1000 dollar payment which has also received 3 years interest on it. Call it an early draft - we learn from our mi

Re: [Jprogramming] J in 5 minutes

2014-02-21 Thread Don Guinn
I'm confused! I assume that the annual payment against the $1 loan is $1000. Which means that the value of the loan must be more than $7000 as only $3000 has been paid against it. Yet the line which should be the value of the loan after three years shows $3711.05. I think the description of th

Re: [Jprogramming] J in 5 minutes

2014-02-21 Thread Raul Miller
On Fri, Feb 21, 2014 at 4:08 PM, Joe Bogner wrote: > I wonder if J could make game programming (without big libraries) more > approachable Games are typically built on top of libraries now and it's > lost how it truly works. Game physics and the rendering math is something > I've always wanted t

Re: [Jprogramming] J in 5 minutes

2014-02-21 Thread Joe Bogner
On Fri, Feb 21, 2014 at 2:57 PM, Raul Miller wrote: > What I want to do is hook > them up with youngsters and young adults. And to me that means developing > J's artistic and gaming potential (and not just "code golf," though of > course that can also sometimes be entertaining). > > I wonder if J

Re: [Jprogramming] J in 5 minutes

2014-02-21 Thread Raul Miller
Your first sentence in your essay is long. This suggests a highly educated audience. Personally, I'd like to see some of your skill in teaching - which I imagine as a little humor, a concise introduction, references to things to learn. I know you feel that your knowledge is obvious - everyone feels

Re: [Jprogramming] Generating code from templates

2014-02-21 Thread Pascal Jasmin
The usefulness of Cloak (and verbifying) is that you can then apply adverbs and conjunctions (" ~ ...)to what are essentially adverbs and conjunctions. Consider the now badly named conjunction vtie which is an enhancement to tie designed to always produce verbs (promoting nouns with "_), and so

Re: [Jprogramming] Generating code from templates

2014-02-21 Thread Jose Mario Quintana
I will not dare to explain it again after Dan has done so; see, http://www.jsoftware.com/pipermail/programming/2013-January/031249.html the form is slightly different but the same logic applies. In my opinion, that thread and the related one: http://www.jsoftware.com/pipermail/programming/2013-Jan

Re: [Jprogramming] J in 5 minutes

2014-02-21 Thread Vijay Lulla
Brian, I think there's error in a couple of places. When I try (1*1.05^3)-1000*(1-~1.05^3)%0.05 I get 8423.75 and not 3711.05 that's listed on that page. Otherwise it looks good! Thanks, Vijay On Fri, Feb 21, 2014 at 1:03 PM, robert therriault wrote: > If you think you could introduce t

Re: [Jprogramming] Generating code from templates

2014-02-21 Thread Pascal Jasmin
neat.    tie ,^:(0:``)    tie&'' f. ,^:(0:``)&'' which is using the gerund (v1`v2) version of ^: . This appears to be undocumented in that v2 here is a conjunction(`).  I assume that using an adverb as v2 is impossible? The other peculiarity is that v1 is 0: which means that , never executes.

Re: [Jprogramming] J in 5 minutes

2014-02-21 Thread robert therriault
If you think you could introduce that adverb without overwhelming the viewer, then I do think that kind of flexibility would be a real motivator for learning J, but I must emphasize that I am not within your target audience so take my feedback with a bag of salt. Cheers, bob On Feb 21, 2014,

Re: [Jprogramming] J in 5 minutes

2014-02-21 Thread Brian Schott
Bob, Thanks very much for the encouragement and the suggestions. If I were to plot more, 2 variations come to mind: non-uniform payments, and different interest rates. The first would just mean changing the values of p, the latter might require a new adverb based on upd; something like vupd =. a

Re: [Jprogramming] J in 5 minutes

2014-02-21 Thread robert therriault
Hi Brian, I think that tangents are not a bad thing if it allows us to get the message across in a more precise way. With the jwiki entry, I am wondering if it may be a good idea to play a little more with the tool that you have built. It seems to me that if I am a viewer who is really interest

Re: [Jprogramming] Generating code from templates

2014-02-21 Thread Jose Mario Quintana
The verbalized conjunctions tie and rank can be produced as follows: 9!:14 '' j701/2011-01-10/11:25 Cloak=. (0:`)(,^:) NB. Conjunction to cloak adverbs and conjunctions as verbs Cloak=. (5!:1@<'Cloak')Cloak NB. Cloaking Cloak 'tie rank'=. (Cloak @: < each) @: ;: '` "' NB. Cloaking ti

Re: [Jprogramming] J in 5 minutes

2014-02-21 Thread Brian Schott
In light of the various proposals regarding J-in-5, my contribution seems very tangential, but there may be an audience for this approach as well. Initially I envisioned a screencast, for the essay, but have had some difficulty with producing the screencast and have elected to make a jwiki entry. P

Re: [Jprogramming] Bug in "tsPlus"?

2014-02-21 Thread Devon McCormick
I still like my own "TSAdd", ugly as it looks: 2005 12 31 0 0 0 tsPlus 6{.0 6 2006 7 1 0 0 0 2005 12 31 0 0 0 tsPlus 6{.0 2 2006 3 3 0 0 0 NB. versus >{:2005 12 31 0 0 0 TSAdd 6{.0 6 2006 6 30 0 0 0 >{:2005 12 31 0 0 0 TSAdd 6{.0 2 2006 2 28 0 0 0 On Wed, Feb 19, 2014 at 4:47 PM, Ric

Re: [Jprogramming] What does this do?

2014-02-21 Thread PMA
I'm wondering how Roger's % 1 +. (+%)/\ 100 $ 1x might accept input seeds -- as many as user enters. Since my stumble over from APL decades ago, I've used the following to do this (& output mod cycles). FibLuc =: 4 : 0 NB. Cyc =. Mod FibLuc Seeds;Tail;Ord Ord=. -$Cyc=. Tail=. Seeds=. x|y

Re: [Jprogramming] Bug? in qtide.

2014-02-21 Thread chris burke
I see it now, and will fix. Thanks. On Fri, Feb 21, 2014 at 3:47 PM, Jan-Pieter Jacobs < janpieter.jac...@gmail.com> wrote: > It is basically after closing the file you just opened. > So when no files are open, the run button (and possibly others) should > disappear or be deactivated. > > Jan-Pi