pspp
13 years agowork on pivot table and FREQUENCIES usage pivot-table
Ben Pfaff [Mon, 15 Mar 2010 05:00:50 +0000 (22:00 -0700)]
work on pivot table and FREQUENCIES usage

13 years agoCROSSTABS: make sort-based crosstabs work
Ben Pfaff [Tue, 30 Mar 2010 04:05:10 +0000 (21:05 -0700)]
CROSSTABS: make sort-based crosstabs work

still needs some touch-up regarding SPLIT FILE and memory leaks

13 years agoFREQUENCIES: Refactor frequency counting with sorting instead of hashing.
Ben Pfaff [Tue, 23 Mar 2010 04:41:25 +0000 (21:41 -0700)]
FREQUENCIES: Refactor frequency counting with sorting instead of hashing.

13 years agosubcase
Ben Pfaff [Thu, 1 Apr 2010 05:06:28 +0000 (22:06 -0700)]
subcase

13 years agosubcase: Add more functions.
Ben Pfaff [Wed, 31 Mar 2010 04:41:50 +0000 (21:41 -0700)]
subcase: Add more functions.

13 years agosubcase: New functions subcase_concat() and subcase_concat_always().
Ben Pfaff [Sun, 28 Mar 2010 20:45:44 +0000 (13:45 -0700)]
subcase: New functions subcase_concat() and subcase_concat_always().

13 years agosort: New function sort_distinct_execute().
Ben Pfaff [Sun, 28 Mar 2010 20:40:25 +0000 (13:40 -0700)]
sort: New function sort_distinct_execute().

13 years agosort: Add support for combining cases with identical sort criteria.
Ben Pfaff [Sun, 21 Mar 2010 19:40:41 +0000 (12:40 -0700)]
sort: Add support for combining cases with identical sort criteria.

This makes it possible to efficiently assemble frequency tables and
crosstabs for data sets that might be larger than available memory.

13 years agosort: Change priority queue implementation from heap to binary tree.
Ben Pfaff [Sat, 20 Mar 2010 05:18:15 +0000 (22:18 -0700)]
sort: Change priority queue implementation from heap to binary tree.

This is not so great in itself--it is probably a wash for performance,
and might be a loss--but it does make it possible to discover duplicate
sort keys while reading the data, which will be useful in an upcoming
commit.

13 years agoCROSSTABS: Merge functions into cmd_crosstabs(). 20100503040521/pspp 20100504040524/pspp 20100505040503/pspp
Ben Pfaff [Mon, 3 May 2010 04:05:42 +0000 (21:05 -0700)]
CROSSTABS: Merge functions into cmd_crosstabs().

It seems to me that this code is more straightforward if it is written as
a single function, instead of four functions, so this commit merges those
functions together.

13 years agoFREQUENCIES: Refactor and simplify percentiles calculations.
Ben Pfaff [Mon, 3 May 2010 04:05:00 +0000 (21:05 -0700)]
FREQUENCIES: Refactor and simplify percentiles calculations.

It always seemed to me that there was more code and more data for
calculating percentiles than was really needed.

13 years agoTake advantage of Gnulib configmake module.
Ben Pfaff [Mon, 3 May 2010 04:00:06 +0000 (21:00 -0700)]
Take advantage of Gnulib configmake module.

Gnulib provides the "configmake" module for discovering configuration
directories at build time.  PSPP already depends on this module indirectly,
so we might as well use it instead of defining our own variables in
Makefile.am and src/automake.mk.

(We can't replace INSTALLDIR by BINDIR because it is used under the
former name by the "relocatable-prog" module.)

13 years agoConvert syntax files to UTF-8 before loading them.
John Darrington [Sun, 2 May 2010 13:20:38 +0000 (15:20 +0200)]
Convert syntax files to UTF-8 before loading them.

Convert the contents of a syntax file to UTF-8 before loading
it into the syntax window. Fixes bug #29733
This change assumes that the files to be loaded are in the
encoding of the current locale.  If this assumption is not
true, then an error will be displayed and the file not loaded.

13 years agoUse ftello() and fseeko() instead of ftell() and fseek() everywhere. 20100502040503/pspp
Ben Pfaff [Sun, 2 May 2010 03:09:55 +0000 (20:09 -0700)]
Use ftello() and fseeko() instead of ftell() and fseek() everywhere.

Newer versions of glibc give annoying warnings on uses of ftell() and
fseek(), so use ftello() and fseeko() instead.

13 years agoImplement MRSETS command. 20100501191104/pspp
Ben Pfaff [Sun, 2 May 2010 02:09:04 +0000 (19:09 -0700)]
Implement MRSETS command.

