2010-07-13 GnuCash IRC logs

00:17:55 *** fbond has quit IRC
00:58:11 *** gour has joined #gnucash
01:10:06 *** aldente has quit IRC
01:56:49 *** andyt has joined #gnucash
02:53:33 *** gour1 has joined #gnucash
02:59:54 *** gour has quit IRC
03:13:07 *** gour1 is now known as gour
03:17:42 *** gour1 has joined #gnucash
03:24:36 *** gour has quit IRC
04:08:39 <blathijs> Ah bah
04:09:10 <blathijs> I've been fiddling over an hour on my C code, while I forgot the parenthesis in the scheme lambda construct...
04:09:15 *** ErKa has joined #gnucash
04:09:54 <blathijs> warlord-afk: But, I got my list of invoices in the report now :-)
04:11:02 *** gour1 is now known as gour
04:11:29 <gour> blathijs: C code for reports?
04:12:11 * gour wonders what would warlord-afk say about using lua as 'glue' language in gnucash
04:13:19 <blathijs> gour: I was trying to build a query that selects invoices instead of splits
04:13:30 <blathijs> gour: But apparently the bindings for that were never used yet (and broken)
04:14:25 <blathijs> gour: Dunno about lua, I don't particularly like it myself. A bit verbose and not enough batteries included IMHO :-)
04:18:04 <gour> blathijs: not enough batteries is supposed to be its strenght, to prevent bloat
04:20:59 <blathijs> Yeah, OTOH, I find it annoying having to type a few lines of code everytime I want to print an array...
04:21:57 <blathijs> Or not having an array concatenation function
04:22:06 <blathijs> Those kinds of batteries :-)
04:23:45 <gour> :-)
04:24:38 <gour> otoh, for templates/reports it may be sufficient
04:27:45 <blathijs> probably, yes
04:28:18 <davr> yes, lets add lua to scheme, the more obscure scripting languages the better! :P
04:36:29 <gour> davr: lua to C ;)
05:12:53 *** daedeloth has joined #gnucash
05:48:59 <blathijs> Hmm, why does the gncEntry struct duplicated all kinds of stuff for invoices and bills?
05:49:29 <blathijs> Is that because with the chargeback stuff, the invoice and bill actually share the same entry?
06:15:24 *** gour1 has joined #gnucash
06:21:35 *** gour has quit IRC
07:05:40 *** fbond has joined #gnucash
07:19:51 <blathijs> warlord-afk: I managed to get the "reversed map" thingy working (e.g., (for <var> in <lst> do <expr-using-var>))
07:19:58 <blathijs> warlord-afk: See http://pastebin.com/R5dLXauz
07:51:05 *** Jimraehl has left #gnucash
07:52:31 *** fbond has quit IRC
08:02:02 *** Jimraehl has joined #gnucash
08:15:21 *** fbond has joined #gnucash
08:31:22 *** warlord-afk is now known as warlord
08:31:26 <warlord> blathijs: excellent.
08:32:18 <warlord> blathijs: yes
08:34:05 <warlord> Interesting. Is 'syncase' an slib thing? Or is it part of standard scheme?
08:36:12 <blathijs> warlord: Dunno, I found it after googling half the world becaue I found this page: https://ccrma.stanford.edu/courses/220a-fall-2006/docs/scm2-iter.html
08:36:33 <blathijs> Then I found the 'snd' sourceforge project, which had a loop macro defined in one of it's older releases
08:37:08 <warlord> does it work without the use-modules ?
08:37:17 <blathijs> And finally I found http://www.gnu.org/software/guile/manual/html_node/Syntax-Rules.html and http://webcache.googleusercontent.com/search?q=cache:i93WJkMhe3wJ:140.120.7.20/OpenSystem1/IntroLinux/node156.html+syntax-rules+guile&cd=2&hl=en&ct=clnk&client=iceweasel-a
08:37:37 <blathijs> Nope: Unbound variable: define-syntax
08:37:42 <warlord> Ah
08:38:11 <blathijs> brb, lunch
08:39:50 *** gour2 has joined #gnucash
08:46:51 *** gour1 has quit IRC
08:48:58 <blathijs> And now I'm off to donate blood, back in two hours. Let's see if I can get scheme's hash-table working, then :-)
08:49:48 <warlord> good luck!
09:00:35 *** Jimraehl has left #gnucash
09:03:19 *** bentob0x has joined #gnucash
09:09:06 *** daedeloth has quit IRC
09:21:13 *** Jimraehl has joined #gnucash
10:07:36 *** gour3 has joined #gnucash
10:14:49 *** gour2 has quit IRC
10:26:00 <blathijs> aha! Passing 0 to make-hash-table creates one with 0 buckets. I had expected some auto-growing thing :-)
10:27:11 <blathijs> Hmm, though the documentation does say something about auto-growing. It also thinks the size argument is optional, so I guess I'm using a different implementation, then.
10:29:30 <blathijs> warlord: Do you know of some easy way to "unpack" a list, like pattern matching in Haskell?
10:30:12 <blathijs> e.g., I'd like to write (map (lambda ((a b)) (+ a b)) (zip as bs)) to pairwise add all values from the lists as and bs
10:30:26 <warlord> no, you have to tell it how many buckets to create.
10:31:07 <blathijs> So far, I've only come up with (map (lambda (x) (let ((a (car x)) (b (cdr x))) (+ a b)
10:31:30 <blathijs> This page says that the size argument is optional, though: http://www.gnu.org/software/guile/manual/html_node/Hash-Table-Reference.html#Hash-Table-Reference
10:31:32 <warlord> Yeah, I think you'd need a list of cons cells.
10:33:05 <blathijs> a list of cons cells? I don't think my scheme knowledge is sufficient to understand that. Could you expand a bit? :-)
10:33:37 <blathijs> AFAIK, "cons" puts an element on top of a list, right? So (1 2 3) == (cons 1 (cons 2 (cons 3 ())))
10:33:40 *** gour4 has joined #gnucash
10:33:50 <blathijs> so a list always contains cons thingies?
10:39:14 <warlord> Right, but I'm more thinking something like (list (cons a1 b1) (cons a2 b2) (cons a3 b3))
10:39:41 <warlord> which would look like: '((a1 . b1) (a2 . b2) (a3 . b3))
10:41:09 *** gour3 has quit IRC
10:41:36 <blathijs> Ah, right. I think that is what (zip as bs) actually produces
10:42:42 <blathijs> Hey! Map already does the pairwise stuff by itself
10:42:58 <blathijs> I can just write (map (lambda (a b) (+ a b)) as bs) according to the manual
10:43:05 <warlord> cool
10:44:41 <blathijs> But how to do that in my (for) macro? :-)
10:44:47 <warlord> no clue
10:45:24 <blathijs> Something with ... probably. Let's google.
10:48:28 *** gour4 is now known as gour
10:49:03 <gour> blathijs: haskell has zip function
10:54:57 *** ErKa has quit IRC
10:57:41 *** markjenkinsparit has quit IRC
11:00:08 <blathijs> gour: Yeah, how is that relevant? Scheme also has a zip function, but no real pattern matching
11:00:25 <blathijs> gour: Or were you suggesting to use Haskell as a scripting language for reports? :-p
11:00:52 <gour> blathijs: ahh...was not following close enough what are you doing and i'm not schemer either
11:02:34 <warlord> blathijs: scheme has regex
11:02:53 <warlord> .. or is that not the kind of "pattern matching" you're looking for?
11:03:51 <blathijs> No, I'm looking to pattern match on list structures
11:04:39 <blathijs> e.g., in Haskell, you can define a function "foo [a, b, c] = ...", which then takes a single list argument that must contain exactly three elements
11:04:48 <blathijs> which are assigned to a, b and c
11:06:43 <gour> haskell is great language...
11:06:58 *** markjenkinsparit has joined #gnucash
11:07:38 <warlord> Oh, no, you can't do that. You can only match on #args, not the structure of the arguments.
11:08:38 <gour> foo (a:b:c) would be in haskell
11:08:56 <blathijs> gour: foo [a, b, c] also works
11:09:07 <blathijs> gour: And your example would be (a:b:c:[]) AFAICS
11:09:18 <blathijs> or (a:b:rest) of course
11:09:45 <blathijs> Anyway, I mostly needed it to loop over multiple lists, but it seems map and for-each can do that out of the box
11:10:04 <blathijs> and now it also looks like I changed my for macro to support it as well
11:10:21 <blathijs> for (a b) in (as bs) do (+ a b)
11:20:03 * gour is not (yet) involved into scheming
11:21:40 <blathijs> Scheme is actually quite nice. A bit parenthesis-heavy, though :-p
11:23:09 *** KaiForce has joined #gnucash
11:23:51 <warlord> drowning in a sea of parenteses.
11:28:55 * gour cosniders haskell's syntax is very clean & noisy-free
11:30:29 <blathijs> Yeah, Haskell is quite nice as well. Scheme looks a bit less consistent at first glance...
11:49:46 <blathijs> warlord: It seems the size argument to make-hash-table got optional in 1.8
11:49:59 <warlord> Ah. Well, we still need to support 1.6
11:57:10 <blathijs> Yeah, I'm still running 1.6 as well it seems
11:59:26 <gour> will 2.4 be able to support new guile?
12:08:31 <warlord> I *think* it should support guile 1.9/2.0
12:39:43 *** aldente has joined #gnucash
12:43:12 <blathijs> warlord: Any clue why gncTaxTableEntryGetTable is in the private interface? I can't use it from scheme now
12:44:18 <warlord> blathijs: why do you need the table from the entry?
12:44:54 <warlord> Or, put another way -- How did you get an access to a TaxTableEntry WITHOUT already having the TaxTable?
12:52:41 <blathijs> I didn't but I'm storing entries in a hash table
12:52:57 <blathijs> I could of course store the table with them
12:53:17 <blathijs> or do some nested stuff
12:53:31 <blathijs> but it surprised me that the function was private
12:57:06 <warlord> Why are you storing individual entries in the hash table? generally it's the full table that really matters.
13:10:06 *** gary has quit IRC
13:15:08 *** gary has joined #gnucash
13:25:19 <blathijs> warlord: Yeah, I also realized that
13:25:31 <blathijs> though sometimes you might want to get per-entry values, I guess
13:25:41 <blathijs> you can also set an account per-entry, right?
13:26:32 <warlord> Yes, that's how you deal with multiple taxes..
13:30:18 <blathijs> So if it makes sense to split out different taxes to different accounts, I guess it also makes sense to separate them in the tax report
13:30:32 <blathijs> I don't particularly need it, though
13:30:43 <blathijs> (And they'd have to be grouped per tax table, of course)
13:33:08 <warlord> Sure, but that doesn't mean you need to walk up the tree.
13:34:13 <blathijs> Yes, so I don't need the gncTaxTableEntryGetTable function
13:34:26 <blathijs> I was just surprised with its private-ness
13:36:54 <warlord> The system was designed top-down
13:37:10 <warlord> There's no way to obtain an entry without having the table.
13:37:20 <warlord> So there's no need to "walk up"
13:41:49 <blathijs> ok
14:03:32 *** cortana has joined #gnucash
14:05:32 <blathijs> This seems to be working
14:05:55 <blathijs> now to put stuff in a proper table
14:07:26 <warlord> :-D
14:07:31 <warlord> You doing it in eguile?
14:08:02 <blathijs> yup
14:08:17 <blathijs> I didn't feel like learning _another_ templating thingy :-)
14:08:23 <blathijs> (or rather, HTML generation thingy)
14:09:14 <warlord> :)
14:17:23 <blathijs> warlord: When calculating the tax values, I get gnc_numerics
14:17:43 <blathijs> shouldn't those be gnc_monetaries or something?
14:17:53 <blathijs> Or, how do I know the currency of the values?
14:19:39 <warlord> There's no exchanges going on... They are in the currency of the invoice.
14:19:56 <warlord> (the biz features have all been mono-currency)
14:20:03 <warlord> .. I dont know how it was extended.
14:22:09 <blathijs> It could be that the currency of the account the taxes end up is different from the currency of the invoice, right?
14:22:27 <blathijs> But, how do I get at that mono-currency? through the invoice owner, I guess?
14:23:28 <warlord> Nope, gncInvoiceGetCurrency
14:26:52 <blathijs> right.
14:31:43 *** bentob0x has quit IRC
14:33:10 <blathijs> Argh, nesting stuff is mean to me: ERROR: In procedure list: ERROR: end of file
14:34:46 <blathijs> Ah, found it
14:35:56 <warlord> This is why emacs lisp-mode is so useful. :)
14:40:21 <blathijs> hehe
14:41:03 <blathijs> vim has some parenthesis matching stuff, but it doesn't know eguile (And I had forgotten a <?scm tag, so the final closing parenthesis was not in Scheme, but in HTML)
14:49:50 <warlord> Oh. oops. Yeah, emacs probably wouldn't help there.
15:07:04 <blathijs> Hm, of course different invoics can have different currencies...
15:07:38 <blathijs> To sum up different currencies (and probably split them out at the end), what would I need? A commodoty-collector?
15:11:09 <warlord> Yes
15:11:25 <blathijs> Is a commodity the same as a currency?
15:19:36 *** Dave_is_sexy has joined #gnucash
15:20:01 <Dave_is_sexy> Hey guys. Any chance of a "Present Total" column for the accounts view?
15:20:21 <blathijs> A total of what, exactly?
15:20:24 <warlord> blathijs: a currency is a subtype of commodity
15:20:51 <warlord> Dave_is_sexy: Have you checked if one exists? I thought there was one.
15:21:18 <Dave_is_sexy> Nope. There's Total and Present, but not a combi one
15:22:14 <Dave_is_sexy> Without Present Total you can't see what all your assets and liabilities add up to right now (if you've already added future transactions)
15:23:04 <warlord> Ah. Well, supply a patch ;)
15:23:09 <warlord> Adding a column is pretty simple.
15:23:13 <warlord> (in C)
15:24:51 <blathijs> warlord: Is there a way to get backtraces for errors in eguile AFAYK?
15:25:14 <warlord> blathijs: um, check your gnucash.trace?
15:26:48 <blathijs> Nope, --debug didn't help either
15:27:53 <blathijs> I've found the relevant code in eguile-gnc.scm, though, so I'll see what I can do there
15:31:03 <warlord> ok
15:41:49 <Dave_is_sexy> Adding a column may be simple in C if you know where to put it ;)
15:43:40 <warlord> Search for those other column names in the sources. ;)
15:43:47 <warlord> ... put it in the same place
15:51:31 <Dave_is_sexy> lol :) I'll wait for someone who knows what they're doing to add it
15:54:33 <Dave_is_sexy> I'm a bit stuck on an accounts problem as it happens. A few years ago I got some housing benefits while i was out of work for a few months. Currently I have it between assets:checking_account and expenses:rent:housename:benefit where it appears negative and lets me see the total rent for the year offset by a few hundred pounds benefit. But, it seems like it should also have a presence between income:benefit:housing and as
15:55:38 *** gour has quit IRC
16:05:03 <blathijs> awesome, I got guile to segfault
16:10:44 <warlord> sweet!
16:10:51 <warlord> you're not supposed to be able to do that!
16:11:10 <blathijs> I passed in a procedure to display-backtrace :-)
16:11:24 <blathijs> e.g., current-output-port instead of (current-output-port)
16:11:40 <blathijs> I got a backtrace, but now it includes some extra junk from the error handler...
16:13:57 <warlord> ok
16:16:00 <blathijs> If I cut off the last three stack entries, it should work out.
16:20:15 <warlord> ok
16:23:38 <blathijs> warlord: What's the difference between use-modules and gnc:module-load ?
16:24:56 <warlord> use-modules is purely for scheme modules. gnc:module-load is to load a GNC module (scheme+C)
16:25:04 <blathijs> ah
16:25:28 <blathijs> I'll just put the error in <pre> tags, though, instead of loading the html-utilities and using nl->br
16:25:47 <warlord> ok
16:30:15 <blathijs> Hmm, the backtrace is a bit impressive now
16:30:32 <blathijs> over two-thirds is irrelevant gnucash code...
16:32:19 <warlord> heh
16:51:42 *** KaiForce has quit IRC
17:16:59 *** fbond has quit IRC
17:30:14 <blathijs> Awesome, seems like the backtrace thing works completely now
17:31:48 <warlord> cool
17:33:58 <blathijs> warlord: The patch is here, if you're interested: http://www.stdout.nl/static/tmp/show-eguile-backtrace.patch
17:34:08 <blathijs> Now it is _really_ time for me to go to bed :-)
17:34:25 <warlord> heh. good night, blathijs. Did you see my email to the lists?
17:34:30 <blathijs> (didn't even get around to debugging the initial error using the backtrace :-p)
17:34:40 <blathijs> warlord: Not sure, I'm not subscribed to -user
17:35:29 <warlord> I sent to both -user and -devel
17:37:15 <blathijs> about what?
17:37:35 <blathijs> Ah, your Holland trip? :-)
17:38:19 <blathijs> Ah, you're Derek? :-)
17:38:39 <blathijs> warlord: We might try meeting up, could be nice
17:38:41 <blathijs> but now, sleep!
17:38:59 <warlord> Good night
17:39:08 <warlord> :-D
17:53:33 *** andyt has quit IRC
18:22:49 <Dave_is_sexy> I have a really hard question. Does anyone know how to get GnuCash to automatically work out the daily interest on my mortgage?
18:34:03 <warlord> what do you mean "daily interest"?
18:35:07 *** bonez has joined #gnucash
18:35:40 <bonez> I like gnucash and am working with it more every day to figure it out.. I would like something that is web accessible though..
18:39:42 *** ErKa has joined #gnucash
18:40:35 <Dave_is_sexy> Some offset mortgages calculate interest daily. I found GnuCash's loan repayment wizard and put some numbers in.
18:46:36 <warlord> bonez: then you'll have to go elsewhere. GnuCash isnt
18:47:30 <warlord> Dave_is_sexy: gnucash's interest calculation is extremely basic. You basically only can tell it whether to compute interest up front or in arrears. I dont think it'll deal with different compounding methods.
18:49:18 <Dave_is_sexy> Warlord: Aw. Why doesn't someone improve it?
18:49:57 <warlord> Dave_is_sexy: go for it! Patches always welcome
18:50:27 <Dave_is_sexy> Ha. I thought you might say that. While I'd love to, I wouldn't have a clue.
18:51:19 <Dave_is_sexy> Is GnuCash behind the competition, or are they all a bit naff at working stuff out?
18:52:04 <warlord> What competition?
18:52:15 <bonez> warlord: no disrespect..
18:52:25 <Dave_is_sexy> Quicken and MS Money
18:52:52 <warlord> Dave_is_sexy: Those aren't open source, so they don't count.
18:53:00 <Dave_is_sexy> ha
18:53:23 <warlord> Dave_is_sexy: seriously. Give me 5 full-time paid people to work on GnuCash and it would blow all of those apps out of the water!
18:53:27 <Dave_is_sexy> how on earth has it worked out my mortgage repayment? that was clever
18:53:46 <warlord> bonez: none taken
18:54:53 <Dave_is_sexy> warlord, you know what would be really good? If GnuCash could take interest rates off something like an rss feed
18:55:20 <warlord> Sure! Send in the patch!
18:55:28 <warlord> Sounds like a great idea
18:55:49 <Dave_is_sexy> cos then it could change the interest rate in the scheduled transaction and the next transaction would be right. Probably
18:56:20 <Dave_is_sexy> When I eventually learn C, I'll be all over this project. How's that?
18:56:41 <warlord> Sounds great.
18:56:52 <warlord> (actually, I think the finance computations might be implemented in Scheme)
18:57:25 <Dave_is_sexy> what's Scheme?
18:57:54 <davr> basically it's Lisp
18:58:24 <Dave_is_sexy> So to do an offset mortgage, do I have to merge the liability and offset asset account?
18:58:56 <Dave_is_sexy> will it work out daily interest if i do?
19:00:24 <warlord> I dont know. You'd probably have to implement the daily interest computation. Also, there is no balance-as-of-date function, either, so it can't handle pre-payment of principal.
19:03:12 <Dave_is_sexy> Oh. So we're no-where near then. Hmm
19:04:28 <Dave_is_sexy> Shouldn't this be a priority? I mean, loans and repayments happen all the time in personal finances
19:06:56 <Dave_is_sexy> Does GnuCash have an API? If so I'm sure I could write a more thorough Scheduled Transactions tool
19:07:03 <warlord> "should" is such a strong word..
19:07:14 <warlord> Of course it does. In C and Scheme
19:07:23 <warlord> But you already said you don't know those languages...
19:07:34 <Dave_is_sexy> I mean an accessible API
19:07:50 <Dave_is_sexy> Like Firefox and AutoCAD have
19:08:29 <warlord> I've never looked at FireFox's API, and I've never touched AutoCAD so those references mean nothing to me
19:08:43 <warlord> But I would argue about your use of the word "accessible"
19:09:19 <Dave_is_sexy> An API is an interface designed to allow you to control the program externally. If you have to control the program internally in it's native language, that's not really an API
19:10:24 <warlord> Technically, an API is "Advanced Programmer Interface". There is NOTHING that says that an API must be in a different language than the native language the app is written in. But going by your bastardized definition, Scheme
19:10:56 <Dave_is_sexy> No you're wrong. APIs are for programs to talk to each other. They aren't language specific
19:11:43 <Dave_is_sexy> If GnuCash had an API, you'd be able to a) control it from any langauge b) control it without having to touch the source code
19:12:18 <warlord> Sorry, Dave.
19:12:47 <warlord> "An application programming interface (API) is an interface implemented by a software program which enables it to interact with other software."
19:12:58 <warlord> It says nothing specifically about "any language"
19:13:07 <warlord> Or even "different language"
19:13:35 <warlord> I would agree about your "not having to touch the source code", but headers != source code in this case.
19:13:51 <warlord> .... However GnuCash doesn't provide that level of hook'ing.
19:14:59 <Dave_is_sexy> Look, if you don't know what it is that's not my problem. "other software" can be written in any language. once it's compiled it doesn't matter what it was written in, hence it can be any langauge by definition. what you're saying is a million miles from an API. It's barely even an "I"
19:15:00 <warlord> However, you CAN control many aspects of gnucash through the scheme bindings without touching the gnucash source code (except in the cases where the bindings are broken).
19:15:28 <warlord> whatever.
19:15:30 *** warlord is now known as warlord-afk
19:15:40 *** Dave_is_sexy has left #gnucash
19:37:11 *** cortana has quit IRC
19:37:21 *** cortana has joined #gnucash
20:32:44 *** ErKa has quit IRC
20:37:20 *** Jimraehl has left #gnucash
20:44:55 *** Jimraehl has joined #gnucash
20:53:59 *** cortana has quit IRC
21:23:13 *** fbond has joined #gnucash
21:51:45 *** bonez has left #gnucash
22:24:13 *** warlord-afk is now known as warlord
23:29:08 *** fbond has quit IRC
23:54:54 *** gour has joined #gnucash