Getting started - saving workspaces

Received: by 10.100.197.3 with SMTP id u3mr129991anf.6.1219421899540; Fri, 22 Aug 2008 09:18:19 -0700 (PDT)Date: Fri, 22 Aug 2008 09:18:19 -0700 (PDT)X-IP: 71.59.214.4User-Agent: G2/1.0X-Google-Token: 888w3wwAAAArzVU4gubrPhNVmHyT_5FNX-HTTP-UserAgent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.8.1.16) Gecko/20080702 Firefox/2.0.0.16,gzip(gfe),gzip(gfe)Message-ID: <96e7618b-e837-421e-ba4d-f9dd191ccdc7@c58g2000hsc.googlegroups.com>Subject: Getting started - saving workspacesFrom: Max Rockbin To: “Kdb+ Personal Developers” X-Google-Approved: simon.garland@gmail.com via email at 2008-08-22 16:34:41I’m just getting started w. Q, having worked in APL before.How do you save your workspace so you can continue a session or haveglobals around? In the manual I’ve found info about saving individualdata structures, but not your Workspace (and how do you load itback!).Maybe I’m missing the boat on this. What’s the “normal” way ofdeveloping in Q. Do you just keep folders on your hard drive with allthe data structures and functions you need for a project in files andbatch load them each time you work on it?I know I’m going to have this question too as I get deeper intothings:I see that you can save a table to a file on disk, but if your tableis a gigabyte or more, that seems hardly a practical way ofmaintaining a large table (or more likely, a set of tables). Is theresome automatic persistence so the table is incrementally stored ondisk as it changes? Power failures, automatic terminations ofsessions, etc. would seem to be hazardous to the health of any largedata structure.Thanks!

max,

you can replicate the saving of the workspace (with everything in it, including functions, data, etc) with:

:your_file set get .

to load it back:

. set get :your_file

the normal way of working is to write your scripts in you favorite text editor, load them in your session interactively or from other scripts or from “database” (a directory on disk containing other things as well).

there are different ways of saving and working with data on disk but you need to take it slowly and understand the basics of q first and the choices to fit you particular app. i cant describe them here as each of them requires more that a simple email reply.

have a look on https://code.kx.com for the tutorials, language refrence and the cookbook.

regards,

felix

On Fri, Aug 22, 2008 at 7:18 PM, Max Rockbin <mrochlin@gmail.com> wrote:

I’m just getting started w. Q, having worked in APL before.
How do you save your workspace so you can continue a session or have
globals around?  In the manual I’ve found info about saving individual
data structures, but not your Workspace (and how do you load it
back!).

Maybe I’m missing the boat on this.  What’s the “normal” way of
developing in Q.  Do you just keep folders on your hard drive with all
the data structures and functions you need for a project in files and
batch load them each time you work on it?

I know I’m going to have this question too as I get deeper into
things:
I see that you can save a table to a file on disk, but if your table
is a gigabyte or more, that seems hardly a practical way of
maintaining a large table (or more likely, a set of tables).  Is there
some automatic persistence so the table is incrementally stored on
disk as it changes?  Power failures, automatic terminations of
sessions, etc. would seem to be hazardous to the health of any large
data structure.

Thanks!