Re: [Jprogramming] "Segmented Strings"

2014-04-08 Thread Raul Miller
The plan is that segmented strings are the data in the database. There's just too much information to hold it all in memory on a single machine. Thanks, -- Raul On Wed, Apr 9, 2014 at 2:23 AM, Linda Alvord wrote: > I know almost nothing about large databases, but what is the advantage of > s

Re: [Jprogramming] "Segmented Strings"

2014-04-08 Thread Linda Alvord
I know almost nothing about large databases, but what is the advantage of staying with sstrings after the data base is built? Once you have your table, or maybe two or more tables of character and numeric data, you might "stay in J and make "subtables" which can be catenated together and destro

Re: [Jprogramming] Euler Project Problem 1

2014-04-08 Thread Don Kelly
sorry- I originally used + which duplicated 15 where I should have used or (+. ) On 08/04/2014 8:52 PM, Don Kelly wrote: try=: 3 : '( (0=3|y)+.(0=5|y))#y' **or** try1=: ] #~ (0 = 3 | ]) +. 0 = 5 | ] * * try1 1+i.19 3 5 6 9 10 12 15 18 Don Kelly On 08/04/2014 8:30 AM, Jon Hough wrote:

Re: [Jprogramming] Euler Project Problem 1

2014-04-08 Thread Don Kelly
try=: 3 : '( (0=3|y)+.(0=5|y))#y' **or** try1=: ] #~ (0 = 3 | ]) +. 0 = 5 | ] * * try1 1+i.19 3 5 6 9 10 12 15 15 18 Don Kelly On 08/04/2014 8:30 AM, Jon Hough wrote: Euler Project #1 is:If we list all the natural numbers below 10 that are multiples of 3 or 5, we get 3, 5, 6 and 9. The

Re: [Jprogramming] "Segmented Strings"

2014-04-08 Thread Raul Miller
I might indeed do that, but in some cases the time to read the file itself will be mostly network transfer time. And, once it's in memory, how it got there isn't really an issue. Still, it's worth benchmarking. Thanks, -- Raul On Tue, Apr 8, 2014 at 8:18 PM, Vijay Lulla wrote: > I second me

Re: [Jprogramming] "Segmented Strings"

2014-04-08 Thread Vijay Lulla
I second memory mapped files and mapped file database. On Tue, Apr 8, 2014 at 4:51 PM, Raul Miller wrote: > It's available for free now, with some limitations: > > http://kx.com/software-download.php > > It'll take me a few years, though, to develop a fluency in K (Q actually, > or kdb+ ...) wh

Re: [Jprogramming] Euler Project Problem 1

2014-04-08 Thread Don Guinn
A pencil and paper solution. A problem with computers is that it is too easy to go for a brute-force solution. Computers are great for solving problems with no simple solutions by applying brute-force, but this isn't one. The problem with adding together all multiples of 3 and 5 in the series 0 .

Re: [Jprogramming] require 'plot' -> script not found though package installed?

2014-04-08 Thread chris burke
It shouldn't matter where J is installed, so it sounds like your reinstall fixed an earlier problem. On Wed, Apr 9, 2014 at 5:30 AM, Ray Zhao wrote: > Ok, so I reinstalled J in the HOME folder instead of system and the > problem's solved now. I guess I really have to read throughout the actual

Re: [Jprogramming] an improvement to apply and perhaps anon evoke

2014-04-08 Thread Pascal Jasmin
evoke6=: evoke&6 eval2 =: 'evoke6 @: <' apply ]    +:(eval2'@')+/1 2 3 22    +:( eval2']')+/1 2 3 12    +:(    eval2'4:')+/1 2 3 8 note that it only works for verbs/modifiers. domain error for nouns, and also:    +:(    eval2'4"_')+/1 2 3 |domain error but: a=. 4"_    +:(    eval2'a')+/1 2 3

Re: [Jprogramming] require 'plot' -> script not found though package installed?

2014-04-08 Thread Ray Zhao
Ok, so I reinstalled J in the HOME folder instead of system and the problem's solved now. I guess I really have to read throughout the actual site more... -- For information about J forums see http://www.jsoftware.com/forums.htm

Re: [Jprogramming] Zeno and the superimposing clock hands puzzle