Thanks to Tom Wilson <tom_wilson@mointel.com> for reporting the format of
the MRSETS record in system files, and to John Darrington for examples of
additional types of records.

13 years agodissect-sysfile: Print contents of extension records with unknown subtypes.
Ben Pfaff [Sat, 1 May 2010 05:14:32 +0000 (22:14 -0700)]
dissect-sysfile: Print contents of extension records with unknown subtypes.

13 years agoNew stringi_set functions.
Ben Pfaff [Mon, 26 Apr 2010 06:11:31 +0000 (23:11 -0700)]
New stringi_set functions.

13 years agoNew case-insensitive string map data structure.
Ben Pfaff [Mon, 26 Apr 2010 05:48:59 +0000 (22:48 -0700)]
New case-insensitive string map data structure.

13 years agoperl-module: Add --without-perl-module configure flag. 20100425040504/pspp 20100426040504/pspp 20100427040521/pspp 20100428040521/pspp 20100430040522/pspp 20100501040520/pspp
Ben Pfaff [Sat, 24 Apr 2010 18:32:44 +0000 (11:32 -0700)]
perl-module: Add --without-perl-module configure flag.

The built Perl module is not useful for cross-compilation.  By default it
is disabled for cross-compilation, but cross-compilation to Mingw32 is not
always detected as cross-compilation (since some Linux systems can run
Windows binaries directly, via Wine), so this option helps in such cases.

Reported by Michel Boaventura <michel.boaventura@gmail.com>.

13 years agocairo-chart: Fix Pango version check.
Ben Pfaff [Sat, 24 Apr 2010 18:18:30 +0000 (11:18 -0700)]
cairo-chart: Fix Pango version check.

There is no Pango version 2.22, but there is a 1.22.

Reported by Michel Boaventura <michel@michelboaventura.com>.

13 years agoDocument system file record type 7, subtype 16 as 64-bit number of cases. 20100422040528/pspp 20100423040516/pspp 20100424040522/pspp
Ben Pfaff [Thu, 22 Apr 2010 04:11:48 +0000 (21:11 -0700)]
Document system file record type 7, subtype 16 as 64-bit number of cases.

I found this record type and subtype in all .sav files written by SPSS 14
and later (and in one file written by SPSS 13).  After scratching my head
a bit I realized that it always contained the same value as the "ncases"
field in the top-level file header, but written as a 64-bit number.  So
presumably the purpose is to allow for a 64-bit count of cases.

13 years agointeger-format: Support 64-bit integers in integer_get().
Ben Pfaff [Thu, 22 Apr 2010 02:57:00 +0000 (19:57 -0700)]
integer-format: Support 64-bit integers in integer_get().

My guess is that this was just a typo from when I originally wrote this
function.

13 years agoperl-module: Avoid compiler warning from conflicting "my_strftime" macros.
Ben Pfaff [Wed, 21 Apr 2010 04:20:30 +0000 (21:20 -0700)]
perl-module: Avoid compiler warning from conflicting "my_strftime" macros.

Avoids the following warnings:

In file included from /usr/lib/perl/5.10/CORE/perl.h:953,
                 from PSPP.xs:23:
/usr/lib/perl/5.10/CORE/embed.h:2803:1: warning: "my_strftime" redefined
In file included from PSPP.xs:20:
/home/blp/pspp/output/_build/config.h:1968:1: warning: this is the location of the previous definition

14 years agoperl-module: Better document Perl module requirements. 20100420040526/pspp 20100421040530/pspp
Ben Pfaff [Tue, 20 Apr 2010 03:30:32 +0000 (20:30 -0700)]
perl-module: Better document Perl module requirements.

14 years agoconfigure: Improve check for PostgreSQL's libpq. 20100419040522/pspp
Ben Pfaff [Fri, 16 Apr 2010 05:23:09 +0000 (22:23 -0700)]
configure: Improve check for PostgreSQL's libpq.

Previously this test did not check that linking against libpq worked.
This commit fixes that.  Besides broken installations this also guards
against pg_config that is applicable to the host when cross-compiling to
Mingw, which doesn't always show up as cross-compiling since some systems
can still run the Mingw binaries if Wine is installed as a binary
interpreter for Windows executables.

This also fixes a minor issue where -lpq was being added to the default
LIBS as well as to PG_LIBS, which meant that every PSPP binary was being
linked against it, not just the ones that needed it (which were being
linked against it twice).

Problem reported by Michel Boaventura <michel@michelboaventura.com>.

14 years agoMove definition of UI_FILES out of HAVE_GUI. 20100416040523/pspp
Ben Pfaff [Fri, 16 Apr 2010 03:39:47 +0000 (20:39 -0700)]
Move definition of UI_FILES out of HAVE_GUI.

