1. ananelson
  2. scidb-docs

Commits

ananelson  committed e5ff4f9

Started work on first few chapters of SciDB user guide in PDF format.

  • Participants
  • Parent commits 8ee7621
  • Branches default

Comments (0)

Files changed (30)

File .dexy

-{
-  "*.scidb|jinja|t|idio|scidb" : {
-    "inputs" : ["prisoner-example.py|jinja|pycon"]
-  },
-  "*.cpp|idio|inlinecss" : {},
-  "*.html|pyg": {},
-  "*.py|jinja|pycon" : {},
-  "*.html|dexy": {},
-  "*.html|jinja" : {
-    "allinputs" : true
-  }
-}

File .hgignore

View file
 artifacts/*
 logs/*
 cache/*
+docs/trunk
+.svn
+*.pyc

File docs/.dexy

View file
+{
+  "*.scidb|ct|jinja|idio|scidb" : {},
+  "create-garlicsim-array.scidb|ct|jinja|idio|scidb" : {
+    "inputs" : ["prisoner-example.py|jinja|pycon|pyg|l"]
+  },
+  "read-output.py|jinja|pyout" : {
+    "inputs" : ["prisoner-example.py|jinja|pycon|pyg|l"]
+  },
+  "trunk/src/qproc/ops/src/attributes/LogicalAttributes.cpp|idio|l" : {},
+  "trunk/src/qproc/ops/src/dimensions/LogicalDimensions.cpp|idio|l" : {},
+  "*.html|pyg": {},
+  "*.py|jinja|pycon|pyg|l" : {},
+  "*.py|idio|l" : {},
+  "*.html|dexy": {},
+  "*.tex|jinja|latex" : {
+    "allinputs" : true,
+    "inputs" : [
+      "../filters/*.py|idio|l",
+      "../trunk/src/qproc/ops/src/attributes/LogicalAttributes.cpp|idio|l",
+      "../trunk/src/qproc/ops/src/dimensions/LogicalDimensions.cpp|idio|l"
+    ]
+  },
+  "*.html|jinja" : {
+    "allinputs" : true
+  }
+}

File docs/create-example-array.scidb

-CREATE ARRAY test_types_1 <a: int32, c:string> [x=0:1,1,0, y=0:1,1,0]
-load('test_types_1', '/home/ana/testdata/test_types.dat')
-scan('test_types_1')
-dimensions('test_types_1')
-attributes('test_types_1')

File docs/filters/scidb.py

View file
     OUTPUT_EXTENSIONS = [".txt"]
     ALIASES = ['scidb']
 
+### @export "process-dict"
     def process_dict(self, input_dict):
         output_dict = OrderedDict()
         for k, v in input_dict.items():
             output = ""
             for line in v.rstrip().split("\n"):
+                # write a fake prompt > then echo the input
                 output += "> %s\n" % line
 
                 if len(line) == 0 or line.startswith('#'):
+                    # Skip comments or blank lines.
                     continue
                 command = "/home/ana/trunk/bin/iquery -a -q \"%s\"" % line
                 self.log.debug(command)
                 output += "\n" # ensure that there's always a newline
             output_dict[k] = output
         return output_dict
-
-class ScidbPointFiveHandler(DexyHandler):
-    INPUT_EXTENSIONS = [".scidb", ".txt"]
-    OUTPUT_EXTENSIONS = [".txt"]
-    ALIASES = ['scidb5']
-
-    def process_dict(self, input_dict):
-        output_dict = OrderedDict()
-        for k, v in input_dict.items():
-            output = ""
-            for line in v.rstrip().split("\n"):
-                output += "> %s\n" % line
-
-                if len(line) == 0 or line.startswith('#'):
-                    continue
-                command = "/home/ana/trunk/bin/iquery -q \"%s\"" % line
-                self.log.debug(command)
-                output += pexpect.run(command).rstrip()
-                output += "\n" # ensure that there's always a newline
-            output_dict[k] = output
-        return output_dict
-

File docs/notes/all.scidb

View file
+scan(expr1)
+scan(expr2)
+scan(pattern)
+scan(mult_1)
+scan(mult_2)
+scan(mult_sp1)
+scan(mult_sp2)
+scan(mult_3)
+scan(mult_4)
+scan(M2x8)
+scan(vec)
+scan(M4x4)
+scan(M_4x4)
+scan(M4x4_3)
+scan(xyz)
+scan(xyz_200)
+scan(xyz_plain)
+scan(dense)
+scan(dense_2)
+scan(dense_3x3x4)
+scan(v10)
+scan(vec22)
+scan(evec)
+scan(mult_1y)
+

File docs/notes/array.scidb

View file
+### @export "save"
+save(mult_sp1, '/home/ana/out.dat')

File docs/notes/attr-v20.scidb

View file
+attributes('mult_4')
+dimensions('mult_4')
+
+scan('mult_4')
+slice(mult_4, 'x', 0)
+slice(mult_4, 'x', 1)
+slice(mult_4, 'x', 2)
+slice(mult_4, 'x', 3)
+
+slice(mult_4, '_2', 0)
+slice(mult_4, '_2', 1)
+slice(mult_4, '_2', 2)
+slice(mult_4, '_2', 3)
+
+count(mult_4)
+
+attributes('expr2')
+dimensions('expr2')
+scan('expr2')
+
+attributes('dense')
+dimensions('dense')
+scan('dense')
+
+slice(dense, 'x', 0)
+slice(dense, 'x', 1)
+slice(dense, 'x', 2)
+
+slice(dense, 'y', 0)
+slice(dense, 'y', 1)
+slice(dense, 'y', 2)

File docs/notes/basic.scidb

View file
+scan('mult_4')
+CREATE ARRAY mult_1y <a:double> [x=0:2,3,0, y=0:2,3,0]
+load('mult_1y', '../tests/basic/data/mult_sp_1.txt')
+scan('mult_1y')
+max(mult_1y, 'a')
+transpose(mult_1y)
+
+

File docs/notes/book.tex

View file
+\documentclass{tufte-book}
+\usepackage{../pastie}
+
+\hypersetup{colorlinks}% uncomment this line if you prefer colored hyperlinks (e.g., for onscreen viewing)
+
+%%
+% Book metadata
+\title{A Tufte-Style Book\thanks{Thanks to Edward R.~Tufte for his inspiration.}}
+\author[The Tufte-LaTeX Developers]{The Tufte-LaTeX\ Developers}
+\publisher{Publisher of This Book}
+
+%%
+% If they're installed, use Bergamo and Chantilly from www.fontsite.com.
+% They're clones of Bembo and Gill Sans, respectively.
+%\IfFileExists{bergamo.sty}{\usepackage[osf]{bergamo}}{}% Bembo
+%\IfFileExists{chantill.sty}{\usepackage{chantill}}{}% Gill Sans
+
+%\usepackage{microtype}
+
+%%
+% Just some sample text
+\usepackage{lipsum}
+
+%%
+% For nicely typeset tabular material
+\usepackage{booktabs}
+
+%%
+% For graphics / images
+\usepackage{graphicx}
+\setkeys{Gin}{width=\linewidth,totalheight=\textheight,keepaspectratio}
+
+% The fancyvrb package lets us customize the formatting of verbatim
+% environments.  We use a slightly smaller font.
+\usepackage{fancyvrb}
+\fvset{fontsize=\normalsize}
+
+%%
+% Prints argument within hanging parentheses (i.e., parentheses that take
+% up no horizontal space).  Useful in tabular environments.
+\newcommand{\hangp}[1]{\makebox[0pt][r]{(}#1\makebox[0pt][l]{)}}
+
+%%
+% Prints an asterisk that takes up no horizontal space.
+% Useful in tabular environments.
+\newcommand{\hangstar}{\makebox[0pt][l]{*}}
+
+%%
+% Prints a trailing space in a smart way.
+\usepackage{xspace}
+
+% Prints the month name (e.g., January) and the year (e.g., 2008)
+\newcommand{\monthyear}{%
+  \ifcase\month\or January\or February\or March\or April\or May\or June\or
+  July\or August\or September\or October\or November\or
+  December\fi\space\number\year
+}
+
+
+% Prints an epigraph and speaker in sans serif, all-caps type.
+\newcommand{\openepigraph}[2]{%
+  %\sffamily\fontsize{14}{16}\selectfont
+  \begin{fullwidth}
+  \sffamily\large
+  \begin{doublespace}
+  \noindent\allcaps{#1}\\% epigraph
+  \noindent\allcaps{#2}% author
+  \end{doublespace}
+  \end{fullwidth}
+}
+
+% Inserts a blank page
+\newcommand{\blankpage}{\newpage\hbox{}\thispagestyle{empty}\newpage}
+
+\usepackage{units}
+
+% Typesets the font size, leading, and measure in the form of 10/12x26 pc.
+\newcommand{\measure}[3]{#1/#2$\times$\unit[#3]{pc}}
+
+% Macros for typesetting the documentation
+\newcommand{\hlred}[1]{\textcolor{Maroon}{#1}}% prints in red
+\newcommand{\hangleft}[1]{\makebox[0pt][r]{#1}}
+\newcommand{\hairsp}{\hspace{1pt}}% hair space
+\newcommand{\hquad}{\hskip0.5em\relax}% half quad space
+\newcommand{\TODO}{\textcolor{red}{\bf TODO!}\xspace}
+\newcommand{\ie}{\textit{i.\hairsp{}e.}\xspace}
+\newcommand{\eg}{\textit{e.\hairsp{}g.}\xspace}
+\newcommand{\na}{\quad--}% used in tables for N/A cells
+\providecommand{\XeLaTeX}{X\lower.5ex\hbox{\kern-0.15em\reflectbox{E}}\kern-0.1em\LaTeX}
+\newcommand{\tXeLaTeX}{\XeLaTeX\index{XeLaTeX@\protect\XeLaTeX}}
+% \index{\texttt{\textbackslash xyz}@\hangleft{\texttt{\textbackslash}}\texttt{xyz}}
+\newcommand{\tuftebs}{\symbol{'134}}% a backslash in tt type in OT1/T1
+\newcommand{\doccmdnoindex}[2][]{\texttt{\tuftebs#2}}% command name -- adds backslash automatically (and doesn't add cmd to the index)
+\newcommand{\doccmddef}[2][]{%
+  \hlred{\texttt{\tuftebs#2}}\label{cmd:#2}%
+  \ifthenelse{\isempty{#1}}%
+    {% add the command to the index
+      \index{#2 command@\protect\hangleft{\texttt{\tuftebs}}\texttt{#2}}% command name
+    }%
+    {% add the command and package to the index
+      \index{#2 command@\protect\hangleft{\texttt{\tuftebs}}\texttt{#2} (\texttt{#1} package)}% command name
+      \index{#1 package@\texttt{#1} package}\index{packages!#1@\texttt{#1}}% package name
+    }%
+}% command name -- adds backslash automatically
+\newcommand{\doccmd}[2][]{%
+  \texttt{\tuftebs#2}%
+  \ifthenelse{\isempty{#1}}%
+    {% add the command to the index
+      \index{#2 command@\protect\hangleft{\texttt{\tuftebs}}\texttt{#2}}% command name
+    }%
+    {% add the command and package to the index
+      \index{#2 command@\protect\hangleft{\texttt{\tuftebs}}\texttt{#2} (\texttt{#1} package)}% command name
+      \index{#1 package@\texttt{#1} package}\index{packages!#1@\texttt{#1}}% package name
+    }%
+}% command name -- adds backslash automatically
+\newcommand{\docopt}[1]{\ensuremath{\langle}\textrm{\textit{#1}}\ensuremath{\rangle}}% optional command argument
+\newcommand{\docarg}[1]{\textrm{\textit{#1}}}% (required) command argument
+\newenvironment{docspec}{\begin{quotation}\ttfamily\parskip0pt\parindent0pt\ignorespaces}{\end{quotation}}% command specification environment
+\newcommand{\docenv}[1]{\texttt{#1}\index{#1 environment@\texttt{#1} environment}\index{environments!#1@\texttt{#1}}}% environment name
+\newcommand{\docenvdef}[1]{\hlred{\texttt{#1}}\label{env:#1}\index{#1 environment@\texttt{#1} environment}\index{environments!#1@\texttt{#1}}}% environment name
+\newcommand{\docpkg}[1]{\texttt{#1}\index{#1 package@\texttt{#1} package}\index{packages!#1@\texttt{#1}}}% package name
+\newcommand{\doccls}[1]{\texttt{#1}}% document class name
+\newcommand{\docclsopt}[1]{\texttt{#1}\index{#1 class option@\texttt{#1} class option}\index{class options!#1@\texttt{#1}}}% document class option name
+\newcommand{\docclsoptdef}[1]{\hlred{\texttt{#1}}\label{clsopt:#1}\index{#1 class option@\texttt{#1} class option}\index{class options!#1@\texttt{#1}}}% document class option name defined
+\newcommand{\docmsg}[2]{\bigskip\begin{fullwidth}\noindent\ttfamily#1\end{fullwidth}\medskip\par\noindent#2}
+\newcommand{\docfilehook}[2]{\texttt{#1}\index{file hooks!#2}\index{#1@\texttt{#1}}}
+\newcommand{\doccounter}[1]{\texttt{#1}\index{#1 counter@\texttt{#1} counter}}
+
+% Generates the index
+\usepackage{makeidx}
+\makeindex
+
+\begin{document}
+
+% Front matter
+\frontmatter
+
+% r.1 blank page
+\blankpage
+
+% v.2 epigraphs
+\newpage\thispagestyle{empty}
+\openepigraph{%
+The public is more familiar with bad design than good design.
+It is, in effect, conditioned to prefer bad design, 
+because that is what it lives with. 
+The new becomes threatening, the old reassuring.
+}{Paul Rand%, {\itshape Design, Form, and Chaos}
+}
+\vfill
+\openepigraph{%
+A designer knows that he has achieved perfection 
+not when there is nothing left to add, 
+but when there is nothing left to take away.
+}{Antoine de Saint-Exup\'{e}ry}
+\vfill
+\openepigraph{%
+\ldots the designer of a new system must not only be the implementor and the first 
+large-scale user; the designer should also write the first user manual\ldots 
+If I had not participated fully in all these activities, 
+literally hundreds of improvements would never have been made, 
+because I would never have thought of them or perceived 
+why they were important.
+}{Donald E. Knuth}
+
+
+% r.3 full title page
+\maketitle
+
+
+% v.4 copyright page
+\newpage
+\begin{fullwidth}
+~\vfill
+\thispagestyle{empty}
+\setlength{\parindent}{0pt}
+\setlength{\parskip}{\baselineskip}
+Copyright \copyright\ \the\year\ \thanklessauthor
+
+\par\smallcaps{Published by \thanklesspublisher}
+
+\par\smallcaps{tufte-latex.googlecode.com}
+
+\par Licensed under the Apache License, Version 2.0 (the ``License''); you may not
+use this file except in compliance with the License. You may obtain a copy
+of the License at \url{http://www.apache.org/licenses/LICENSE-2.0}. Unless
+required by applicable law or agreed to in writing, software distributed
+under the License is distributed on an \smallcaps{``AS IS'' BASIS, WITHOUT
+WARRANTIES OR CONDITIONS OF ANY KIND}, either express or implied. See the
+License for the specific language governing permissions and limitations
+under the License.\index{license}
+
+\par\textit{First printing, \monthyear}
+\end{fullwidth}
+
+% r.5 contents
+\tableofcontents
+
+\listoffigures
+
+\listoftables
+
+% r.7 dedication
+\cleardoublepage
+~\vfill
+\begin{doublespace}
+\noindent\fontsize{18}{22}\selectfont\itshape
+\nohyphenation
+Dedicated to those who appreciate \LaTeX{} 
+and the work of \mbox{Edward R.~Tufte} 
+and \mbox{Donald E.~Knuth}.
+\end{doublespace}
+\vfill
+\vfill
+
+
+% r.9 introduction
+\cleardoublepage
+\chapter*{Introduction}
+
+This is a user guide for SciDB, prepared using \url{http://dexy.it}. This document includes a number of suggestions for SciDB, presented in numbered sidebar notes\footnote[0]{like this}.
+
+Commands are passed to SciDB through the following code
+
+<< d['sections']['scidb.py|idio|l']['process-dict'] >>
+
+Among other things, this code allows us to write ``scripts'' for SciDB including comments\footnote{The iquery tool should have an option which allows a script file with multiple commands in a single file and support for simple comments and blank lines.}, and fake prompts are added to give the effect that these commands were run in a console session.
+
+\chapter{A Small Dense Example}
+
+Let's jump right in to an example of using SciDB. We are going to run a simulation and import the results into SciDB for analysis.
+
+For a simulation, we'll use the Prisoner's Dilemma example in the GarlicSim library for Python.
+
+\section{Simulation Code}
+
+The simulation code is short, we'll go through it briefly.
+
+First we import the libraries we will be using.
+<< d['sections']['prisoner-example.py|idio|l']['imports'] >>
+
+Then we set up a few constants which will be referenced later.
+<< d['sections']['prisoner-example.py|idio|l']['constants'] >>
+
+We set up the file we are going to write our output to (the filename is dynamically generated so different runs don't conflict with each other).
+<< d['sections']['prisoner-example.py|idio|l']['output-file-init'] >>
+
+We define the method which will write a row of data at a time to the output file.
+<< d['sections']['prisoner-example.py|idio|l']['collect-data'] >>
+
+We will call this function after each time period, and it will record each agent's state at that time. The whole row is enclosed in square brackets, with each agent's state variables in parentheses.
+
+We write an opening square bracket to our output file, each row of data is a row in this outer array.
+<< d['sections']['prisoner-example.py|idio|l']['open-array'] >>
+
+
+Now we initialize our simulation
+<< d['sections']['prisoner-example.py|idio|l']['init'] >>
+
+and write the initial state to our data file
+<< d['sections']['prisoner-example.py|idio|l']['write-initial-state'] >>
+
+Prelimiaries out of the way, now we run the main loop. Stepping the simulation and collecting data after each step.
+<< d['sections']['prisoner-example.py|idio|l']['loop'] >>
+
+Finally we write a closing square bracket and close the file handle.
+<< d['sections']['prisoner-example.py|idio|l']['output-file-close'] >>
+
+Here's how this looks when run
+<< d['prisoner-example.py|jinja|pycon|pyg|l'] >>
+
+and here's an abbreviated version of the resulting output file:
+\begin{Verbatim}
+<< d['read-output.py|jinja|pyout'] >>
+\end{Verbatim}
+
+This format was designed to be compatible with SciDB. In the next section we will import and explore this data in SciDB.
+
+\section{Importing and Exploring Arrays}
+
+We first define the size of the array we wish to store. Arrays in SciDB have dimensions (like coordinates) and attributes, which exist at specific coordinates. Here is the declaration for the array which will store the data we have just generated:
+
+\begin{Verbatim}
+<< d['sections']['create-garlicsim-array.scidb|ct|jinja|idio|scidb']['define'] >>
+\end{Verbatim}
+
+After creating the array, we can use the load function to import the data from the text file.
+
+\begin{Verbatim}
+<< d['sections']['create-garlicsim-array.scidb|ct|jinja|idio|scidb']['load']|truncate(2000) >>
+\end{Verbatim}
+
+\chapter{In-Depth Tour}
+
+In this chapter we work through the available SciDB operators in detail.
+
+\section{Creating, Importing and Describing Data}
+
+\subsection{create array}
+We create some example arrays of various shapes to work with.
+
+\begin{Verbatim}
+<< d['sections']['examples.scidb|ct|jinja|idio|scidb']['create'] >>
+\end{Verbatim}
+
+\subsection{load}
+The load() command reads input from a text file into an array (which must already be defined).
+
+Vector data source:
+
+\begin{Verbatim}
+<< h.read_file("/home/ana/scidb-docs/docs/notes/data/vec.txt") >>
+\end{Verbatim}
+
+Results of importing:
+\begin{Verbatim}
+<< d['sections']['examples.scidb|ct|jinja|idio|scidb']['load-vec'] >>
+\end{Verbatim}
+
+n x m matrix data source:
+\begin{Verbatim}
+<< h.read_file("/home/ana/scidb-docs/docs/notes/data/nm.txt") >>
+\end{Verbatim}
+
+Results of importing:
+\begin{Verbatim}
+<< d['sections']['examples.scidb|ct|jinja|idio|scidb']['load-nm'] >>
+\end{Verbatim}
+
+dense matrix data source:
+\begin{Verbatim}
+<< h.read_file("/home/ana/scidb-docs/docs/notes/data/dense.txt") >>
+\end{Verbatim}
+
+Results of importing:
+\begin{Verbatim}
+<< d['sections']['examples.scidb|ct|jinja|idio|scidb']['load-dense'] >>
+\end{Verbatim}
+
+sparse matrix data source:
+\begin{Verbatim}
+<< h.read_file("/home/ana/scidb-docs/docs/notes/data/sparse.txt") >>
+\end{Verbatim}
+
+Results of importing:
+\begin{Verbatim}
+<< d['sections']['examples.scidb|ct|jinja|idio|scidb']['load-sparse'] >>
+\end{Verbatim}
+
+\subsection{list}
+To see all items in the database, use |list()|.
+\begin{Verbatim}
+<< d['sections']['examples.scidb|ct|jinja|idio|scidb']['list'] >>
+\end{Verbatim}
+
+\subsection{dimensions}
+To see the sizes of items, use dimensions()
+\begin{Verbatim}
+<< d['sections']['examples.scidb|ct|jinja|idio|scidb']['dimensions'] >>
+\end{Verbatim}
+
+The dimensions() function returns an array with:
+\begin{itemize}
+\item{name}
+\item{start}
+\item{length}
+\item{chunk-interval}
+\item{chunk-overlap}
+\end{itemize}
+<< d['sections']['LogicalDimensions.cpp|idio|l']['dimensions'] >>
+
+\subsection{count}
+The count() function 
+
+\subsection{attributes}
+
+The attributes() function returns the attributes defined for an array.
+\begin{Verbatim}
+<< d['sections']['examples.scidb|ct|jinja|idio|scidb']['attributes'] >>
+\end{Verbatim}
+
+The attributes function returns an array with:
+\begin{itemize}
+\item{name}
+\item{type id}
+\item{type name}
+\item{nullable}
+\end{itemize}
+<< d['sections']['LogicalAttributes.cpp|idio|l']['attributes'] >>
+
+
+\subsection{remove}
+To remove arrays from storage, use remove():
+\begin{Verbatim}
+<< d['sections']['examples.scidb|ct|jinja|idio|scidb']['cleanup-old'] >>
+\end{Verbatim}
+
+
+\section{last section}
+
+
+\backmatter
+
+\bibliography{sample-handout}
+\bibliographystyle{plainnat}
+
+
+\printindex
+
+\end{document}
+

File docs/notes/create-garlicsim-array.scidb

View file
+### @export "cleanup-prior"
+remove(garlicsim)
+
+### @export "define"
+create array garlicsim <points: int32, strategy:string> [period=0:101,102,0, agent=0:69,70,0]
+
+### @export "load"
+load(garlicsim, '/home/ana/scidb-docs/docs/{{ d['a']['sim_output'] }}')
+
+### @end
+slice(garlicsim, period, 0)
+slice(garlicsim, period, 50)
+slice(garlicsim, period, 100)
+slice(garlicsim, period, 101)
+slice(garlicsim, agent, 10)
+slice(garlicsim, agent, 50)
+#
+#filter(garlicsim,points>50)
+#count(filter(garlicsim,points>50))
+#
+#max(slice(garlicsim, 'period', 100), 'points')
+#sum(slice(garlicsim, 'period', 100), 'points')
+#
+#aggregate(garlicsim, 'period', 'totpoints', 0, totpoints + points)
+#aggregate(garlicsim, 'agent', 'totpoints', 0, totpoints + points)
+

File docs/notes/data/dense.txt

View file
+[
+[(1,2),(2,2),(3,2)],
+[(1,2),(2,2),(3,2)],
+[(1,2),(2,2),(3,2)],
+[(1,2),(2,2),(3,2)]
+]

File docs/notes/data/nm.txt

View file
+[
+[(1),(2),(3)],
+[(1),(2),(3)],
+[(1),(2),(3)],
+[(1),(2),(3)]
+]

File docs/notes/data/sparse.txt

View file
+[
+[{0,0}(1,2)]
+]
+
+

File docs/notes/data/vec.txt

View file
+[(1),(2),(3)]

File docs/notes/describe.scidb

View file
+### @export "list"
+list()
+
+### @export "scan-vector"
+scan(v10)
+
+### @export "scan-multi"
+scan(mult_1)
+
+### @export "dimensions"
+dimensions(v10)
+dimensions(mult_1)
+
+### @export "attributes"
+attributes(v10)
+attributes(mult_1)
+attributes(mult_sp1)
+
+### @export "count"
+count(v10)
+count(mult_1)
+
+### @export "scan-sparse"
+scan(mult_sp1)
+dimensions(mult_sp1)
+count(mult_sp1)
+
+### @export "large-sparse"
+dimensions(xyz)
+count(xyz)
+
+
+### @export "multiple-attributes"
+scan(expr1)
+dimensions(expr1)
+attributes(expr1)
+
+

File docs/notes/examples.scidb

View file
+### @export "cleanup-old"
+remove(vec)
+remove(nm)
+remove(dense)
+remove(sparse)
+
+### @export "create"
+create array vec <value: int32> [x=0:2,3,0]
+create array nm <value: int32> [x=0:3,4,0, y=0:2,3,0]
+create array dense <a: int32, b:int32> [x=0:3,4,0, y=0:2,3,0]
+create array sparse <a: int32, b:int32> [x=0:3,4,0, y=0:2,3,0]
+
+### @export "load-vec"
+load(vec, '/home/ana/scidb-docs/docs/notes/data/vec.txt')
+
+### @export "load-nm"
+load(nm, '/home/ana/scidb-docs/docs/notes/data/nm.txt')
+
+### @export "load-dense"
+load(dense, '/home/ana/scidb-docs/docs/notes/data/dense.txt')
+
+### @export "load-sparse"
+load(sparse, '/home/ana/scidb-docs/docs/notes/data/sparse.txt')
+
+### @export "list"
+list()
+
+### @export "dimensions"
+dimensions(vec)
+dimensions(nm)
+dimensions(dense)
+dimensions(sparse)
+
+### @export "attributes"
+attributes(vec)
+attributes(nm)
+attributes(dense)
+attributes(sparse)
+

File docs/notes/list.scidb

View file
+list()

File docs/notes/prisoner-example.py

View file
+### @export "imports"
+import garlicsim
+from garlicsim_lib.simpacks import prisoner
+
+### @export "constants"
+NUMBER_OF_PLAYERS = 70 # hard coded into simpack
+NUMBER_OF_STEPS = 100
+
+### @export "output-file-init"
+filename = "{{ a.create_input_file('sim_output', 'arr', False) }}"
+f = open(filename, "w")
+
+### @export "collect-data"
+def collect_data():
+    row = []
+    for j in range(NUMBER_OF_PLAYERS):
+        agent = state.player_pool[j]
+        strategy = agent.__class__.__name__
+        row.append("(%s,\"%s\")" % (agent.points, strategy))
+    f.write("[%s],\n" % ",".join(row))
+
+### @export "open-array"
+f.write("[\n")
+
+### @export "init"
+state = prisoner.State.create_messy_root()
+
+
+### @export "write-initial-state"
+collect_data()
+
+### @export "loop"
+for i in range(NUMBER_OF_STEPS):
+    state = garlicsim.simulate(state)
+    collect_data()
+
+
+### @export "output-file-close"
+f.write("\n]")
+f.close()
+

File docs/notes/read-output.py

View file
+f = open("{{ d['a']['sim_output'] }}", "r")
+text = f.read()
+
+start = "\n".join([line[0:80] for line in text.split("\n")[0:10]])
+finish = "\n".join([line[0:80] for line in text.split("\n")[-10:]])
+
+print start, "\n...\n", finish

File docs/notes/scan-vector.scidb

View file
+### @export "scan"
+scan('v10')
+### @export "info"
+dimensions('v10')
+attributes('v10')
+

File docs/notes/show.scidb

View file
+scan('v10')
+scan('expr1')
+scan('mult_1')
+
+scan('mult_sp2')

File docs/notes/subset.scidb

View file
+### @export "slice-sparse"
+slice(xyz, x, 5)
+slice(xyz, y, 16)
+slice(xyz, _1, 5)
+slice(xyz, _2, 16)
+
+### @export "subsample-sparse"
+subsample(xyz, 1, 1, 20, 20)

File docs/notes/subsetting.scidb

View file
+### @export "slice-sparse"
+slice(xyz, 'x', 5)
+slice(xyz, 'y', 16)

File docs/notes/test-results.scidb

View file
+attributes('v10')

File docs/pastie.sty

View file
+
+\makeatletter
+\def\PY@reset{\let\PY@it=\relax \let\PY@bf=\relax%
+    \let\PY@ul=\relax \let\PY@tc=\relax%
+    \let\PY@bc=\relax \let\PY@ff=\relax}
+\def\PY@tok#1{\csname PY@tok@#1\endcsname}
+\def\PY@toks#1+{\ifx\relax#1\empty\else%
+    \PY@tok{#1}\expandafter\PY@toks\fi}
+\def\PY@do#1{\PY@bc{\PY@tc{\PY@ul{%
+    \PY@it{\PY@bf{\PY@ff{#1}}}}}}}
+\def\PY#1#2{\PY@reset\PY@toks#1+\relax+\PY@do{#2}}
+
+\def\PY@tok@gd{\def\PY@tc##1{\textcolor[rgb]{0.00,0.00,0.00}{##1}}\def\PY@bc##1{\colorbox[rgb]{1.00,0.87,0.87}{##1}}}
+\def\PY@tok@gu{\def\PY@tc##1{\textcolor[rgb]{0.38,0.38,0.38}{##1}}}
+\def\PY@tok@gt{\def\PY@tc##1{\textcolor[rgb]{0.67,0.00,0.00}{##1}}}
+\def\PY@tok@gs{\let\PY@bf=\textbf}
+\def\PY@tok@gr{\def\PY@tc##1{\textcolor[rgb]{0.67,0.00,0.00}{##1}}}
+\def\PY@tok@cm{\def\PY@tc##1{\textcolor[rgb]{0.53,0.53,0.53}{##1}}}
+\def\PY@tok@vg{\def\PY@tc##1{\textcolor[rgb]{0.87,0.47,0.00}{##1}}}
+\def\PY@tok@m{\let\PY@bf=\textbf\def\PY@tc##1{\textcolor[rgb]{0.00,0.00,0.87}{##1}}}
+\def\PY@tok@mh{\let\PY@bf=\textbf\def\PY@tc##1{\textcolor[rgb]{0.00,0.00,0.87}{##1}}}
+\def\PY@tok@cs{\let\PY@bf=\textbf\def\PY@tc##1{\textcolor[rgb]{0.80,0.00,0.00}{##1}}\def\PY@bc##1{\colorbox[rgb]{1.00,0.94,0.94}{##1}}}
+\def\PY@tok@ge{\let\PY@it=\textit}
+\def\PY@tok@vc{\def\PY@tc##1{\textcolor[rgb]{0.20,0.40,0.60}{##1}}}
+\def\PY@tok@il{\let\PY@bf=\textbf\def\PY@tc##1{\textcolor[rgb]{0.00,0.00,0.87}{##1}}}
+\def\PY@tok@go{\def\PY@tc##1{\textcolor[rgb]{0.53,0.53,0.53}{##1}}}
+\def\PY@tok@cp{\let\PY@bf=\textbf\def\PY@tc##1{\textcolor[rgb]{0.80,0.00,0.00}{##1}}}
+\def\PY@tok@gi{\def\PY@tc##1{\textcolor[rgb]{0.00,0.00,0.00}{##1}}\def\PY@bc##1{\colorbox[rgb]{0.87,1.00,0.87}{##1}}}
+\def\PY@tok@gh{\def\PY@tc##1{\textcolor[rgb]{0.19,0.19,0.19}{##1}}}
+\def\PY@tok@s2{\def\PY@tc##1{\textcolor[rgb]{0.87,0.13,0.00}{##1}}\def\PY@bc##1{\colorbox[rgb]{1.00,0.94,0.94}{##1}}}
+\def\PY@tok@nl{\let\PY@it=\textit\def\PY@tc##1{\textcolor[rgb]{0.20,0.40,0.60}{##1}}}
+\def\PY@tok@nn{\let\PY@bf=\textbf\def\PY@tc##1{\textcolor[rgb]{0.73,0.00,0.40}{##1}}}
+\def\PY@tok@no{\let\PY@bf=\textbf\def\PY@tc##1{\textcolor[rgb]{0.00,0.20,0.40}{##1}}}
+\def\PY@tok@na{\def\PY@tc##1{\textcolor[rgb]{0.20,0.40,0.60}{##1}}}
+\def\PY@tok@nb{\def\PY@tc##1{\textcolor[rgb]{0.00,0.20,0.53}{##1}}}
+\def\PY@tok@nc{\let\PY@bf=\textbf\def\PY@tc##1{\textcolor[rgb]{0.73,0.00,0.40}{##1}}}
+\def\PY@tok@nd{\def\PY@tc##1{\textcolor[rgb]{0.33,0.33,0.33}{##1}}}
+\def\PY@tok@ne{\let\PY@bf=\textbf\def\PY@tc##1{\textcolor[rgb]{0.73,0.00,0.40}{##1}}}
+\def\PY@tok@nf{\let\PY@bf=\textbf\def\PY@tc##1{\textcolor[rgb]{0.00,0.40,0.73}{##1}}}
+\def\PY@tok@si{\def\PY@tc##1{\textcolor[rgb]{0.20,0.20,0.73}{##1}}\def\PY@bc##1{\colorbox[rgb]{1.00,0.94,0.94}{##1}}}
+\def\PY@tok@sh{\def\PY@tc##1{\textcolor[rgb]{0.87,0.13,0.00}{##1}}\def\PY@bc##1{\colorbox[rgb]{1.00,0.94,0.94}{##1}}}
+\def\PY@tok@vi{\def\PY@tc##1{\textcolor[rgb]{0.20,0.20,0.73}{##1}}}
+\def\PY@tok@py{\let\PY@bf=\textbf\def\PY@tc##1{\textcolor[rgb]{0.20,0.40,0.60}{##1}}}
+\def\PY@tok@nt{\let\PY@bf=\textbf\def\PY@tc##1{\textcolor[rgb]{0.73,0.00,0.40}{##1}}}
+\def\PY@tok@nv{\def\PY@tc##1{\textcolor[rgb]{0.20,0.40,0.60}{##1}}}
+\def\PY@tok@s1{\def\PY@tc##1{\textcolor[rgb]{0.87,0.13,0.00}{##1}}\def\PY@bc##1{\colorbox[rgb]{1.00,0.94,0.94}{##1}}}
+\def\PY@tok@gp{\def\PY@tc##1{\textcolor[rgb]{0.33,0.33,0.33}{##1}}}
+\def\PY@tok@ow{\def\PY@tc##1{\textcolor[rgb]{0.00,0.53,0.00}{##1}}}
+\def\PY@tok@sx{\def\PY@tc##1{\textcolor[rgb]{0.13,0.73,0.13}{##1}}\def\PY@bc##1{\colorbox[rgb]{0.94,1.00,0.94}{##1}}}
+\def\PY@tok@bp{\def\PY@tc##1{\textcolor[rgb]{0.00,0.20,0.53}{##1}}}
+\def\PY@tok@c1{\def\PY@tc##1{\textcolor[rgb]{0.53,0.53,0.53}{##1}}}
+\def\PY@tok@kc{\let\PY@bf=\textbf\def\PY@tc##1{\textcolor[rgb]{0.00,0.53,0.00}{##1}}}
+\def\PY@tok@c{\def\PY@tc##1{\textcolor[rgb]{0.53,0.53,0.53}{##1}}}
+\def\PY@tok@mf{\let\PY@bf=\textbf\def\PY@tc##1{\textcolor[rgb]{0.00,0.00,0.87}{##1}}}
+\def\PY@tok@err{\def\PY@tc##1{\textcolor[rgb]{0.65,0.09,0.09}{##1}}\def\PY@bc##1{\colorbox[rgb]{0.89,0.82,0.82}{##1}}}
+\def\PY@tok@kd{\let\PY@bf=\textbf\def\PY@tc##1{\textcolor[rgb]{0.00,0.53,0.00}{##1}}}
+\def\PY@tok@ss{\def\PY@tc##1{\textcolor[rgb]{0.67,0.40,0.00}{##1}}\def\PY@bc##1{\colorbox[rgb]{1.00,0.94,0.94}{##1}}}
+\def\PY@tok@sr{\def\PY@tc##1{\textcolor[rgb]{0.00,0.53,0.00}{##1}}\def\PY@bc##1{\colorbox[rgb]{1.00,0.94,1.00}{##1}}}
+\def\PY@tok@mo{\let\PY@bf=\textbf\def\PY@tc##1{\textcolor[rgb]{0.00,0.00,0.87}{##1}}}
+\def\PY@tok@mi{\let\PY@bf=\textbf\def\PY@tc##1{\textcolor[rgb]{0.00,0.00,0.87}{##1}}}
+\def\PY@tok@kn{\let\PY@bf=\textbf\def\PY@tc##1{\textcolor[rgb]{0.00,0.53,0.00}{##1}}}
+\def\PY@tok@kr{\let\PY@bf=\textbf\def\PY@tc##1{\textcolor[rgb]{0.00,0.53,0.00}{##1}}}
+\def\PY@tok@s{\def\PY@tc##1{\textcolor[rgb]{0.87,0.13,0.00}{##1}}\def\PY@bc##1{\colorbox[rgb]{1.00,0.94,0.94}{##1}}}
+\def\PY@tok@kp{\def\PY@tc##1{\textcolor[rgb]{0.00,0.53,0.00}{##1}}}
+\def\PY@tok@w{\def\PY@tc##1{\textcolor[rgb]{0.73,0.73,0.73}{##1}}}
+\def\PY@tok@kt{\let\PY@bf=\textbf\def\PY@tc##1{\textcolor[rgb]{0.53,0.53,0.53}{##1}}}
+\def\PY@tok@sc{\def\PY@tc##1{\textcolor[rgb]{0.87,0.13,0.00}{##1}}\def\PY@bc##1{\colorbox[rgb]{1.00,0.94,0.94}{##1}}}
+\def\PY@tok@sb{\def\PY@tc##1{\textcolor[rgb]{0.87,0.13,0.00}{##1}}\def\PY@bc##1{\colorbox[rgb]{1.00,0.94,0.94}{##1}}}
+\def\PY@tok@k{\let\PY@bf=\textbf\def\PY@tc##1{\textcolor[rgb]{0.00,0.53,0.00}{##1}}}
+\def\PY@tok@se{\def\PY@tc##1{\textcolor[rgb]{0.00,0.27,0.87}{##1}}\def\PY@bc##1{\colorbox[rgb]{1.00,0.94,0.94}{##1}}}
+\def\PY@tok@sd{\def\PY@tc##1{\textcolor[rgb]{0.87,0.13,0.00}{##1}}\def\PY@bc##1{\colorbox[rgb]{1.00,0.94,0.94}{##1}}}
+
+\def\PYZbs{\char`\\}
+\def\PYZus{\char`\_}
+\def\PYZob{\char`\{}
+\def\PYZcb{\char`\}}
+\def\PYZca{\char`\^}
+% for compatibility with earlier versions
+\def\PYZat{@}
+\def\PYZlb{[}
+\def\PYZrb{]}
+\makeatother
+

File docs/sim/create-garlicsim-array.scidb

View file
-CREATE ARRAY garlicsim <points: int32, strategy:string> [period=0:101,102,0, agent=0:69,70,0]
-#load('garlicsim', '/home/ana/testdata/garlicsim.dat')
-load('garlicsim', '/home/ana/b_0_5_release/dexy/{{ d['a']['sim_output'] }}')
-dimensions('garlicsim')
-attributes('garlicsim')
-slice(garlicsim, 'period', 0)
-slice(garlicsim, 'period', 50)
-slice(garlicsim, 'period', 100)
-slice(garlicsim, 'period', 101)
-slice(garlicsim, 'agent', 10)
-slice(garlicsim, 'agent', 50)
+remove(garlicsim)
 
-filter(garlicsim,points>50)
-count(filter(garlicsim,points>50))
+create array garlicsim <points: int32, strategy:string> [period=0:101,102,0, agent=0:69,70,0]
+load(garlicsim, '/home/ana/scidb-docs/docs/{{ d['a']['sim_output'] }}')
+dimensions(garlicsim)
+attributes(garlicsim)
+slice(garlicsim, period, 0)
+slice(garlicsim, period, 50)
+slice(garlicsim, period, 100)
+slice(garlicsim, period, 101)
+slice(garlicsim, agent, 10)
+slice(garlicsim, agent, 50)
+#
+#filter(garlicsim,points>50)
+#count(filter(garlicsim,points>50))
+#
+#max(slice(garlicsim, 'period', 100), 'points')
+#sum(slice(garlicsim, 'period', 100), 'points')
+#
+#aggregate(garlicsim, 'period', 'totpoints', 0, totpoints + points)
+#aggregate(garlicsim, 'agent', 'totpoints', 0, totpoints + points)
 
-max(slice(garlicsim, 'period', 100), 'points')
-sum(slice(garlicsim, 'period', 100), 'points')
-
-aggregate(garlicsim, 'period', 'totpoints', 0, totpoints + points)
-aggregate(garlicsim, 'agent', 'totpoints', 0, totpoints + points)
-

File docs/sim/hist.txt

-    1  ls
-    2  vim conf
-    3  . ./conf 
-    4  sudo ./conf 
-    5  sudo conf
-    6  ls
-    7  cat conf 
-    8  chmod a+x conf 
-    9  . ./conf 
-   10  sudo ./conf 
-   11  sudo /etc/init.d/postgresql-8.4 status
-   12  svn co http://svn.scidb.org/svn/branches/b_0_5_release b_0_5_release
-   13  history
-   14  make
-   15  cd bin
-   16  cd ..
-   17  zzinit
-   18  zzstart
-   19  ls
-   20  ls tests
-   21  iquery
-   22  iquery --help
-   23  iquery -f tests/basic/load/load.002.aql 
-   24  iquery -f tests/basic/create/load.001.aql 
-   25  iquery --help
-   26  iquery -q "sort(mult_1, -1)"
-   27  iquery -q "sort(mult_1, -1, 1)"
-   28  iquery -q "list()")
-   29  iquery -q "list()"
-   30  iquery -q "mult_1"
-   31  iquery -q "transpose(mult_1)"
-   32  iquery -q "scan(testarr)"
-   33  iquery -q "scan(mult_1)"
-   34  ls
-   35  iquery -q "load(testarr, 'data/mult1.txt')"
-   36  iquery -q "transpose(testar)"
-   37  iquery -q "list()"
-   38  iquery -q "load(mult_1, 'data/mult1.txt'"
-   39  iquery -q "load(mult_1, 'data/mult1.txt')"
-   40  iquery -q "transpose(mult_1)"
-   41  iquery -f tests/basic/load/load.002.aql 
-   42  iquery -f
-   43  iquery --help
-   44  python --version
-   45  ls
-   46  cd ..
-   47  ls
-   48  mkdir dexy
-   49  cd dexy
-   50  ls
-   51  cd ..
-   52  rm -r dexy/
-   53  hg
-   54  sudo apt-get install mercurial
-   55  sudo apt-get install python-jinja2
-   56  hg clone http://bitbucket.org/ananelson/dexy
-   57  sudo apt-get install pydot
-   58  sudo apt-get install python-pydot
-   59  exit
-   60  vim
-   61  which vim
-   62  cat /usr/local/bin/vim 
-   63  clear
-   64  which vim
-   65  vim --version
-   66  sudo rm /usr/local/bin/vim
-   67  which vim
-   68  vim --version
-   69  exit
-   70  cd b_0_5_release/dexy/
-   71  ls
-   72  cd scidb/
-   73  ls
-   74  ruby
-   75  apt-cache search ^ruby
-   76  sudo apt-get install ruby1.8
-   77  sudo gem install RedCloth
-   78  apt-cache search rubygem
-   79  sudo apt-get install rubygems1.8
-   80  sudo apt-get install libredcloth-ruby1.89
-   81  sudo apt-get install libredcloth-ruby1.8
-   82  redcloth
-   83  ruby
-   84  ls /usr/local/bin/
-   85  ls /usr/bin
-   86  ls /usr/bin/ruby1.8 
-   87  ruby1.8
-   88  ruby1.8 --version
-   89  ls
-   90  sudo gem install RedCloth
-   91  ls /var/lib
-   92  ls /var/lib/gems/
-   93  ls /var/lib/gems/1.8/bin/redcloth 
-   94  /var/lib/gems/1.8/bin/redcloth --version
-   95  clear
-   96  ls
-   97  vim discuss.html
-   98  vim --version
-   99  sudo apt-get install vim
-  100  vim --version
-  101  vim discuss.html
-  102  vim --help
-  103  apt-cache  search vim
-  104  apt-cache  search vim | less
-  105  which vim
-  106  vim
-  107  clear
-  108  sudo apt-get install vim
-  109  vim ~/.vimrc
-  110  vim
-  111  exit
-  112  ls
-  113  pwd
-  114  ls
-  115  vim install-mongrel2.sh
-  116  sudo sh install-mongrel2.sh 
-  117  sudo apt-get install -y sqlite3 libsqlite3-dev
-  118  cd mongrel2-1.4/
-  119  make
-  120  sudo make install
-  121  cd ..
-  122  ls
-  123  which mongrel
-  124  which mongrel2
-  125  ls
-  126  cd b_0_5_release/dexy/
-  127  ls
-  128  dexy-live-server
-  129  exit
-  130  cd b_0_5_release/dexy/
-  131  tail -f logs/dexy.log 
-  132  cd ../..
-  133  cd dexy-examples/
-  134  tail -f logs/dexy.log 
-  135  cd ../b_0_5_release/dexy/
-  136  tail -f logs/dexy.log 
-  137  ls
-  138  cd ../..
-  139  ls
-  140  pwd
-  141  ls
-  142  history
-  143  history | less
-  144  ls
-  145  svn co http://svn.scidb.org/svn/trunk trunk
-  146  ls
-  147  cd trunk/
-  148  ls
-  149  cmake .
-  150  make
-  151  ls
-  152  cd bin
-  153  ls
-  154  source commands.sh 
-  155  cat scidb
-  156  clear
-  157  ls
-  158  cat scidb.py 
-  159  vim scidb.py 
-  160  ls
-  161  vim commands.sh 
-  162  source commands.sh 
-  163  zzinit
-  164  sudo ls
-  165  zzinit
-  166  svn revert commands.sh 
-  167  svn --help
-  168  cd ../..
-  169  ls
-  170  cd trunk/
-  171  ls
-  172  svn revert .
-  173  cd bin/
-  174  ls
-  175  cat commands.sh 
-  176  vim commands.sh 
-  177  source commands.sh 
-  178  zzinit
-  179  zzstart
-  180  clear
-  181  ls
-  182  history
-  183  history > hist.txt

File docs/trunk/README

View file
+This is a checkout of SciDB source so that we can add idiopidae tags and reference chunks of live code.

File docs/trunk/src/qproc/ops/src/attributes/LogicalAttributes.cpp

View file
+/*
+**
+* BEGIN_COPYRIGHT
+*
+* This file is part of SciDB.
+* Copyright (C) © 2008-2010 SciDB, Inc.
+*
+* SciDB is free software: you can redistribute it and/or modify
+* it under the terms of the GNU General Public License as published by
+* the Free Software Foundation, either version 3 of the License, or
+* (at your option) any later version.
+*
+* SciDB is distributed "AS-IS" AND WITHOUT ANY WARRANTY OF ANY KIND,
+* INCLUDING ANY IMPLIED WARRANTY OF MERCHANTABILITY,
+* NON-INFRINGEMENT, OR FITNESS FOR A PARTICULAR PURPOSE. See
+* the GNU General Public License for the complete license terms.
+*
+* You should have received a copy of the GNU General Public License
+* along with SciDB.  If not, see <http://www.gnu.org/licenses/>.
+*
+* END_COPYRIGHT
+*/
+
+/*
+ * file LogicalAttributes.cpp
+ *
+ * author knizhnik@garret.ru
+ *
+ * Get list of persistent array attributes
+ */
+
+#include "qproc/include/Operator.h"
+#include "common/include/Exceptions.h"
+#include "common/include/Metadata.h"
+#include "services/catalog/include/SystemCatalog.h"
+
+namespace ops
+{
+
+using namespace std;
+using namespace qproc;
+using namespace boost;
+using namespace common;
+using namespace typesystem;
+
+class LogicalAttributes: public LogicalOperator
+{
+public:
+    LogicalAttributes(const string& logicalName, const std::string& alias):
+        LogicalOperator(logicalName, alias)
+    {
+    	ADD_PARAM_IN_ARRAY_NAME()
+        _properties.ddl = true;
+    }
+
+    common::ArrayDesc inferSchema(std::vector<common::ArrayDesc> inputSchemas)
+    {
+        assert(inputSchemas.size() == 0);
+        assert(_parameters.size() == 1);
+
+        const string &arrayName = ((boost::shared_ptr<OperatorParamReference>&)_parameters[0])->getObjectName();
+
+        common::ArrayDesc arrayDesc;
+        catalog::SystemCatalog::getInstance()->getArrayDesc(arrayName, arrayDesc);
+        
+
+        size_t nAttrs = arrayDesc.getAttributes().size();
+        Attributes attributes(4);
+// @export "attributes"
+        attributes[0] = AttributeDesc((AttributeID)0, "name", TID_STRING, 0, 0);
+        attributes[1] = AttributeDesc((AttributeID)1, "type_id", TID_INT64, 0, 0);
+        attributes[2] = AttributeDesc((AttributeID)2, "type_name", TID_STRING, 0, 0);
+        attributes[3] = AttributeDesc((AttributeID)3, "nullable", TID_BOOL, 0, 0);
+// @end
+        vector<DimensionDesc> dimensions(1);
+        dimensions[0] = DimensionDesc("No", 0, nAttrs, nAttrs, 0);
+        return ArrayDesc("Attributes", attributes, dimensions, psLocalNode);
+    }
+
+};
+
+
+DECLARE_LOGICAL_OPERATOR_FACTORY(LogicalAttributes, "attributes")
+
+
+} //namespace