Re: [rkward-devel] import/export CSV

2014-12-02 Thread Thomas Friedrichsmeier
Hi,

On Monday 01 December 2014 22:11:39 meik michalke wrote:
 here's a refined version, what do think of the restructured comments?

definitely better, IMO. I'd suggest also putting all implicit paramteres on a 
single line of the comment, though, so the comment does not push the actual 
code out of sight.

Some more small items:
- When specifying custom sep / dec, that generates sep=other/dec=other.
- Quote all values would more appropriately be labelled Quote all strings
- Typo on varselector-label: varaible

Again, I think it may make sense to move the format specs to the first tab 
(and file encoding somewhere else). Sure, that makes for a rather largish 
dialog, but I think it's still just acceptable. To help reduce height, you 
can:
- Set the labels of the inputs for custom dec/sep to  (these are definitely 
expendable, IMO)
- Set the label of the file name selector to . Probably self-explanatory.
- As a rather desparate (but effective) measure, you could put varslot and 
browser on the same row.

Regards
Thomas


signature.asc
Description: This is a digitally signed message part.
--
Download BIRT iHub F-Type - The Free Enterprise-Grade BIRT Server
from Actuate! Instantly Supercharge Your Business Reports and Dashboards
with Interactivity, Sharing, Native Excel Exports, App Integration  more
Get technology previously reserved for billion-dollar corporations, FREE
http://pubads.g.doubleclick.net/gampad/clk?id=157005751iu=/4140/ostg.clktrk___
RKWard-devel mailing list
RKWard-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/rkward-devel


Re: [rkward-devel] import/export CSV

2014-12-02 Thread meik michalke
hi,

thanks for the fast feedback.

Am Dienstag, 2. Dezember 2014, 09:59:12 schrieb Thomas Friedrichsmeier:
 On Monday 01 December 2014 22:11:39 meik michalke wrote:
  here's a refined version, what do think of the restructured comments?
 
 definitely better, IMO. I'd suggest also putting all implicit paramteres on
 a single line of the comment, though, so the comment does not push the
 actual code out of sight.

ok, fixed.

 Some more small items:
 - When specifying custom sep / dec, that generates sep=other/dec=other.

oops... fixed.

 - Quote all values would more appropriately be labelled Quote all
 strings

fixed.

 - Typo on varselector-label: varaible

fixed.

 Again, I think it may make sense to move the format specs to the first tab
 (and file encoding somewhere else). Sure, that makes for a rather largish
 dialog, but I think it's still just acceptable.

shuffling around elements is no problem, i'll try something. however:

 - Set the labels of the inputs for custom dec/sep to  (these are
 definitely expendable, IMO)
 - Set the label of the file name selector to . Probably self-explanatory.

that could actually help, if i manage to get rkwarddev to write empty strings 
into its objects... currently, it leaves the labels out and RKWard auto-fills 
them.

generally: should i simply already add the XML and JS file to git already? if 
so, should i also put the rkwarddev script somewhere there, or would you like 
to have its results, only?


viele grüße :: m.eik

-- 
  dipl. psych. meik michalke
  institut fur experimentelle psychologie
  abt. fur diagnostik und differentielle psychologie
  heinrich-heine-universitat d-40204 dusseldorf

signature.asc
Description: This is a digitally signed message part.
--
Download BIRT iHub F-Type - The Free Enterprise-Grade BIRT Server
from Actuate! Instantly Supercharge Your Business Reports and Dashboards
with Interactivity, Sharing, Native Excel Exports, App Integration  more
Get technology previously reserved for billion-dollar corporations, FREE
http://pubads.g.doubleclick.net/gampad/clk?id=157005751iu=/4140/ostg.clktrk___
RKWard-devel mailing list
RKWard-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/rkward-devel


Re: [rkward-devel] import/export CSV

2014-12-02 Thread Thomas Friedrichsmeier
Hi,

On Tuesday 02 December 2014 11:46:52 meik michalke wrote:
 shuffling around elements is no problem, i'll try something. however:
  - Set the labels of the inputs for custom dec/sep to  (these are
  definitely expendable, IMO)
  - Set the label of the file name selector to . Probably
  self-explanatory.
 
 that could actually help, if i manage to get rkwarddev to write empty
 strings into its objects... currently, it leaves the labels out and RKWard
 auto-fills them.