UI_FILES needs to be defined regardless of whether the GUI is being built,
because the .ui files are needed to generate pspp.pot.  (We don't want
pspp.pot to depend on whether the GUI is configured, either.)

Problem reported by Michel Boaventura <michel.boaventura@gmail.com>.

14 years agoconfigure.ac: Define DEPENDS_ON_LIBINTL if LIBINTL is nonempty.
Ben Pfaff [Sat, 27 Mar 2010 18:32:07 +0000 (11:32 -0700)]
configure.ac: Define DEPENDS_ON_LIBINTL if LIBINTL is nonempty.

This avoids a collision between the gnulib and libintl printf wrappers.
See http://permalink.gmane.org/gmane.comp.lib.gnulib.bugs/21139 for
more information.

Thanks to Michel Boaventura for reporting the problem and to Bruno Haible
for the fix.

14 years agoconfigure.ac: Restore use of AM_GNU_GETTEXT.
Ben Pfaff [Sat, 27 Mar 2010 18:30:01 +0000 (11:30 -0700)]
configure.ac: Restore use of AM_GNU_GETTEXT.

AM_GNU_GETTEXT is useful for its sophisticated support for finding the
libraries needed to use gettext, but it also calls AM_PO_SUBDIRS, which
we do not want because PSPP has its own "po" directory makefile support.

This commit reintroduces AM_GNU_GETTEXT but disables AM_PO_SUBDIRS by
declaring that we have already called it using AC_PROVIDE.  It also
adds a dummy Makefile.in to the "po" directory and an ABOUT-NLS file
because Automake requires both.

14 years agoperl-module: Fix missing data in PSPP code embedded in generate_sav_file. 20100415131421/pspp
Ben Pfaff [Thu, 15 Apr 2010 20:13:25 +0000 (13:13 -0700)]
perl-module: Fix missing data in PSPP code embedded in generate_sav_file.

14 years agoperl-module: Use Autotest for testing Perl. 20100415040525/pspp
Ben Pfaff [Thu, 15 Apr 2010 04:47:07 +0000 (21:47 -0700)]
perl-module: Use Autotest for testing Perl.

The output of the existing Perl test is difficult to understand, in my
opinion.  When everything goes right, it prints out plenty of stuff.
When something goes wrong, it prints more stuff, but that stuff usually
doesn't make it clear to me what went wrong or where.

Moving it into Autotest helps in two ways.  When everything goes right,
all you get is a clear summary that says that.  When something goes wrong,
you get clear log files that explain where.

(This commit actually duplicates the Perl module tests: it makes Autotest
copies of each of the individual tests, and Autotest also runs the
t/Pspp.t unit test.  The former are easier to understand; the latter is
what Perl hackers apparently expect to see.)

14 years agoperl-module: Use new var_get_encoding() function.
Ben Pfaff [Wed, 14 Apr 2010 04:18:37 +0000 (21:18 -0700)]
perl-module: Use new var_get_encoding() function.

14 years agoshort-names: Eliminate use of old hash table data structure. 20100414040503/pspp
Ben Pfaff [Mon, 12 Apr 2010 05:10:25 +0000 (22:10 -0700)]
short-names: Eliminate use of old hash table data structure.

14 years agoAGGREGATE: Convert tests to use Autotest. 20100413040518/pspp
Ben Pfaff [Tue, 13 Apr 2010 04:30:16 +0000 (21:30 -0700)]
AGGREGATE: Convert tests to use Autotest.

14 years agoDESCRIPTIVES: Convert tests to use Autotest.
Ben Pfaff [Tue, 13 Apr 2010 03:55:45 +0000 (20:55 -0700)]
DESCRIPTIVES: Convert tests to use Autotest.

14 years agoCOMPUTE: Convert tests to use Autotest.
Ben Pfaff [Tue, 13 Apr 2010 02:18:56 +0000 (19:18 -0700)]
COMPUTE: Convert tests to use Autotest.

14 years agoRECODE: Convert tests to use Autotest.
Ben Pfaff [Mon, 12 Apr 2010 22:49:20 +0000 (15:49 -0700)]
RECODE: Convert tests to use Autotest.

14 years agoAUTORECODE: Eliminate use of old hash table implementation.
Ben Pfaff [Sat, 3 Apr 2010 04:28:46 +0000 (21:28 -0700)]
AUTORECODE: Eliminate use of old hash table implementation.

14 years agoAUTORECODE: Use Autotest for test suite.
Ben Pfaff [Fri, 2 Apr 2010 23:53:07 +0000 (16:53 -0700)]
AUTORECODE: Use Autotest for test suite.