2014-04-08 Thread Jose Mario Quintana
I think so; actually, I would say it is even more related to the exact value of 1/3 as a binary number: 0.01010101010101010101010101... On Tue, Apr 8, 2014 at 12:00 AM, Don Kelly wrote: > Ah, then the question is that when the trains are exactly opposite to one > another- where is the fly- hal

Re: [Jprogramming] require 'plot' -> script not found though package installed?

2014-04-08 Thread Devon McCormick
The path you're showing does not look like the one that pacman installs to, at least not on my Windows machine: I see "plot.ijs" under "C:\Program Files (x86)\j64-701\addons\graphics\plot". On Tue, Apr 8, 2014 at 5:09 PM, Ray Zhao wrote: > Hi Chris, I have tried this method of reinstalling the

Re: [Jprogramming] an improvement to apply and perhaps anon evoke

2014-04-08 Thread Jose Mario Quintana
That is right, evoke=. (<'`:')(0:`)(,^:) 'evoke&6 @: <' apply '@' @ This is not suitable for the purposes that Pascal has in mind (that is an ideal job for wl (104!:1)); but, apply can return any kind of words. "To see and listen to the wicked is already the beginning of wickedness." ;)

[Jprogramming] require 'plot' -> script not found though package installed?

2014-04-08 Thread Ray Zhao
Hi Chris, I have tried this method of reinstalling the addons using tools->package manager in admin mode, but I still get the same error. The ijs file is installed in a folder different than that from the one JQt is actually searching in: load 'C:/Program Files/j801/graphics/plot/plot.ijs' not fo

Re: [Jprogramming] "Segmented Strings"

2014-04-08 Thread Raul Miller
It's available for free now, with some limitations: http://kx.com/software-download.php It'll take me a few years, though, to develop a fluency in K (Q actually, or kdb+ ...) which approaches my fluency in other languages. Anyways, it's not at all clear that K (or Q or KDB+) would be any better f

Re: [Jprogramming] Euler Project Problem 1

2014-04-08 Thread Roger Hui
It may help if you knew how fork came about. http://keiapl.org/rhui/remember.htm#fork0 http://keiapl.org/anec/#nvv It was a long struggle. The triple aspect is integral to the idea. On Tue, Apr 8, 2014 at 12:09 PM, Joe Bogner wrote: > On Tue, Apr 8, 2014 at 11:48 AM, Jan-Pieter Jacobs < >

Re: [Jprogramming] Euler Project Problem 1

2014-04-08 Thread Joe Bogner
On Tue, Apr 8, 2014 at 11:48 AM, Jan-Pieter Jacobs < janpieter.jac...@gmail.com> wrote: [snip] > Other things to note are : you can use a for for dummy, and instead of > multiplying with 1, it's easier to use the identity function (which, as a > bonus works also for non-numeric types). Now a fork

Re: [Jprogramming] "Segmented Strings"

2014-04-08 Thread km
I think I would pay for k's database capability. --Kip Murray Sent from my iPad > On Apr 8, 2014, at 12:46 PM, Björn Helgason wrote: > > I would take a look at the mapped file database lab to get ideas. > > - > Björn Helgason > gsm:6985532 > skype:gosiminn >> On 8.4.2014 15:34, "Raul Miller"

Re: [Jprogramming] "Segmented Strings"

2014-04-08 Thread Björn Helgason
I would take a look at the mapped file database lab to get ideas. - Björn Helgason gsm:6985532 skype:gosiminn On 8.4.2014 15:34, "Raul Miller" wrote: > I have thought about using symbols, but the only way to delete symbols that > I know of involves exiting J. And, my starting premise was that I

Re: [Jprogramming] Euler Project Problem 1

2014-04-08 Thread Devon McCormick
The J video here - https://www.youtube.com/watch?v=OzaIi8BnHIc - walks you through building the J code for Project Euler problem 1. It ends with a variant that leads into Pascal's extremely terse version. On Tue, Apr 8, 2014 at 11:56 AM, Pascal Jasmin wrote: >3 5 (0=|)"0 1 i.10 > 1 0 0 1 0

Re: [Jprogramming] Euler Project Problem 1

2014-04-08 Thread Pascal Jasmin
   3 5 (0=|)"0 1 i.10 1 0 0 1 0 0 1 0 0 1 1 0 0 0 0 1 0 0 0 0    3 5 (0  ([: +./ =) |"0 1) i.10 1 0 0 1 0 1 1 0 0 1    3 5 (] #~   0  ([: +./ =) |"0 1) i.10 0 3 5 6 9    +/ 3 5 (] #~  0 ([: +./ =) |"0 1)  i.1000 233168 - Original Message - From: Jon Hough To: "programm...@jsoftware.c

Re: [Jprogramming] Euler Project Problem 1

2014-04-08 Thread Jan-Pieter Jacobs
Hey Jon, It can be written in one go, try: +/@result f. This fixes the all verbs, converting a verb to it's constituent primitives. That said, you are over-specifying your ranks. Ranks are there by default, and as it happens = already has rank 0, so there is no use in setting the ranks. Other

Re: [Jprogramming] Euler Project Problem 1

2014-04-08 Thread robert therriault
Hi Jon, Have you had a chance to watch the J in 10 minutes video that Martin Saurer produced a few days ago (link below). About a minute in, Project Euler #1 is used as an example to explain a J approach to the problem. https://www.youtube.com/watch?v=OzaIi8BnHIc&list=PLLcTTp6EQ_egylIerYEjCBbE

Re: [Jprogramming] Euler Project Problem 1

2014-04-08 Thread Jon Hough
Hi, Thanks for the reply. That is essentially what I tried to do. "Multiply the number by 1 if it has remainder zero on division by 3 or 5, 1 otherwise. Then sum.". But my J is clunky, ugly and doesn't look like other peoples' J. > Date: Tue, 8 Apr 2014 11:39:07 -0400 > From: ircsurfe...@gmail

Re: [Jprogramming] Euler Project Problem 1

2014-04-08 Thread Lee Fallat
Hey Jon, I remember seeing this done by someone before. They went about it like this: generate numbers 0 through 1000 a = i.1000 create a "mask" list of 0s and 1s where the numbers are divisible by 3 and 5 (pseudo code: b = a % 3 OR a % 5) multiply the mask list and the number list together and a

Re: [Jprogramming] "Segmented Strings"

2014-04-08 Thread Raul Miller
I have thought about using symbols, but the only way to delete symbols that I know of involves exiting J. And, my starting premise was that I would have too much data to fit into memory. For some computations it does make sense to start up an independent J session for each part of the calculation

[Jprogramming] Euler Project Problem 1

2014-04-08 Thread Jon Hough
Euler Project #1 is:If we list all the natural numbers below 10 that are multiples of 3 or 5, we get 3, 5, 6 and 9. The sum of these multiples is 23. Find the sum of all the multiples of 3 or 5 below 1000. In C/Java I could easily do something like: int total =0; for (int counter = 0; counter <

Re: [Jprogramming] "Segmented Strings"

2014-04-08 Thread Björn Helgason
Looks to me like a mapped file would be good - Björn Helgason gsm:6985532 skype:gosiminn On 8.4.2014 06:40, "Raul Miller" wrote: > Consider this example: > > table=:<;._2;._2]0 :0 > First Name,Last Name,Sum, > Adam,Wallace,19, > Travis,Smith,10, > Donald,Barnell,8, > Gary,Wallace,27, > James,Smi

Re: [Jprogramming] "Segmented Strings"

2014-04-08 Thread Pascal Jasmin
Its very cool to develop routines to treat delimited files as data.  This can make sense as large read only reference data, or generally low priority "discardable" data.  Your example might be a file that is generated by an "expensive" other query process and will be replaced next time it is run

Re: [Jprogramming] Qt: isigraph resize behavior

2014-04-08 Thread chris burke
Thanks for pointing this out. The next Qt release will allow isigraph to resize the way you want. Also, the table control is stable now, and that early comment about syntax changing will be removed. On Mon, Apr 7, 2014 at 5:52 PM, Christoph von Basum < christoph.von.ba...@gmail.com> wrote: >

Re: [Jprogramming] "Segmented Strings"

2014-04-08 Thread Joe Bogner
It seems this representation is somewhat similar to how the symbol table stores strings: http://m.jsoftware.com/help/dictionary/dsco.htm Also, did you consider using symbols? I've used symbols for string columns that contain highly repetitive data, for example, an invoice table with an alpha-nume