From b6b1285781853d4e749f03e3ace5cf975e89f0b0 Mon Sep 17 00:00:00 2001 From: Ben Pfaff Date: Mon, 27 Oct 2014 21:33:22 -0700 Subject: [PATCH] dump: Successfully parse all dimensions. --- .gitignore | 2 + 31 | 81 ++++++++++++++++++++++++++++++--- dump.c | 70 +++++++++++++++++++++++------ notes | 130 ++++++++++++++++++++++++++++++++++++++++++----------- 4 files changed, 236 insertions(+), 47 deletions(-) diff --git a/.gitignore b/.gitignore index 72ed440922..ad1ca01a94 100644 --- a/.gitignore +++ b/.gitignore @@ -1,6 +1,8 @@ germano/ smekens/ williams/ +web/ +websav/ dump tdump* ndump* diff --git a/31 b/31 index f3d51e5b8a..90787d4a70 100644 --- a/31 +++ b/31 @@ -1,3 +1,5 @@ +31 i0 i0 len:(...) string number? n_substs i0 + tdump9 (./williams/00000000033_lightTableData.bin): 03 "Statistics" 58 "statistics_10" "Statistics" 01 00 01 i2 01 00 01 i2 i4 @@ -9,15 +11,80 @@ tdump9 (./williams/00000000033_lightTableData.bin): tdump15 (./williams/00000000032_lightTableData.bin): - 03 "Crosstabulation" 58 "crosstabulation" "Crosstabulation" 01 00 00 i2 01 00 i1 00 i1 - 00 31 i0 i0 i27: (i21: (i0 31 "[%1: * ^1:]1") 58 58) "[%1: * ^1:]1" i1 i2 i0 + 03 "Crosstabulation" 58 "crosstabulation" "Crosstabulation" 01 00 00 i2 01 00 i1 00 i1 00 + 31 i0 i0 i27: (i21: (i0 31 "[%1: * ^1:]1") 58 58) "[%1: * ^1:]1" i1 i2 i0 05 58 "Q8New_4" "Q8_4 I think..." i2 00 05 58 "Q8New_1" "Q8_1 It is a..." i2 i2 i0 i0 +tdump20 ./germano/Crosstabs/00000000018_lightTableData.bin: + + 03 "Statistics" 58 "statistics_10" "Statistics" 01 00 00 i2 01 00 i1 00 i1 00 + 31 i0 i0 i42: (i36: (i0 31 "Odds Ratio for ^1 (^2 / ^3)") 58 58) "Odds Ratio for ^1 (^2 / ^3)" i3 i0 + 05 58 "cond" "" i3 00 + 02 58 F40.0(1) "cond" "" i3 00 + 02 58 F40.0(2) "cond" "" i3 i2 i0 i0 + + tdump21 ./germano/Crosstabs/00000000016_lightTableData.bin: - 03 "Statistics" 58 "statistics_10" "Statistics" 01 00 00 i2 01 00 i1 00 i1 00 - 31 00 00 00 00 00 00 00 00 i42: (i36: (i0 31 "Odds Ratio for ^1 (^2 / ^3)") 58 58) "Odds Ratio for ^1 (^2 / ^3)" i3 i0 - 05 58 "cond" i0 i3 00 - 02 58 F40.0(1) "cond" i0 i3 00 - 02 58 F40.0(2) "cond" i0 i3 i2 i0 i0 + 03 "Direction" 58 "direction" "Direction" 01 00 00 i2 01 00 i1 00 i3 + 03 "Symmetric" 58 "symmetric" "Symmetric" i1 i2 i0 i0 00 + 31 i0 i0 i27: (i21: (i0 31 "^1 Dependent") 58 58) "^1 Dependent" i1 i0 + 05 58 "cond" "" i3 i2 i1 i0 00 + 31 i0 i0 i27: (i21: (i0 31 "^1 Dependent") 58 58) "^1 Dependent" i1 i0 + 05 58 "fobia" "" i3 i2 i2 i0 + + 03 "Values" 58 "values_10" "Values" 01 00 01 i2 01 00 01 i2 i4 + 03 "Value" 58 "value_18" "Value" i1 i2 00 00 00 00 00 00 00 00 + 03 "Asymp. Std. Error" 31 i1 i0 00 00 i11: (i5: ("" 58) 58 58) "asymptotic_standard_error" "Asymptotic Std. Error" i1 i2 i1 00 00 00 00 + 03 "Approx. T" 31 i1 i1 00 00 i11: (i5: ("" 58) 58 58) "approximate_t" "Approximate T" i1 i2 i2 00 00 00 00 + 03 "Approx. Sig." 58 "approximate_probability" "Approximate Significance" i1 i2 i3 00 00 00 00 00 00 00 00 i2 i1 00 00 00 00 i1 i2 i44 + + +tdump22 ./germano/Crosstabs/00000000017_lightTableData.bin: + +This is a good example for footnotes: there are three footnotes in the table and two of them are referenced from the dimensions. + + 03 "Values" 58 "values_10" "Values" 01 00 01 i2 01 00 01 i1 i4 + 03 "Value" 58 "value_18" "Value" i1 i2 00 00 00 00 00 00 00 00 + 03 "Asymp. Std. Error" 31 i1 i0 00 00 i11: (i5: (i0 58) 58 58) "ase" "Asymptotic Std. Error" i1 i2 i1 00 00 00 00 + 03 "Approx. T" 31 i1 i1 00 00 i11: (i5: (i0 58) 58 58) "approximate_t" "Approximate T" i1 i2 i2 00 00 00 00 + 03 "Approx. Sig." 58 "approximate_probability" "Approximate Significance" i1 i2 i3 i0 i0 + +tdump24 ./germano/Crosstabs/00000000014_lightTableData.bin + + 03 "Statistics" 58 "statistics_10" "Statistics" 01 00 01 i2 01 00 01 i2 i8 + 03 "Count" 58 "count_6" "Count" i1 i2 i0 i0 + 03 "Expected Count" 58 "expected_count" "Expected Count" i1 i2 i1 i0 00 + 31 i0 i0 i26: (i20: (i0 31 "row % of ^1") 58 58) "% within ^1" i1 i0 + 05 58 "cond" "" i3 i2 i2 i0 00 + 31 i0 i0 i26: (i20: (i0 31 "col % of ^1") 58 58) "% within ^1" i1 i0 + 05 58 "fobia" "" i3 i2 i3 i0 + 03 "% of Total" 58 "_pct_of_total" "% of Total" i1 i2 i4 i0 + 03 "Residual" 58 "residual_3" "Residual" i1 i2 i5 i0 + 03 "Std. Residual" 58 "std_residuals" "Std. Residual" i1 i2 i6 i0 + 03 "Adj. Residual" 58 "adj_residuals" "Adj. Residual" i1 i2 i7 i0 + +tdump25 ./germano/Crosstabs/00000000013_lightTableData.bin + + 03 "Crosstabulation" 58 "crosstabulation" "Crosstabulation" 01 00 00 i2 01 00 i1 00 i1 00 + 31 i0 i0 i27: (i21: (i0 31 "[%1: * ^1:]1") 58 58) "[%1: * ^1:]1" i1 i2 i0 + 05 58 "cond" "" i3 00 + 05 58 "fobia" "" i3 i2 i0 i0 + +0427a44fc2a99165411ecd27896fe4fd/00000000013_lightTableData.bin: + + 03 "Variables" 58 "variable_s_1" "Variables" 01 00 00 i2 01 00 i1 00 i23 00 + 31 i0 i0 i22: (i16: ("" 31 "Pair ^1") 58 58) "Pair ^1" i1 i0 + 01 58 F40.0(1) 00 00 01 i2 i-1 i2 + 05 58 "pre1.1" 00 00 00 00 i2 i2 i0 i0 + 05 58 "post1.1" 00 00 00 00 i2 i2 i1 i0 00 + 31 i0 i0 i22: (i16: ("" 31 "Pair ^1" 58 58) "Pair ^1" i1 i0 + 01 58 F40.0(2) 00 00 01 i2 i-1 i2 + 05 58 "pre1.2" 00 00 00 00 i2 i2 i2 00 00 00 00 + 05 58 "post1.2" 00 00 00 00 i2 i2 i3 00 00 00 00 00 + 31 i0 i0 i22: i16: ("" 31 "Pair ^1") 58 58) "Pair ^1" i1 i0 + 01 58 F40.0(3) 00 00 01 i2 ff ff ff ff i2 + 05 58 "pre1.3" 00 00 00 00 i2 i2 i4 00 00 00 00 + 05 58 "post1.3" 00 00 00 00 i2 i2 i5 00 00 00 00 00 + ... diff --git a/dump.c b/dump.c index ce87e86b2d..4d77609cad 100644 --- a/dump.c +++ b/dump.c @@ -120,19 +120,26 @@ get_string(void) } static void -dump_category(int level) +dump_value(int level) { for (int i = 0; i <= level; i++) printf (" "); - match_byte (0); - match_byte (0); - match_byte (0); - match_byte (0); if (match_byte (3)) { get_string(); - match_byte_assert (0x58); + if (match_byte (0x31)) + { + match_u32 (1); + printf("(footnote %d) ", get_u32()); + match_byte_assert (0); + match_byte_assert (0); + int subn = get_u32 (); + printf ("nested %d bytes", subn); + pos += subn; + } + else + match_byte_assert (0x58); get_string(); printf("string \"%s\"", get_string()); match_byte (0); @@ -152,6 +159,7 @@ dump_category(int level) match_byte (0); match_byte (0); match_byte (0); + match_byte (0); } else if (match_byte (2)) { @@ -168,6 +176,7 @@ dump_category(int level) value, format >> 16, (format >> 8) & 0xff, format & 0xff, var, vallab); if (!match_u32 (3)) match_u32_assert (2); + match_byte (0); } else if (match_byte (1)) { @@ -187,21 +196,44 @@ dump_category(int level) else { int subn; + int total_subs = 1; + match_byte (0); match_byte_assert (0x31); match_u32_assert (0); match_u32_assert (0); subn = get_u32 (); printf ("nested %d bytes", subn); pos += subn; - printf ("; \"%s\"", get_string()); - fprintf (stderr, "got %02x\n", data[pos]); - match_byte (1); - match_byte (0); - match_byte (0); - match_byte (0); - goto next; + printf ("; \"%s\", substitutions:", get_string()); + fprintf (stderr, "substitutions:"); + for (;;) + { + int n_subst = get_u32(); + if (!n_subst) + break; + printf (" %d", n_subst); + fprintf (stderr, " %d", n_subst); + total_subs *= n_subst; + } + putc ('\n', stderr); + + for (int i = 0; i < total_subs; i++) + { + putc ('\n', stdout); + dump_value (level + 1); + } } +} + +static void +dump_category(int level) +{ + match_byte (0); + match_byte (0); + match_byte (0); + match_byte (0); + dump_value (level); if (match_u32 (2)) get_u32 (); @@ -217,7 +249,7 @@ dump_category(int level) match_u32_assert (0); get_u32 (); } -next:; + int n_categories = get_u32(); if (n_categories > 0) printf (", %d subcategories:", n_categories); @@ -317,6 +349,16 @@ main(int argc, char *argv[]) if (argc > 1) { + if (!strcmp(argv[1], "title0")) + { + pos = 0x27; + if (match_byte (0x03) + || (match_byte (0x05) && match_byte (0x58))) + printf ("%s\n", get_string()); + else + printf ("\n"); + return 0; + } if (!strcmp(argv[1], "title")) { const char fonts[] = "\x01\x31\x09\0\0\0SansSerif"; diff --git a/notes b/notes index 499ba95cd2..f5b8cf3a6f 100644 --- a/notes +++ b/notes @@ -582,6 +582,19 @@ tdump19: +tdump20 ./germano/Crosstabs/00000000018_lightTableData.bin: + + i2 + + 03 "Statistics" 58 "statistics_10" "Statistics" 01 00 00 i2 01 00 i1 00 i1 00 + 31 i0 i42: (i36: (i0 31 "Odds Ratio for ^1 (^2 / ^3)") 58 58) "Odds Ratio for ^1 (^2 / ^3)" i3 i0 + 05 58 "cond" "" i3 00 + 02 58 F40.0(1) "cond" "" i3 00 + 02 58 F40.0(2) "cond" "" i3 i2 i0 i0 + + 03 "Values" 58 "values_10" "Values" 01 00 01 i2 01 00 01 i1 i1 + 03 "Value" 58 "value_18" "Value" i1 i2 00 00 00 00 00 00 00 00 00 00 00 00 i1 i1 00 00 00 00 i + tdump27 (germano/Frequencies.pdf): i2 (two dimensions) @@ -643,11 +656,11 @@ tdump24 (germano/Crosstabs.pdf): 03 "Statistics" 58 "statistics_10" "Statistics" 01 00 01 i2 01 00 01 i2 i8 03 "Count" 58 "count_6" "Count" i1 i2 i0 i0 - 03 "Expected Count" 58 "expected_count" "Expected Count" i1 i2 i1 i0 - 00 31 i0 i0 i26: (i20: (i0 31 "row % of ^1") 58 58) "% within ^1" i1 - i0 05 58 "cond" "" i3 i2 i2 i0 - 00 31 i0 i0 i26: (i20: (i0 31 "col % of ^1") 58 58) "% within ^1" i1 - i0 05 58 "fobia" "" i3 i2 i3 i0 + 03 "Expected Count" 58 "expected_count" "Expected Count" i1 i2 i1 i0 00 + 31 i0 i0 i26: (i20: (i0 31 "row % of ^1") 58 58) "% within ^1" i1 i0 + 05 58 "cond" "" i3 i2 i2 i0 00 + 31 i0 i0 i26: (i20: (i0 31 "col % of ^1") 58 58) "% within ^1" i1 i0 + 05 58 "fobia" "" i3 i2 i3 i0 03 "% of Total" 58 "_pct_of_total" "% of Total" i1 i2 i4 i0 03 "Residual" 58 "residual_3" "Residual" i1 i2 i5 i0 03 "Std. Residual" 58 "std_residuals" "Std. Residual" i1 i2 i6 i0 @@ -659,7 +672,7 @@ tdump25 (germano/Crosstabs.pdf): i3 (3 dimensions) 03 "Crosstabulation" 58 "crosstabulation" "Crosstabulation" 01 00 00 i2 01 00 i1 00 i1 - 00 31 i0 i0 (i27: (i21 i0 31 "[%1: * ^1:]1") 58 58) "[%1: * ^1:]1" i1 i2 i0 + 00 31 i0 i0 i27: (i21: (i0 31 "[%1: * ^1:]1") 58 58) "[%1: * ^1:]1" i1 i2 i0 05 58 "cond" "" i3 00 05 58 "fobia" "" i3 i2 i0 i0 @@ -672,20 +685,7 @@ tdump25 (germano/Crosstabs.pdf): 03 "Missing" 58 "missing_observations" "Missing" i1 i2 i1 i0 03 "Total" 58 "total_4" "Total" i1 i2 i2 i0 -tdump21 ./germano/Crosstabs/00000000016_lightTableData.bin: - -i2 - - 03 "Statistics" 58 "statistics_10" "Statistics" 01 00 00 i2 01 00 i1 00 i1 00 - 31 00 00 00 00 00 00 00 00 i42: (i36: (i0 31 "Odds Ratio for ^1 (^2 / ^3)") 58 58) "Odds Ratio for ^1 (^2 / ^3)" i3 i0 - 05 58 "cond" i0 i3 00 - 02 58 F40.0(1) "cond" i0 i3 00 - 02 58 F40.0(2) "cond" i0 i3 i2 i0 i0 - - 03 "Values" 58 "values_10" "Values" 01 00 01 i2 01 00 01 i1 i1 - 03 "Value" 58 "value_18" "Value" i1 i2 00 00 00 00 00 00 00 00 00 00 00 00 i1 i1 00 00 00 00 i1 i1 00 00 00 00 00 00 00 00 i3 00 31 i1 00 00 00 00 00 00 i11 i5 00 00 00 00 58 58 58 00 00 00 00 00 00 00 00 00 - -tdump21 (germano/Crosstabs.pdf): +tdump21 ./germano/Crosstabs/00000000016_lightTableData.bin (Directional Measures): i3 (three dimensions) @@ -712,7 +712,7 @@ tdump21 (germano/Crosstabs.pdf): 03 "Approx. T" 31 i1 i1 00 00 i11: (i5: ("" 58) 58 58) "approximate_t" "Approximate T" i1 i2 i2 00 00 00 00 03 "Approx. Sig." 58 "approximate_probability" "Approximate Significance" i1 i2 i3 00 00 00 00 00 00 00 00 i2 i1 00 00 00 00 i1 i2 i44 -tdump22 ./germano/Crosstabs/00000000017_lightTableData.bin: +tdump22 ./germano/Crosstabs/00000000017_lightTableData.bin (Symmetric Measures): This is a good example for footnotes: there are three footnotes in the table and two of them are referenced from the dimensions. @@ -734,11 +734,89 @@ This is a good example for footnotes: there are three footnotes in the table and 03 "Kappa" 58 "kappa" "Kappa" i1 i2 i8 00 00 00 00 03 "N of Valid Cases" 58 "valid" "N of Valid Cases" i1 i2 i9 00 00 00 00 - 03 "Values" 58 "values_10" "Values" 01 00 01 i2 01 00 01 i1 i4 - 03 "Value" 58 "value_18" "Value" i1 i2 00 00 00 00 00 00 00 00 - 03 "Asymp. Std. Error" 31 i1 i0 00 00 i11: (i5: (i0 58) 58 58) "ase" "Asymptotic Std. Error" i1 i2 i1 00 00 00 00 - 03 "Approx. T" 31 i1 i1 00 00 i11: (i5: (i0 58) 58 58) "approximate_t" "Approximate T" i1 i2 i2 00 00 00 00 - 03 "Approx. Sig." 58 "approximate_probability" "Approximate Significance" i1 i2 i3 i0 i0 + 03 "Values" 58 "values_10" "Values" 01 00 01 i2 01 00 01 i1 i4 + 03 "Value" 58 "value_18" "Value" i1 i2 00 00 00 00 00 00 00 00 + 03 "Asymp. Std. Error" 31 i1 i0 00 00 i11: (i5: (i0 58) 58 58) "ase" "Asymptotic Std. Error" i1 i2 i1 00 00 00 00 + 03 "Approx. T" 31 i1 i1 00 00 i11: (i5: (i0 58) 58 58) "approximate_t" "Approximate T" i1 i2 i2 00 00 00 00 + 03 "Approx. Sig." 58 "approximate_probability" "Approximate Significance" i1 i2 i3 i0 i0 + +tdump24 ./germano/Crosstabs/00000000014_lightTableData.bin + + i3 + + 05 58 "cond" 00 00 00 00 03 00 00 i2 01 00 i1 00 i2 + 05 58 "cond" 00 00 00 00 03 00 00 i1 00 ff ff ff ff i4 + 02 58 F40.0(1) "cond" 00 00 00 00 i3 i2 00 00 00 00 00 00 00 00 + 02 58 F40.0(2) "cond" 00 00 00 00 i3 i2 i1 00 00 00 00 + 02 58 F40.0(3) "cond" 00 00 00 00 i3 i2 i2 00 00 00 00 + 02 58 F40.0(4) "cond" 00 00 00 00 i3 i2 i3 00 00 00 00 + 03 "Total" 58 "total_4" "Total" i1 i2 i4 00 00 00 00 + 05 58 "fobia" 00 00 00 00 03 00 00 i2 01 00 01 i1 i2 + 05 58 "fobia" 00 00 00 00 03 00 00 i1 00 ff ff ff ff i11 + 02 58 F40.0(0) "fobia" 00 00 00 00 i3 i2 00 00 00 00 00 00 00 00 + 02 58 F40.0(1) "fobia" 00 00 00 00 i3 i2 i1 00 00 00 00 + 02 58 F40.0(2) "fobia" 00 00 00 00 i3 i2 i2 00 00 00 00 + 02 58 F40.0(3) "fobia" 00 00 00 00 i3 i2 i3 00 00 00 00 + 02 58 F40.0(4) "fobia" 00 00 00 00 i3 i2 i4 00 00 00 00 + 02 58 F40.0(5) "fobia" 00 00 00 00 i3 i2 i5 00 00 00 00 + 02 58 F40.0(6) "fobia" 00 00 00 00 i3 i2 i6 00 00 00 00 + 02 58 F40.0(7) "fobia" 00 00 00 00 i3 i2 i7 00 00 00 00 + 02 58 F40.0(8) "fobia" 00 00 00 00 i3 i2 i8 00 00 00 00 + 02 58 F40.0(9) "fobia" 00 00 00 00 i3 i2 i9 00 00 00 00 + 02 58 F40.0(10) "fobia" 00 00 00 00 i3 i2 i10 00 00 00 00 + 03 "Total" 58 "total_4" "Total" i1 i2 i11 00 00 00 00 + + 03 "Statistics" 58 "statistics_10" "Statistics" 01 00 01 i2 01 00 01 i2 i8 + 03 "Count" 58 "count_6" "Count" i1 i2 00 00 00 00 00 00 00 00 + 03 "Expected Count" 58 "expected_count" "Expected Count" i1 i2 i1 00 00 00 00 00 + 31 i0 i0 i26: (i20: (i0 31 "row % of ^1") 58 58) "% within ^1" i1 i0 + 05 58 "cond" 00 00 00 00 i3 i2 i2 00 00 00 00 00 + 31 i0 i0 i26: (i20: (i0 31 "col % of ^1") 58 58) "% within ^1" i1 i0 + 05 58 "fobia" 00 00 00 00 i3 i2 i3 00 00 00 00 + 03 "% of Total" 58 "_pct_of_total" "% of Total" i1 i2 i4 00 00 00 00 + 03 "Residual" 58 "residual_3" "Residual" i1 i2 i5 00 00 00 00 + 03 "Std. Residual" 58 "standardized_residuals" "Standardized Residual" i1 i2 i6 00 00 00 00 + 03 "Adjusted Residual" 58 "adjusted_standardized_residual" "Adjusted Residual" i1 i2 i7 00 00 00 00 + + +tdump25 ./germano/Crosstabs/00000000013_lightTableData.bin + + i3 + + 03 "Crosstabulation" 58 "crosstabulation" "Crosstabulation" 01 00 00 i2 01 00 i1 00 i1 00 + 31 i0 i0 i27: (i21: (i0 31 "[%1: * ^1:]1") 58 58) "[%1: * ^1:]1" i1 i2 i0 + 05 58 "cond" "" i3 00 + 05 58 "fobia" "" i3 i2 i0 i0 + + 03 "Statistics" 58 "statistics_10" "Statistics" 01 00 01 i2 01 00 01 i1 i2 + 03 "N" 58 "n" "N" i1 i2 00 00 00 00 00 00 00 00 + 03 "Percent" 58 "percent_2" "Percent" i1 i2 i1 00 00 00 00 + + 03 "Cases" 58 "cases" "Cases" 01 00 01 i2 00 00 01 i2 i3 + 03 "Valid" 58 "valid" "Valid" i1 i2 00 00 00 00 00 00 00 00 + 03 "Missing" 58 "missing_observations" "Missing" i1 i2 i1 00 00 00 00 + 03 "Total" 58 "total_4" "Total" i1 i2 i2 i0 i0 + + +0427a44fc2a99165411ecd27896fe4fd/00000000013_lightTableData.bin: + + i2 + + 03 "Variables" 58 "variable_s_1" "Variables" 01 00 00 i2 01 00 i1 00 i23 00 + 31 i0 i0 i22: (i16: ("" 31 "Pair ^1") 58 58) "Pair ^1" i1 i0 + 01 58 F40.0(1) 00 00 01 i2 i-1 i2 + 05 58 "pre1.1" 00 00 00 00 i2 i2 00 00 00 00 00 00 00 00 + 05 58 "post1.1" 00 00 00 00 i2 i2 i1 00 00 00 00 00 + 31 i0 i0 i22: (i16: ("" 31 "Pair ^1" 58 58) "Pair ^1" i1 i0 + 01 58 F40.0(2) 00 00 01 i2 ff ff ff ff i2 + 05 58 "pre1.2" 00 00 00 00 i2 i2 i2 00 00 00 00 + 05 58 "post1.2" 00 00 00 00 i2 i2 i3 00 00 00 00 00 + 31 i0 i0 i22: i16: ("" 31 "Pair ^1") 58 58) "Pair ^1" i1 i0 + 01 58 F40.0(3) 00 00 01 i2 ff ff ff ff i2 + 05 58 "pre1.3" 00 00 00 00 i2 i2 i4 00 00 00 00 + 05 58 "post1.3" 00 00 00 00 i2 i2 i5 00 00 00 00 00 + ... + Data: tdump21 (germano/Crosstabs.pdf) ------------- -- 2.30.2