14 years agoAUTORECODE: Use "union value" instead of custom "union arc_value".
Ben Pfaff [Fri, 2 Apr 2010 23:48:55 +0000 (16:48 -0700)]
AUTORECODE: Use "union value" instead of custom "union arc_value".

These days "union value" has everything that AUTORECODE needs, so there is
no point in maintaining a local replacement for it.

14 years agoAUTORECODE: Fix indentation.
Ben Pfaff [Fri, 2 Apr 2010 14:51:25 +0000 (07:51 -0700)]
AUTORECODE: Fix indentation.

14 years agovariable-parser: Implement PV_NO_DUPLICATE.
Ben Pfaff [Sat, 3 Apr 2010 04:26:52 +0000 (21:26 -0700)]
variable-parser: Implement PV_NO_DUPLICATE.

Now that we have string_set, PV_NO_DUPLICATE is easy to implement, so
we might as well.

14 years agovariable-parser: Eliminate use of old hash table data structure.
Ben Pfaff [Fri, 2 Apr 2010 23:48:12 +0000 (16:48 -0700)]
variable-parser: Eliminate use of old hash table data structure.

14 years agoAdd case-insensitive string set.
Ben Pfaff [Sat, 3 Apr 2010 18:29:33 +0000 (11:29 -0700)]
Add case-insensitive string set.

14 years agovalue: New function value_clone_pool().
Ben Pfaff [Fri, 2 Apr 2010 23:47:14 +0000 (16:47 -0700)]
value: New function value_clone_pool().

14 years agodictionary: Use hmap instead of older hsh_table. 20100412040508/pspp
Ben Pfaff [Mon, 12 Apr 2010 04:45:16 +0000 (21:45 -0700)]
dictionary: Use hmap instead of older hsh_table.

The greatest benefit of this change is that it allows dict_lookup_var() to
avoid creating and destroying a whole variable just to look one up by name.

14 years agohmapx: New function hmapx_clear().
Ben Pfaff [Sun, 4 Apr 2010 19:51:08 +0000 (12:51 -0700)]
hmapx: New function hmapx_clear().

14 years agohmap: New function hmap_clear().
Ben Pfaff [Sun, 11 Apr 2010 20:04:37 +0000 (13:04 -0700)]
hmap: New function hmap_clear().

14 years agovariable: Remove unneeded assertions.
Ben Pfaff [Sat, 10 Apr 2010 03:55:25 +0000 (20:55 -0700)]
variable: Remove unneeded assertions.

These assertions are already effectively checked anyhow, since the program
will already segfault if passed a null pointer.

14 years agodictionary: Remove unneeded assertions.
Ben Pfaff [Sat, 10 Apr 2010 03:54:24 +0000 (20:54 -0700)]
dictionary: Remove unneeded assertions.

These assertions are already effectively checked anyhow, since the program
will already segfault if passed a null pointer.

14 years agovardict: Make vardict opaque to variable code.
Ben Pfaff [Sat, 10 Apr 2010 03:41:04 +0000 (20:41 -0700)]
vardict: Make vardict opaque to variable code.

14 years agoMake struct variable refer to struct vardict through a pointer.
Ben Pfaff [Fri, 9 Apr 2010 04:37:24 +0000 (21:37 -0700)]
Make struct variable refer to struct vardict through a pointer.

This will allow the dictionary to integrate struct vardict into itself in
an upcoming commit.

14 years agoMake "internal variables" part of a dictionary.
Ben Pfaff [Fri, 9 Apr 2010 04:06:43 +0000 (21:06 -0700)]
Make "internal variables" part of a dictionary.

The "internal variables" created by var_create_internal() are somewhat of
a nasty corner case in the PSPP dictionary and variable implementation,
because they are the only variables that have a case index and
dictionary index but do not belong to a dictionary.  This commit fixes
that wart, by putting internal variables in a dictionary that is used just
for them.  It adds an assertion to var_set_vardict() to ensure that this
is now an invariant property.

As part of the change, var_create_internal() is renamed
dict_Create_internal_var() and moved to dictionary.c, since it fits better
there.  Also, a new function dict_destroy_internal_var() must now be used
to destroy internal variables.

The dictionary indexes of internal variables are no longer unique
process-wide.  A previous commit eliminated the dependencies on this
property.

14 years agovariable: Introduce and use new function var_get_encoding().
Ben Pfaff [Fri, 9 Apr 2010 04:28:42 +0000 (21:28 -0700)]
variable: Introduce and use new function var_get_encoding().

