IRC channel logs

2014-02-24.log

back to list of logs

***ijp` is now known as ijp
***Yawar_ is now known as Yawar
<nalaginrut>morning guilers~
<Onslauth>Hi guys, I have a few questions regarding ice-9 and modified-julian-day
<Onslauth>Also regarding date
<Onslauth>Internally it looks like everything is based off of UTC?
<Onslauth>So if I do something like
<Onslauth>(define utc-jdn (date->modified-julian-day (current_date 0)))
<Onslauth>and
<Onslauth>(define tz-jdn (date->modified-julian-day (current_date)))
<Onslauth>the values are the same?
<nalaginrut>Onslauth: IMO, it's local time if you don't pass time zone, or it's the time zone specified by you
<Onslauth>I can show you output
<Onslauth>nalaginrut - I would have expected that too, but it seems to always be UTC
<Onslauth>julian-day always seems to be the UTC value, and never includes the timezone.
<Onslauth> https://gist.github.com/onslauth/9183578
<Onslauth>Ah
<Onslauth>hi Wingo, I dont suppose you might know an easy way to solve the problem I am having with dates and julian-day?
<Onslauth>I am having issues with julian-day not including the timezone when converting from date to julian-day
<Onslauth> https://gist.github.com/onslauth/9183578
<Onslauth>nalaginrut - You get the gist before you split?
<nalaginrut>Onslauth: no, I don't, my connection is down
<Onslauth>Ok - https://gist.github.com/onslauth/9183578
<nalaginrut>Onslauth: Julian Day uses GMT+0, so...
<nalaginrut>it's unrelative to timezone, although you specified it
<Onslauth>Yeah. Julian day is great for log file rotation. i.e. rotate at midnight
<Onslauth>but without the timezone, it rotates at midnight + timezone
<nalaginrut>when you convert it to Julian day, they're in same hour, so the difference between utc-jdn and sast-jdn was eliminated
<Onslauth>They should be different by 2 hours
<nalaginrut>let me check it out in another Scheme implementation
<Onslauth>but if you say its working off utc then its ok. I'll figure out a way of getting the tz into the value.
<nalaginrut>I mean the timezone is eliminated during the conversion
<nalaginrut>and it's the same hour in Racket
<Onslauth>But is there no way to keep the tz when converting to julian day?
<Onslauth>I would have expected the julian day conversion to take into account the timezone if one is specified in the date?
<nalaginrut>as I said, Julian day is +0, so there's no difference even you specified it in current-date
<Onslauth>But then to make it useful you have to calculate your tz separately in julian day and add it?
<nalaginrut>Onslauth: http://stats.stackexchange.com/questions/17176/do-julian-day-number-handle-timezone-offset
<Onslauth>Is it possible to get the timezone from the (current_date) object?
<nalaginrut>Onslauth: well, I've no idea about your usage, it's rarely to use Julian day for me ;-)
<Onslauth>Ok, so can I get the timezone from the current_date object?
<Onslauth>nalaginrut - julian date is great for working with date-time as a decimal value.
<nalaginrut>Onslauth: you may checkout srfi-19 for it: http://srfi.schemers.org/srfi-19/srfi-19.html
<nalaginrut>date-zone-offset is what you need, I think
<Onslauth>Thanks
<Onslauth>Yeah I just found it
<Onslauth>Thanks for all the help nalaginrut
<nalaginrut>np ;-)
<didi>Using GOOPS, I have a <base> class with a #:init-value slot `foo' as (list 1 2). I want to write a <derived> class from <base> with a #:init-value slot `foo' as (list 1 2 3). Is it possible to use some incantation so I only have to write in <derived> (list 3) and it generates a `foo' as (list 1 2 3), i.e., the list defined on <derived> appended with the list defined on <base>?
<didi>Well, thinking about it, it will not be necessary. For my use case, I can just call (next-method).
***Fuuzetsu is now known as Guest68448
***add^_` is now known as add^_
<taylanub>didi: hidy ho, did you get my notice from sneek ?
<didi>taylanub: I did not. :^(
<taylanub>if you're using `make-c-struct', also see https://gitorious.org/taylan-guile/bytestructures/, just be wary that offset calculation will happen at run-time so you don't want to use it in the innerest of inner loops; see benchmarks at bottom
<didi>taylanub: Oh, cool. Thank you.
***DerGuteM1 is now known as DerGuteMoritz
<wingo> http://edofic.com/posts/2014-02-23-haskell-web.html is nice
<taylanub>didi: BTW don't hesitate to ask any questions about the library. (The docs are quite comprehensive but I'm not sure about their clarity.)
***dunsmoreb_ is now known as dunsmoreb
***Shozan is now known as SHODAN
<mark_weaver>ArneBab: I enjoyed your post about your journey from Python to Scheme. Regarding loops and list comprehensions, you might want to check out foof-loop <http://mumble.net/~campbell/scheme/foof-loop.txt> which is in Guildhall, and SRFI-42 <http://srfi.schemers.org/srfi-42/srfi-42.html> which comes with Guile.
<mark_weaver>(We should probably just import foof-loop into Guile)
<davexunit>I like SRFI-42 a lot.
<davexunit>I need to try out foof-loop as well.
<ArneBab>mark_weaver: nice - thanks!
<mark_weaver>you're welcome!
<davexunit>ArneBab: where can I read your post? was this a blog post or something I can find on the mailing list?
<ArneBab>davexunit: it’s a work in progress: http://draketo.de/proj/py2guile/
<ArneBab>published directly from org-mode ☺
<davexunit>:)
<davexunit>I wish I could write all of my blog posts in org-mode and still keep the neat features of Pelican
<ArneBab>davexunit: I’m thinking about going to that… I finally managed to get comments on static pages working: http://draketo.de/proj/freecom
<cluck>:)
<davexunit>ArneBab: oh neat :)
<davexunit>I wonder how hard it would be to roll my own static site generator that used emacs batch mode to process org-mode files.
<ArneBab>davexunit: that should not be that hard. Have a look at org-publish - that might already get you most of the way
<davexunit>ArneBab: cool. will do.
<davexunit>ArneBab: reading your post about python->scheme and was pleasantly surprised to see guile-2d referenced!
<davexunit>:)
<ArneBab>davexunit: It’s one of the really neat examples for people who tried their hands at game programming ☺
<ArneBab>(i.e. me)
<davexunit>the day I learned about coroutines was a good day.
<ArneBab>davexunit: and reading its source showed me how deep even short snippets can go ☺
<ArneBab>mark_weaver: also as you can see from the py2guile text, I finally fixed the fontification regexps for wisp
<davexunit>ArneBab: I believe that snippet is from wingo. it was posted on the guile mailing list ~2 years ago I think. it took me a long time to understand it, myself.
<ArneBab>nice!
<ArneBab>(how code flows from one to another…)
<davexunit>but it's proved to be one of the most useful code snippets ever.
<ArneBab>I can imagine that
*ArneBab needs to go…
<davexunit>see ya!
***amoe_ is now known as amoe
***Guest68448 is now known as Fuuzetsu
<lloda>if I use test-begin & test-end from srfi-64, how do I get the result of the test in a variable? I don't have a explicit 'test runner'.
<lloda>a e/an e
<mark_weaver>lloda: see 'test-result-alist' et al.
<mark_weaver>and (test-runner-current) to get the current test runner.
<mark_weaver>ArneBab: I didn't notice the fontification because I use emacs-w3m :)
***Fuuzetsu is now known as Guest56456
***Guest56456 is now known as Fuuzetsu`
***Fuuzetsu` is now known as Fuuzetsu
<lloda>mark_weaver: not sure I get it.
<lloda>(test-begin "one")
<lloda>(test-assert (= 1 1))
<lloda>(test-end "one")
<lloda>(test-passed? (test-runner-current))
<lloda>
<lloda>gives #f (??)
<mark_weaver>you probably need it before the 'test-end'
<mark_weaver>it might make more sense to make a custom test-runner. it's not hard. see test-suite/tests/srfi-64.test in git for an example.
<mark_weaver>out of curiosity, what are you trying to do?
<lloda>it's for a wrapper for FFTW. Usually I do C++ wrappers by hand and my own clunky SConstruct/bash test setup, but I'd like to publish this, so I'm using the ffi and srfi-64. But it's my first time using either so I'm probably carrying over some bad habits.
<mark_weaver>I don't know why you'd need to check the results of the tests explicitly. The default SRFI-64 test runner will generate a report at the end.
<lloda`>mark_weaver: In my current setup I abort the build on test failures. It's easier for me to transition to a proper test suite library if I don't have to do everything differently all at once.
<mark_weaver>okay, then I recommend using a custom test runner like the one in test-suite/tests/srfi-64.test that aborts on failure.
<lloda`>I'll have a look, thanks
<ArneBab_>re
<didi>Do guile macros guarantee an expression is not evaled more than once?
<mark_weaver>no
<didi>OK.
<mark_weaver>if you need that, then you must use a let in the generated code.
<didi>Roger.