[rkward-devel] Provide a UI for CRAN mirrors

Thomas Friedrichsmeier thomas.friedrichsmeier at ruhr-uni-bochum.de
Thu Nov 26 20:06:38 UTC 2009


Hi,

On Thursday 26 November 2009, Prasenjit Kapat wrote:
> (2) If the urls are stored, then
> we'll have to do an indexOf(...) search for the hostname combobox,
> everytime the settings dialog is loaded.

not to worry. The main rule of thumb is: If each call of the code is a direct 
result of a user action, then wasting a couple thousand CPU cycles is nothing. 
Performance is often an issue for something that may run in a loop of some 
sort, but rarely for anything else.

> But the only difference (for better) would be to read the mirror list
> from getCRANmirrors() instead of the hard coded file on disk, right?

Yes.

> But remember that the hard coding is done for a specific version of R.
> If R changes, then we anyway have to recompile rkward. And as I
> commented in the code, my "ideal" solution is to create a .h file
> during the configure/make process (using CRAN_mirror_list.R) and this
> .h file will just contain the definition of two QStringLists (or even
> one list may work actually). Now, I do not know how to trigger the
> creation from either configure/make. But if you can give me a working
> .h file containing the two lists (hard coded) then I can modify
> CRAN_mirror_list.R to generate this .h file dynamically.

Yes, that would make things a lot less scary. Of course mirrors may change 
independently of the R installation (and BTW, getCRANmirrors() fetches a list 
of mirrors from the net, by default). I admit, in practice, that's probably 
not something to worry about, though.

> (2) I like the idea to give the user more readable choices, like the
> ones in the combobox (Country, State, City, Hostname), rather than the
> "choices" offered using the Tcl/Tk menu box.
> (3) Also, being able to store the choice is a plus point, I think.

Both are good points. But perhaps both are solvable without hardcoding 
anything:

1) In the settings, perhaps we could offer a "pick from list" button, which 
quite simply calls chooseCRANmirror() in R. Hence we'd have a dropdown choice, 
and still be able to save the result.
2) We could replace chooseCRANmirror() to offer a nicer menu, with all the 
additional info from getCRANmirrors().

Would that cover all wishes?

Regards
Thomas
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 198 bytes
Desc: This is a digitally signed message part.
URL: <http://mail.kde.org/pipermail/rkward-devel/attachments/20091126/5b767e82/attachment.sig>


More information about the Rkward-devel mailing list