These changes seem like slight cleanups since they eliminate a function
parameter in these cases.

14 years agodictionary: Fix memory leak in dict_set_encoding().
Ben Pfaff [Fri, 9 Apr 2010 04:12:02 +0000 (21:12 -0700)]
dictionary: Fix memory leak in dict_set_encoding().

If this function was called more than once for a given dictionary then all
but the final encoding name would be leaked.

14 years agodictionary: Fix potential access beyond allocated memory.
Ben Pfaff [Sat, 10 Apr 2010 04:45:50 +0000 (21:45 -0700)]
dictionary: Fix potential access beyond allocated memory.

This code replaces the dictionary's "var" array by another one, so it must
either update "var_cap" to the allocated size or allocate "var_cap" (not
"var_cnt") elements.  I chose the latter fix.

14 years agoGet rid of unnecessary uses of var_get_dict_index(). 20100408040503/pspp 20100409040510/pspp 20100410040506/pspp 20100411040529/pspp
Ben Pfaff [Thu, 8 Apr 2010 05:12:07 +0000 (22:12 -0700)]
Get rid of unnecessary uses of var_get_dict_index().

Some code used the result of var_get_dict_index() on a pair of variables to
tell whether the variables are the same.  This is unnecessary: v1 == v2
works just as well.

Other code used the result of var_get_dict_index() as part of a hash value
computation.  This is reasonable, but it is even better just to hash the
pointer to the variable.

14 years agohash-functions: New function hash_pointer().
Ben Pfaff [Thu, 8 Apr 2010 04:39:06 +0000 (21:39 -0700)]
hash-functions: New function hash_pointer().

14 years agoexamples: Remove obsolete Makefile.am. 20100328040511/pspp 20100329040507/pspp 20100330040524/pspp 20100331040505/pspp 20100401040502/pspp 20100402040502/pspp 20100403040502/pspp 20100404040505/pspp 20100405040503/pspp 20100406040528/pspp 20100407040507/pspp
Ben Pfaff [Sat, 27 Mar 2010 21:09:02 +0000 (14:09 -0700)]
examples: Remove obsolete Makefile.am.

The build is now done through automake.mk (and has been for a long time
now).

14 years agoUpdate to most recent gnulib. 20100326040502/pspp 20100327040513/pspp
Ben Pfaff [Fri, 26 Mar 2010 03:36:21 +0000 (20:36 -0700)]
Update to most recent gnulib.

14 years agodict: Make dict_clone_var(), dict_clone_var_assert() not rename variables.
Ben Pfaff [Thu, 25 Mar 2010 04:18:34 +0000 (21:18 -0700)]
dict: Make dict_clone_var(), dict_clone_var_assert() not rename variables.

Most uses of dict_clone_var() and dict_clone_var_assert() do not involve
renaming variables, but the interface assumes that renaming is the common
case.  This commit changes their interfaces to not support renaming and
adds new functions dict_clone_var_as() and dict_clone_var_as_assert() to
support renaming during cloning.

14 years agobt: Improve code formatting. 20100322040515/pspp 20100323040521/pspp 20100324040506/pspp
Ben Pfaff [Sat, 20 Mar 2010 05:14:42 +0000 (22:14 -0700)]
bt: Improve code formatting.

14 years agobt: New function bt_is_empty().
Ben Pfaff [Sat, 20 Mar 2010 05:14:24 +0000 (22:14 -0700)]
bt: New function bt_is_empty().

14 years agopsppire: Use default GTK+ font in output shown in GUI.
Ben Pfaff [Mon, 22 Mar 2010 04:06:44 +0000 (21:06 -0700)]
psppire: Use default GTK+ font in output shown in GUI.

This makes the output look more consistent with the rest of the interface.

I didn't see an easy way to get a "default" monospace font.  GTK+ doesn't
seem to have one.

Reported by John Darrington.

14 years agoFREQUENCIES: Simplify code for sorting the frequency table. 20100320040502/pspp 20100321040506/pspp
Ben Pfaff [Sat, 20 Mar 2010 04:29:41 +0000 (21:29 -0700)]
FREQUENCIES: Simplify code for sorting the frequency table.

14 years agoFREQUENCIES: Get rid of final (non-const) file-scope variable. 20100319040503/pspp
Ben Pfaff [Fri, 19 Mar 2010 04:55:09 +0000 (21:55 -0700)]
FREQUENCIES: Get rid of final (non-const) file-scope variable.

14 years agoFREQUENCIES: Move file-scope variables for charts into struct frq_proc.
Ben Pfaff [Fri, 19 Mar 2010 04:42:17 +0000 (21:42 -0700)]
FREQUENCIES: Move file-scope variables for charts into struct frq_proc.