I see. Would it have any negative side-effect, if you just remove the check 
for nchar  0 in pasteXMLAttr?
 
 generally: should i simply already add the XML and JS file to git already?
 if so, should i also put the rkwarddev script somewhere there, or would you
 like to have its results, only?

I'm still not sure what is the best way to handle this. But we already have 
one rkwarddev script in plugins/rkwarddev_scripts, and so you can simply 
follow that path for now.

Of course, having both in git is potentially asking for trouble. Sooner or 
later someone (or a script) will overlook the warning at the top of the 
generated files, and make changes, there, which are not represented in the 
rkwarddev-script. Ideally, rkwarddev-based plugins would be generated during 
cmake, somehow(*), and git-ignored...

Regards
Thomas

(*): But that is not trivial, either
- Should work without prior installation of XiMpLe and rkwarddev
- Need to make sure the generated files go to the correct location
- Should ideally detect and warn about edits by hand (perhaps by storing a 
timestamp inside the generated file, or something)

signature.asc
Description: This is a digitally signed message part.
--
Download BIRT iHub F-Type - The Free Enterprise-Grade BIRT Server
from Actuate! Instantly Supercharge Your Business Reports and Dashboards
with Interactivity, Sharing, Native Excel Exports, App Integration  more
Get technology previously reserved for billion-dollar corporations, FREE
http://pubads.g.doubleclick.net/gampad/clk?id=157005751iu=/4140/ostg.clktrk___
RKWard-devel mailing list
RKWard-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/rkward-devel


Re: [rkward-devel] import/export CSV

2014-12-01 Thread Thomas Friedrichsmeier
Hi,

On Sunday 30 November 2014 23:19:48 meik michalke wrote:
 as promised, i completely re-wrote the export tabular data dialog. it's
 attached[*] as a pre-built plugin package so you can check it out (it also
 includes the rkwarddev script used to build it).

will give it a look, shortly.
 
 it defaults to custom file format at the moment -- CSV or CSV2 could be
 better choices, but this deactivates some elements and could confuse some
 people, couldn't it?

I wouldn't be too afraid of that, in particular, as the File format 
preselection, and the elements controlled by it are all on the same tab. State 
that on the .rkh-page to be on the safe side. Also, exporting to one of the 
standard formats is certainly the most common thing to do, and should be 
easiest.

 i have a question regarding the current plugin:
 
 what plugin is referred to by use the plugin 'write' for mere variables?
 is it Write vector / matrix? generally, can i somehow refer to a plugin
 so that my dialog fetches its current name (dialog label) dynamically? i
 guess not -- would be cool to have it as a direct link, shown as the path
 from its root menu.

As to that warning:
a) It seems to be pretty useless (and in fact rather misleading) in the first 
place. I suppose it might have had a real meaning some time in the past 
(before we were running plugin code inside local(), for instance.
b) If at all, it should go to the help page.

The plugin, referred to, would be save_variables, inded. You can refer to 
that in the .rkh page (see above) using link 
href=rkward://component/save_variables/, which will insert the correct 
label, automatically (and menu-path might be added, later).

 and one questions regarding the import CSV plugin: what does this logic
 statement do?
 
   connect client=commentchar.enabled governor=quickNone /

Well, it disables specification of the commentchar (effectively disabling 
comments), if any of the pre-defined formats is selected. I believe the 
rationale for that is:
- For the predefined formats, code using read.csv(2) / read.delim(2) is 
generated, for easier copying of code.
- These default to comment.char=, instead of # for read.table().
- Cleanly covering that in the UI would have been rather cumbersome, and did 
not seem worth bothering (as comment-lines inside csv-files should be rather 
uncommon, in the first place).

Regards
Thomas

signature.asc
Description: This is a digitally signed message part.
--
Download BIRT iHub F-Type - The Free Enterprise-Grade BIRT Server
from Actuate! Instantly Supercharge Your Business Reports and Dashboards
with Interactivity, Sharing, Native Excel Exports, App Integration  more
Get technology previously reserved for billion-dollar corporations, FREE
http://pubads.g.doubleclick.net/gampad/clk?id=157005751iu=/4140/ostg.clktrk___
RKWard-devel mailing list
RKWard-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/rkward-devel


Re: [rkward-devel] import/export CSV

2014-12-01 Thread Thomas Friedrichsmeier
Hi,

