--- Log opened Sun May 15 00:00:49 2011 --- Day changed Sun May 15 2011 00:00 < rael_wiki_> in the language specification there is an example of select that I don't understand http://golang.org/doc/go_spec.html#Select_statements 00:02 < rael_wiki_> I mean, if we put that select in a for loop, we eventually get to know on the third case that c3 is closed but our select will keep executing that case, right? 00:11 -!- Tuller [~tuller@c-69-143-48-210.hsd1.va.comcast.net] has joined #go-nuts 00:22 -!- jhawk28 [~jhawk28@user-387c58d.cable.mindspring.com] has joined #go-nuts 00:24 -!- gtaylor [~gtaylor@99-5-124-9.lightspeed.gnvlsc.sbcglobal.net] has joined #go-nuts 00:29 -!- rlab_ [~Miranda@91.200.158.34] has quit [Read error: Connection reset by peer] 00:41 < Ekspluati> rael_wiki_: Executing as in checking ig there's data coming? 00:44 < rael_wiki_> Ekspluati: executing the body of the case, the checking of data coming should result true since a read on a closed channel should return a zero value 00:44 < rael_wiki_> Ekspluati: am I wrong? 00:45 < Ekspluati> rael_wiki_: Oh right, that's true. 00:45 -!- hallas [~hallas@x1-6-30-46-9a-b2-c5-1f.k891.webspeed.dk] has left #go-nuts [] 00:46 < rael_wiki_> Ekspluati: so I don't know how to manage a for loop with many channels with some of them that might be eventually closed 00:46 < Ekspluati> That means the default should never execute. 00:46 < rael_wiki_> exactly 00:49 < rael_wiki_> Ekspluati: it would be nice to have a select with many channels that keeps reading them until none of them is open and then executes the default, exiting 00:51 -!- pearle [~pearle@blk-224-181-222.eastlink.ca] has quit [Ping timeout: 246 seconds] 00:53 -!- mwarning [~mwarning@ip-178-202-97-131.unitymediagroup.de] has joined #go-nuts 00:53 < mwarning> Hi, may I ask what this program prints? http://www.reddit.com/r/programming/comments/hb6m8/google_io_2011_writing_web_apps_in_go/c1u1xj6 00:54 < mwarning> I tried to compile the go compiler, but got some error I couldn't fix right away. 00:56 < Ekspluati> "if(blah()) <newline> {" will become "if(blah()); {" 00:56 < Ekspluati> So the if statement is basically ignored. 00:56 < mwarning> ah, that's the problem. thanks a lot 00:57 < mwarning> I wonder why if(..); isn't invalid? 00:59 < mwarning> nvm, apparently it doesn't compile 00:59 -!- jhawk28 [~jhawk28@user-387c58d.cable.mindspring.com] has quit [Quit: Linkinus - http://linkinus.com] 01:01 -!- Tuller [~tuller@c-69-143-48-210.hsd1.va.comcast.net] has quit [Quit: Computer has gone to sleep.] 01:01 -!- mwarning [~mwarning@ip-178-202-97-131.unitymediagroup.de] has quit [Quit: Leaving] 01:12 -!- breadlorde [~dreadlord@c-24-11-39-160.hsd1.mi.comcast.net] has quit [Ping timeout: 250 seconds] 01:17 < skelterjohn> Ekspluati, rael_wiki_: the default case also fires if you have open channels that don't have something ready to send, immediately 01:17 < skelterjohn> it's not only if all the chans are closed, but that will also trigger default 01:21 < rael_wiki_> skelterjohn: I agree on the fact that default case is executed if open channels don't have data to send at the moment, but a closed channel actually has data to send immediately (the zero-value for the specified type) so it shouldn't execute the default 01:39 < fzzbt> how do i do length matching with go's regexp? i can't seem to get the {m,n} syntax working 01:39 < fzzbt> eg. [a-z]{1,10} to match 10 character words 01:40 < fzzbt> it's not implemented? 01:42 < moraes> fzzbt, no 01:42 < moraes> fzzbt, but this one implements it: http://code.google.com/p/sre2/ 01:42 < moraes> http://code.google.com/p/re2/wiki/Syntax 01:43 < moraes> nitpick: that doesn't match 10, matches 1 to 10 01:43 < fzzbt> yeah :0. i'll have to switch then 01:49 -!- Ekspluati [5b9a0bcf@gateway/web/freenode/ip.91.154.11.207] has quit [Ping timeout: 252 seconds] 02:02 -!- fheller [~hellerf@c-24-9-120-132.hsd1.co.comcast.net] has quit [Remote host closed the connection] 02:02 -!- rael_wiki_ [~chatzilla@87.18.214.175] has quit [Quit: ChatZilla 0.9.86.1 [Iceweasel 3.5.19/20110430164311]] 02:03 -!- pearle [~pearle@blk-224-181-222.eastlink.ca] has joined #go-nuts 02:26 < tsp> Why won't this relatively simple program compile under gccgo? http://paste.pocoo.org/show/389151/ 02:27 < tsp> readlines.go:9:23: error: reference to undefined field or method ‘ReadLine’ -- it works just fine under 8g. 02:29 -!- danilo04 [~danilo04@129.21.100.41] has joined #go-nuts 02:30 -!- GutenLinux [~chatzilla@125.117.86.199] has joined #go-nuts 02:31 -!- GutenLinux [~chatzilla@125.117.86.199] has quit [Client Quit] 02:33 < edsrzf> tsp: Probably different versions of the Go core packages 02:33 < edsrzf> ReadLine is a relatively recent addition 02:34 < tsp> Can I update gccgo's core somehow? 02:35 < edsrzf> If you built it, it should be pretty easy to at least add in that one method 02:35 < edsrzf> Other newer parts might not go in so easily 02:37 < tsp> Is there a changelog for the go trunk somewhere? 02:42 -!- quag [~quag@121-98-81-61.bitstream.orcon.net.nz] has joined #go-nuts 02:43 < quag> I've built a small go program and it currently has a horrible build.sh script to build it instead of using Makefiles and packages. 02:43 < quag> It's up on https://github.com/quag/mcobj/tree/develop 02:44 < quag> is there a tutorial on how to build a program like this? 02:44 < quag> Ideally, I'd like multiple packages for different bits. 02:44 < quag> There is already one package there (nbt.go) and it is making switching over to the normal cmd Makefile difficult. 02:53 -!- rcrowley [~rcrowley@c-71-202-44-233.hsd1.ca.comcast.net] has quit [Quit: Computer has gone to sleep.] 02:53 -!- gaiusp [~gaiusparx@bb219-75-41-232.singnet.com.sg] has left #go-nuts [] 02:55 -!- ExsysTech [~ExsysTech@50-46-213-60.evrt.wa.frontiernet.net] has quit [Read error: Connection reset by peer] 02:56 -!- jemes [~jemeshsu@bb219-75-41-232.singnet.com.sg] has joined #go-nuts 02:56 -!- ExsysTech [~ExsysTech@50-46-213-60.evrt.wa.frontiernet.net] has joined #go-nuts 02:57 -!- jemes [~jemeshsu@bb219-75-41-232.singnet.com.sg] has quit [Client Quit] 02:59 -!- jemeshsu [~jemeshsu@bb219-75-41-232.singnet.com.sg] has joined #go-nuts 03:03 -!- blackmagik [~blackmagi@unaffiliated/blackmagik] has joined #go-nuts 03:04 < steven> hi guys 03:04 < fzzbt> hey steve 03:04 < steven> do you have any idea how to notice when a file's contents have changed in Go code? 03:04 < quag> hi steven 03:04 < steven> like, how to observe that? 03:05 < quag> steven: stat the file every so often and check if the modified timestamp has changed? 03:06 < steven> i like that solution 03:06 < quag> normally, I store the current timestamp and then check to see if the new timestamp is different. (Not >) 03:06 < steven> but theres nothing platform-independent like inotify? 03:06 < quag> not to my knowledge. 03:10 < quag> if I recall correctly, windows has an api that fires an event when anything in a directory changes, but not specific files. 03:10 < quag> But that may have changed 03:10 < quag> don't recall what osx has 03:10 < steven> i know mac has one, FSEvents 03:10 < steven> i wish there was some wrapper around it tho 03:10 < steven> since its C-based and cgo is tough 03:10 -!- boscop_ [~boscop@f055153169.adsl.alicedsl.de] has joined #go-nuts 03:11 -!- angasule_ [~angasule@190.2.33.49] has quit [Read error: Connection reset by peer] 03:11 < quag> steven: could you call out to a commandline program to watch the files? 03:13 -!- boscop [~boscop@f055049000.adsl.alicedsl.de] has quit [Ping timeout: 246 seconds] 03:14 < steven> hmm interesting idea 03:14 < steven> thanks 03:15 -!- breadlorde [~dreadlord@c-24-11-39-160.hsd1.mi.comcast.net] has joined #go-nuts 03:23 -!- nteon [~nteon@c-98-210-195-105.hsd1.ca.comcast.net] has joined #go-nuts 03:25 -!- chomp [~chomp@c-67-186-35-69.hsd1.pa.comcast.net] has joined #go-nuts 03:26 -!- manveru [~manveru@b08s28ur.corenetworks.net] has joined #go-nuts 03:26 < manveru> heya 03:26 < quag> hi 03:26 < manveru> i'm trying to implement a line-based protocol server 03:27 -!- hq1 [~hq@ns1.insant.pl] has quit [Read error: Connection reset by peer] 03:27 < manveru> lines are separated by \r\n 03:27 < manveru> i have one command that acts like a header, giving the number of bytes to follow until the next \r\n considered eol 03:28 < manveru> right now i make a []byte with the given size and simply use bufio.Reader.Read with that buffer 03:28 < manveru> is that an ok approach? 03:29 < quag> depends on how large the data will be 03:29 < quag> if, say, it was 2GB, you may find yourself struggling for memory 03:29 < manveru> heh 03:29 < manveru> no, shouldn't be that big :) 03:29 < manveru> i expect up to a few mb 03:29 < quag> could nasty people target your system? 03:29 < quag> :-) 03:30 < manveru> yeah 03:30 < manveru> well, gotta cap it for sure 03:30 < quag> what will you do with the bytes afterwards? 03:31 < chomp> heh sooo... wrapping a C API whose use requires function pointers for callbacks. any good documentation on handling this? 03:31 < manveru> i store them in a job struct in a priority ordered red-black tree until someone requests a job 03:31 < chomp> i've seen talk of //export but haven't found a clear example or description of what it actually does 03:31 < manveru> i'll def. also have to handle out-of-memory errors 03:31 < manveru> if the job queue is too big 03:31 < quag> so you're not going to spill to disk always? 03:32 < manveru> no 03:32 < quag> a simple way to handle this would be to use io.Copyn() to write it to a file, then pull it back when the job needs it. 03:32 < quag> and rely on the OS caching files for speed :-) 03:33 < quag> if you're going to keep it all in memory anyway, then allocating the []byte and reading into it seems like the way to go. 03:33 -!- hq1 [~hq@ns1.insant.pl] has joined #go-nuts 03:33 < manveru> that might be a nice feature later on... but not something i need for small queues right now 03:33 < manveru> ok... 03:33 < manveru> then the next issue i have 03:33 < quag> how large are these pieces of data? 03:34 < quag> heh 03:34 < manveru> how do i keep reading from the connection? 03:34 < manveru> without blocking everything else 03:34 < quag> do the read in a goroutine? 03:34 < manveru> i cannot find select or epoll... 03:34 < manveru> hm, yeah 03:35 < manveru> go server.accept(listener) 03:35 < manveru> basically that 03:36 < quag> yup 03:36 < manveru> but i don't know how to find out if the other side disconnected or sent more data 03:37 < quag> handle each socket in its own goroutine 03:37 < quag> they'll block waiting for more data 03:38 < manveru> hm, ok 03:39 < quag> looking at http://golang.org/src/pkg/net/fd_linux.go 03:39 < manveru> maybe i need a continuous reader... 03:39 < quag> it looks like on linux it uses epoll for implementation anyway 03:39 < manveru> i use NewReaderSize right now 03:40 < danilo04> is there a binding to access usb devices? 03:41 < quag> danilo04: http://go-lang.cat-v.org/library-bindings lists go-pkg-usb but that 404s 03:41 < danilo04> quag, yeah that is what I found 03:41 -!- blackmagik [~blackmagi@unaffiliated/blackmagik] has quit [Read error: Connection reset by peer] 03:41 < danilo04> quag: thanks anyway 03:42 < quag> what are you wanting to do with usb? 03:42 < manveru> guess NewReader is good enough 03:43 < danilo04> maybe play with a kinect device 03:44 < quag> cool :-) 03:45 < danilo04> quag: can I import C and make a wrapper of libusb 03:45 < danilo04> quag: I am really new in go 03:45 < quag> danilo04: I haven't played with the cgo stuff. Sorry. 03:45 < danilo04> ok 03:56 < nteon> danilo04: I'm new as well, but the go gtk bindings make heavy use of cgo, as well as dealing with marshalling go callbacks to c 03:56 < nteon> chomp: ^^ 03:56 < nteon> both of you I guess 03:57 < chomp> i found the life example in misc/cgo, it appears to be useful after all :p 03:57 < danilo04> nteon: sounds good, let me check 03:57 < chomp> i'm wrapping PAM btw. good times, good times :p 03:58 < nteon> hah 03:58 < nteon> nice 03:59 < manveru> :) 03:59 * manveru is working on a beanstalkd 03:59 < chomp> soon i'll have my httpsh server in go. soon... 04:00 < chomp> going to serve a js/canvas vt100 emulator with a login shell, over websockets 04:00 < skelterjohn> add a button for scp too :) 04:00 < chomp> hrh yeah i actually thought about that 04:01 < skelterjohn> would be a very useful little tool 04:01 < manveru> better than those java ones anyway :P 04:01 < chomp> it's next on my agenda 04:02 < chomp> i actually have a working shell server now, but it uses a ssh client on the server side for authentication 04:02 < manveru> but isn't canvas really slow for text? 04:02 < chomp> vt100 emulator works pretty well though. i can vim in my browser 04:02 < chomp> yeah, im separating the rendering out and will be building a plain old DOM terminal renderer 04:02 < manveru> cool 04:02 < chomp> canvas was quick n dirty 04:03 < manveru> i built a terminal emulator in tk before 04:03 < manveru> termcap was such a pita 04:03 < manveru> only vt100 would be nice :) 04:03 < chomp> one step at a time :) 04:03 < manveru> heh 04:04 < manveru> i gave up when i had to implement scrolling regions 04:04 < chomp> right now the extent of my tty control involves sending stty commands over the wire upon successful login >< 04:04 < chomp> i got scrolling regions in! :) 04:04 < manveru> w007 04:04 < chomp> vim really works beautifully 04:04 < manveru> yeah, that's where i encountered them 04:04 < chomp> and yes, that was a huge PITA. documentation is so sparse 04:04 < manveru> couldn't for the life of me find docs for how they should behave 04:05 < chomp> i basically just reverse engineered the CSI sequences coming from about 10 different console applications 04:05 < manveru> even read half the urxvt source :P 04:05 < chomp> after getting all i could out of any "real" documentation 04:06 -!- alc [~arx@222.128.132.65] has joined #go-nuts 04:06 < manveru> well, at least it's a pretty efficient protocol 04:07 < chomp> for a computer, indeed :) 04:08 < manveru> please lemme know when you get a demo running :) 04:09 < nteon> chomp: that sounds sweet 04:09 < manveru> https://github.com/manveru/yonde/blob/master/lib/yonde/terminfo.rb 04:09 < nteon> I'm working on an sshd implementation 04:10 < manveru> that's how i get termcap/terminfo 04:10 < chomp> nice 04:10 < manveru> sorry, not go 04:10 < nteon> manveru: beanstalk daemon or client (or both) 04:10 < manveru> daemon 04:10 < nteon> nice 04:10 < manveru> i figured goroutines are made for it :) 04:11 < nteon> oh, theres already a beanstalk go client :) 04:11 < manveru> there are clients for just about any language... 04:11 < manveru> it's a really easy protocol 04:11 < manveru> no XML crap like AMQP 04:13 < nteon> hah 04:13 < nteon> xml is a disease 04:14 < manveru> ok... my prototype seems to work... 04:15 -!- rejb [~rejb@unaffiliated/rejb] has quit [Disconnected by services] 04:15 -!- rejb [~rejb@unaffiliated/rejb] has joined #go-nuts 04:17 < manveru> hm 04:17 < manveru> well, i do wish they'd use JSON instead of YAML in beanstalk 04:21 < manveru> can't find a yaml lib... 04:22 < justinlilly> oh the fun of a new language ^_^ 04:22 < manveru> oh well, the C beanstalkd builds the YAML by hand as well 04:27 -!- breadlorde [~dreadlord@c-24-11-39-160.hsd1.mi.comcast.net] has quit [Ping timeout: 240 seconds] 04:28 -!- breadlorde [~dreadlord@c-24-11-39-160.hsd1.mi.comcast.net] has joined #go-nuts 04:33 < nteon> heh, nice, TCP_NODELAY defaults to true in Go :) 04:33 -!- photron [~photron@port-92-201-244-191.dynamic.qsc.de] has joined #go-nuts 04:33 < vsmatck> That's weird. 04:44 < nteon> vsmatck: idk, for most applications these days that makes sense. its the first thing i do when making a networked application in C, Python or Java 04:48 -!- pearle [~pearle@blk-224-181-222.eastlink.ca] has quit [Quit: Leaving] 04:51 < nteon> does anyone know if there is a reason go doesn't support python style slice notation: slice[:-1] in python is aSlice[:len(aSlice)-1] 04:52 -!- rcrowley [~rcrowley@c-71-202-44-233.hsd1.ca.comcast.net] has joined #go-nuts 04:52 < edsrzf> Probably because it would penalize the performance of the common case (when signed variables are involved, anyway) 04:53 < edsrzf> I remember somebody asking about it on the mailing list once. Or maybe it was an issue. I can't remember. 04:53 < nteon> it seems like it would be a somewhat trivial change to detect the unary op '-' in the high part of the slice expression and replace it with len(aSlice) - ... at compile tiem 04:53 < nteon> edsrzf: hmm, I briefly searched and didnt find it, I will try looking harder 04:54 < edsrzf> Yes, but if you have an expression like slice[a:b], you have to generate extra code. 04:54 -!- rcrowley [~rcrowley@c-71-202-44-233.hsd1.ca.comcast.net] has quit [Client Quit] 04:54 < edsrzf> Since you don't know statically if a or b is negative. 04:55 < manveru> well, it def. is not a search/replace issue :) 04:55 < nteon> edsrzf: i would be happy restricting it to compile-time negative ints 04:56 < edsrzf> nteon: Here's Rob talking about it a little bit: http://groups.google.com/group/golang-nuts/msg/0b0af95059d4dc11 04:57 < manveru> at least job insertion works now... 05:00 < nteon> edsrzf: thanks, that makes sense. I suppose its not that big a deal :) 05:01 -!- ios_ [~ios@180.191.131.160] has joined #go-nuts 05:04 < nteon> i still like the idea of allowing compile time negative integer constants, but I see how that could add confusion 05:04 < edsrzf> There are a few other relevant posts in that thread 05:05 < manveru> hm 05:05 < manveru> how would you implement a priority queue? 05:06 < manveru> WP says a tree would work fine, but i fear that would give me locking issues 05:07 < manveru> channels have FIFO order, so i cannot easily translate it into that either 05:08 < edsrzf> manveru: There's the package container/heap, which you could use for a priority queue, but it won't take care of synchronization for you. 05:10 < manveru> hm 05:11 < manveru> i guess i could sequencialize the access through a channel 05:11 < manveru> that way i don't have to lock manually 05:11 < |Craig|> heaps through channels really seems like the right approach 05:12 < manveru> ok... out of battery, will tackle that tonight 05:12 < manveru> thanks guys 05:25 -!- danilo04 [~danilo04@129.21.100.41] has quit [Read error: Operation timed out] 05:27 < chomp> so call me crazy, but bool is most certainly a Go type, yes? 05:28 < edsrzf> chomp: Yes 05:28 < chomp> rhetorical question reallay, of course it is 05:28 < chomp> but i'm trying to compile some code, say func foo() (*C.char,bool) { // ... 05:28 < chomp> and i am getting an "unrecognized Go type *ast.Ident" 05:28 < chomp> which disappears if i remove the bool 05:28 -!- danilo04 [~danilo04@rm2348358874.student.rit.edu] has joined #go-nuts 05:29 < edsrzf> That kind of sounds like a cgo bug 05:29 < chomp> was thinking as much 05:30 < chomp> yep, looks like specifically a cgo bug with exporting bool types 05:31 < chomp> or signatures that use bool types 05:31 < chomp> int it is, then! 05:35 -!- quag [~quag@121-98-81-61.bitstream.orcon.net.nz] has quit [Remote host closed the connection] 05:35 -!- quag [~quag@121-98-81-61.bitstream.orcon.net.nz] has joined #go-nuts 05:35 -!- nteon [~nteon@c-98-210-195-105.hsd1.ca.comcast.net] has quit [Ping timeout: 240 seconds] 05:42 -!- quag [~quag@121-98-81-61.bitstream.orcon.net.nz] has quit [Ping timeout: 240 seconds] 05:45 -!- hq1 [~hq@ns1.insant.pl] has quit [Ping timeout: 250 seconds] 05:46 -!- breadlorde [~dreadlord@c-24-11-39-160.hsd1.mi.comcast.net] has quit [Ping timeout: 240 seconds] 05:48 -!- danilo04 [~danilo04@rm2348358874.student.rit.edu] has quit [Quit: Saliendo] 05:50 -!- quag [~quag@121-98-81-61.bitstream.orcon.net.nz] has joined #go-nuts 05:57 -!- quag [~quag@121-98-81-61.bitstream.orcon.net.nz] has quit [Ping timeout: 240 seconds] 05:58 -!- zozoR [~Morten@2906ds2-arno.0.fullrate.dk] has joined #go-nuts 05:59 -!- quag [~quag@121-98-81-61.bitstream.orcon.net.nz] has joined #go-nuts 06:12 -!- jamesmiller5 [~jamesmill@184.17.105.74] has quit [Remote host closed the connection] 06:17 -!- alc [~arx@222.128.132.65] has quit [Ping timeout: 248 seconds] 06:27 -!- ShadowIce [~pyoro@unaffiliated/shadowice-x841044] has joined #go-nuts 06:36 -!- ios_ [~ios@180.191.131.160] has quit [Quit: Leaving] 06:40 -!- monsieur_max [~maxime@ip-78.net-89-2-171.rev.numericable.fr] has joined #go-nuts 06:41 < chomp> is there any way to cheat and do some pointer arithmetic? i've got some data from C code and i essentially need to walk through an array of *C.char 06:42 < chomp> ah of course i'd figure it out after asking 06:43 < chomp> foo := (uintptr)(unsafe.Pointer(C.terrible_C_function())); foo += (uintptr)(unsafe.Sizeof(foo)) 06:50 -!- jeremy_c_ [~jeremy@cowgar.com] has joined #go-nuts 06:53 -!- hq1 [~hq@ns1.insant.pl] has joined #go-nuts 06:57 -!- jeremy_c_ [~jeremy@cowgar.com] has quit [Quit: leaving] 07:04 -!- gtaylor [~gtaylor@99-5-124-9.lightspeed.gnvlsc.sbcglobal.net] has quit [Quit: gtaylor] 07:17 -!- chomp [~chomp@c-67-186-35-69.hsd1.pa.comcast.net] has quit [Quit: Leaving] 07:24 -!- heatxsink [u956@gateway/web/irccloud.com/x-ngylfklxhmstihlb] has joined #go-nuts 07:24 < heatxsink> are there any examples of using a filewatcher like thing in go? 07:25 < vsmatck> There is inotify on linux. The Go API is very similar to the C API. 07:26 < heatxsink> ah but there's no high level abstraction for other oses? 07:27 < vsmatck> File system events are a hard problem from the kernel developer standpoint. There is not a good common subset of functionality between all major OS's such that high level abstraction could be created. 07:27 < vsmatck> Inotify is one of the better ones. 07:29 < heatxsink> vsmatck: dumb question does inotify work on osx? last i knew it was only for linux 07:30 < vsmatck> It's only for linux as far as I know. A thing like that is very tied to a specific kernel. 07:30 -!- Cobi [~Cobi@2002:1828:88fb:0:aede:48ff:febe:ef03] has quit [Ping timeout: 264 seconds] 07:31 < heatxsink> vsmatck: k thx. 07:32 < vsmatck> I made a setup a while ago in C++ that did continual scanning that checked for modification dates using c++/boost. Sort-of yuck. 07:32 < vsmatck> But it was portable. :-/ 07:33 < str1ngs> heatxsink: there is a package for inotify in the stdlib if you use linux 07:34 < heatxsink> vsmatck: nice ... was it efficient? 07:34 < heatxsink> vsmatck: i'm trying to write something that is portable across osx and linux that does that... 07:35 < heatxsink> vsmatck: i've already wrote it in C# using mono but i kinda wanna ditch any dependancy on C# that's all.. 07:36 < vsmatck> It did ok. It was basically a while true, with a sleep in it. I'd disable the sleep after finding a modified file because the files I was monitoring tended to be modified in groups. 07:37 < heatxsink> ah 07:37 < vsmatck> It was a p2p program share scanner. 07:37 -!- piranha [~piranha@5ED43A0B.cm-7-5a.dynamic.ziggo.nl] has joined #go-nuts 07:38 < manveru> heatxsink: osx has kqueue i think 07:39 < heatxsink> manveru: ya that's what mono is invoking under the hood 07:39 < manveru> you could use libevent, it works on both 07:40 < heatxsink> i was kinda blown away at the whole differences in unix'es but I guess it makes sense that everyone for very specific system things always go their own way 07:40 < manveru> but of course adds a dependency... 07:40 < manveru> https://secure.wikimedia.org/wikipedia/en/wiki/Libevent 07:44 < manveru> damn, i could swear it had stuff for file handles too 07:44 < manveru> guess not, then :( 07:44 < justinlilly> str1ngs: if I can talk you into outlining the work that remains in your libgit2 bindings, I may help you. I need the ability to traverse something akin to git-log, which I don't think your version currently supports. 07:45 < justinlilly> ... not that I know how to work with the cgo stuff or have ever worked with libgit2... but necessity and all that. 07:45 -!- Cobi [~Cobi@2002:1828:88fb:0:aede:48ff:febe:ef03] has joined #go-nuts 07:46 -!- |Craig| [~|Craig|@panda3d/entropy] has quit [Quit: |Craig|] 07:47 < str1ngs> justinlilly: hello 07:47 < str1ngs> currently yes it does support Rev walking 07:48 < str1ngs> the api is abit low level I'll put something together to demostrate 07:48 < heatxsink> manveru: balls. 07:49 < justinlilly> str1ngs: yea. I think I can kinda get the idea. Must have glanced over the revwalk bits. 07:49 -!- alc [~arx@222.128.132.65] has joined #go-nuts 07:49 < str1ngs> justinlilly: its modeled after the libgit api which is not idea. and I've sorta been selective about what I have included 07:50 -!- alc [~arx@222.128.132.65] has quit [Remote host closed the connection] 07:51 < str1ngs> justinlilly: for etc C object I bassically wrap it in a go struct ie Oid = Oid.git_oid 07:51 -!- iant [~iant@216.239.45.130] has quit [Ping timeout: 276 seconds] 07:51 < str1ngs> but let me put together an example of a RevWalk 07:51 < justinlilly> see that. Makes it a bit difficult to know what the struct contains. 07:52 < str1ngs> not really Oid is a oid just the C parts are hidden 07:53 -!- hq1 [~hq@ns1.insant.pl] has left #go-nuts ["WeeChat 0.3.3"] 07:56 -!- ImpatientSpoon [~ashley@115.6.233.220.static.exetel.com.au] has joined #go-nuts 07:56 < str1ngs> justinlilly: http://libgit2.github.com/api.html#revwalk 07:59 < justinlilly> I suppose the biggest issue I was having is that "push" doesn't seem to jive with my thinking of traversing the data structure. 08:00 < str1ngs> justinlilly: make sure you pull I just merged my devel branch to master 08:03 < str1ngs> justinlilly: push pretty much gives it a place to start 08:04 < str1ngs> for the Test I use head oid 08:06 -!- photron [~photron@port-92-201-244-191.dynamic.qsc.de] has quit [Quit: Leaving] 08:08 < str1ngs> justinlilly: its not very go idium but my plan was sorta to do a direct api mapping the raise the level of the api and make it more go idiomatic 08:09 < str1ngs> justinlilly: let me put a example Rev walker together for you. if you could add a Readme that might be a start? 08:09 < str1ngs> basic install instructions I guess 08:09 < justinlilly> k. just trying to map out what I think a revwalker should look like. I'll probably get to testing & installing tomorrow 08:10 -!- iant [~iant@adsl-71-133-8-30.dsl.pltn13.pacbell.net] has joined #go-nuts 08:10 -!- mode/#go-nuts [+v iant] by ChanServ 08:11 < str1ngs> justinlilly: awesome thanks 08:13 < str1ngs> justinlilly: I do live far from you btw 08:13 < str1ngs> dont* 08:13 < justinlilly> orly? Neat. 08:13 < str1ngs> yes just north of the border 08:15 -!- dfr|mac [~dfr|work@ool-182e3fca.dyn.optonline.net] has quit [Remote host closed the connection] 08:24 -!- wrtp [~rog@92.17.93.207] has joined #go-nuts 08:27 -!- araujo [~araujo@gentoo/developer/araujo] has quit [Quit: Leaving] 08:29 < str1ngs> justinlilly: https://gist.github.com/972976 08:29 < str1ngs> a basic walk 08:29 < str1ngs> I think revwalk.Next should return a Oid not use the pointer.. off hand 08:36 -!- huin [~huin@91.85.171.238] has joined #go-nuts 08:37 -!- mehalelal [~androirc@76.103.175.11] has quit [Quit: AndroIRC] 08:38 -!- rlab [~Miranda@91.200.158.34] has joined #go-nuts 08:42 -!- jemeshsu [~jemeshsu@bb219-75-41-232.singnet.com.sg] has quit [Quit: jemeshsu] 08:42 -!- ucasano [~ucasano@host185-90-static.5-79-b.business.telecomitalia.it] has joined #go-nuts 08:44 -!- Project_2501 [~Marvin@dynamic-adsl-94-36-161-95.clienti.tiscali.it] has joined #go-nuts 08:49 -!- mehalelal [~androirc@94.sub-174-253-244.myvzw.com] has joined #go-nuts 08:56 -!- jemeshsu [~jemeshsu@bb219-75-41-232.singnet.com.sg] has joined #go-nuts 09:06 -!- hallas [~hallas@x1-6-30-46-9a-b2-c5-1f.k891.webspeed.dk] has joined #go-nuts 09:06 < hallas> hey all 09:07 -!- firwen [~firwen@2a01:e34:eea3:7e10:4a5b:39ff:fe51:e8ae] has joined #go-nuts 09:07 < str1ngs> hello 09:22 -!- Mehak [~androirc@76.103.175.11] has joined #go-nuts 09:25 -!- mehalelal [~androirc@94.sub-174-253-244.myvzw.com] has quit [Ping timeout: 248 seconds] 09:25 -!- TheMue [~TheMue@p5DDF4DC8.dip.t-dialin.net] has joined #go-nuts 09:26 -!- Loonacy [~loonacy@c-67-172-248-248.hsd1.ut.comcast.net] has quit [Ping timeout: 248 seconds] 09:46 -!- ucasano [~ucasano@host185-90-static.5-79-b.business.telecomitalia.it] has quit [Quit: ucasano] 09:54 -!- sacho [~sacho@83.228.17.177] has quit [Ping timeout: 246 seconds] 09:57 -!- Mehak [~androirc@76.103.175.11] has quit [Quit: AndroIRC] 09:57 -!- sebastianskejoe [~sebastian@188.114.142.217] has joined #go-nuts 09:59 -!- skelterjohn [~jasmuth@c-24-0-2-70.hsd1.nj.comcast.net] has quit [Ping timeout: 246 seconds] 10:02 -!- Project_2501 [~Marvin@dynamic-adsl-94-36-161-95.clienti.tiscali.it] has quit [Ping timeout: 240 seconds] 10:07 -!- sacho [~sacho@83.228.17.177] has joined #go-nuts 10:17 -!- Squeese [~squeese@cm-84.209.17.156.getinternet.no] has joined #go-nuts 10:25 -!- sacho [~sacho@83.228.17.177] has quit [Read error: Operation timed out] 10:26 -!- napsy [~luka@88.200.96.18] has quit [Ping timeout: 260 seconds] 10:27 -!- napsy [~luka@88.200.96.18] has joined #go-nuts 10:29 < jemeshsu> Is there any golang book under development? Coming soon? 10:30 < TheMue> jemeshsu: There are already several 10:31 < TheMue> One in the US, two (mine and another one) in Germany and afaik one in Japan 10:32 < jemeshsu> I can only find one by Baugh in Amazon 10:32 < TheMue> jemeshsu: http://www.amazon.de/gp/product/3898647129/ 10:32 < TheMue> But it's in German 10:32 < jemeshsu> TheMue: where's yours? url? 10:33 -!- m4dh4tt3r [~Adium@c-98-210-145-213.hsd1.ca.comcast.net] has quit [Ping timeout: 252 seconds] 10:34 < jemeshsu> TheMue: I don't want to learn another language to learn a new language :-) Thanks for the link 10:35 < fzzbt> jemeshsu: here is free go book http://miek.nl/files/go/ 10:35 < TheMue> Hehe, sorry, we already asked US publishers for a translation, but there is no interest 10:35 < TheMue> There are new English book in work 10:37 < jemeshsu> TheMue: i know about the Gieben book. thanks 10:37 < jemeshsu> guess need more github projects, blog posts to make golang more mainstream 10:46 -!- ExsysTech [~ExsysTech@50-46-213-60.evrt.wa.frontiernet.net] has quit [Read error: Connection reset by peer] 10:47 -!- edsrzf [~edsrzf@122-61-221-144.jetstream.xtra.co.nz] has quit [Remote host closed the connection] 10:48 -!- ExsysTech [~ExsysTech@50-46-213-60.evrt.wa.frontiernet.net] has joined #go-nuts 11:00 -!- oal [~oal@5.79-160-122.customer.lyse.net] has joined #go-nuts 11:04 -!- Project_2501 [~Marvin@82.84.68.151] has joined #go-nuts 11:11 < TheMue> jemeshsu: You know the dashboard? 11:12 < TheMue> jemeshsu: And this week Go has been announced as third lang on the GAE. So for such a young lang it get's better each day. 11:13 < quag> fzzbt: what's the book like? 11:17 < fzzbt> quag: haven't read it. seems promising, but it's still WIP. 11:27 -!- Squeese [~squeese@cm-84.209.17.156.getinternet.no] has quit [Remote host closed the connection] 11:27 < heatxsink> TheMue: that's pretty crazy that it's the third lang for app eng. 11:28 < TheMue> heatxsink: Yep, an important step for go. So this week the go related traffic on the web raised a lot. 11:28 < heatxsink> w00t 11:28 -!- keidaa [~keidaa@cm-84.210.56.138.getinternet.no] has joined #go-nuts 11:30 < quag> I wonder if it is because there is pressure to use Go internally on google's internal 'app engine' 11:33 < str1ngs> I think it was more because there as alot of intreset for it. and go language seems quite logical for app engine 11:36 -!- Adys_ [~Adys@unaffiliated/adys] has joined #go-nuts 11:38 < TheMue> or just to lower the importance of (oracles) language (java) 11:39 < quag> TheMue: isn't Oracle doing a good job of that themselves? 11:39 -!- Adys_ [~Adys@unaffiliated/adys] has quit [Client Quit] 11:39 < TheMue> quag: hehe 11:40 < aiju> Oracle even sucks at sucking 11:40 < heatxsink> aiju: lolz 11:45 -!- Project-2501 [~Marvin@dynamic-adsl-94-36-170-9.clienti.tiscali.it] has joined #go-nuts 11:48 < moraes> they want to place go as the gae option for highly intensive tasks 11:48 -!- Project_2501 [~Marvin@82.84.68.151] has quit [Ping timeout: 264 seconds] 11:51 < moraes> heatxsink, and this is pretty funny: http://twitter.com/#!/dougnaka/statuses/68039575997661184 11:52 < heatxsink> nobody has ever heard of? 11:52 < heatxsink> lolz 11:52 < heatxsink> geez 11:52 < heatxsink> if you haven't heard of it you have n00b status 11:55 < moraes> many php users only like languages that can run wordpress 11:56 < str1ngs> ya he uses php so we should not worry to much about his opinion 11:56 < aiju> php users only know php 11:56 < aiju> and C 11:56 < aiju> because php is written in it 11:57 -!- Ekspluati [5b9a00ea@gateway/web/freenode/ip.91.154.0.234] has joined #go-nuts 11:58 -!- Elspeth_ [ca2e8ec1@gateway/web/freenode/ip.202.46.142.193] has joined #go-nuts 12:00 < str1ngs> struct fields should be created when creating a struct with f := new(Foo) correct? 12:03 < quag> isn't it a relief that app-engine doesn't support php? 12:03 < str1ngs> ok I think I have declaring and new confused 12:05 < quag> str1ngs: all fields go to their zero values when using new() 12:05 < quag> if you want to populate a struct with values use Foo{a=..., b=...} and so on 12:05 < quag> Is that what you're getting at? 12:05 < str1ngs> ok thats working for go types 12:06 < str1ngs> no I have a problem with new(Foo) and C type fields 12:06 < str1ngs> ie type Foo { cfield *C.foo } 12:07 < str1ngs> typo missed the struct keyword 12:07 < str1ngs> I'll paste some code will make it easier 12:07 < str1ngs> but my guess the the zero value for C fields is nil 12:08 < quag> sorry, I don't know about the C interation. 12:14 -!- skelterjohn [~jasmuth@c-24-0-2-70.hsd1.nj.comcast.net] has joined #go-nuts 12:14 < str1ngs> doh pointers are nil 12:14 < str1ngs> sill me 12:14 < str1ngs> silly* 12:14 < str1ngs> ok that explains that 12:22 -!- aho [~nya@fuld-590c6141.pool.mediaWays.net] has joined #go-nuts 12:34 -!- ImpatientSpoon [~ashley@115.6.233.220.static.exetel.com.au] has quit [Read error: Connection reset by peer] 12:35 -!- photron [~photron@port-92-201-244-191.dynamic.qsc.de] has joined #go-nuts 12:39 -!- breadlorde [~dreadlord@c-24-11-39-160.hsd1.mi.comcast.net] has joined #go-nuts 12:51 -!- XenoPhoenix [~Xeno@cpc13-aztw24-2-0-cust23.aztw.cable.virginmedia.com] has quit [Quit: back in a bit] 12:53 -!- keidaa [~keidaa@cm-84.210.56.138.getinternet.no] has quit [Quit: Leaving] 12:56 -!- l00t [~i-i3id3r_@189.105.66.232] has quit [Ping timeout: 246 seconds] 13:06 -!- ExsysHost [~ExsysTech@50-46-213-60.evrt.wa.frontiernet.net] has joined #go-nuts 13:06 -!- snearch [~snearch@g225018121.adsl.alicedsl.de] has joined #go-nuts 13:08 -!- ExsysTech [~ExsysTech@50-46-213-60.evrt.wa.frontiernet.net] has quit [Ping timeout: 252 seconds] 13:10 < uriel> 11:40 < aiju> Oracle even sucks at sucking 13:10 < uriel> nonsense, they are really good at it 13:10 < uriel> specially at sucking up all the money from corporate fools 13:10 < str1ngs> haha 13:12 -!- boscop [~boscop@f055153169.adsl.alicedsl.de] has quit [Ping timeout: 246 seconds] 13:12 -!- huin [~huin@91.85.171.238] has quit [Quit: luncheon] 13:25 -!- napsy [~luka@88.200.96.18] has quit [Quit: leaving] 13:25 -!- napsy [~luka@88.200.96.18] has joined #go-nuts 13:28 -!- Ekspluati [5b9a00ea@gateway/web/freenode/ip.91.154.0.234] has quit [Quit: Page closed] 13:29 < manveru> container/heap really could do with some example... 13:32 -!- napsy [~luka@88.200.96.18] has quit [Quit: Lost terminal] 13:33 < str1ngs> manveru: see there tests 13:33 < str1ngs> manveru: also you can contribute to the docs for that 13:35 -!- XenoPhoenix [~Xeno@cpc13-aztw24-2-0-cust23.aztw.cable.virginmedia.com] has joined #go-nuts 13:35 < manveru> heh 13:35 < manveru> if i knew how to write those docs... 13:36 -!- napsy [~luka@88.200.96.18] has joined #go-nuts 13:36 < manveru> the only useful test i can find is test/chan/sieve2.go - which seems to say that any container/vector can be used as a container/heap 13:37 < manveru> now i just have to write my own vector because we still don't have generics :( 13:38 -!- mattn_jp [~mattn@180-144-129-39f1.hyg1.eonet.ne.jp] has joined #go-nuts 13:39 < Soultaker> does Go have something like Java's Scanner or C++ iostream yet? (Not go.scanner, which is for Go source only) 13:40 < manveru> 200 lines of useless boilerplate... 13:40 -!- rael_wiki [~chatzilla@unaffiliated/rael-wiki/x-8420294] has joined #go-nuts 13:41 < exch> Soultaker: I guess the closest match are the fmt.Scan() functions and friends 13:41 < exch> not sure if that is what you are after 13:42 -!- boscop [~boscop@f055145097.adsl.alicedsl.de] has joined #go-nuts 13:42 < TheMue> manveru: Why do you explicitely need vectors? 13:42 < manveru> TheMue: because that's what the test uses? 13:43 < manveru> needs push/pop, and the sort interface 13:43 < TheMue> manveru: do you need it or the test? 13:43 < manveru> so this seems like the best option 13:44 < Soultaker> exch: actually that looks pretty close to what I was looking for, thanks! 13:44 < manveru> TheMue: i need container/heap 13:44 < manveru> anything else is boilerplate 13:45 < manveru> vector seems like the most mature option for that, and i can translate it with two gofmts 13:47 -!- araujo [~araujo@gentoo/developer/araujo] has joined #go-nuts 13:50 -!- snearch [~snearch@g225018121.adsl.alicedsl.de] has quit [Quit: Verlassend] 14:00 < Soultaker> is there a ReadLine function that allocates its own buffer, so I don't have to bother with preallocating a slice of sufficient length? 14:01 -!- breadlorde [~dreadlord@c-24-11-39-160.hsd1.mi.comcast.net] has quit [Ping timeout: 250 seconds] 14:03 < hallas> Soultaker, which package? 14:03 < Soultaker> I don't know, that's why I ask. ;) 14:04 < Soultaker> (or if you meant ReadLine: I found that in bufio) 14:05 < hallas> I dont 14:05 < hallas> I mean 14:05 < aiju> ReadLine allocates its own buffer 14:05 < rael_wiki> if a channel is closed while there are some values still left inside it a range operator on that channel will immediately stop or will it keep getting the remaining values and then stop? 14:05 < hallas> If you talk about the ReadLine of bufio, then it doesnt make any sence about pre allocating anything 14:05 < aiju> rael_wiki: the latter 14:05 -!- mattn_jp [~mattn@180-144-129-39f1.hyg1.eonet.ne.jp] has quit [Remote host closed the connection] 14:05 < rael_wiki> aiju: thanks god ;) 14:07 < kamaji> java makes me sad 14:08 < kamaji> tomcat is so enterprisey it hurts 14:08 < heatxsink> kamaji: ya it is 14:09 < kamaji> it feels like a collection of libraries that are all trying to do the same thing in ever-so-slightly different ways, and aren't really managing it very well 14:10 < kamaji> I wish I could use twister for this 14:10 -!- angasule [~angasule@190.2.33.49] has joined #go-nuts 14:10 < aiju> kamaji: aren't most libraries like that? 14:10 < kamaji> ever the cynic 14:11 < kamaji> Maybe 14:11 < Soultaker> aiju/hallas: you are right, I misread that. 14:12 < kamaji> but it's just... ugh 14:16 -!- monsieur_max [~maxime@ip-78.net-89-2-171.rev.numericable.fr] has quit [Quit: Leaving.] 14:16 -!- PortatoreSanoDiI [~Marvin@82.84.74.1] has joined #go-nuts 14:20 -!- Project-2501 [~Marvin@dynamic-adsl-94-36-170-9.clienti.tiscali.it] has quit [Ping timeout: 260 seconds] 14:28 -!- l00t [~i-i3id3r_@189.105.108.155] has joined #go-nuts 14:38 < str1ngs> I have a good idea for a project github markdow support for doc.go 14:39 -!- huin [~huin@91.85.171.238] has joined #go-nuts 14:41 -!- Tuller [~tuller@c-69-143-48-210.hsd1.va.comcast.net] has joined #go-nuts 14:41 -!- firwen [~firwen@2a01:e34:eea3:7e10:4a5b:39ff:fe51:e8ae] has quit [Remote host closed the connection] 14:42 -!- monsieur_max [~maxime@ip-78.net-89-2-171.rev.numericable.fr] has joined #go-nuts 14:43 < hallas> doc.go ? 14:43 < hallas> godoc? 14:46 < str1ngs> right 14:49 -!- hallas [~hallas@x1-6-30-46-9a-b2-c5-1f.k891.webspeed.dk] has left #go-nuts [] 14:52 -!- ako [~nya@fuld-590c6993.pool.mediaWays.net] has joined #go-nuts 14:54 -!- bortzmeyer [~stephane@2a01:e35:8bd9:8bb0:c4f3:affa:111a:fa53] has joined #go-nuts 14:54 -!- aho [~nya@fuld-590c6141.pool.mediaWays.net] has quit [Ping timeout: 246 seconds] 14:58 -!- monsieur_max [~maxime@ip-78.net-89-2-171.rev.numericable.fr] has quit [Quit: Leaving.] 15:01 -!- merijn [~merijn@535134AB.cm-6-2a.dynamic.ziggo.nl] has joined #go-nuts 15:01 -!- monsieur_max [~maxime@ip-78.net-89-2-171.rev.numericable.fr] has joined #go-nuts 15:02 < merijn> How is it decided what gets exported in a package? Are there explicit public/private declarations or...? 15:02 < aiju> merijn: first letter 15:02 < aiju> capital letter means exported 15:02 < merijn> ok, thanks :) 15:07 -!- nictuku [~nict@84-72-7-79.dclient.hispeed.ch] has joined #go-nuts 15:07 -!- nictuku [~nict@84-72-7-79.dclient.hispeed.ch] has quit [Changing host] 15:07 -!- nictuku [~nict@unaffiliated/nictuku] has joined #go-nuts 15:11 -!- hallas [~hallas@x1-6-30-46-9a-b2-c5-1f.k891.webspeed.dk] has joined #go-nuts 15:11 < hallas> Small question, not entirely go related. What kind of token is { and } if you had to give them a name? In most grammars they're simply LEFT_PARAM RIGHT_PARAM. 15:13 < hallas> A seperator, or control character? I'm not sure. 15:15 < ampleyfly> what about block delimiter 15:16 < skelterjohn> brackets 15:17 < skelterjohn> scope operator 15:17 < skelterjohn> dunno 15:17 -!- Tuller [~tuller@c-69-143-48-210.hsd1.va.comcast.net] has quit [Quit: Computer has gone to sleep.] 15:17 < hallas> Meh alright 15:18 < aiju> SQUIRLYTHINGLEFT 15:18 < hallas> Writing a disposition for my thesis - and I just started to wonder :P 15:18 < aiju> SQUIRLYTHINGRIGHT 15:19 < ampleyfly> seriously, I think block delimiter is an established term 15:22 < hallas> ampleyfly: alright thanks 15:28 -!- MX80 [~MX80@cust151.253.117.74.dsl.g3telecom.net] has joined #go-nuts 15:28 -!- FX80 [~MX80@cust151.253.117.74.dsl.g3telecom.net] has joined #go-nuts 15:35 -!- danilo04 [~danilo04@129.21.100.41] has joined #go-nuts 15:36 -!- dfr|mac [~dfr|work@ool-182e3fca.dyn.optonline.net] has joined #go-nuts 15:37 < skelterjohn> aren't delimiters things that go on the end? like semicolons w/ C? 15:37 < Soultaker> what's a good way to do for i := range(array) {} when I don't use i in the loop? 15:37 < skelterjohn> it sets de-limit 15:37 < skelterjohn> _ = range array 15:37 < skelterjohn> don't need the parens - range is not a function 15:38 < Soultaker> ah, I was trying _ := range, but that's not allowed apparently :) 15:38 < Soultaker> thanks. 15:38 < Soultaker> (and I'll get rid of the parentheses) 15:39 < Soultaker> (it's a bit confusing that builtins like make() and len() require parentheses but other builtins like new and range apparently don't) 15:39 < aiju> new requires parentheses 15:39 < aiju> and range is not a builtin function 15:39 < aiju> range is a part of syntax 15:39 < aiju> like if or for 15:39 < Soultaker> yeah, but so is make. 15:40 < aiju> make is a builtin function 15:40 < aiju> valid as a value 15:40 < aiju> range is not valid as a value 15:40 < Soultaker> functions can't take types as arguments, can they? 15:40 < aiju> it's a magical function 15:40 < Soultaker> well, then the same could be said of range, couldn't it? 15:41 < aiju> you can't write i := range foo 15:41 < aiju> you need a for statement around that 15:44 -!- moraes_ [~moraes@189.103.176.38] has joined #go-nuts 15:47 -!- moraes [~moraes@189.103.176.38] has quit [Ping timeout: 248 seconds] 15:49 < rael_wiki> is it a good habit to close all open channels before the end of programs or is it just to be done if useful? 15:50 -!- chomp [~chomp@c-67-186-35-69.hsd1.pa.comcast.net] has joined #go-nuts 16:00 < manveru> rael_wiki: only if you like :) 16:01 < str1ngs> godoc -html . > index.html and profit :P 16:03 -!- Fish [~Fish@9fans.fr] has joined #go-nuts 16:04 -!- Squeese [~squeese@cm-84.209.17.156.getinternet.no] has joined #go-nuts 16:10 -!- dju [dju@fsf/member/dju] has quit [Read error: Connection reset by peer] 16:10 -!- dju_ [dju@fsf/member/dju] has joined #go-nuts 16:14 -!- bockmabe [~bockmabe@c-24-143-97-84.customer.broadstripe.net] has joined #go-nuts 16:17 -!- merijn [~merijn@535134AB.cm-6-2a.dynamic.ziggo.nl] has quit [Ping timeout: 276 seconds] 16:18 < wrtp> Soultaker: make and new can be used in any expression context; range can only be used in a for statement 16:22 < manveru> ok... priority queue seems to work fine 16:23 -!- gtaylor [~gtaylor@99-5-124-9.lightspeed.gnvlsc.sbcglobal.net] has joined #go-nuts 16:26 -!- Squeese [~squeese@cm-84.209.17.156.getinternet.no] has quit [Remote host closed the connection] 16:27 -!- firwen [~firwen@2a01:e34:eea3:7e10:4a5b:39ff:fe51:e8ae] has joined #go-nuts 16:28 < str1ngs> hmm godoc --http does no generate a table of contents for each package 16:29 -!- oal [~oal@5.79-160-122.customer.lyse.net] has quit [Read error: Connection reset by peer] 16:33 -!- oal [~oal@5.79-160-122.customer.lyse.net] has joined #go-nuts 16:38 -!- twopoint718 [~chris@fsf/member/twopoint718] has joined #go-nuts 16:38 -!- wrtp [~rog@92.17.93.207] has quit [Quit: wrtp] 16:44 -!- nteon [~nteon@c-98-210-195-105.hsd1.ca.comcast.net] has joined #go-nuts 16:48 -!- tvw [~tv@e176004005.adsl.alicedsl.de] has joined #go-nuts 16:49 -!- pearle [~pearle@blk-224-181-222.eastlink.ca] has joined #go-nuts 16:54 < justinlilly> how do you go about telling C where it can find libraries? Trying to compile a go module that uses C libraries. 16:54 < justinlilly> Its telling me that it can't find some header files. 16:54 < str1ngs> C or cgo? 16:55 < justinlilly> basically I'm trying to install go-git, and it can't find git2.h 16:55 < justinlilly> not sure which environment variable tells it where to find C packages. 16:55 < str1ngs> ah do you have libgit2 installed? 16:55 < justinlilly> I have a check out of it nearby 16:55 < justinlilly> just not sure how to say "look for libgit2 over THERE" 16:56 < str1ngs> what os are you using? 16:56 < justinlilly> linux 16:56 < str1ngs> distro? 16:56 < justinlilly> ubuntu 11.* 16:56 < str1ngs> apt-cache search libgit 16:56 < justinlilly> I have a checkout of libgit right nearby.. can I not use that? 16:57 < str1ngs> you can but its more work 16:57 < justinlilly> It should seemingly be as easy as setting an environment variable telling it where to search for libraries, no? 16:57 < str1ngs> you need to use -I cflag iirc 16:57 < str1ngs> let me mess with it here 16:57 < str1ngs> also make module should pull the libgit sub module 16:57 < nteon> justinlilly: tipically it searches /usr/include and friends, so you can do make install in libgit2 and it should work 16:58 < str1ngs> justinlilly: or git submodule init;git submodule update 16:58 < nteon> but if it pulls ti in as a submodule do that :) 16:58 < justinlilly> str1ngs: I did that. btw, git submodule update --init is a shortcut for those two commands. 16:58 < str1ngs> no! make module :P 16:58 < str1ngs> :) 16:59 < str1ngs> ok let me mess with the -L cflag 16:59 < nteon> a native git package would be really cool 16:59 < justinlilly> https://github.com/str1ngs/go-git 16:59 < str1ngs> not exactly native but a start 17:00 -!- FX80 [~MX80@cust151.253.117.74.dsl.g3telecom.net] has quit [Quit: Leaving] 17:00 < str1ngs> justinlilly: hope you saw http://str1ngs.github.com/go-git/ 17:00 < str1ngs> justinlilly: this way I only have to hack at one document source 17:01 < justinlilly> I didn't. I see the make rule for it though. 17:01 * justinlilly has just been reading the source. 17:01 < chomp> hrm so os provides geteuid but not seteuid? 17:02 -!- rcrowley [~rcrowley@c-71-202-44-233.hsd1.ca.comcast.net] has joined #go-nuts 17:02 < nteon> str1ngs: very cool 17:09 < justinlilly> str1ngs: btw, only libgit stuff in apt is libgit-ruby 17:09 < str1ngs> justinlilly: the other option is to use /usr/local/ for now 17:09 < str1ngs> ./waf configure 17:09 < str1ngs> ./waf build 17:09 < str1ngs> ./waf install iirc 17:09 < justinlilly> right. 17:10 < justinlilly> Well I'll give it a go. 17:10 < str1ngs> but that crufts up /usr/local .. which I dont mind much but you may 17:10 * justinlilly would prefer it didn't happen, but wants to get this tool working more. 17:10 < str1ngs> I'll work on the CFLAGS issue 17:11 < skelterjohn> justinlilly: // #cgo CFLAGS: -I somewhere 17:11 < skelterjohn> above import "C" 17:11 < skelterjohn> http://golang.org/cmd/cgo/ 17:12 -!- hungrygruffalo [~hungrygru@host86-186-120-61.range86-186.btcentralplus.com] has quit [Quit: hungrygruffalo] 17:13 -!- hungrygruffalo [~hungrygru@host86-186-120-61.range86-186.btcentralplus.com] has joined #go-nuts 17:15 < str1ngs> yes but if we change that then it breaks for goinstall 17:16 < str1ngs> which might not be the best option 17:18 < str1ngs> justinlilly: I think /usr/local is the best option 17:18 < justinlilly> that's what I'm doing for now. 17:18 < str1ngs> its easier to support people this way 17:18 < str1ngs> and goinstall will work also 17:19 < str1ngs> and for people with distro packages it will just work provided is sane 17:19 < str1ngs> push comes to shove I'll go back to pkg-config but will break goinstall 17:21 < str1ngs> also w/e you decide is fine for top level design is fine with me. I'm kinda weak in that regards. you seem to be much better at it then I 17:22 < justinlilly> making up apis is fun. I tend to just pseudocode then try to make the code reflect it. 17:23 < str1ngs> thats perfect 17:24 -!- cinghialino [~Marvin@82.84.74.1] has quit [Read error: Connection reset by peer] 17:25 < str1ngs> I'm also going to play with godef more. its possible we can do direct struct mappings like https://gist.github.com/9d118b7db3cfb9043aa9 17:26 < justinlilly> cool. 17:26 < str1ngs> which I think you were sorry after? 17:26 < str1ngs> sorta* 17:26 < justinlilly> kinda, yea. 17:27 < justinlilly> I need to walk git log and get a list of files touched with each commit, then generate diffs for them. 17:27 < justinlilly> I'm making a git-backed static site generator, fwiw. 17:28 < justinlilly> https://gist.github.com/5ca661d29a354be0847c -- general idea 17:30 -!- preflex [~preflex@unaffiliated/mauke/bot/preflex] has quit [Ping timeout: 276 seconds] 17:30 < str1ngs> ah nice 17:31 < str1ngs> I'll forgive you for useing emacs :P 17:31 * justinlilly has used all other editors, including vim for 5 years, before converting. 17:31 * justinlilly is happy with his choice. ^_^ 17:33 < str1ngs> I really tried to use emacs. but sadly I could not convert 17:33 < justinlilly> Why's that? 17:33 < str1ngs> I started with vi 17:33 < str1ngs> and chaining commands I could not get use to 17:34 < str1ngs> I also set -o vi . to make matters worst so I never use gnu style bindings 17:34 -!- preflex [~preflex@unaffiliated/mauke/bot/preflex] has joined #go-nuts 17:34 < justinlilly> I started with vim. I greatly disliked emacs, for no real reason. I decided I wanted to write an objective article about why emacs was awful, so I tried it for a month. I've been with it since :) 17:34 < justinlilly> (though I still use vim almost daily) 17:34 < str1ngs> hehe 17:35 < hallas> VIM FTW! 17:35 < str1ngs> I can not say I dislike emacs. I just like to bug emacs users :P 17:35 < moraes> i'd like to try emacs but i have a pc 17:35 < str1ngs> https://github.com/str1ngs/go-git/blob/master/pkg/git/git_test.go#L139 example refwalk 17:35 * moraes is trolling too 17:35 < hallas> Install Ubuntu :-)? 17:36 < justinlilly> Can't say that I really want to convert anyone to emacs, just feel obligated to help educate. 17:36 < moraes> eubuntus? 17:36 < hallas> Huh? 17:36 < moraes> my joke is lame. 17:36 < justinlilly> str1ngs: I have the refwalk working. I'm down to commit objects, but I need to access deeper than what Commit exposes. 17:36 < str1ngs> justinlilly: I think you want tree 17:36 < str1ngs> justinlilly: possibly use the oid to do a tree look up 17:36 < str1ngs> for each commit 17:38 < str1ngs> also make sure to defer repo.Free() and possibly revwalk.Free() I need to check revwalk repo you should call 17:38 < justinlilly> what's the best way to develop this locally? I have a .a file under GOROOT? 17:38 < str1ngs> I use _test.go files 17:39 < str1ngs> use _test files for working on the go-git and then make install and import git 17:42 < aiju> the funny thing is most arguments "why EMACS is bad" also apply to vim 17:46 < moraes> i don't use any, my editor is awful 17:46 < str1ngs> justinlilly: ah I have limited tree support right now 17:46 < justinlilly> that's fine. I'll add some in a bit. 17:50 -!- dju__ [dju@fsf/member/dju] has joined #go-nuts 17:51 -!- Loonacy [~loonacy@c-67-172-248-248.hsd1.ut.comcast.net] has joined #go-nuts 17:52 -!- dju_ [dju@fsf/member/dju] has quit [Ping timeout: 240 seconds] 18:04 -!- awidegreen [~quassel@h-170-226.A212.priv.bahnhof.se] has quit [Remote host closed the connection] 18:06 -!- awidegreen [~quassel@h-170-226.A212.priv.bahnhof.se] has joined #go-nuts 18:12 < chomp> mmm PAM wrapper's up- https://github.com/krockot/gopam 18:13 < aiju> yuck pam 18:13 -!- tvw [~tv@e176004005.adsl.alicedsl.de] has quit [Ping timeout: 246 seconds] 18:13 < chomp> i know right 18:13 < aiju> haha 18:13 < chomp> at least it's ever-so-slightly less painful than using the C API directly 18:18 -!- angasule [~angasule@190.2.33.49] has quit [Ping timeout: 240 seconds] 18:18 -!- l00t [~i-i3id3r_@189.105.108.155] has quit [Read error: Connection reset by peer] 18:20 -!- alexandere [~alexander@eijg.xs4all.nl] has joined #go-nuts 18:21 -!- l00t [~i-i3id3r_@20150141106.user.veloxzone.com.br] has joined #go-nuts 18:23 -!- angasule [~angasule@190.2.33.49] has joined #go-nuts 18:25 < nteon> is there a way to create something like pipes? I need to test a function that uses a bufio.Reader 18:25 < aiju> io.Copy? 18:26 -!- l00t [~i-i3id3r_@20150141106.user.veloxzone.com.br] has quit [Read error: Connection reset by peer] 18:28 < str1ngs> nteon: io.Pipe() 18:28 < nteon> I think io.Pipe is what im looking for 18:28 < nteon> heh 18:28 < nteon> yes :) 18:28 < str1ngs> nteon: are you running something? 18:28 < str1ngs> with exec or StartProcess 18:30 -!- l00t [~i-i3id3r_@189.105.3.38] has joined #go-nuts 18:31 < nteon> str1ngs: no, basically I just want to test some code that takes a reader as an argument. maybe there is an easier way. I guess I could create a bufio.NewReader from some byte slice, that might be better 18:32 < chomp> that sounds perfectly reasonable 18:32 < str1ngs> nteon: bytes.Buffer 18:33 < nteon> str1ngs: thanks 18:33 < str1ngs> then use io.Copy 18:33 < str1ngs> you might not need bytes.Buffer with io.Copy 18:33 < str1ngs> just copy to os.Stderr for testing 18:35 < str1ngs> bytes.NewBuffer to create one from a bytes slice 18:35 -!- merijn [~merijn@inconsistent.nl] has joined #go-nuts 18:36 -!- twopoint718 [~chris@fsf/member/twopoint718] has quit [Ping timeout: 252 seconds] 18:42 < chomp> is there currently any way to get goinstall to play nicely with cgo modules 18:42 < chomp> specifically to, say, become aware of an external linker dependency 18:44 -!- nictuku [~nict@unaffiliated/nictuku] has quit [Quit: brb] 18:45 -!- eikenberry [~jae@ivanova.zhar.net] has quit [Quit: End of line.] 18:46 -!- rcrowley [~rcrowley@c-71-202-44-233.hsd1.ca.comcast.net] has quit [Quit: Computer has gone to sleep.] 18:49 -!- l00t [~i-i3id3r_@189.105.3.38] has quit [Ping timeout: 264 seconds] 18:49 < chomp> ah, nevermind. there it goes. 18:49 -!- alexandere [~alexander@eijg.xs4all.nl] has quit [Quit: alexandere] 18:51 < str1ngs> chomp: there is see http://golang.org/cmd/cgo/ 18:51 < chomp> ya, just found the LDFLAGS stuff 18:51 < chomp> thanks 18:51 < str1ngs> np 18:58 -!- |Craig| [~|Craig|@panda3d/entropy] has joined #go-nuts 19:02 -!- hungrygruffalo [~hungrygru@host86-186-120-61.range86-186.btcentralplus.com] has quit [Quit: hungrygruffalo] 19:03 < justinlilly> str1ngs: how do you go about debugging issues with this cgo stuff? I'm not fairly familiar with C, if you couldn't tell, though I can read it. 19:04 < justinlilly> Specifically, I'm doing something I think should work, mostly following the C api docs, but I'm getting a rather opaque error: Cannot read reference file 'packed-refs' 19:05 -!- aho [~nya@fuld-590c6172.pool.mediaWays.net] has joined #go-nuts 19:07 < str1ngs> ah from refwalk.Next() ? 19:07 < justinlilly> https://gist.github.com/8ab864d2a1f0cd19589a -- gist if it makes it clearer. 19:08 < justinlilly> compare to: http://libgit2.github.com/api.html#trees 19:08 -!- m4dh4tt3r [~Adium@c-98-210-145-213.hsd1.ca.comcast.net] has joined #go-nuts 19:08 < justinlilly> (btw, I think the ruby api is something worth basing the go one off of. It makes lots of sense) 19:08 < str1ngs> I assume you have a commit? 19:08 < justinlilly> I'm reusing the repo object from earlier in the tests. It should have several commits. 19:08 -!- ako [~nya@fuld-590c6993.pool.mediaWays.net] has quit [Ping timeout: 246 seconds] 19:08 < justinlilly> ... assuming I'm following this correctly? 19:09 < str1ngs> try with one created by git 19:09 < justinlilly> I tried with a real repository. same effect. 19:10 < str1ngs> ok I'll look into it more . mean time you can get the error number from the C function and look it up in error.h 19:11 < justinlilly> found the error earlier, just couldn't find where to look it up. 19:11 < str1ngs> LastError is new and might be buggy or not completey on the libgit2 side 19:12 < justinlilly> hmm. GIT_EMISSINGOBJDATA 19:12 < str1ngs> but I think its an issue with GetHead 19:12 < str1ngs> thats rather hackish and not the right way 19:12 < str1ngs> also sounds perverted 19:13 < justinlilly> err. I think it might be GIT_EINVALIDTYPE as I wasn't reading the define properly. 19:15 < str1ngs> if you see GetHead I hardcode the ref path which is probably wrong 19:17 < justinlilly> seems to return the correct oid in this case. 19:18 -!- breadlorde [~dreadlord@c-24-11-39-160.hsd1.mi.comcast.net] has joined #go-nuts 19:19 < str1ngs> what is the error code? 19:19 < justinlilly> -9 19:20 -!- merijn [~merijn@inconsistent.nl] has left #go-nuts [] 19:21 < str1ngs> GIT_EMISSINGOBJDATA 19:21 < justinlilly> no. its -8 19:21 < justinlilly> because GIT_ERROR is -1 already 19:21 < justinlilly> -1 - 8 = -1 + -8 = -9 19:21 < str1ngs> sorry your right 19:21 < justinlilly> (I made the same mistake) 19:21 < str1ngs> I actually did the math but selected the wrong one 19:21 < str1ngs> for paste 19:22 < justinlilly> so wrong type for tree. 19:22 < str1ngs> http://libgit2.github.com/api.html#trees 19:23 < justinlilly> teehee. I just linked that above ^_^ 19:23 < str1ngs> sorry 19:23 < justinlilly> so it seems like I'm following the API they've defined there. 19:23 < str1ngs> missed it 19:23 -!- bortzmeyer [~stephane@2a01:e35:8bd9:8bb0:c4f3:affa:111a:fa53] has quit [Quit: Leaving.] 19:23 < str1ngs> ok my guess HEAD is not going to have a tree 19:23 < str1ngs> so try with a commit 19:24 < justinlilly> HEAD == commit 19:24 < justinlilly> specifically in my case, but I think generally as well. 19:25 < str1ngs> justinlilly: also I think this &tree.git_tree is a better way to wrap 19:26 < str1ngs> offtopic but I'm thinking I not using pointer for fields 19:29 < justinlilly> apparently you can't use short shas with NewOidString. 19:29 < justinlilly> anyway, even pegging a commit sha to it in a repo with a single file and single commit.. no luck. 19:29 < str1ngs> no there is another method for that 19:29 < str1ngs> can you push to my repo please. and I'll mess with it 19:30 < justinlilly> sure. 19:30 < str1ngs> I you can make commits saves doing pull requests 19:33 < justinlilly> comitted. 19:33 < str1ngs> thanks 19:33 < str1ngs> also I there are some methods that can be converted to static functions just not sure which yet 19:35 < str1ngs> oops sub :P 19:35 < str1ngs> I though of that but I forgot to change it 19:37 -!- Elspeth_ [ca2e8ec1@gateway/web/freenode/ip.202.46.142.193] has quit [Ping timeout: 252 seconds] 19:38 < str1ngs> CommitCreate is hackish so becareful with it right now 19:40 -!- rcrowley [~rcrowley@c-71-202-44-233.hsd1.ca.comcast.net] has joined #go-nuts 19:41 < kamaji> does go follow 'BODMAS'? 19:41 -!- dreadlorde [~dreadlord@c-24-11-39-160.hsd1.mi.comcast.net] has quit [Ping timeout: 252 seconds] 19:42 -!- tobym [~tobym@cpe-72-229-2-6.nyc.res.rr.com] has joined #go-nuts 19:45 -!- twopoint718 [~chris@adsl-71-150-251-93.dsl.mdsnwi.sbcglobal.net] has joined #go-nuts 19:45 -!- twopoint718 [~chris@adsl-71-150-251-93.dsl.mdsnwi.sbcglobal.net] has quit [Changing host] 19:45 -!- twopoint718 [~chris@fsf/member/twopoint718] has joined #go-nuts 19:45 < justinlilly> kamaji: I would imagine so, yes. 19:50 -!- napsy [~luka@88.200.96.18] has quit [Read error: Operation timed out] 19:53 < nteon> heh, I had to look that up. we called it PEDMAS :) 19:56 -!- boscop [~boscop@f055145097.adsl.alicedsl.de] has quit [Ping timeout: 246 seconds] 19:57 -!- boscop [~boscop@f055145097.adsl.alicedsl.de] has joined #go-nuts 19:59 < str1ngs> justinlilly: LastError is wrong in this regards so its confusing the issue. 19:59 < justinlilly> *shakes a fist* 19:59 < justinlilly> how do you go about debugging this? 19:59 < str1ngs> thats from RevWalk test 20:00 < str1ngs> mainly I use the libgit headers and sometimes read the C source. 20:00 < str1ngs> for the post parts though I use prints 20:05 < kamaji> nteon: I can't even think what the O is now... 20:05 < kamaji> I'm going to kick myself in a minute 20:06 < justinlilly> kamaji: orders 20:06 < justinlilly> powers/sqrrts 20:06 < kamaji> Ok i don't think i've ever heard it referred to as "orders" 20:06 < kamaji> I wonder why I learned that mnemonic :D 20:07 < justinlilly> dunno. we always just called it "the order of operations" afaicr 20:07 -!- TheMue [~TheMue@p5DDF4DC8.dip.t-dialin.net] has quit [Quit: TheMue] 20:10 -!- ExsysTech [~ExsysTech@50-46-213-60.evrt.wa.frontiernet.net] has joined #go-nuts 20:11 -!- anticw [~anticw@c-98-210-108-13.hsd1.ca.comcast.net] has quit [Read error: Connection reset by peer] 20:11 -!- monsieur_max1 [~maxime@ip-78.net-89-2-171.rev.numericable.fr] has joined #go-nuts 20:11 -!- aho [~nya@fuld-590c6172.pool.mediaWays.net] has quit [Ping timeout: 246 seconds] 20:11 -!- monsieur_max [~maxime@ip-78.net-89-2-171.rev.numericable.fr] has quit [Ping timeout: 246 seconds] 20:11 -!- chomp_ [~chomp@c-67-186-35-69.hsd1.pa.comcast.net] has joined #go-nuts 20:11 -!- ako [~nya@fuld-590c6172.pool.mediaWays.net] has joined #go-nuts 20:11 -!- ExsysHost [~ExsysTech@50-46-213-60.evrt.wa.frontiernet.net] has quit [Ping timeout: 246 seconds] 20:11 -!- chomp [~chomp@c-67-186-35-69.hsd1.pa.comcast.net] has quit [Ping timeout: 246 seconds] 20:11 -!- anticw [~anticw@c-98-210-108-13.hsd1.ca.comcast.net] has joined #go-nuts 20:15 -!- rlab [~Miranda@91.200.158.34] has quit [Ping timeout: 260 seconds] 20:16 < nteon> kamaji: Orders (exponents) according to the wikipeia 20:17 < nteon> oh, right, been answered 20:17 < nteon> heh 20:17 -!- rlab [~Miranda@91.200.158.34] has joined #go-nuts 20:18 -!- danilo04 [~danilo04@129.21.100.41] has quit [Ping timeout: 250 seconds] 20:21 < nteon> does anyone know anythign/have any advice for running 6cov? I'd love to be able to run my unit tests through it, but its telling me "6cov: stopped at 0x413203; not at breakpoint 1" 20:21 -!- m4dh4tt3r [~Adium@c-98-210-145-213.hsd1.ca.comcast.net] has quit [Quit: Leaving.] 20:22 < nteon> tracked as issue 1319 it seems 20:25 -!- sebastianskejoe [~sebastian@188.114.142.217] has quit [Quit: Lost terminal] 20:25 < str1ngs> common waf . waf install does that not imply build 20:25 -!- Urmel| [~11087Urme@82-136-196-44.ip.telfort.nl] has quit [Ping timeout: 248 seconds] 20:30 -!- Urmel| [~11087Urme@82-136-196-44.ip.telfort.nl] has joined #go-nuts 20:35 < str1ngs> justinlilly: hows your C? 20:35 < justinlilly> str1ngs: I can read it, but that's about the extent. 20:35 < justinlilly> Why? 20:36 < str1ngs> was going to see if you could replicate this with C 20:36 < str1ngs> I'll put a ctest together 20:36 < str1ngs> but it boilds down to the git_object_lookup 20:36 < str1ngs> boils* 20:38 < jeremy_c> no go-iup on appspot yet :-/ 20:40 -!- zozoR [~Morten@2906ds2-arno.0.fullrate.dk] has quit [Ping timeout: 260 seconds] 20:43 -!- sacho [~sacho@83.228.17.177] has joined #go-nuts 20:44 -!- grncdr [~stephen@sdo.csc.UVic.CA] has quit [Ping timeout: 260 seconds] 20:45 -!- hungrygruffalo [~hungrygru@host86-186-120-61.range86-186.btcentralplus.com] has joined #go-nuts 20:46 -!- dreadlorde [~dreadlord@c-24-11-39-160.hsd1.mi.comcast.net] has joined #go-nuts 20:46 -!- hungrygruffalo [~hungrygru@host86-186-120-61.range86-186.btcentralplus.com] has quit [Client Quit] 20:50 -!- bockmabe [~bockmabe@c-24-143-97-84.customer.broadstripe.net] has quit [Ping timeout: 258 seconds] 20:52 -!- Tuller [~tuller@c-69-143-48-210.hsd1.va.comcast.net] has joined #go-nuts 20:52 -!- firwen [~firwen@2a01:e34:eea3:7e10:4a5b:39ff:fe51:e8ae] has quit [Remote host closed the connection] 20:53 -!- Dr_Who [~tgall@206.9.88.154] has quit [Ping timeout: 276 seconds] 20:54 -!- photron [~photron@port-92-201-244-191.dynamic.qsc.de] has quit [Read error: Operation timed out] 21:02 -!- monsieur_max1 [~maxime@ip-78.net-89-2-171.rev.numericable.fr] has quit [Quit: Leaving.] 21:04 -!- Fish [~Fish@9fans.fr] has quit [Quit: So Long, and Thanks for All the Fish] 21:06 -!- Tuller [~tuller@c-69-143-48-210.hsd1.va.comcast.net] has quit [Quit: muffins] 21:09 -!- nictuku [~yvesj@unaffiliated/nictuku] has joined #go-nuts 21:09 -!- awidegreen [~quassel@h-170-226.A212.priv.bahnhof.se] has quit [Remote host closed the connection] 21:09 -!- vzx [~ryan@74-129-201-27.dhcp.insightbb.com] has quit [Quit: </d] 21:09 < nictuku> am I wrong to think that the documentation for package math should say that Cos() Sin() and Sincos() take radians as input, confront to degrees? 21:10 < nictuku> I realize most people used to math just assume it's degrees, but not the rest of us ;-P 21:10 -!- danilo04 [~danilo04@rm2348358874.student.rit.edu] has joined #go-nuts 21:11 < chomp> nictuku, i am confused 21:11 < chomp> they operate in radians, yes? 21:11 < nictuku> yes. 21:11 -!- piranha [~piranha@5ED43A0B.cm-7-5a.dynamic.ziggo.nl] has quit [Quit: Computer has gone to sleep.] 21:11 < chomp> that's the de facto standard across virtually all math libraries 21:12 < chomp> though i suppose it's a fair point that it wouldn't hurt the documentation to divulge such information :p 21:12 < nictuku> right, that doesn't mean it shouldn't be explicit. 21:12 < |Craig|> nictuku: what do you mean by "confront to degrees"? 21:12 < nictuku> "as opposed to" 21:13 < |Craig|> thats not what confront means, I assumed you had a typo of convert 21:14 < |Craig|> confront = Meet (someone) face to face with hostile or argumentative intent. 21:14 < nictuku> should have been confer, my bad. 21:14 < nictuku> I meant in the sense of "cf." 21:14 < nictuku> I incorrectly expanded that to "confront". Sorry for the confusion. 21:16 < nictuku> seems like that is an improper use of "cf." too 21:16 < chomp> i think "as opposed to" or "instead of" are the clearest ways of expressing what you wanted :) 21:18 < nictuku> chomp, thank you, that's what I said before. 21:18 < chomp> but digression abounds and this is not #english. i agree with you that the documentation should be explicit about this 21:21 -!- AmourDeZombi [~jphillips@c-68-41-9-175.hsd1.mi.comcast.net] has joined #go-nuts 21:26 -!- mehalelal [~androirc@76.103.175.11] has joined #go-nuts 21:27 -!- hallas [~hallas@x1-6-30-46-9a-b2-c5-1f.k891.webspeed.dk] has quit [Remote host closed the connection] 21:34 -!- oal [~oal@5.79-160-122.customer.lyse.net] has quit [Remote host closed the connection] 21:38 -!- dju_ [dju@fsf/member/dju] has joined #go-nuts 21:40 -!- gtaylor [~gtaylor@99-5-124-9.lightspeed.gnvlsc.sbcglobal.net] has quit [Quit: gtaylor] 21:42 -!- dju__ [dju@fsf/member/dju] has quit [Ping timeout: 248 seconds] 21:43 -!- wrtp [~rog@92.17.93.207] has joined #go-nuts 21:43 -!- huin [~huin@91.85.171.238] has quit [Quit: bedtime] 21:45 -!- ExsysTech [~ExsysTech@50-46-213-60.evrt.wa.frontiernet.net] has quit [Read error: Connection reset by peer] 21:46 -!- ExsysTech [~ExsysTech@50-46-213-60.evrt.wa.frontiernet.net] has joined #go-nuts 21:48 < str1ngs> justinlilly: I'm going to post something to the libgit2 ML. is this holding you up? 21:48 -!- mehalelal [~androirc@76.103.175.11] has quit [Quit: AndroIRC] 21:51 -!- rlab [~Miranda@91.200.158.34] has quit [Read error: Connection reset by peer] 21:54 -!- mehalelal [~mehalelal@76.103.175.11] has joined #go-nuts 21:55 -!- espeed [~espeed@63.246.231.57] has joined #go-nuts 21:58 -!- Dr_Who [~tgall@206.9.88.154] has joined #go-nuts 22:03 < hpvincent> hi, why does 'package' takes a plain word, but 'import' a string ? 22:04 < str1ngs> because import needs to be escaped in some way 22:04 < str1ngs> its quite common to have url's and number for import names 22:05 -!- wrtp [~rog@92.17.93.207] has quit [Quit: wrtp] 22:06 < hpvincent> so you do not necessarily import a package ? 22:06 < |Craig|> you may need a path along with the package name 22:07 < str1ngs> import github.com/pkg/foobar/blah is going to break the compiler 22:07 < str1ngs> so it needs to be escaped 22:07 < |Craig|> or even just "image/png". You can't have a / in an identifier 22:08 < str1ngs> yep 22:08 < hpvincent> I see; so import actually refers to a path 22:09 < str1ngs> right 22:10 -!- ShadowIce [~pyoro@unaffiliated/shadowice-x841044] has quit [Quit: Verlassend] 22:10 < hpvincent> I suppose the 'int' type implement the Stringer interface, but do I need to import something to benefit from it ? 22:11 < skelterjohn> benefit from it in what way? and i don't believe int satisfies Stringer 22:11 < str1ngs> justinlilly: I have a good idea whats going on commit oid != tree oid 22:11 -!- pearle [~pearle@blk-224-181-222.eastlink.ca] has quit [Ping timeout: 246 seconds] 22:11 < hpvincent> skelterjohn, I mean, I have 'a' of type 'int', I want to do a.String() 22:12 < skelterjohn> right. i don't believe that happens. 22:12 < skelterjohn> i'll check 22:12 < skelterjohn> yeah, doesn't happen 22:12 < skelterjohn> none of the built-in types have methods 22:12 < skelterjohn> not even string implements Stringer :) 22:14 < str1ngs> hpvincent: you can do that still 22:14 < str1ngs> hpvincent: it may not impliment stringer but you can use a.String() to return a string representation 22:14 < hpvincent> I though it was possible to add new methods to any type :( 22:15 < str1ngs> you can 22:15 < skelterjohn> hpvincent: you can't add methods to a type you do not define. you have to create a new type 22:15 < skelterjohn> type MyInt int 22:15 < skelterjohn> func (i MyInt) String() string { ... } 22:15 < hpvincent> ah 22:15 < skelterjohn> then you can do MyInt(aRegularInt).String() 22:15 < hpvincent> I see, you have to be very explicit 22:15 < skelterjohn> yes 22:15 < skelterjohn> "var a int; a.String()" <- does not compile 22:16 < hpvincent> so a given type has all its methods defined together in only one module 22:17 < skelterjohn> yes 22:17 < skelterjohn> so you only have to import one package to know everything about a type 22:17 < hpvincent> I see, that was not very clear from the doc I read so far :) 22:18 < skelterjohn> otherwise two different pieces of code could think something different about one particular type 22:18 < hpvincent> but it does make sense 22:18 < hpvincent> yes, that was actually bugging me 22:19 -!- ab3 [~abe@83.101.90.66] has joined #go-nuts 22:19 < ab3> is there something luke curl in go 22:19 < ab3> i mean a pkg 22:19 < skelterjohn> check http://godashboard.appspot.com/project 22:20 < taruti> ab3: http.Get() is not enough? 22:20 < mehalelal> I am trying to learn how to use the netchan package. This code: http://pastie.org/1906711 . Is causing this error: multiple-value netchan.Import() in single-value context. What am I doing wrong? 22:21 < skelterjohn> mehalelal: netchan.Import() returns multiple values 22:21 < skelterjohn> you're only providing a landing zone for one 22:21 < skelterjohn> the other is probably os.Error, but i haven't looked at the doc 22:22 < mehalelal> Yea, it is. I changed it to err := imp.Import(service, chan, Recv, 1) and same issue 22:22 < skelterjohn> imp, err := netchan.Import(...) 22:22 -!- dreadlorde [~dreadlord@c-24-11-39-160.hsd1.mi.comcast.net] has quit [Ping timeout: 248 seconds] 22:22 < mehalelal> oh, that makes sense. Thank you 22:22 < mehalelal> I feel real stupid now 22:22 < skelterjohn> if a function has signature "func Foo() (a, b int)" 22:22 < skelterjohn> you have to say "a, b = Foo()" 22:24 < mehalelal> I thought that the Import I was using was a method? 22:24 < ab3> taruti: why is there no Get func in the doc of http http://golang.org/pkg/http/ 22:24 -!- dreadlorde [~dreadlord@c-24-11-39-160.hsd1.mi.comcast.net] has joined #go-nuts 22:25 < skelterjohn> ab3: Client.Get 22:25 < taruti> ab3: http://golang.org/pkg/http/#Response.Get 22:25 < mehalelal> Sorry, I was looking at the wrong line number 22:26 < mehalelal> Thank you for your help! :-) 22:29 -!- allengeorge [~allengeor@c-24-7-17-50.hsd1.ca.comcast.net] has joined #go-nuts 22:29 < ab3> taruti: why is it func Get(url string) ... instead of func (*Response) Get(url string) ... 22:30 < taruti> ab3: because the Get function _creates_ the response. 22:30 < str1ngs> Get is a helper function 22:30 < ab3> from the doc you are made to belief that Get is part of Response 22:30 < ab3> k, so it is something like CreateBLaBla 22:31 < str1ngs> no 22:31 < taruti> meh, I want unsafeCoerce# in Go :( 22:32 < taruti> *(*foo)(unsafe.Pointer(&x)) is ugly 22:33 < str1ngs> ab3: you need to play with the http package abit after abit it will make sense. also dependant on how much you have used othere libraries 22:35 < hpvincent> say I defined "type MyInt int", and "type MyOtherInt int", how can I cast from MyInt to MyOtherInt or vice versa ? 22:37 < ab3> str1ngs: guess so 22:37 -!- AmourDeZombi [~jphillips@c-68-41-9-175.hsd1.mi.comcast.net] has left #go-nuts [] 22:39 < |Craig|> hpvincent: I assume you can cast to an int, then to the final type 22:39 < hpvincent> ok, I found how to cast to int, just type 'int (expression)' 22:40 < hpvincent> one funny thing , if 'a' is of type 'MyInt', then apparently 'a + 3' is still of this type, as well as '3 + a' 22:40 < jnwhiteh> why is that funny? 22:41 < jnwhiteh> its just straightforward type inference 22:41 < hpvincent> well, why MyInt rather than int ? 22:41 < jnwhiteh> because a is a MyInt 22:41 < hpvincent> but 3 is int ? 22:41 < jnwhiteh> yes, and they both have the same underlying type 22:42 < jnwhiteh> you could have it so the 'a' is basically coerced back to that underlying type, or you can promote the 3 in order to keep the user defined type 22:42 < jnwhiteh> having it the other way would make writing lots of code a pain in the ass =/ 22:42 -!- nteon [~nteon@c-98-210-195-105.hsd1.ca.comcast.net] has quit [Quit: leaving] 22:43 -!- vpit3833 [~user@203.111.33.203] has joined #go-nuts 22:44 < hpvincent> ok; actually when writing 'a+3', 3 must have been considered as MyInt 22:44 < jnwhiteh> yes 22:46 < hpvincent> but I canno write 'a + b' where b would be an int 22:46 < jnwhiteh> type MyInt int; func main() { var a MyInt = 4; var b int = 3; println(a + b) } 22:46 < jnwhiteh> that doe 22:46 < jnwhiteh> that doesn't work 22:46 < jnwhiteh> correct 22:46 < hpvincent> it's just int constant that are automatically coerced 22:46 < jnwhiteh> the 'type' of 3 is inferred 22:46 < jnwhiteh> its not even coerced 22:46 < hpvincent> I see 22:46 < jnwhiteh> the type is inferred 22:46 < hpvincent> ok 22:47 < hpvincent> it's getting clearer :) 22:47 < jnwhiteh> you can add two MyInts together, so a + b where a is a MyInt needs a MyInt for b as well, and the compiler knows that the constant 3 can be a MyInt =) 22:47 < jnwhiteh> I'm simplifying, but that's the general idea 22:49 -!- Squeese [~squeese@cm-84.209.17.156.getinternet.no] has joined #go-nuts 22:57 < hpvincent> I wonder why I cannot do that : http://pastebin.com/LFu8NgLy 22:58 < hpvincent> basically, I have two types defined to be similar structure, I want to convert one to the other 22:58 < hpvincent> to do that I try to convert to an anonymous structure 23:00 < skelterjohn> constants are untyped 23:00 < skelterjohn> 3 has no type 23:00 < skelterjohn> however, if you do x := 3, x has type int 23:00 < skelterjohn> cause you gotta choose something 23:00 < skelterjohn> but var x MyInt = 3 is fine too 23:01 < skelterjohn> as is x + 3 23:01 < skelterjohn> even though x + a regular int is a problem 23:01 < skelterjohn> and for the MyOtherInt, you can change MyOtherInt(int(b)) to MyOtherInt(b) 23:02 < skelterjohn> i think 23:02 < skelterjohn> ? 23:02 < hpvincent> yes, but my problem is with the types t3 and t4 in my pastebin now 23:02 < skelterjohn> yeah - those types have nothing to do with each other 23:02 < skelterjohn> that they have the same data layout is a coincidence, as far as the compiler is concerned 23:02 < justinlilly> str1ngs: what I'm doing isn't time sensitive. just a side project. :) 23:02 < hpvincent> but the way I can convert MyInt to int, why can't I convert t3 to anonymous structure ? 23:03 < skelterjohn> you could probably convert t3 to a struct {a, b int} 23:03 < hpvincent> since it has same structure, it should be allowed, just like I was allowed to convert MyInt to int 23:03 < str1ngs> justinlilly: ok if you look at the 23:03 < skelterjohn> i don't know what a "struct { int int 23:03 < skelterjohn> } is 23:03 < skelterjohn> i think it might be nonsense 23:03 < str1ngs> justinlilly: test dir in libgit2 they help 23:03 < hpvincent> the same but without the name of the fields ? 23:03 < skelterjohn> no - it isn't go synta 23:03 < skelterjohn> x 23:03 < skelterjohn> that's what i mean 23:04 < skelterjohn> "struct { int int }" doesn't mean anything at all 23:04 < str1ngs> justinlilly: maily the tree one you see that the sha1 for the tree_oid does not match any commit sha1 23:04 < skelterjohn> but "struct {a, b int}" or maybe even "struct { int; int }" would be ok 23:04 < str1ngs> justinlilly: so they are not one in the same 23:04 < skelterjohn> but "int int" is not go 23:04 < hpvincent> skelterjohn, ok 23:05 < hpvincent> indeed, I guess it meant a field of type int called int :) 23:05 < justinlilly> So you have to get the treeoid for the given commit then. 23:05 < skelterjohn> hpvincent: ah yes, it is go 23:05 < skelterjohn> just not what you meant 23:05 < skelterjohn> right 23:05 < str1ngs> yes I'm thinking you have to some how get the tree oid from the commit 23:06 < str1ngs> justinlilly: I just got a new keyboard so dont mind all the typos 23:06 < hpvincent> skelterjohn, after fixing the syntax, it refuses to do the conversion anyway 23:06 < hpvincent> apparently , it cares not only about the type of the fields, but also their names 23:07 < str1ngs> justinlilly: this is partyly why I do not like the examples on the libgit2 site they are not complete 23:07 < skelterjohn> http://pastebin.com/LLYaNKF0 23:07 < skelterjohn> this compiles, hpvincent 23:07 < skelterjohn> oh interesting 23:07 < skelterjohn> right you are 23:08 < hpvincent> this works http://pastebin.com/DnzMrp1C , but I need the fields to have the same name in both types 23:09 < skelterjohn> btw the use of anonymous types like that is very rare 23:10 < hpvincent> I guess so :) I was just curious if it was possible to do similar to the MyInt to MyOtherInt conversion with more complicated types 23:11 < hpvincent> actually, I could have just wrote t4(e) 23:12 < skelterjohn> rule of thumb for a new language - if what you're doing seems unnecessarily complicated, there is probably a better way :) 23:12 -!- twopoint718 [~chris@fsf/member/twopoint718] has quit [Ping timeout: 240 seconds] 23:13 < str1ngs> justinlilly: git_commit_tree 23:13 < justinlilly> str1ngs: aha! they have api docs. http://libgit2.github.com/libgit2/group__git__commit.html 23:13 < str1ngs> lol 23:13 < justinlilly> ^_^ found it at the same time 23:14 < str1ngs> just use the header files 23:14 < str1ngs> those docs are meh. or am I to hardcore? 23:14 < justinlilly> those docs are effectively prettier header files :) 23:15 -!- pearle [~pearle@blk-224-181-222.eastlink.ca] has joined #go-nuts 23:15 < str1ngs> I cant grep them :P 23:15 -!- Adys [~Adys@unaffiliated/adys] has quit [Ping timeout: 240 seconds] 23:17 < str1ngs> also I'm not a fan of how they hardcode so many sha1's 23:17 < str1ngs> atleast not in the example's there not very useful when they do that 23:18 -!- bombuzal [~bombuzal@cpc5-newc14-2-0-cust836.gate.cable.virginmedia.com] has joined #go-nuts 23:20 < justinlilly> nice! Have it parsing commits to trees now. 23:21 < str1ngs> good stuff. ok I'm not going to touch this code then. commit away 23:21 < justinlilly> will flesh out Tree with the bits I need, then commit. 23:21 < str1ngs> no worries 23:22 -!- dfc [~dfc@eth59-167-133-99.static.internode.on.net] has joined #go-nuts 23:23 < str1ngs> I'll surf around for a libgit2 ppa 23:29 -!- Adys [~Adys@unaffiliated/adys] has joined #go-nuts 23:40 -!- gtaylor [~gtaylor@99-5-124-9.lightspeed.gnvlsc.sbcglobal.net] has joined #go-nuts 23:56 -!- gtaylor [~gtaylor@99-5-124-9.lightspeed.gnvlsc.sbcglobal.net] has quit [Quit: gtaylor] 23:56 -!- gtaylor [~gtaylor@99-5-124-9.lightspeed.gnvlsc.sbcglobal.net] has joined #go-nuts --- Log closed Mon May 16 00:00:50 2011