14 years agoFREQUENCIES: Move file-scope variables for stats into struct frq_proc.
Ben Pfaff [Fri, 19 Mar 2010 04:31:11 +0000 (21:31 -0700)]
FREQUENCIES: Move file-scope variables for stats into struct frq_proc.

14 years agoFREQUENCIES: Move file-scope variables for percentiles into struct frq_proc.
Ben Pfaff [Fri, 19 Mar 2010 04:27:57 +0000 (21:27 -0700)]
FREQUENCIES: Move file-scope variables for percentiles into struct frq_proc.

14 years agoFREQUENCIES: Move file-scope variable syntax_pool into struct frq_proc.
Ben Pfaff [Thu, 18 Mar 2010 16:34:05 +0000 (09:34 -0700)]
FREQUENCIES: Move file-scope variable syntax_pool into struct frq_proc.

14 years agoFREQUENCIES: Eliminate file-scope variables n_variables, v_variables. 20100318040503/pspp
Ben Pfaff [Thu, 18 Mar 2010 05:02:42 +0000 (22:02 -0700)]
FREQUENCIES: Eliminate file-scope variables n_variables, v_variables.

Also, as a nice side effect, FREQUENCIES no longer uses the variable
auxiliary data feature, which is ugly at best.

14 years agoFREQUENCIES: Get rid of unused data_pool.
Ben Pfaff [Thu, 18 Mar 2010 04:20:23 +0000 (21:20 -0700)]
FREQUENCIES: Get rid of unused data_pool.

14 years agoFREQUENCIES: Capitalize names of enums.
Ben Pfaff [Thu, 18 Mar 2010 04:18:24 +0000 (21:18 -0700)]
FREQUENCIES: Capitalize names of enums.

This is just a cleanup for consistency with the style used elsewhere in
PSPP.

14 years agoFREQUENCIES: Use newer hmap library instead of older hsh_table library. 20100317040506/pspp
Ben Pfaff [Wed, 17 Mar 2010 04:43:15 +0000 (21:43 -0700)]
FREQUENCIES: Use newer hmap library instead of older hsh_table library.

The FREQUENCIES procedure can use some cleanup.  Here's one step.

14 years agovalue: New function value_clone().
Ben Pfaff [Tue, 16 Mar 2010 05:05:24 +0000 (22:05 -0700)]
value: New function value_clone().

14 years agoarray: Fix indentation.
Ben Pfaff [Wed, 17 Mar 2010 04:36:25 +0000 (21:36 -0700)]
array: Fix indentation.

14 years agoINSTALL: libintl is also required.
Ben Pfaff [Wed, 17 Mar 2010 03:45:22 +0000 (20:45 -0700)]
INSTALL: libintl is also required.

Reported by Michel Boaventura <michel.boaventura@gmail.com>.

14 years agoINSTALL: Remove duplicate pkg-config requirement.
Ben Pfaff [Wed, 17 Mar 2010 03:37:48 +0000 (20:37 -0700)]
INSTALL: Remove duplicate pkg-config requirement.

14 years agogui: Add charts, additional formatting feature to FREQUENCIES dialog. 20100314040516/pspp 20100315040510/pspp 20100316040524/pspp
Ben Pfaff [Sun, 14 Mar 2010 06:08:30 +0000 (22:08 -0800)]
gui: Add charts, additional formatting feature to FREQUENCIES dialog.

Partial fix for bug #27832 "Wishlist: graphic output in GUI".

14 years agotests: Integrate FREQUENCIES tests into Autotest testsuite.
Ben Pfaff [Sun, 14 Mar 2010 05:44:30 +0000 (21:44 -0800)]
tests: Integrate FREQUENCIES tests into Autotest testsuite.

14 years agoFREQUENCIES: Modernize syntax and improve chart support.
Ben Pfaff [Sun, 14 Mar 2010 05:53:05 +0000 (21:53 -0800)]
FREQUENCIES: Modernize syntax and improve chart support.

The FREQUENCIES syntax was carrying a lot of baggage from old versions
that is no longer mentioned in the SPSS syntax reference.  This commit
removes support for those obsolete features.

The implementation only supported a single chart at a time.  Now it
supports pie charts and histograms in a single command.  The MIN and
MAX format options are now implemented, as are the MISSING/NOMISSING
options for pie charts.  (The FREQ/PERCENT options are still not
implemented.)

Also update documentation to match.

14 years agoFREQUENCIES: Use Freedman-Diaconis formula to choose histogram bin width.
Ben Pfaff [Sat, 13 Mar 2010 19:43:13 +0000 (11:43 -0800)]
FREQUENCIES: Use Freedman-Diaconis formula to choose histogram bin width.

