/srv/irclogs.ubuntu.com/2017/09/15/#ubuntu-us-mi.txt

cmaloneymorning14:39
ZimdaleMorning14:40
rick_hparty14:45
cmaloneyare we having fun yet?17:10
jrwrenYES17:10
jrwrenI really want to write strtotime in go, but I'm afraid I'll hit a wall. What do you think I should do?17:11
cmaloneyshell out to C? ;)17:12
jrwrenI'd rather not.17:12
cmaloneyuse Python like a gentleman17:12
notlikethesouppython++17:12
notlikethesouperm... python += 117:13
jrwrenso... I call strtotime from python, because python datetime parsing sucks.17:13
jrwrenthat is a wrapped C function because python calls C nicely.17:13
cmaloneyPython Datetime parsing is pretty awesome17:14
cmaloneyusing dateutils17:14
jrwrenterrible.17:14
jrwrenj/k. i never used it because I had strtotime.17:14
cmaloneyhttps://pypi.python.org/pypi/python-dateutil/2.6.117:14
cmaloneyI'd be afraid to write anything related to time because it's a clusterfuck of exceptions17:15
cmaloneyand I'd wind up writing 0:60:01 or some shit17:15
greg-gI just was handed a smoothie with frozen peaches in it, so yeah, having fun now17:15
jrwrenmmm... peaches.17:15
jrwrenwell, my job is all about video playback which is time based, so yeah... time and a clusterfuck of exceptions is my job now.17:16
greg-gyeah, the big flat of them we got from costco were good, but a few got soft spots before we could eat them, so, into the freezer they go!17:16
jrwrenin what state were they grown?17:16
greg-guhhhhh, dunno17:17
cmaloneyjrwren: Fun times17:17
greg-gbox is recycled (and pickup day was yesterday)17:17
jrwrengreg-g: i'll pretend they are MI peaches ;P17:17
greg-gheh, thanks to ya'll then :P17:18
jrwrenI don't see a way I can parse '1 day ago 2 hours ago' in dateutils :p17:18
cmaloneyjrwren: datetime17:19
cmaloneyhttps://stackoverflow.com/questions/6871016/adding-5-days-to-a-date-in-python17:19
cmaloneyand timedelta17:19
jrwrencmaloney: no no no... I want it to work like gnu date cmd line.  e.g. `$ date -d ‘1 day ago 2 hours ago’`17:20
jrwrenyou can run that on linux (not on bsd/mac)17:20
jrwrenerr, well, those quotes aren't right, but if you fix them you can run it :)17:20
cmaloneytry this:17:20
cmaloneyexec("date -d '1 day ago 2 hours ago'") :-P17:21
jrwrenbwahahahahahaha17:22
jrwreni would, but I am concerned aboud speed of http responses and so I will not fork.17:23
cmaloneyhttps://golang.org/pkg/time/#Time.AddDate17:23
jrwrenthat doesn't help.17:23
cmaloneyUse that to get the day one day before17:23
jrwrenlets say I pass '1 day ago' as a query parameter, how do I get a date.17:23
jrwrenright, you are saying to write my own parser. I'll take your advice.17:24
cmaloneyYeah, sadly I don't know why Go doesn't have a parser like that17:24
jrwrenmost langs don't.17:24
jrwrenmost call C strtotime :)17:24
jrwrenalthough strangely ruby's fancy pants parser seems original17:25
cmaloneyMOst of the time I'm not parsing a string for my "two days ago" foo. That's a config parameter17:25
cmaloneyAnd if I need to get really fancy-pants I use https://docs.python.org/2/library/calendar.html17:26
cmaloneyfor stuff like first day of the week17:26
jrwrenit must have just been teh nature of atlas apis when I was at arbor. the "days ago" queries were VERY useful.17:26
cmaloneyhttps://dateparser.readthedocs.io/en/latest/17:28
jrwrenoooh! that is the one.17:29
jrwrenomg, those deps though17:30
cmaloneyThat's not too crazy. ;)17:31
cmaloneypytz six17:31
cmaloneyhttps://pypi.python.org/pypi/ruamel.yaml <- this one I don't quite understand17:31
cmaloneynor the added regex lib17:32
cmaloneyah, for reading config files17:32
jrwreni don't see wehre it is supporting some of that syntax. https://github.com/scrapinghub/dateparser/blob/master/dateparser/parser.py17:32
jrwrenoh... https://github.com/scrapinghub/dateparser/blob/master/dateparser/freshness_date_parser.py  there it is.17:32
jrwrenwell, i wasn't going to hand write the parser, but maybe I will.17:33
jrwreni just ran longer than I've ever run in my life. It was also the first run in my 40s21:57
jrwrenAlso the first run since my knee injury. I didn't even notice it, so I guess I laid off it too long21:57
_stink__jrwren++22:29
rick_hjrwren: <3 awesome22:41
brouschjrwren: You want date time stuff in Go?22:51
jrwrenbrousch: I want strtotime, yes.22:54
brouschI remember our Gonads at work talking about doing that22:58
brouschI assume that's what Go programmers are called22:58
jrwrengophers.22:59
jrwrenbrousch: have I told you how much I love go now? I like it a lot. :)22:59
_stink__brousch++23:35

Generated by irclog2html.py 2.7 by Marius Gedminas - find it at mg.pov.lt!