Gentoo Archives: gentoo-user

From: Alec Ten Harmsel <alec@××××××××××××××.com>
To: gentoo-user@l.g.o
Subject: Re: [gentoo-user] postgresql 9.5.2 versus Gentoo wiki install instructions?
Date: Sat, 21 May 2016 12:22:06
Message-Id: 7badd2fb-c8bb-c97e-7f06-36857e1971b5@alectenharmsel.com
In Reply to: Re: [gentoo-user] postgresql 9.5.2 versus Gentoo wiki install instructions? by "J. Roeleveld"
1 On 2016-05-21 07:32, J. Roeleveld wrote:
2 > On Saturday, May 21, 2016 06:51:46 AM Alec Ten Harmsel wrote:
3 >
4 >> `equery use gnumeric' gives the `libgda' flag, which should pull in
5 >> database support. I've never used it, so I don't know whether or not it
6 >> works/how well it works. What is in this spreadsheet? If it is financial
7 >> stuff, you can use Gnucash, which supports using a database as a backend.
8 > Does this finally work?
9 > Last time I tried this, half the functionality didn't work at all and the
10 > other half was buggy. (This was years ago)
11
12 I have no idea, but I'm going to test in a VM because I'm a little
13 curious now.
14
15 >>> My main problem is that columns of several thousand rows are functions
16 >>>
17 >>> based on other columns of several thousand rows. For the time-being,
18 >>> I've split up the spreadsheet into a few pieces, but a database is the
19 >>> best solution. If I could run the calculations in the database, and
20 >>> pull in the final results as static numbers for graphing, that would
21 >>> greatly reduce the strain on the spreadsheet. Or is it possible to
22 >>> graph directly from postgresql?
23 >> Here are my recommendations, in order of "least code" to "most code" (I
24 >> don't think postgresql supports graphing):
25 >>
26 >> 1. Write some sql scripts that compute the data you need and output CSV,
27 >> then import to Gnumeric and do the plots.
28 > For script examples:
29 > http://stackoverflow.com/questions/1517635/save-pl-pgsql-output-from-postgresql-to-a-csv-file
30 >
31 >> 2. Write python script(s) that run SQL commands and plot the data with
32 >> matplotlib.
33 >> 3. Write a webapp so you don't have to run scripts by hand - the plots
34 >> are generated by opening a web page.
35 > 4. Write it all in C++ :)
36
37 Qt and QCustomPlot are nice, but I'm not sure I have quite that much time.
38
39 >> Depending on how much automation you want vs. how much time you want to
40 >> spend writing/debugging code, hopefully one of those helps. I help
41 >> researchers use a HPC cluster; some are very savvy programmers, some are
42 >> not. For working on "big data" projects, some will throw raw data into a
43 >> Hadoop cluster and happily do all their work using Hadoop, while some
44 >> will put in raw data, clean it up, and then pull it out and use MATLAB,
45 >> stata, R, etc., so you just need to find the workflow that works best
46 >> for you. I personally would choose option 3, as it involves the least
47 >> amount of running scripts over and over, but to each his own.
48 >>
49 >> I have actual free time now (done with school, finally), so I might be
50 >> able to help prototype if you would like as well.
51 > Something I could use (and others):
52 > A simple PHP page which I can feed:
53 > - connection parameters to a database
54 > - select-query
55 > - which result-field to use for the horizontal axis
56 > and then plots the remaining fields for the vertical axis.
57 >
58 > I haven't checked with google yet, so if there is a decent example, I'd be
59 > interested :)
60 >
61 > --
62 > Joost
63 >
64
65 Google gave me nothing. I have not written PHP for a long time, and I'm
66 so unfamiliar with deploying/running PHP that it would take me a long
67 time to write this.
68
69 Another option is R - I just did some searching, and it supports pulling
70 data from a database. R's basic plotting functions are real nice. I
71 imagine a script could do some basic queries + plotting in 20-30 lines.
72
73 Alec