Recently the FREQUENCIES procedure adopted Sturges' formula, more or less
arbitrarily, to choose the bin width of histograms.  Gaj Vidmar
<gaj.vidmar@mf.uni-lj.si>, however, recommended the Freedman-Diaconis
formula instead, so this commit adopts that formula instead.

Tested with only a few examples.

14 years agoFREQUENCIES: Add ability to calculating percentiles without showing them.
Ben Pfaff [Sat, 13 Mar 2010 19:41:14 +0000 (11:41 -0800)]
FREQUENCIES: Add ability to calculating percentiles without showing them.

This feature is not used yet, but it will be in an upcoming commit.

14 years agotab: Add debugging checks to tab_hline() to match those for tab_vline().
Ben Pfaff [Sat, 13 Mar 2010 18:59:09 +0000 (10:59 -0800)]
tab: Add debugging checks to tab_hline() to match those for tab_vline().

I'm not sure that this is really a good approach, but we might as well be
consistent.

14 years agoFREQUENCIES: Fix spelling error in dialog box text. 20100311040503/pspp 20100312040506/pspp 20100313040505/pspp
Ben Pfaff [Wed, 10 Mar 2010 22:19:59 +0000 (14:19 -0800)]
FREQUENCIES: Fix spelling error in dialog box text.

14 years agoDESCRIPTIVES: In GUI, generate Z scores immediately instead of deferring.
Ben Pfaff [Sat, 6 Mar 2010 18:57:29 +0000 (10:57 -0800)]
DESCRIPTIVES: In GUI, generate Z scores immediately instead of deferring.

Having the Z scores variable show up immediately, but not the actual Z
scores, confuses users.

Reported by Douglas A Ferguson <FergusonD@cofc.edu>.