On Sunday 30 November 2014 23:19:48 meik michalke wrote:
 as promised, i completely re-wrote the export tabular data dialog. it's
 attached[*] as a pre-built plugin package so you can check it out (it also
 includes the rkwarddev script used to build it).

ok, some first comments, below. Minor stuff, only.
 
 it defaults to custom file format at the moment -- CSV or CSV2 could be
 better choices, but this deactivates some elements and could confuse some
 people, couldn't it?

See my last mail. I think defaulting to CSV (_not_ CVS2!) would be sensible.

Assorted comments:
- Why is the append option controlled by the predefined format?
- Uncommenting arguments, that do not apply, is a nifty idea, but does come 
with some drawbacks:
  - Bloats the generated code
  - Seems to suggest that these _could_ be customized for write.csv(2). 
However, the R help says: append, col.names, sep, dec and qmethod cannot be 
altered. I'd suggest stripping these.
- Remove the data.frame-warning (see my last mail).
- For encoding specification, import_spss and import_stata share some code 
(currently in the form of a snippet. It might make sense to turn this into 
an embeddable plugin, and use it.

Regards
Thomas

signature.asc
Description: This is a digitally signed message part.
--
Download BIRT iHub F-Type - The Free Enterprise-Grade BIRT Server
from Actuate! Instantly Supercharge Your Business Reports and Dashboards
with Interactivity, Sharing, Native Excel Exports, App Integration  more
Get technology previously reserved for billion-dollar corporations, FREE
http://pubads.g.doubleclick.net/gampad/clk?id=157005751iu=/4140/ostg.clktrk___
RKWard-devel mailing list
RKWard-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/rkward-devel


Re: [rkward-devel] import/export CSV

2014-12-01 Thread meik michalke
hi,

Am Montag, 1. Dezember 2014, 11:12:48 schrieb Thomas Friedrichsmeier:
 See my last mail. I think defaulting to CSV (_not_ CVS2!) would be sensible.

ok, i'm all for it.

 Assorted comments:
 - Why is the append option controlled by the predefined format?

you just wrote it yourself:

 append, col.names, sep, dec and qmethod cannot be altered.
  

;-)

that option and the column names are the deactivated settings i was referring 
to, for write.csv() and write.csv2(). they are not all on the same tab -- i 
tried to make the dialog as similar to the import plugin as possible, but 
there are quite some differences.

 - Uncommenting arguments, that do not apply, is a nifty idea, but does come
 with some drawbacks:
   - Bloats the generated code
   - Seems to suggest that these _could_ be customized for write.csv(2).
 However, the R help says: append, col.names, sep, dec and qmethod cannot be
 altered. I'd suggest stripping these.

sure, this is only an idea. but let me explain how it came to this: firstly, i 
was thinking about people who want to learn R; there should also appear an 
explaining comment above the write.csv() call explaining that the commented 
options cannot be changed here (btw, if you try, write.csv() throws a warning 
saying the same). secondly, the commented options show the value that they're 
set to internally; for instance, col.names depends on the setting of 
row.names.

@aaron: what do you think would be most useful? the generated code currently 
reads:

  # some options can't be changed with write.csv()
  # they have been commented out to show the values they are set to
  write.csv(
x=,
file=,
#append=FALSE,
#sep=,,
eol=\n,
na=NA,
#dec=.,
row.names=TRUE,
#col.names=NA,
#qmethod=double,
fileEncoding=
  )

the stripped alternative would be:

  write.csv(
x=,
file=,
eol=\n,
na=NA,
row.names=TRUE,
fileEncoding=
  )

the R code currently also includes all defaults. if we want to strip it down 
to the absolutely necessary arguments only, it would result in just this:

  write.csv(
x=,
file=
  )

 - Remove the data.frame-warning (see my last mail).

with pleasure.

 - For encoding specification, import_spss and import_stata share some code
 (currently in the form of a snippet. It might make sense to turn this into
 an embeddable plugin, and use it.

i actually included that snipped first, but it added another full tab and had 
a checkbox for converting strings which i didn't find the best wording here. 
so i copied the dropdown menu -- and added the checked (default) option, 
since write.table() defaults to 'fileEncoding='.

having something to embed would be great, but i still didn't really get how to 
write an embeddable plugin ;-)


viele grüße :: m.eik