14 years agogui: Fix build problem (missing header #include).
Ben Pfaff [Wed, 10 Mar 2010 17:44:39 +0000 (09:44 -0800)]
gui: Fix build problem (missing header #include).

Reported by Grzegorz Artur Daszuta <crefff@gmail.com>.

14 years agogui: Merge File|Open|Syntax and File|Open|Data into File|Open. 20100310040505/pspp
Ben Pfaff [Wed, 10 Mar 2010 05:48:42 +0000 (21:48 -0800)]
gui: Merge File|Open|Syntax and File|Open|Data into File|Open.

In playing with the GUI, I've found it increasingly annoying to have to
click an extra time to tell PSPPIRE whether I want to open a data file or
a syntax file.  There's no need for that--it can easily figure out what
kind of file it's being asked to read.  This commit implements that
behavior.

14 years agoFREQUENCIES: Choose number of bins for histogram based on valid cases.
Ben Pfaff [Wed, 10 Mar 2010 04:52:48 +0000 (20:52 -0800)]
FREQUENCIES: Choose number of bins for histogram based on valid cases.

Until now, histograms have always had exactly 11 bins.  There is no
"correct" number of bins, but a fixed number of bins also seems less than
ideal.  Use Sturges' formula, instead, to choose the number of bins.

Reported by Erik Frebold <efrebold@interchange.ubc.ca>.

14 years agoconfigure: Check for glib-genmarshal program at configure time.
Ben Pfaff [Wed, 10 Mar 2010 00:59:06 +0000 (16:59 -0800)]
configure: Check for glib-genmarshal program at configure time.

The GUI build cannot succeed without glib-genmarshal, so it seems like a
good idea to fail earlier.

Related to bug #28959, reported by Harry Thijssen.

14 years agoCROSSTABS: Make 3-way crosstabulation work reasonably. 20100309040527/pspp
Ben Pfaff [Tue, 9 Mar 2010 05:25:46 +0000 (21:25 -0800)]
CROSSTABS: Make 3-way crosstabulation work reasonably.

As reported in bug #27452, until now 3-way crosstabulations have completely
failed to work.  This commit makes them work, apparently correctly at
first glance.  Only the actual crosstabulation tables have been tested; it
is likely that statistics tables still do not display correctly or cause
runtime failures.

14 years agotab: Drop redundant assertions.
Ben Pfaff [Tue, 9 Mar 2010 04:43:54 +0000 (20:43 -0800)]
tab: Drop redundant assertions.

There is not much value in asserting that a pointer parameter is non-null
if that parameter is always dereferenced.

14 years agotests: Fix bug in NPAR TESTS subtest for CHISQUARE command.
Ben Pfaff [Tue, 9 Mar 2010 04:02:36 +0000 (20:02 -0800)]
tests: Fix bug in NPAR TESTS subtest for CHISQUARE command.

Reported by John Darrington.

14 years agoCROSSTABS: Rewrite tests in Autotest and add test for bug #27883. 20100307040504/pspp 20100308040506/pspp
Ben Pfaff [Sat, 6 Mar 2010 19:54:11 +0000 (11:54 -0800)]
CROSSTABS: Rewrite tests in Autotest and add test for bug #27883.

14 years agoterminal UI: Fix circumstances when errors should be logged to stdout.
Ben Pfaff [Sat, 6 Mar 2010 19:43:42 +0000 (11:43 -0800)]
terminal UI: Fix circumstances when errors should be logged to stdout.

The logic here was supposed to be that, if errors weren't already being
logged explicitly and if no output driver was already directed to stdout,
then send errors to standard output.  But one of the conditions was
reversed.  This fixes the problem.

14 years agoCROSSTABS: Initialize hash tables for every split, not just once overall.
Ben Pfaff [Sat, 6 Mar 2010 19:26:47 +0000 (11:26 -0800)]
CROSSTABS: Initialize hash tables for every split, not just once overall.

Fixes bug #27883, reported by Jason Stover.

14 years agoprocedure: Fix LIST procedure (and others) in GUI. 20100302040526/pspp 20100303040503/pspp 20100304040503/pspp 20100305040503/pspp 20100306040503/pspp
Ben Pfaff [Tue, 2 Mar 2010 06:20:02 +0000 (22:20 -0800)]
procedure: Fix LIST procedure (and others) in GUI.

John Darrington reported that the following syntax makes PSPPIRE
crash:

    data list list /alpha * beta * gamma *.
    begin data.
    1 2 3
    4 5 6
    end data.

    list.

The problem is that the GUI output driver keeps a reference to the
output_items that are submitted to it.  An output_item that in turn
has a reference to the casereader for the procedure casereader (that
is, the casereader returned by proc_open()), which currently is LIST
and few if any other procedures, then causes an assertion failure in
proc_commit().  This is because until now a precondition of
proc_commit() has been that the procedure casereader be closed, which
is what the assertion enforces.

This commit fixes the problem by getting rid of the precondition on
proc_commit().  Now the procedure casereader's lifetime may be
extended arbitrarily.  This should help take PSPP output in the
direction that I want it to go, where more and more output is
generated directly or semi-directly from casereaders, as the LIST
procedure now does.

14 years agocasereader: Factor buffering shim out into separate source file.
Ben Pfaff [Tue, 2 Mar 2010 06:12:48 +0000 (22:12 -0800)]
casereader: Factor buffering shim out into separate source file.

This moves the "shim" code out of casereader.c into a separate
casereader-shim.[ch] in preparation for using it from procedure.c.

This commit also adds an optimization: if the shim reads all of the
subreader, then it closes the subreader immediately, instead of waiting
for the shim itself to be destroyed. This can allow resources to be freed
earlier.

This commit also adds a new function casereader_shim_slurp().  This
function will be used for the first time in the following commit.

14 years agoconfigure: Always apply zlib crc32() rename fix.
Ben Pfaff [Fri, 26 Feb 2010 17:09:45 +0000 (09:09 -0800)]
configure: Always apply zlib crc32() rename fix.

PSPP can link against zlib indirectly even if it doesn't link directly, so
it is simplest to always rename gnulib's crc32() to gl_crc32().

Reported by John Darrington.

14 years agogui: Save positions of windows only when they are closed. 20100227040506/pspp 20100228040509/pspp 20100301040511/pspp
Ben Pfaff [Fri, 26 Feb 2010 05:40:52 +0000 (21:40 -0800)]
gui: Save positions of windows only when they are closed.

When windows in the GUI are moved around the desktop or resized, the
machine's disk can thrash madly in some setups.  This is because each
change in a window's position or size triggers a write to the PSPPIRE
preferences file noting the new position as a default for the next
PSPPIRE run.  It wasn't always a problem, but newer Glib versions call
fsync() from g_file_set_contents(), the function used to write the
preferences file, which bypasses the OS cache and forces a synchronous
disk write.

This commit makes PSPPIRE update the preferences file only when a window
is closed, which fixes the problem.  Avoiding g_file_set_contents() would
be another reasonable solution.

Reported by Grzegorz Artur Daszuta <crefff@gmail.com>.

14 years agopo: Update Dutch translation. 20100225040506/pspp 20100226040508/pspp
Ben Pfaff [Thu, 25 Feb 2010 04:36:56 +0000 (20:36 -0800)]
po: Update Dutch translation.

From Harry Thijssen via translationproject.org.