-- 
  dipl. psych. meik michalke
  institut fur experimentelle psychologie
  abt. fur diagnostik und differentielle psychologie
  heinrich-heine-universitat d-40204 dusseldorf

signature.asc
Description: This is a digitally signed message part.
--
Download BIRT iHub F-Type - The Free Enterprise-Grade BIRT Server
from Actuate! Instantly Supercharge Your Business Reports and Dashboards
with Interactivity, Sharing, Native Excel Exports, App Integration  more
Get technology previously reserved for billion-dollar corporations, FREE
http://pubads.g.doubleclick.net/gampad/clk?id=157005751iu=/4140/ostg.clktrk___
RKWard-devel mailing list
RKWard-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/rkward-devel


Re: [rkward-devel] import/export CSV

2014-12-01 Thread Thomas Friedrichsmeier
Hi,

On Monday 01 December 2014 12:14:19 meik michalke wrote:
  Assorted comments:
  - Why is the append option controlled by the predefined format?
 
 you just wrote it yourself:
  append, col.names, sep, dec and qmethod cannot be altered.
 
   
 
 ;-)

yes, it occurred to me a few minutes after sending the mail...
 
 that option and the column names are the deactivated settings i was
 referring to, for write.csv() and write.csv2(). they are not all on the
 same tab

Yes. I see that now. And for the append option that is particularly 
unfortunate (but changing the default to custom does not help at that point, 
either; quite the contrary: If you first check append on the first tab, then 
select CSV on the second tab, you may be in for a nasty surprise!).

Have you tried moving all format options to the first tab? Perhaps moving 
encoding to a less prominent place?

 sure, this is only an idea. but let me explain how it came to this: firstly,
 i was thinking about people who want to learn R;

Yes, neither alternative is clearly superior to the other. But on the other 
side of the coin, listing all these parameters makes it harder to see just 
what you changed from the default.
Besides, this still does not explain what other values are permissible for 
each argument. Particularly for parameters with non-obvious semantics, such as 
col.names (and I don't think anyone would guess the correct meaning of 
col.names=NA without consulting the documentation).

[...]

 the R code currently also includes all defaults.

Except for quote.

 having something to embed would be great, but i still didn't really get how
 to write an embeddable plugin ;-)

Simple: Just like any standalone plugin (including a dialog).

The additional thing to worry about is passing information between embedded 
and embedding plugin. The standard ways are:
1) Providing external-properties in the embedded plugin.
2) Generating code the usual way. The embedding plugin can retrieve that using
  getString (embedded_id.code.calculate);
etc.

Oh, one more thing:
- The export plugin's .js code still lacks appropriate i18n()-calls. Consider 
utilizing the new Header()-functionality to make that easier 
(http://www.mail-archive.com/rkward-devel@lists.sourceforge.net/msg02499.html).

Regards
Thomas

signature.asc
Description: This is a digitally signed message part.
--
Download BIRT iHub F-Type - The Free Enterprise-Grade BIRT Server
from Actuate! Instantly Supercharge Your Business Reports and Dashboards
with Interactivity, Sharing, Native Excel Exports, App Integration  more
Get technology previously reserved for billion-dollar corporations, FREE
http://pubads.g.doubleclick.net/gampad/clk?id=157005751iu=/4140/ostg.clktrk___
RKWard-devel mailing list
RKWard-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/rkward-devel


Re: [rkward-devel] import/export CSV

2014-12-01 Thread meik michalke
hi,

here's a refined version, what do think of the restructured comments?


viele grüße :: m.eik

--
  dipl. psych. meik michalke
  institut fur experimentelle psychologie
  abt. fur diagnostik und differentielle psychologie
  heinrich-heine-universitat d-40204 dusseldorf

signature.asc
Description: This is a digitally signed message part.


ExportTableCSVfiles_0.01-0.tar.gz
Description: application/compressed-tar
--
Download BIRT iHub F-Type - The Free Enterprise-Grade BIRT Server
from Actuate! Instantly Supercharge Your Business Reports and Dashboards
with Interactivity, Sharing, Native Excel Exports, App Integration  more
Get technology previously reserved for billion-dollar corporations, FREE
http://pubads.g.doubleclick.net/gampad/clk?id=157005751iu=/4140/ostg.clktrk___
RKWard-devel mailing list
RKWard-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/rkward-devel