Go Language Resources Go, golang, go... NOTE: This page ceased updating in October, 2012

--- Log opened Tue May 24 00:00:51 2011
00:02 -!- hallas [~hallas@x1-6-30-46-9a-b2-c5-1f.k891.webspeed.dk] has quit [Read
error: Connection reset by peer]
00:09 -!- flaguy48 [~gmallard@user-0c6s350.cable.mindspring.com] has quit [Ping
timeout: 246 seconds]
00:13 -!- flaguy48 [~gmallard@user-0c6s350.cable.mindspring.com] has joined
#go-nuts
00:14 -!- angasule [~angasule@190.2.33.49] has joined #go-nuts
00:24 < mjard> I remember that issue, chrome and IE both have "friendly"
error messages that they would display if the response was under 1024 bytes, the
only way to get them to display the message from the server is to pad them
00:26 < dfc> i thought the header had to be > 512 bytes
00:26 < dfc> there was a header
00:26 < dfc> X-Pad: Stop clever IE messages\r\n (sic)
00:28 < mjard> clever
00:28 < dfc> oh, no
00:28 < dfc> i was mistaken
00:28 < dfc> that was a different header
00:28 < dfc> http://www.develobert.info/2009/10/x-pad-avoid-browser-bug.html
00:29 < dfc> but I think the same applies to the clever error messages
00:29 < dfc> you can pass a header to ask for them to be disabled, or supply
a decent sized 4xx page
00:29 < mjard> "If Apache didn't do this, old versions of Netscape would
hang." :(
00:30 < mjard> I would have been less friendly had I been at apache
00:30 < dfc> exactly
00:31 < mjard> bet that was a long debugging session
00:31 -!- exch [~exch@c74149.upc-c.chello.nl] has joined #go-nuts
00:33 -!- Tv__ [~Tv__@cpe-76-168-227-45.socal.res.rr.com] has joined #go-nuts
00:37 -!- vyom [~vyom@c-24-18-47-160.hsd1.wa.comcast.net] has joined #go-nuts
00:37 < fvbommel> Maybe "<!-- Chrome/IE would ignore this error page if
this text weren't here.  -->" would make a better padding?  (Only works if the
error page is (x)html/xml, obviously)
00:41 < mjard> no, you're not always serving up html
00:41 < mjard> oh
00:41 < mjard> you said that
00:42 < mjard> brain is cutting out early today :D
00:42 * dfc considers the irony of the number of hacks that exist to support a
browser who's parent company went bust
00:44 * fvbommel considers the irony of the standard lib of Go (mainly developed
at Google) including a hack to work around what it considers a misfeature of
Google Chrome.
00:45 < dfc> specifically ?
00:46 -!- wallerdev [~wallerdev@c-68-60-43-43.hsd1.mi.comcast.net] has joined
#go-nuts
00:47 < fvbommel> dfc: The whole "Chrome/IE would ignore this error page if
this text weren't here." thing we're talking about.
00:47 -!- tylerl [~tylerl@ip24-251-232-171.ph.ph.cox.net] has quit [Quit: leaving]
00:47 < fvbommel> That's because apparently Chrome ignores short error
messages, on purpose.
00:49 < dfc> yeah, i'll pay that
00:56 < manveru> i guess it's just hard to convince the chrome team if
you're not on it :)
01:15 -!- cafesofie [~cafesofie@ool-18b97779.dyn.optonline.net] has joined
#go-nuts
01:19 -!- iant [~iant@216.239.45.130] has joined #go-nuts
01:19 -!- mode/#go-nuts [+v iant] by ChanServ
01:19 -!- hallas [~hallas@x1-6-30-46-9a-b2-c5-1f.k891.webspeed.dk] has joined
#go-nuts
01:27 -!- hargettp [~hargettp@pool-71-174-139-181.bstnma.east.verizon.net] has
quit [Ping timeout: 246 seconds]
01:29 -!- noam [~noam@87.69.42.61.cable.012.net.il] has quit [Ping timeout: 240
seconds]
01:29 -!- noam [noam@87.69.42.61.cable.012.net.il] has joined #go-nuts
01:29 -!- kr [~Keith@204.14.152.118] has quit [Ping timeout: 246 seconds]
01:35 -!- dreadlorde [~dreadlord@c-24-11-39-160.hsd1.mi.comcast.net] has joined
#go-nuts
01:46 -!- bugQ [~bug@c-67-186-255-54.hsd1.ut.comcast.net] has quit [Ping timeout:
248 seconds]
01:46 -!- bubb [~AndChat@S01065cd9985ba2e7.va.shawcable.net] has quit [Read error:
Connection reset by peer]
01:48 < vyom> "cannot use &v1.artist (type *[30]_Ctype_char) as type
*_Ctype_char in function argument"
01:48 < vyom> I am using some C types
01:49 < vyom> and one of them is a fixed length char array
01:49 < vyom> I am trying to convert it to string : C.GoString(&v1.artist)
01:49 < vyom> and I get that error
01:49 < vyom> how do I get rid of that error
01:55 -!- angasule [~angasule@190.2.33.49] has quit [Ping timeout: 264 seconds]
01:55 < vyom> anyone?
01:59 -!- dfr|mac [~dfr|work@nat/google/x-aabugbhykdbqzxon] has joined #go-nuts
02:06 -!- _foocraft [~ewanas@78.101.218.80] has joined #go-nuts
02:07 -!- foocraft_ [~ewanas@78.101.131.133] has quit [Ping timeout: 250 seconds]
02:12 < skelterjohn> vyom: v1.artist is probably a char*?
02:12 < skelterjohn> so you'd just want to pass v1.artist to C.GoString
instead of &v1.artist
02:14 < vyom> thanks..  that's what I just did :) :
https://gist.github.com/988032
02:15 < vyom> sorry..  did not follow you.  I had to pass the address of the
first index of v1.artist..  as v1.artist[0]
02:23 -!- |Craig| [~|Craig|@panda3d/entropy] has joined #go-nuts
02:27 -!- aho [~nya@fuld-590c76ac.pool.mediaWays.net] has quit [Quit:
EXEC_over.METHOD_SUBLIMATION]
02:31 -!- niemeyer [~niemeyer@200-102-196-125.pltce701.dsl.brasiltelecom.net.br]
has joined #go-nuts
02:37 -!- dfr|mac [~dfr|work@nat/google/x-aabugbhykdbqzxon] has quit [Ping
timeout: 276 seconds]
02:54 < skelterjohn> yes, that seems better :)
03:09 < manveru> hm
03:10 < manveru> ok, given i have 'type Foo struct { id int }; func (f Foo)
Id() int { return f.id }'
03:10 -!- werdan7 [~w7@freenode/staff/wikimedia.werdan7] has joined #go-nuts
03:10 < manveru> why would using Foo.Id() in another package give me
"implicit assignment of unexported field 'id' of job.Job in method receiver"
03:11 < manveru> s/job.Job/Foo/
03:11 < manveru> how else do i get that information without making it
writable?
03:15 < vyom> I think you just ran into this
https://groups.google.com/d/topic/golang-nuts/RrfxMj-UaHQ/discussion
03:16 -!- foocraft_ [~ewanas@178.152.75.255] has joined #go-nuts
03:17 -!- _foocraft [~ewanas@78.101.218.80] has quit [Ping timeout: 250 seconds]
03:20 < Tv__> manveru: you could use pointers to avoid outsiders needing to
know the struct internals
03:20 < Tv__> manveru: the f arg gets a *copy* of the struct, and taking
that copy is your problem
03:23 < manveru> hm
03:24 < manveru> but i call it on a pointer anyway
03:24 < Tv__> change the received to be f *Foo, and it'll work
03:25 < manveru> thanks
03:26 -!- kr [~Keith@c-24-5-193-165.hsd1.ca.comcast.net] has joined #go-nuts
03:28 < Tv__> *receiver
03:32 -!- gigatropolis [~chatzilla@c-76-126-13-14.hsd1.ca.comcast.net] has joined
#go-nuts
03:36 -!- kr [~Keith@c-24-5-193-165.hsd1.ca.comcast.net] has quit [Quit: WeeChat
0.3.4]
03:41 -!- keithgcascio [~keithcasc@nat/google/x-yihstddfhdruyeyz] has quit [Quit:
Leaving]
03:52 -!- Viriix [~joseph@c-67-169-172-251.hsd1.ca.comcast.net] has joined
#go-nuts
03:52 -!- mbohun [~mbohun@ppp115-156.static.internode.on.net] has joined #go-nuts
03:58 -!- zozoR [~Morten@2906ds2-arno.0.fullrate.dk] has joined #go-nuts
04:00 -!- nteon [~nteon@c-98-210-195-105.hsd1.ca.comcast.net] has quit [Remote
host closed the connection]
04:05 -!- niemeyer [~niemeyer@200-102-196-125.pltce701.dsl.brasiltelecom.net.br]
has quit [Ping timeout: 240 seconds]
04:10 -!- Null-A [~Null-A@129-97-205-219.uwaterloo.ca] has joined #go-nuts
04:11 -!- Null-A [~Null-A@129-97-205-219.uwaterloo.ca] has quit [Client Quit]
04:13 -!- rejb [~rejb@unaffiliated/rejb] has quit [Disconnected by services]
04:13 -!- rejb [~rejb@unaffiliated/rejb] has joined #go-nuts
04:27 -!- noam [noam@87.69.42.61.cable.012.net.il] has quit [Ping timeout: 250
seconds]
04:32 -!- wallerdev [~wallerdev@c-68-60-43-43.hsd1.mi.comcast.net] has quit [Quit:
wallerdev]
04:33 -!- jarsen [~jarsen@76.8.206.34] has joined #go-nuts
04:34 -!- B33p [~mgray@li226-224.members.linode.com] has joined #go-nuts
04:34 -!- wallerdev [~wallerdev@c-68-60-43-43.hsd1.mi.comcast.net] has joined
#go-nuts
04:35 -!- dreadlorde [~dreadlord@c-24-11-39-160.hsd1.mi.comcast.net] has quit
[Ping timeout: 240 seconds]
04:38 -!- dreadlorde [~dreadlord@c-24-11-39-160.hsd1.mi.comcast.net] has joined
#go-nuts
04:38 -!- vyom [~vyom@c-24-18-47-160.hsd1.wa.comcast.net] has quit [Remote host
closed the connection]
04:38 -!- hallas [~hallas@x1-6-30-46-9a-b2-c5-1f.k891.webspeed.dk] has quit [Ping
timeout: 250 seconds]
04:39 -!- gtaylor [~gtaylor@99-5-124-9.lightspeed.gnvlsc.sbcglobal.net] has quit
[Quit: gtaylor]
04:43 -!- ctimmerm [~ctimmerm@cs181050011.pp.htv.fi] has joined #go-nuts
04:46 -!- dfr|mac [~dfr|work@ool-182e3fca.dyn.optonline.net] has joined #go-nuts
04:50 -!- fabled [~fabled@83.145.235.194] has quit [Quit: Ex-Chat]
04:53 -!- dfr|mac [~dfr|work@ool-182e3fca.dyn.optonline.net] has quit [Remote host
closed the connection]
04:57 -!- fabled [~fabled@83.145.235.194] has joined #go-nuts
05:05 -!- edsrzf [~edsrzf@122-61-221-144.jetstream.xtra.co.nz] has joined #go-nuts
05:14 -!- allengeorge_ [~allengeor@c-24-7-17-50.hsd1.ca.comcast.net] has joined
#go-nuts
05:17 -!- allengeorge [~allengeor@c-24-7-17-50.hsd1.ca.comcast.net] has quit [Ping
timeout: 240 seconds]
05:18 -!- dreadlorde [~dreadlord@c-24-11-39-160.hsd1.mi.comcast.net] has quit
[Ping timeout: 258 seconds]
05:18 -!- tvw [~tv@e176008113.adsl.alicedsl.de] has joined #go-nuts
05:18 -!- tvw [~tv@e176008113.adsl.alicedsl.de] has quit [Remote host closed the
connection]
05:19 -!- tvw [~tv@e176008113.adsl.alicedsl.de] has joined #go-nuts
05:22 -!- gigatropolis [~chatzilla@c-76-126-13-14.hsd1.ca.comcast.net] has quit
[Quit: ChatZilla 0.9.85 [Firefox 3.5.6/2009120100]]
05:27 -!- quag [~quag@121-98-81-61.bitstream.orcon.net.nz] has quit [Ping timeout:
276 seconds]
05:29 -!- abra [~abra@178.47.224.150] has quit [Ping timeout: 276 seconds]
05:29 -!- jarsen [~jarsen@76.8.206.34] has quit [Remote host closed the
connection]
05:31 -!- ExtraSpice [XtraSpice@78-57-204-104.static.zebra.lt] has joined #go-nuts
05:38 -!- eimantas [~eimantas@ip-212-52-52-163.kava.lt] has joined #go-nuts
05:38 -!- bmizerany [~bmizerany@c-76-21-40-53.hsd1.ca.comcast.net] has quit
[Remote host closed the connection]
05:39 -!- quag [~quag@121-98-81-61.bitstream.orcon.net.nz] has joined #go-nuts
05:40 -!- wallerdev [~wallerdev@c-68-60-43-43.hsd1.mi.comcast.net] has quit [Ping
timeout: 246 seconds]
05:42 -!- abra [~abra@178.47.225.120] has joined #go-nuts
05:46 -!- Fish- [~Fish@9fans.fr] has joined #go-nuts
05:59 -!- Tv__ [~Tv__@cpe-76-168-227-45.socal.res.rr.com] has quit [Ping timeout:
246 seconds]
06:08 -!- bmizerany [~bmizerany@c-76-21-40-53.hsd1.ca.comcast.net] has joined
#go-nuts
06:24 -!- noodles775 [~michael@canonical/launchpad/noodles775] has joined #go-nuts
06:44 -!- _foocraft [~ewanas@89.211.179.230] has joined #go-nuts
06:47 -!- foocraft_ [~ewanas@178.152.75.255] has quit [Ping timeout: 240 seconds]
06:49 -!- bmizerany [~bmizerany@c-76-21-40-53.hsd1.ca.comcast.net] has quit
[Remote host closed the connection]
06:51 -!- bmizerany [~bmizerany@c-76-21-40-53.hsd1.ca.comcast.net] has joined
#go-nuts
06:55 -!- firwen [~firwen@pb-d-128-141-131-148.cern.ch] has joined #go-nuts
06:55 -!- firwen [~firwen@pb-d-128-141-131-148.cern.ch] has quit [Client Quit]
06:57 -!- eimantas [~eimantas@ip-212-52-52-163.kava.lt] has quit [Quit: eimantas]
07:01 -!- napsy [~luka@193.2.66.6] has joined #go-nuts
07:01 -!- bmizerany [~bmizerany@c-76-21-40-53.hsd1.ca.comcast.net] has quit
[Remote host closed the connection]
07:06 -!- |Craig| [~|Craig|@panda3d/entropy] has quit [Quit: |Craig|]
07:11 -!- flaguy48 [~gmallard@user-0c6s350.cable.mindspring.com] has quit [Ping
timeout: 246 seconds]
07:14 -!- gregschlom [~quassel@187.118.210.62.te-dns.org] has joined #go-nuts
07:15 -!- flaguy48 [~gmallard@user-0c6s350.cable.mindspring.com] has joined
#go-nuts
07:16 -!- snearch [~snearch@f053001249.adsl.alicedsl.de] has joined #go-nuts
07:24 -!- ctimmerm [~ctimmerm@cs181050011.pp.htv.fi] has quit [Ping timeout: 248
seconds]
07:25 -!- zcram [~zcram@77-233-78-167.cdma.dyn.kou.ee] has joined #go-nuts
07:25 -!- boscop_ [~boscop@g225203026.adsl.alicedsl.de] has joined #go-nuts
07:27 -!- boscop [~boscop@unaffiliated/boscop] has quit [Ping timeout: 246
seconds]
07:30 -!- rael_wiki [~chatzilla@unaffiliated/rael-wiki/x-8420294] has joined
#go-nuts
07:31 < rael_wiki> hello
07:31 -!- photron [~photron@port-92-201-72-43.dynamic.qsc.de] has joined #go-nuts
07:31 < edsrzf> Hi
07:36 < rael_wiki> is there a cleaner way to do the following?
07:36 < rael_wiki> select {
07:36 < rael_wiki> case a := <-c1:
07:36 < rael_wiki> daAStuff()
07:36 < rael_wiki> if something_happens {b := <-c2; doBStuff()}
07:36 < rael_wiki> case b := <-c2:
07:36 < rael_wiki> doBStuff()
07:36 < rael_wiki> }
07:36 < rael_wiki> without doubling the code?
07:36 < rael_wiki> I mean like a fallthrough statement for the select
07:38 -!- foocraft_ [~ewanas@89.211.174.65] has joined #go-nuts
07:38 < edsrzf> rael_wiki: I can't think of a way
07:40 < edsrzf> I guess you could make a boolean variable
(something_happened) that defaults to true, then set it to !something_happens in
the first case.
07:40 -!- _foocraft [~ewanas@89.211.179.230] has quit [Ping timeout: 246 seconds]
07:41 < edsrzf> Then move the b := <-c2 after the select
07:41 < edsrzf> Inside an if something_happened block
07:41 < edsrzf> Assuming you don't have any other cases, of course
07:44 -!- dfc [~dfc@eth59-167-133-99.static.internode.on.net] has quit [Ping
timeout: 246 seconds]
07:47 -!- Niedar [~bleh@68.99.166.222] has quit [Ping timeout: 276 seconds]
07:49 -!- Niedar [~bleh@ip68-99-166-222.hr.hr.cox.net] has joined #go-nuts
07:53 < rael_wiki> I'm thinking about it...
07:55 < rael_wiki> edsrzf: I forgot to tell you that the select is inside a
for loop
07:56 < rael_wiki> so I need to do case b := <-c2 if nothing arrives from
c1 and after something has arrived from c1 to wait only on c2
08:01 -!- ctimmerm [~ctimmerm@83.150.80.193] has joined #go-nuts
08:01 -!- dj2 [~dj2@CPE001f5b35feb4-CM0014048e0344.cpe.net.cable.rogers.com] has
quit [Read error: Connection reset by peer]
08:01 -!- dj2 [~dj2@CPE001f5b35feb4-CM0014048e0344.cpe.net.cable.rogers.com] has
joined #go-nuts
08:02 -!- snearch [~snearch@f053001249.adsl.alicedsl.de] has quit [Quit:
Verlassend]
08:03 < edsrzf> rael_wiki: Maybe do the select outside the for loop, then?
And remove the second case in favor of an empty default case so that it doesn't
block.
08:05 < rael_wiki> edsrzf: the actual code I'm writing is quite complicated,
maybe I should reengineer it
08:16 -!- GeertJohan [~Squarc@D978EC5D.cm-3-1d.dynamic.ziggo.nl] has joined
#go-nuts
08:19 -!- Ekspluati [5b9a0df9@gateway/web/freenode/ip.91.154.13.249] has joined
#go-nuts
08:27 -!- B33p [~mgray@li226-224.members.linode.com] has quit [Quit: Lost
terminal]
08:33 -!- ampleyfly [ampleyfly@gateway/shell/blinkenshell.org/x-auzbktdzyjjsjgmt]
has quit [Ping timeout: 240 seconds]
08:37 -!- exch [~exch@c74149.upc-c.chello.nl] has quit [Ping timeout: 246 seconds]
08:45 -!- cafesofie [~cafesofie@ool-18b97779.dyn.optonline.net] has quit [Remote
host closed the connection]
08:50 -!- exch [~exch@c74149.upc-c.chello.nl] has joined #go-nuts
08:53 -!- mbohun [~mbohun@ppp115-156.static.internode.on.net] has quit [Ping
timeout: 240 seconds]
09:08 -!- cafesofie [~cafesofie@ool-18b97779.dyn.optonline.net] has joined
#go-nuts
09:10 -!- cafesofie [~cafesofie@ool-18b97779.dyn.optonline.net] has quit [Remote
host closed the connection]
09:13 -!- cafesofie [~cafesofie@ool-18b97779.dyn.optonline.net] has joined
#go-nuts
09:15 -!- cafesofie [~cafesofie@ool-18b97779.dyn.optonline.net] has quit [Remote
host closed the connection]
09:20 -!- edsrzf [~edsrzf@122-61-221-144.jetstream.xtra.co.nz] has quit [Remote
host closed the connection]
09:34 -!- Sep102_ [~Sep102@c-71-231-176-153.hsd1.wa.comcast.net] has quit [Read
error: Connection reset by peer]
09:40 -!- Fish [~Fish@coss6.exosec.net] has quit [Quit: So Long, and Thanks for
All the Fish]
09:40 -!- Fish [~Fish@exo3753.pck.nerim.net] has joined #go-nuts
09:52 -!- GeertJohan [~Squarc@D978EC5D.cm-3-1d.dynamic.ziggo.nl] has quit [Quit:
Leaving.]
09:54 -!- espeed [~espeed@63.246.231.57] has quit [Quit: Leaving]
09:58 -!- hcatlin [~hcatlin@host86-147-13-88.range86-147.btcentralplus.com] has
joined #go-nuts
09:58 -!- hcatlin [~hcatlin@host86-147-13-88.range86-147.btcentralplus.com] has
quit [Changing host]
09:58 -!- hcatlin [~hcatlin@pdpc/supporter/professional/hcatlin] has joined
#go-nuts
09:58 -!- hcatlin [~hcatlin@pdpc/supporter/professional/hcatlin] has quit [Client
Quit]
10:05 -!- noam [noam@87.69.42.61.cable.012.net.il] has joined #go-nuts
10:17 -!- rael_wiki [~chatzilla@unaffiliated/rael-wiki/x-8420294] has quit [Quit:
ChatZilla 0.9.86.1 [Iceweasel 3.5.19/20110430164311]]
10:21 -!- noam [noam@87.69.42.61.cable.012.net.il] has quit [Ping timeout: 260
seconds]
10:26 -!- noam [noam@87.69.42.61.cable.012.net.il] has joined #go-nuts
10:36 < xyproto> Why does this only print 0, -1 ?
http://go.pastie.org/1965534
10:36 < xyproto> I tried to follow the const/iota example for bitmasks from
the go spec
10:37 < xyproto> ah, nvm, typo :D
10:37 < xyproto> 1 instead of 0...
10:42 -!- noam [noam@87.69.42.61.cable.012.net.il] has quit [Ping timeout: 260
seconds]
10:43 -!- alehorst [~alehorst@187.58.246.204] has joined #go-nuts
10:47 -!- noam [noam@87.69.42.61.cable.012.net.il] has joined #go-nuts
10:50 -!- angasule [~angasule@190.2.33.49] has joined #go-nuts
10:57 -!- mbohun [~mbohun@ppp115-156.static.internode.on.net] has joined #go-nuts
11:22 -!- ExsysHost [~ExsysTech@50-46-213-60.evrt.wa.frontiernet.net] has quit
[Read error: Connection reset by peer]
11:23 -!- ExsysTech [~ExsysTech@50-46-213-60.evrt.wa.frontiernet.net] has joined
#go-nuts
11:41 -!- noam [noam@87.69.42.61.cable.012.net.il] has quit [Ping timeout: 240
seconds]
11:46 -!- noam [noam@87.69.42.61.cable.012.net.il] has joined #go-nuts
11:56 < manveru> omfg
12:01 < manveru> how can i get 'foo <-bar()' to only execute bar() when
foo is being read from?
12:02 < manveru> foo being a channel without buffer
12:07 -!- tobier_ [~tobier@c-1c9de055.712-1-64736c11.cust.bredbandsbolaget.se] has
joined #go-nuts
12:08 < str1ngs> manveru: just a guess but maybe something like . select
{case <-foo <-bar(): }
12:08 < str1ngs> I would think there would be a better way though
12:08 -!- tobier [~tobier@c-1c9de055.712-1-64736c11.cust.bredbandsbolaget.se] has
quit [Read error: Operation timed out]
12:10 -!- tobier_ [~tobier@c-1c9de055.712-1-64736c11.cust.bredbandsbolaget.se] has
quit [Read error: Operation timed out]
12:10 < manveru> you mean passing a channel in?
12:11 < str1ngs> both foo and bar are channels right?
12:11 < manveru> bar is a function
12:12 < str1ngs> ok somc case foo <-bar()
12:12 < manveru> yeah, that doesn't work either
12:12 -!- tobier [~tobier@c-1c9de055.712-1-64736c11.cust.bredbandsbolaget.se] has
joined #go-nuts
12:12 -!- dreadlorde [~dreadlord@c-24-11-39-160.hsd1.mi.comcast.net] has joined
#go-nuts
12:12 < str1ngs> do you want the value returned though?
12:13 < manveru> sure
12:13 < manveru> when foo is being read from, i want to execute bar() and
put the result into foo
12:14 < manveru> go seems to execute bar() before for some strange reason
12:14 < str1ngs> do you have a simple code snippet.
12:20 < manveru> str1ngs: http://ideone.com/49gcM
12:20 < manveru> this way seems to work
12:20 < manveru> just a roundtrip more :|
12:23 -!- bXi [bluepunk@irssi.co.uk] has quit [Quit: leaving]
12:23 -!- dreadlorde [~dreadlord@c-24-11-39-160.hsd1.mi.comcast.net] has quit
[Ping timeout: 252 seconds]
12:24 -!- dRbiG [drbig@unhallowed.pl] has quit [Ping timeout: 240 seconds]
12:24 -!- ctimmerm [~ctimmerm@83.150.80.193] has quit [Read error: Operation timed
out]
12:25 -!- ctimmerm [~ctimmerm@83.150.80.193] has joined #go-nuts
12:25 < str1ngs> why not just use a string channel vs a chanel of string
chanel
12:26 < manveru> because otherwise pop() would be executed twice
12:27 < manveru> http://ideone.com/rYvZC see?
12:28 < manveru> making a channel of channels allows me to wait for the
reader to notify me that he's reading
12:28 -!- Fish-- [~Fish@coss6.exosec.net] has joined #go-nuts
12:30 < str1ngs> https://gist.github.com/988622
12:30 < str1ngs> but I guess you still want a loop?
12:30 -!- Fish [~Fish@exo3753.pck.nerim.net] has quit [Read error: Operation timed
out]
12:31 < manveru> well, of course :)
12:32 < str1ngs> but you dont need a chanel of a chanel since when the value
changes it signals
12:32 < str1ngs> does that makes sence?
12:34 < manveru> what value changes?
12:34 < str1ngs> the channel
12:35 < str1ngs> you could say do this thouogh.  wait <- "reading"
12:35 < str1ngs> this way you only use one channel.  keeps it simple
12:36 < manveru> but i have multiple readers
12:36 < manveru> plus more complex values than strings
12:37 < str1ngs> gah ok that makes more sense
12:37 -!- piranha [~piranha@D57D1AB3.static.ziggozakelijk.nl] has joined #go-nuts
12:37 < str1ngs> ok so what you want to do is case <-foo
12:38 < str1ngs> you dont need the value of foo right?
12:38 < manveru> a case for a single channel?
12:38 < manveru> huh?
12:38 < manveru> what's foo?
12:38 < str1ngs> manveru | how can i get 'foo <-bar()' to only execute
bar() when foo is being read from?
12:39 < str1ngs> foo is the wait channel right?
12:39 < manveru> no
12:39 < manveru> or...  yes
12:39 < manveru> in the non-working example
12:40 < str1ngs> ok which you dont need the value of
12:40 < manveru> i need all values
12:41 < manveru> i just want to delay execution of 'bar()' until there's
someone receiving
12:41 < str1ngs> right so select { case <-foo: bar() }
12:41 < str1ngs> if foo changes bar() is called
12:41 < manveru> i also want to send the return value of bar() ...
12:42 < manveru> is that so complicated?
12:42 < jnwhiteh> hrm, should I report a bug if the runtime trace from a
panic is not giving me the correct line numbers in one of my files?
12:42 < str1ngs> manveru: I think you are making more complex then it needs
to be ya.  but again I'm sure there is more code here
12:42 < manveru> jnwhiteh: try running it through gofmt first
12:43 -!- adlan [~adlan@175.138.44.64] has joined #go-nuts
12:43 < manveru> str1ngs: it's simple
12:43 < jnwhiteh> manveru: I have, my code is almost always gofmt output due
to the :Fmt vim plugin =)
12:43 < jnwhiteh> its also off by about 50 lines
12:43 < jnwhiteh> its also off by about 50 lines
12:44 < manveru> str1ngs: the second paste i gave you, i want the output to
be "this should only show up once\nresult: something\n"
12:44 -!- angasule [~angasule@190.2.33.49] has quit [Ping timeout: 244 seconds]
12:44 < manveru> the actual output is: "this should only show up
once\nresult: something\nthis should only show up once\n"
12:45 < str1ngs> manveru: that works if you use select but would still be
stuck in your for loop
12:45 < str1ngs> which is ok if you want to keep listening I guess
12:45 < manveru> select doesn't solve it
12:46 < str1ngs> actuall sorry no thats fine
12:46 < manveru> try it
12:46 < str1ngs> the problem is writer will never stop writing
12:46 < manveru> why is that a problem?
12:46 < manveru> that's what i want
12:47 < manveru> the problem is pop() is being called before a reader is
available
12:47 < str1ngs> ok I see what you mean
12:47 -!- alehorst [~alehorst@187.58.246.204] has quit [Ping timeout: 246 seconds]
12:47 < manveru> jnwhiteh: then i guess you should :)
12:48 < jnwhiteh> its quite a complicated package/test
12:48 < jnwhiteh> I'll see what I can put together
12:48 -!- ampleyfly [ampleyfly@gateway/shell/blinkenshell.org/x-xblqakkdegavbkph]
has joined #go-nuts
12:51 < str1ngs> manveru: ok the problem is your loop
12:52 -!- ampleyfly [ampleyfly@gateway/shell/blinkenshell.org/x-xblqakkdegavbkph]
has quit [Read error: Operation timed out]
12:53 < manveru> wtf?
12:53 < str1ngs> https://gist.github.com/988660
12:54 < str1ngs> you need to throttle the for loop
12:55 < manveru> no way
12:55 < str1ngs> also the go reader is not needed
12:55 < manveru> sorry, but, srsly, no way
12:55 < str1ngs> you have 2 go routines and a sleep after nothing blocks
12:55 < manveru> anyway, i'm using channel of channels now, working sweet
12:56 < str1ngs> fixed?
12:56 < manveru> it sleeps for 2 seconds, enough for one iteration, before
exiting
12:56 < str1ngs> kk
12:56 < str1ngs> still strange how it does that
12:56 < str1ngs> in one functions it calls the channel twice
13:00 -!- hargettp_ [~hargettp_@dhcp-162.mirrorimage.net] has joined #go-nuts
13:02 -!- alehorst [~alehorst@201.47.18.25.dynamic.adsl.gvt.net.br] has joined
#go-nuts
13:06 -!- niemeyer [~niemeyer@200-102-196-125.pltce701.dsl.brasiltelecom.net.br]
has joined #go-nuts
13:11 -!- freetz [~fritz@bc-proxy-2.sandia.gov] has joined #go-nuts
13:12 -!- hallas [~hallas@x1-6-30-46-9a-b2-c5-1f.k891.webspeed.dk] has joined
#go-nuts
13:14 -!- foocraft_ [~ewanas@89.211.174.65] has quit [Ping timeout: 255 seconds]
13:17 < skelterjohn> manveru: the issue is that when a channel is closed and
you try to read from it, it gets the zero value
13:17 < skelterjohn> it won't panic
13:18 < skelterjohn> and you have nothing that breaks the loop
13:18 < skelterjohn> to see if the channel was closed when you tried to
read, do "val, ok := <- theChan"
13:23 < manveru> skelterjohn: nobody closes the channel
13:23 < skelterjohn> oh
13:23 < skelterjohn> right
13:24 -!- creack [~charme_g@163.5.84.203] has quit [Read error: Operation timed
out]
13:24 < manveru> the issue is that "somechan <-somefunc()" executes
"somefunc()" immediately, not when another goroutine does "<-somechan"
13:24 < skelterjohn> oh - it's because pop() is on the rhs of the <-
13:24 < skelterjohn> so it will show up twice
13:24 -!- dlowe [~dlowe@ita4fw1.itasoftware.com] has joined #go-nuts
13:24 < manveru> yes
13:24 < skelterjohn> how did you get it to show up three times?
13:25 < manveru> i never said it does that three times
13:25 -!- iant [~iant@216.239.45.130] has quit [Ping timeout: 260 seconds]
13:25 < skelterjohn> you didn't.
13:25 < skelterjohn> i must have misread earlier
13:26 -!- foocraft_ [~ewanas@78.101.90.123] has joined #go-nuts
13:27 -!- gtaylor [~gtaylor@99-126-136-139.lightspeed.gnvlsc.sbcglobal.net] has
joined #go-nuts
13:34 -!- kkress [~kkress@2001:470:1:41::403e:ad36] has quit [Ping timeout: 248
seconds]
13:35 -!- kkress [~kkress@2001:470:1:41::403e:ad36] has joined #go-nuts
13:37 -!- napsy [~luka@193.2.66.6] has quit [Ping timeout: 240 seconds]
13:39 -!- napsy [~luka@193.2.66.6] has joined #go-nuts
13:39 -!- iant [~iant@67.218.109.241] has joined #go-nuts
13:39 -!- mode/#go-nuts [+v iant] by ChanServ
13:42 < str1ngs> channels and IPC.  whats the easiest method . netchan over
unix socket?
13:42 -!- sunfmin [~sunfmin@115.206.253.191] has joined #go-nuts
13:42 < sunfmin> hi
13:43 < sunfmin> If I do "type MyString string"
13:43 < sunfmin> s := MyString("hello")
13:43 < sunfmin> How do I convert s to string?
13:43 <+iant> string(s)
13:43 < sunfmin> ohh, thanks
13:44 < sunfmin> Is that a method?
13:44 < ww> iant: just to check, that basically just has the compiler check
that the conversion is ok, right?  e.g.  there's no allocation involved
13:44 <+iant> right
13:45 < sunfmin> Any type can do TheTypeName(something) ?
13:45 <+iant> yes, that is a type conversion
13:45 < sunfmin> what is the s.(string) ? type testing?
13:46 -!- ampleyfly [ampleyfly@gateway/shell/blinkenshell.org/x-imzuhzgdedpoqjvh]
has joined #go-nuts
13:46 <+iant> that is used for converting an interface type to some other
type, which is tested dynamically; it's called a type assertion
13:46 <+iant> the difference is that type conversions are handled by the
compiler, type assertions are checked at runtime
13:47 < sunfmin> clear, thank you very much!
13:49 < skelterjohn> and in your case, s.(string) won't compile
13:49 < skelterjohn> because MyString isn't an interface type
13:50 < sunfmin> yes, it doesn't compile, ;-)
13:50 < jeremy_c> skelterjohn: not sure if you saw or not, but the newest
version of gb works fine w/go-iup and its /* #cgo */ directives.
13:50 < skelterjohn> awesome
13:50 < skelterjohn> i hadn't seen
13:51 < skelterjohn> now you just need to get go-iup working on mac so i can
use it
13:51 < jeremy_c> :-)
13:51 < jeremy_c> that one is a bit beyond me, not being a mac programmer
13:52 < skelterjohn> actually, i'll be doing a lot of work on linux this
summer for an internship
13:52 < skelterjohn> does iup offer a canvas element, along with all the
usual widgets?
13:53 < jeremy_c> yes.  a 2d and Gl canvas.
13:53 < skelterjohn> aweseome
13:53 < skelterjohn> i'll take a look at it when i start next week
13:54 -!- rlab [~Miranda@91.200.158.34] has joined #go-nuts
13:54 < sunfmin> I again, How can I convert an integer to string?
string(232221) not returning "232221"
13:54 < Namegduf> sunfmin: strconv.Itoa
13:55 < sunfmin> thanks
13:55 < jeremy_c> or for something more complex, there is always the fmt
package.
13:55 < Namegduf> jeremy_c: Don't recommend the slow way to do a simple
problem.  :P
13:55 < Namegduf> string(int) returns the UTF-8 character for that int
13:55 < sunfmin> cool, thanks, strconv.Itoa suppose to be faster ?
13:56 < Namegduf> strconv.Itoa does exactly what you asked for.
13:56 < sunfmin> fmt.Println(strconv.Itoa(121212312312))
13:56 < sunfmin> get a overflow with this
13:57 -!- chomp [~chomp@dap-209-166-184-50.pri.tnt-3.pgh.pa.stargate.net] has
joined #go-nuts
13:57 < sunfmin> I suppose I should check strconv for other methods
13:57 < skelterjohn> Ita64
13:57 < skelterjohn> Itoa64
13:58 < Namegduf> sunfmin: For *that*, you are probably best with fmt.Printf
13:58 < skelterjohn> or Itoa64!
13:58 < Namegduf> fmt.Printf("%s", somenumber)
13:58 < skelterjohn> won't overflow an int64
13:58 < Namegduf> Or that, yeah.
13:58 < jeremy_c> Namegduf: I wasn't recommending it, was offering if he had
more complex conversions to do, there is the fmt package.  Figured he was new and
could use a peek at the docs and see various options.
13:59 < Namegduf> Using Printf and Fprintf when you're writing to an fd
avoids an in-memory buffer needing allocated
13:59 < Namegduf> Well, an additional one.
13:59 < Namegduf> I think so, anyway.
13:59 * Namegduf could be entirely wrong.  Also there's the varargs allocation...
14:07 < sunfmin> Hi, Any templates in go you guys recommend?  mustache?
14:08 < hallas> sunfmin: what do you mean?  Template engines?
14:08 < sunfmin> yes
14:09 < hallas> sunfmin: I'll gladly recommend the templates package then
:-)
14:09 < sunfmin> cool, check it out now, ;-)
14:12 -!- mbohun [~mbohun@ppp115-156.static.internode.on.net] has quit [Quit:
Leaving]
14:16 -!- napsy [~luka@193.2.66.6] has quit [Quit: leaving]
14:22 -!- r_linux [~r_linux@smtp.mandique.com.br] has joined #go-nuts
14:25 < sunfmin> Hi
14:25 -!- Viriix [~joseph@c-67-169-172-251.hsd1.ca.comcast.net] has quit [Quit:
This computer has gone to sleep]
14:25 < sunfmin> For {Decl FSet|html-esc}
14:25 < sunfmin> where Can I find a set of methods like "html-esc" located?
14:26 < sunfmin> Or any document somewhere for the templates package?
14:26 -!- Viriix [~joseph@c-67-169-172-251.hsd1.ca.comcast.net] has joined
#go-nuts
14:27 < niemeyer> sunfmin: The default ones are pretty much just html and
str, IIRC
14:28 < niemeyer> sunfmin: Documentation is here:
http://golang.org/pkg/template/
14:29 < sunfmin> where I can find a listing of existing formatter methods?
14:33 -!- dfr|mac [~dfr|work@ool-182e3fca.dyn.optonline.net] has joined #go-nuts
14:34 < niemeyer> sunfmin: I just told you
14:35 < niemeyer> sunfmin: html and str are the only default ones, and that
information is in the documentation.
14:35 < sunfmin> ok, it's a map passed in, I thought there are standard
ones.
14:37 -!- jarsen [~jarsen@76.8.206.34] has joined #go-nuts
14:37 < niemeyer> sunfmin: There are standard ones.  The ones I told you,
twice.
14:37 < sunfmin> yeah, html and str
14:39 -!- jarsen [~jarsen@76.8.206.34] has quit [Remote host closed the
connection]
14:40 -!- ExsysHost [~ExsysTech@50-46-213-60.evrt.wa.frontiernet.net] has joined
#go-nuts
14:42 -!- ExsysTech [~ExsysTech@50-46-213-60.evrt.wa.frontiernet.net] has quit
[Ping timeout: 252 seconds]
14:43 -!- imsplitbit [~imsplitbi@64.39.4.132] has joined #go-nuts
14:49 -!- wallerdev [~wallerdev@c-68-60-43-43.hsd1.mi.comcast.net] has joined
#go-nuts
14:55 < xyproto> Is it correct to say that in Go, nothing is left
uninitialized?
14:55 < Namegduf> Yes.
14:55 < xyproto> For instance, when declaring a variable?
14:55 < Namegduf> Everything is initialised to zero.
14:56 < dlowe> "zero"
14:56 < dlowe> every type has a zero-value
14:56 < taruti> xyproto: some things are left uninitialized to useful values
(e.g.  channels)
14:56 < xyproto> dlowe: yes, exactly
14:56 < Namegduf> They're initialised to nil
14:56 < xyproto> taruti: ah, ok.  But is channels the exception to the rule?
14:56 < Namegduf> There's no exceptions.
14:57 -!- ctimmerm [~ctimmerm@83.150.80.193] has quit [Ping timeout: 264 seconds]
14:57 < Namegduf> Everything is initialised to a zero value.
14:57 < xyproto> *are
14:57 < Namegduf> For pointers, channels, and maps, this is nil.
14:57 -!- wrtp [~rog@92.17.18.72] has joined #go-nuts
14:57 < Namegduf> For numbers, this is 0
14:57 -!- iant [~iant@67.218.109.241] has quit [Quit: Leaving.]
14:57 < Namegduf> For strings, it's ""
14:57 < Namegduf> Slices are also nil
14:58 < Namegduf> And structs to the zero values of everything in them.
14:58 < Namegduf> All of these are the result of giving the variables zeroed
memory
14:59 -!- mbohun [~mbohun@ppp115-156.static.internode.on.net] has joined #go-nuts
15:07 < sunfmin> I have a file database.go which have package "database" and
main.go which have package "main", in the same folder
15:07 < sunfmin> How Can I in main.go use database package?
15:08 < aiju> import "database"
15:08 < Namegduf> Note that it is not the Go way to have a package per small
file
15:08 < Namegduf> Packages cannot have circular dependencies and such
15:09 < sunfmin> I got "package main; expected database"
15:09 < Namegduf> Then you're building it wrong.
15:09 -!- bugQ [~bug@c-67-186-255-54.hsd1.ut.comcast.net] has joined #go-nuts
15:10 < sunfmin> My build file: https://gist.github.com/988897
15:11 -!- a2800276 [~a2800276@xdsl-87-79-227-178.netcologne.de] has joined
#go-nuts
15:11 < sunfmin> Added the build error there: https://gist.github.com/988897
15:12 < skelterjohn> you're compiling main and package together
15:12 < skelterjohn> you don't need to import package at all
15:12 < skelterjohn> if you compile them together you can just use stuff
from the other file with no preamble
15:12 < Namegduf> And the other file is not in "package database"
15:12 < skelterjohn> main and package -> main.go and database.go
15:12 < Namegduf> It's in "package main"
15:14 < skelterjohn> sunfmin: if you want to have database.go be its own
package, you need to compile it separately
15:14 < skelterjohn> for you the most straightforward way to do this is to
have a separate makefile that has GOFILES=package.go
15:14 < skelterjohn> and remove package.go from the other makefile
15:14 -!- pharris [~Adium@rhgw.opentext.com] has joined #go-nuts
15:14 < skelterjohn> also your new makefile needs to import Make.pkg instead
of Make.cmd
15:15 < sunfmin> alright, I'll see
15:15 < sunfmin> So normally one project always within one package?
15:15 < str1ngs> $GOROOT/misc/chrome/gophertool I haz gopher button!  o.O
15:16 < sunfmin> I mean practical way of building one project
15:16 < skelterjohn> "normally" is misleading
15:16 -!- vinisterx [~ryan@74-129-201-27.dhcp.insightbb.com] has joined #go-nuts
15:16 < skelterjohn> it depends entirely on what you want to do
15:16 < sunfmin> or one simple web project
15:16 < sunfmin> just build a simple web application
15:17 < sunfmin> which have database and views and stuff.
15:17 < skelterjohn> if you aren't making a library to be used by other
things, make it all part of the main package
15:17 < skelterjohn> packages are for code re-ues
15:17 < skelterjohn> re-use
15:17 < skelterjohn> it's not like java
15:17 -!- Nitro [~Nitro@unaffiliated/nitro] has joined #go-nuts
15:17 -!- Viriix [~joseph@c-67-169-172-251.hsd1.ca.comcast.net] has quit [Quit:
Leaving]
15:18 < skelterjohn> if you have separate modules of functionality, just put
them each in their own source file but you can still link them together
15:18 < sunfmin> put them in their own source file but have same package
right?
15:18 < Namegduf> Yes.
15:18 < sunfmin> So basically one Makefile, one package.
15:19 < sunfmin> can't be one Makefile multiple package.
15:19 < Namegduf> No.
15:19 < skelterjohn> not with the standard makefiles
15:19 < Namegduf> (Not with- yeah)
15:19 < skelterjohn> you could roll your own, but that's a waste of time
15:19 < Namegduf> Mine is one makefile, entire project, including automatic
rules
15:19 < sunfmin> yes, I like to follow the standard ways.
15:19 < skelterjohn> i don't use makefiles at all
15:19 < Namegduf> I'm likely to replace it with something sooner or later
15:20 < Namegduf> I might do something crazy
15:20 < Namegduf> Like put the building stuff in a library and link it into
the server itself so it can rebuild and reconfigure its own built-in modules at
runtime
15:20 < Namegduf> With restarting and serialisation of state.
15:20 -!- noodles775 [~michael@canonical/launchpad/noodles775] has quit [Quit:
leaving]
15:21 < skelterjohn> i floated the idea of making a "build" package on
go-dev...and got made fun of
15:21 < Namegduf> Just have a makefile that builds the most basic core, and
then invokes it to rebuild.
15:22 < skelterjohn> but i still think it's a good idea
15:22 < skelterjohn> would include basic interfaces to the compiler, also a
standard way to filter source files based on _GOARCH stuff in the file name
15:22 < Namegduf> I think that, plus a "connection helper" package which
implements net.Conn
15:22 < skelterjohn> i don't follow
15:22 < Namegduf> With the connections actually in another process and
persistent across the main process restarting
15:23 < Namegduf> Would let it upgrade and reconfigure pretty seamlessly
while running.
15:23 < Namegduf> Which would be shiny.
15:23 < skelterjohn> i see
15:23 < Namegduf> Need to get around to implementing it, though.
15:23 < skelterjohn> that would be pretty sweet, yeah
15:24 < Namegduf> I'm going to try to make that package reusable.
15:27 < skelterjohn> campus time
15:27 -!- skelterjohn [~jasmuth@c-24-0-2-70.hsd1.nj.comcast.net] has quit [Quit:
skelterjohn]
15:31 -!- bugQ [~bug@c-67-186-255-54.hsd1.ut.comcast.net] has quit [Ping timeout:
255 seconds]
15:32 < xyproto> How can I find the name of a variable through reflection?
15:32 < Namegduf> I'm not sure if that information is available at runtime.
15:33 < taruti> no
15:34 < xyproto> taruti: not possible?
15:34 < taruti> nope
15:35 < xyproto> taruti: ok, thank you.
15:35 < xyproto> taruti: but it is possible for struct fields, right?
15:37 < taruti> yes iirc
15:38 < wrtp> xyproto: yes
15:49 -!- sunfmin [~sunfmin@115.206.253.191] has quit [Quit: sunfmin]
15:54 -!- binarypie [~binarypie@adsl-76-254-24-124.dsl.pltn13.sbcglobal.net] has
joined #go-nuts
15:56 -!- wrtp [~rog@92.17.18.72] has quit [Quit: wrtp]
16:04 -!- skelterjohn [~jasmuth@lawn-gw.rutgers.edu] has joined #go-nuts
16:04 -!- piranha [~piranha@D57D1AB3.static.ziggozakelijk.nl] has quit [Quit:
Computer has gone to sleep.]
16:05 -!- dfr|mac [~dfr|work@ool-182e3fca.dyn.optonline.net] has quit [Remote host
closed the connection]
16:07 -!- ctimmerm [~ctimmerm@cs181050011.pp.htv.fi] has joined #go-nuts
16:13 -!- cafesofie [~cafesofie@ool-18b97779.dyn.optonline.net] has joined
#go-nuts
16:13 -!- DerHorst [~Horst@e176103040.adsl.alicedsl.de] has joined #go-nuts
16:18 -!- tncardoso [~thiago@bananal.lbd.dcc.ufmg.br] has joined #go-nuts
16:21 -!- gedevan [~gedevan@83.167.106.253] has joined #go-nuts
16:22 -!- th0re [~thre@p5B3B4B27.dip.t-dialin.net] has joined #go-nuts
16:25 -!- wallerdev [~wallerdev@c-68-60-43-43.hsd1.mi.comcast.net] has quit [Ping
timeout: 246 seconds]
16:25 -!- gedevan [~gedevan@83.167.106.253] has quit [Ping timeout: 240 seconds]
16:25 -!- hargettp_ [~hargettp_@dhcp-162.mirrorimage.net] has quit [Quit:
hargettp_]
16:26 -!- wallerdev [~wallerdev@c-68-60-43-43.hsd1.mi.comcast.net] has joined
#go-nuts
16:28 -!- th0re [~thre@p5B3B4B27.dip.t-dialin.net] has quit [Remote host closed
the connection]
16:28 -!- th0re [~thre@p5B3B4B27.dip.t-dialin.net] has joined #go-nuts
16:30 -!- gedevan [~gedevan@83.167.106.253] has joined #go-nuts
16:35 -!- ShadowIce [~pyoro@unaffiliated/shadowice-x841044] has joined #go-nuts
16:41 -!- Venom_X [~pjacobs@66.54.185.131] has joined #go-nuts
16:41 -!- awidegreen [~quassel@h-170-226.A212.priv.bahnhof.se] has joined #go-nuts
16:48 -!- iant [~iant@216.239.45.19] has joined #go-nuts
16:48 -!- mode/#go-nuts [+v iant] by ChanServ
16:49 -!- tobym [~tobym@cpe-72-229-2-6.nyc.res.rr.com] has quit [Ping timeout: 246
seconds]
16:49 -!- jemeshsu [~jemeshsu@bb119-74-88-105.singnet.com.sg] has quit [Quit:
jemeshsu]
16:50 -!- creack [~charme_g@163.5.84.203] has joined #go-nuts
16:51 -!- aho [~nya@fuld-590c7374.pool.mediaWays.net] has joined #go-nuts
16:54 -!- iant [~iant@216.239.45.19] has quit [Ping timeout: 260 seconds]
16:59 < xyproto> Is redeclare a word?
17:00 -!- pphalen [~pphalen@66.92.11.149] has joined #go-nuts
17:01 < skelterjohn> yes
17:01 -!- imsplitbit [~imsplitbi@64.39.4.132] has quit [Quit: Bye!]
17:02 -!- aweber [~done@dslb-084-056-093-055.pools.arcor-ip.net] has joined
#go-nuts
17:04 < xyproto> skelterjohn: thx
17:06 -!- th0re [~thre@p5B3B4B27.dip.t-dialin.net] has quit [Quit: Der weg zur
erkenntniss ist der richtige.]
17:07 -!- iant [~iant@nat/google/x-hhbncnewihgxskwp] has joined #go-nuts
17:07 -!- mode/#go-nuts [+v iant] by ChanServ
17:07 -!- awidegreen [~quassel@h-170-226.A212.priv.bahnhof.se] has quit [Quit: No
Ping reply in 180 seconds.]
17:08 -!- awidegreen [~quassel@h-170-226.A212.priv.bahnhof.se] has joined #go-nuts
17:09 -!- oal [~oal@5.79-160-122.customer.lyse.net] has joined #go-nuts
17:16 -!- robteix [~robteix@host40.201-253-152.telecom.net.ar] has joined #go-nuts
17:26 -!- bugQ [~bug@c-67-186-255-54.hsd1.ut.comcast.net] has joined #go-nuts
17:26 -!- firwen [~firwen@2a01:e34:eea3:7e10:4a5b:39ff:fe51:e8ae] has joined
#go-nuts
17:35 -!- robteix [~robteix@host40.201-253-152.telecom.net.ar] has quit [Quit:
Computer has gone to sleep.]
17:36 -!- TheMue [~TheMue@p5DDF5CB6.dip.t-dialin.net] has joined #go-nuts
17:41 -!- TrollMaster [~SrTroll@209.189.232.132] has joined #go-nuts
17:41 < TrollMaster> so what's poppin ?
17:42 * TrollMaster repeats himeself
17:42 < TrollMaster> so waht's poppin ?
17:43 * TrollMaster repeats himeself
17:43 < TrollMaster> so waht's poppin ?
17:44 -!- TrollMaster [~SrTroll@209.189.232.132] has left #go-nuts []
17:44 < dlowe> whew
17:44 < aiju> fucking retards
17:44 < dlowe> that's the most effective not feeding the troll I've ever
seen
17:45 < dlowe> good job, channel :D
17:48 -!- jstemmer [~cheetah@mrpwn.stemmertech.com] has joined #go-nuts
17:56 < skelterjohn> he didn't make it hard on us
17:56 < skelterjohn> left almost immediately
17:57 -!- wallerdev [~wallerdev@c-68-60-43-43.hsd1.mi.comcast.net] has quit [Quit:
wallerdev]
17:59 -!- |Craig| [~|Craig|@panda3d/entropy] has joined #go-nuts
18:00 -!- bugQ [~bug@c-67-186-255-54.hsd1.ut.comcast.net] has quit [Ping timeout:
276 seconds]
18:01 -!- cafesofie [~cafesofie@ool-18b97779.dyn.optonline.net] has quit [Remote
host closed the connection]
18:02 -!- mbohun [~mbohun@ppp115-156.static.internode.on.net] has quit [Quit:
Leaving]
18:03 -!- DerHorst [~Horst@e176103040.adsl.alicedsl.de] has quit [Remote host
closed the connection]
18:03 < aweber> Hi! Small (dumb?) question - I had a look at the
specification and this rule 'UnaryExpr = PrimaryExpr | unary_op UnaryExpr' (found
at http://golang.org/doc/go_spec.html#Operators) would mean that I can write
something like '+-!&5' in theory?
18:04 < aiju> no
18:04 < aiju> &5 is illegal
18:04 -!- piranha [~piranha@5ED43A0B.cm-7-5a.dynamic.ziggo.nl] has joined #go-nuts
18:06 -!- Fish- [~Fish@9fans.fr] has quit [Quit: So Long, and Thanks for All the
Fish]
18:07 -!- bugQ [~bug@c-67-186-255-54.hsd1.ut.comcast.net] has joined #go-nuts
18:08 -!- Fish [~Fish@9fans.fr] has joined #go-nuts
18:09 < aweber> ah now I get it - it is for example possible to write
something like '-*p' when *p evaulates to an integer
18:11 -!- bugQ [~bug@c-67-186-255-54.hsd1.ut.comcast.net] has quit [Read error:
Operation timed out]
18:13 < skelterjohn> i don't think that ! is a unary op...  or if it is i
have no idea what it does
18:13 < skelterjohn> but x - *p, for var p *int, works fine
18:14 < KirkMcDonald> skelterjohn: ! is logical-NOT.
18:14 < skelterjohn> duh
18:14 < skelterjohn> brain fart.
18:15 < KirkMcDonald> And - is also a unary operator.
18:16 -!- vinisterx [~ryan@74-129-201-27.dhcp.insightbb.com] has quit [Ping
timeout: 241 seconds]
18:16 -!- vzx [~ryan@74-129-201-27.dhcp.insightbb.com] has joined #go-nuts
18:17 -!- bugQ [~bug@c-67-186-255-54.hsd1.ut.comcast.net] has joined #go-nuts
18:17 -!- tncardoso [~thiago@bananal.lbd.dcc.ufmg.br] has quit [Ping timeout: 248
seconds]
18:18 -!- ctimmerm [~ctimmerm@cs181050011.pp.htv.fi] has quit [Ping timeout: 258
seconds]
18:19 -!- dRbiG [drbig@unhallowed.pl] has joined #go-nuts
18:20 -!- Stiletto [7f000001@69.195.144.4] has quit [Read error: Operation timed
out]
18:21 -!- bugQ [~bug@c-67-186-255-54.hsd1.ut.comcast.net] has quit [Ping timeout:
250 seconds]
18:28 -!- Stiletto [7f000001@69.195.144.4] has joined #go-nuts
18:29 -!- ctimmerm [~ctimmerm@cs181050011.pp.htv.fi] has joined #go-nuts
18:29 -!- tncardoso [~thiago@150.164.2.20] has joined #go-nuts
18:29 -!- bug- [~bug@c-67-186-255-54.hsd1.ut.comcast.net] has joined #go-nuts
18:34 -!- bug- [~bug@c-67-186-255-54.hsd1.ut.comcast.net] has quit [Ping timeout:
264 seconds]
18:39 -!- bugQ [~bug@c-67-186-255-54.hsd1.ut.comcast.net] has joined #go-nuts
18:43 -!- kr [~Keith@204.14.152.118] has joined #go-nuts
18:44 -!- gregschlom_ [~quassel@187.118.210.62.te-dns.org] has joined #go-nuts
18:44 -!- krutcha [~krutcha@remote.icron.com] has joined #go-nuts
18:44 -!- bugQ [~bug@c-67-186-255-54.hsd1.ut.comcast.net] has quit [Ping timeout:
260 seconds]
18:46 -!- Ekspluati [5b9a0df9@gateway/web/freenode/ip.91.154.13.249] has quit
[Ping timeout: 252 seconds]
18:47 -!- gregschlom [~quassel@187.118.210.62.te-dns.org] has quit [Ping timeout:
258 seconds]
18:49 -!- bugQ [~bug@c-67-186-255-54.hsd1.ut.comcast.net] has joined #go-nuts
18:49 -!- huin [~huin@91.85.171.238] has joined #go-nuts
18:49 -!- keithcascio [~keithcasc@nat/google/x-lajwnvthiksggjna] has joined
#go-nuts
18:49 -!- gregschlom_ [~quassel@187.118.210.62.te-dns.org] has quit [Ping timeout:
240 seconds]
18:51 -!- bthomson [~bthomson@c-68-33-5-232.hsd1.va.comcast.net] has joined
#go-nuts
18:52 < ahf> Meh, I have been playing around with Go for the past few days
and I really enjoy it.  But my, oh, my I miss my generic data-types from C++ :-(
18:52 -!- Transformer [~Transform@ool-4a59e397.dyn.optonline.net] has joined
#go-nuts
18:52 < ahf> I don't miss typing for (std::map<std::string,
std::shared_ptr<std::pair<int, Foo>>>::const_iterator ...  though
:-P
18:52 < skelterjohn> i've found that i only miss generics when i try to
write libraries with no immediate purpose
18:52 < skelterjohn> like, when i made a hashtable lib, generics would have
been useful
18:53 < ahf> I need a set right now
18:53 < skelterjohn> but when i write a program that's supposed to do
something specific, it doesn't matter
18:53 < skelterjohn> for a set use a map[theType]bool
18:53 < ahf> So I was going to just write a RB tree, but now I can't make it
generic.
18:53 < ahf> Yeah, I considered that too.
18:53 < ahf> Might as well go with that for now.
18:53 < skelterjohn> there exists an RB tree library - GoLLRB
18:53 < skelterjohn> you can also use gohash.googlecode.com (the hash lib i
made)
18:53 < skelterjohn> it uses interface{} and you need to use type assertions
18:54 < ahf> Ah, no need for to bother with it then :-P
18:54 < skelterjohn> and that would be nicer with generics
18:54 -!- bugQ [~bug@c-67-186-255-54.hsd1.ut.comcast.net] has quit [Ping timeout:
260 seconds]
18:54 -!- tobier_ [~tobier@c-1c9de055.712-1-64736c11.cust.bredbandsbolaget.se] has
joined #go-nuts
18:54 -!- kr [~Keith@204.14.152.118] has quit [Ping timeout: 246 seconds]
18:54 < ahf> Nah, I think I'll (ab)use the the map's idea for now.
18:54 < skelterjohn> for simple sets it's definitely "the way"
18:54 < ahf> Aye.
18:54 < skelterjohn> but set operations are difficult
18:54 < skelterjohn> union, intersect, etc
18:54 -!- Transformer [~Transform@ool-4a59e397.dyn.optonline.net] has quit [Excess
Flood]
18:54 < ahf> I don't need intersect, etc.
18:54 < aiju> just iterate over it
18:54 < skelterjohn> no fast way to do it with map[T]bool
18:54 < ahf> Only need "contains", "add" and "delete" :-)
18:54 * aiju just uses slices for lists
18:55 < skelterjohn> then map will do it
18:55 < ahf> aiju: Ditto :-)
18:55 < aiju> ehm
18:55 -!- tobier [~tobier@c-1c9de055.712-1-64736c11.cust.bredbandsbolaget.se] has
quit [Read error: Operation timed out]
18:55 < aiju> s/lists/sets/
18:55 < aiju> no need to overengineer
18:55 < skelterjohn> do slices come with a "contains" method?
18:55 -!- r_linux [~r_linux@smtp.mandique.com.br] has quit [Read error: Connection
reset by peer]
18:55 < ahf> Oh. Do you keep it sorted then or do you just ignore the O(n)
lookups there, or?
18:55 < aiju> ahf: i just ignore O(n)
18:55 < ahf> Ok :-)
18:56 < skelterjohn> i wouldn't call using map[T]bool for sets
overengineering
18:56 < skelterjohn> but it's clearly subjective
18:56 < aiju> skelterjohn: RB trees are
18:56 < ahf> I guess I am too much of a C++ monkey to ignore that :-(
18:56 < skelterjohn> it's objectively subjective
18:56 < aiju> at least for small sets
18:56 < skelterjohn> aiju: yes.  i agree there.
18:56 < ahf> For small sets, sure.
18:56 < aiju> map[T] bool is fine, too
18:56 < chomp> maps for sets seem pretty intuitive
18:57 < ahf> chomp: Yeah, usually it's the same data-structure that's being
used :-)
18:57 < chomp> it's not like you have to implement the RB-tree.
18:57 < aiju> there are many programmers who write every single program as
if it HAD to work efficiently in O(n^1.553868) on N = 1 trillion
18:57 < skelterjohn> chomp: if you want something other than a built-in as
your key you do
18:57 < chomp> ah.
18:57 < chomp> well that seems like a map design issue :)
18:58 < skelterjohn> that's the only thing that gohash gives you that map
doesn't - arbitrary key types (as long as you can provide a hashcode function)
18:58 < ahf> It would be nice to have set's and list's to be build-ins
though.  Like maps.
18:58 < skelterjohn> lists are.
18:58 < ahf> a := ["foo", "bar", "baz]
18:58 < aiju> this is not python
18:58 < skelterjohn> a := []string{"foo", "bar", "baz"}
18:59 < chomp> is there a fundamental reason why map doesn't or shouldn't
support a generic Mappable key interface or something like that?
18:59 < ahf> Sure, but that's not a list.
18:59 < skelterjohn> looks like one to me
18:59 < skelterjohn> you may have redefined the word "list"
18:59 < aiju> lists are pretty easy to do
18:59 < aiju> making them builtin only complicates matters
18:59 < aiju> just put "next" pointers in your structs
18:59 < ahf> I don't think a slice is a list.  Just like I don't see int
a[]; in C as a list.
18:59 < aiju> skelterjohn: linked lists
18:59 < skelterjohn> chomp: because map operations are written in C and
don't want to do type assertions?  i dunno
18:59 < aiju> or so i assume
18:59 < ahf> A single-linked list or a doubly-linked list is a list in my
world.
18:59 < aiju> ahf: just do it yourself
18:59 < chomp> hmm
18:59 < ahf> aiju: Aye, that's what I am doing now.
19:00 < aiju> "code reuse" is massively overrated
19:00 < ahf> Though, currently I'm just toying around :-)
19:00 < skelterjohn> i think there is a linked list impl in container
19:00 < ahf> There is.
19:00 < skelterjohn> w/ interface{} once again
19:00 < aiju> container is spawn from hell
19:00 < ahf> But the containers is what raised my initial comment in this
channel a few mins ago :-P
19:00 -!- cafesofie [~cafesofie@ool-18b97779.dyn.optonline.net] has joined
#go-nuts
19:01 < skelterjohn> i've never used it.  but LLs are so trivial to code
that it never bothered me
19:01 < skelterjohn> i've only had to do it like, once though
19:01 -!- r_linux [~r_linux@smtp.mandique.com.br] has joined #go-nuts
19:01 < skelterjohn> and that was for gohash :) and i used interface{} as
the type...  maybe i should have used the container version
19:01 < skelterjohn> w/e
19:02 < ahf> So, I am more curious.  What do you guys currently hack on?  I
don't use Go at work now, but I am toying a bit around with some petprojects at
home in it.
19:02 < skelterjohn> i do machine learning software w/ go
19:02 < ahf> I am impressed about how much I get done in so little time.  At
first the standard library didn't look overly impressive to me, but it really has
everything I need :-P
19:02 < skelterjohn> and make general tools
19:02 < ahf> Ah, cool.
19:02 -!- dfr|work [~dfr|work@nat/google/x-whwoczdtvgxrytqt] has quit [Remote host
closed the connection]
19:02 < skelterjohn> the ones i need to write my ML stuff
19:03 -!- dfr|work [~dfr|work@nat/google/x-nizzxjnlcirubxfd] has joined #go-nuts
19:03 < ahf> Hm?
19:03 -!- bug- [~bug@c-67-186-255-54.hsd1.ut.comcast.net] has joined #go-nuts
19:03 < skelterjohn> i make general tools (that i need to write my machine
learning code)
19:04 < skelterjohn> the hashcode stuff, some linear algebra and statistics
stuff, a project builder
19:04 < ahf> Ahhh.  I was thinking of SML.  No idea why I didn't give
machine learning a thought given you just mentioning it.
19:04 < skelterjohn> what is SML?
19:04 < ahf> A programming language.
19:10 -!- alehorst [~alehorst@201.47.18.25.dynamic.adsl.gvt.net.br] has quit [Ping
timeout: 246 seconds]
19:13 -!- boscop_ [~boscop@g225203026.adsl.alicedsl.de] has quit [Ping timeout:
250 seconds]
19:13 < chomp> ahf, my current project is a remote login server over
websockets
19:14 -!- serverhorror_ [~martin@krlh-4d021284.pool.mediaWays.net] has joined
#go-nuts
19:14 -!- boscop_ [~boscop@g225203026.adsl.alicedsl.de] has joined #go-nuts
19:14 < chomp> not using Go at "work" either.
19:14 -!- alehorst [~alehorst@187.58.246.207] has joined #go-nuts
19:15 -!- ExsysHost [~ExsysTech@50-46-213-60.evrt.wa.frontiernet.net] has quit
[Read error: Connection reset by peer]
19:16 < ahf> chomp: Ah
19:16 < ahf> My "learning" project is an ircd that supports websocket's too.
19:17 < chomp> nice
19:17 < ahf> Once it's done and the whole WebSocket thingy has been sorted
about by the standard guys, i was planning on adding support for them to irssi
too, to make it easier to test :-P
19:17 -!- ExsysTech [~ExsysTech@50-46-213-60.evrt.wa.frontiernet.net] has joined
#go-nuts
19:17 < serverhorror_> hi, I'm playing around with the web app codelab.  Now
I'd like an url that works like "/[a-zA-Z]+/view" (in regex) should I just create
a handler for "/" and then parses the http.Request or is there some magic I'm
missing that let's me use regex?
19:17 < chomp> sounds cool
19:17 < ahf> but Go's awesome for playing around with websocket's.  That was
actually how I ended up playing with it.
19:17 < ahf> I work with browser/webkit development at work :-P
19:17 < chomp> yeah my biggest hangup right now is actually browser support
for websockets+tls
19:18 < ahf> Aye :-P
19:18 < chomp> seems to be broken as shit
19:18 < serverhorror_> I'm not using web.go or another pre-made framework on
purpose.  This is purely to get a better feel for the packages and to learn...
19:18 < ahf> Know the feeling
19:19 < chomp> serverhorror_, the default handler multiplexer uses a simple
string map, so no regexes there
19:19 < chomp> you could of course handle "/" with your own multiplexer
though
19:19 -!- tvw [~tv@e176008113.adsl.alicedsl.de] has quit [Remote host closed the
connection]
19:19 < chomp> which i guess is what you suggested, so yes, that :)
19:24 -!- bugQ [~bug@c-67-186-255-54.hsd1.ut.comcast.net] has quit [Ping timeout:
240 seconds]
19:27 -!- wallerdev [~wallerdev@c-68-60-43-43.hsd1.mi.comcast.net] has joined
#go-nuts
19:27 -!- r_linux [~r_linux@smtp.mandique.com.br] has quit [Read error: Connection
reset by peer]
19:28 < serverhorror_> chomp: I guess I'll stay with the "/" in the handler
and then parse whatever is in the request path for now.  If the pain gets to
strong I'll just have work over it again...
19:28 < chomp> shouldn't be bad, that's what i've ended up doing most of the
time
19:29 < chomp> a dumb string map is only so useful
19:33 -!- r_linux [~r_linux@smtp.mandique.com.br] has joined #go-nuts
19:38 -!- boscop_ [~boscop@g225203026.adsl.alicedsl.de] has quit [Ping timeout:
246 seconds]
19:39 -!- boscop_ [~boscop@g226239191.adsl.alicedsl.de] has joined #go-nuts
19:41 < Tonnerre> Hm, if I have a method
19:41 < Tonnerre> Oh, I think I saw the typo
19:41 < Tonnerre> Thanks ;)
19:45 -!- Cobi [~Cobi@2002:1828:88fb:0:aede:48ff:febe:ef03] has quit [Quit: ZNC -
http://znc.sourceforge.net]
19:45 -!- markcol [~markcol@74.125.59.1] has joined #go-nuts
19:46 -!- boscop_ [~boscop@g226239191.adsl.alicedsl.de] has quit [Ping timeout:
246 seconds]
19:46 < chomp> Tonnerre, always glad to help
19:46 < Tonnerre> chomp: thanks a lot
19:47 -!- boscop_ [~boscop@g226239191.adsl.alicedsl.de] has joined #go-nuts
19:47 < Tonnerre> Ok, a different question
19:48 < Tonnerre> If I have a function func (p *Something) Ping() (value
*Bla, ire *InvalidRequestException, nfe *NotFoundException, ue
*UnavailableException, te *TimedOutException, err os.Error)
19:48 < Tonnerre> Do I have to capture every single value?
19:48 -!- wrtp [~rog@92.17.18.72] has joined #go-nuts
19:48 < Tonnerre> i.e.  a, b, c, d, e, f = client.Ping()
19:48 < Tonnerre> ?
19:50 -!- bugQ [~bug@c-67-186-255-54.hsd1.ut.comcast.net] has joined #go-nuts
19:50 < chomp> whoa
19:51 < Tonnerre> It's generated RPC code from someone else :/
19:51 < chomp> that's awful
19:51 < Tonnerre> Very much
19:51 < chomp> short answer, you can use _ to throw away values instead of
capturing though
19:51 < chomp> a, _, _, _, _, _ = client.Ping()
19:51 < chomp> etc
19:52 < Tonnerre> Yes, but I guess I have to check every single exception to
whether it occurred
19:52 < Tonnerre> Just guessing though
19:52 < chomp> long answer, go clobber that special someone else in the face
19:53 < Tonnerre> That would be the Apache foundation
19:53 < bugQ> that's...both shorter and more direct
19:53 < chomp> heh.
19:53 < chomp> i guess i meant in terms of implementation time :)
19:53 -!- Cobi [~Cobi@2002:1828:88fb:0:aede:48ff:febe:ef03] has joined #go-nuts
19:53 < bugQ> aha
19:53 < str1ngs> Tonnerre: imo just create a function that calls Ping
returns only what you need
19:54 < Tonnerre> str1ngs: yes, I guess that's what I should do
19:54 < Tonnerre> Or change this compiler to be less insane
19:54 < str1ngs> what generates that Ping code btw?
19:55 < Tonnerre> str1ngs: some compiler generates it from an IDL
19:55 < Tonnerre> Basically it's an RPC interface
19:55 < str1ngs> ya hard to get around that I guess
19:55 < str1ngs> go way would be to return a PingReponse I would thing
19:56 < str1ngs> think*
20:00 -!- virtualsue [~chatzilla@nat/cisco/x-jpmybldbwreezold] has joined #go-nuts
20:00 -!- bugQ [~bug@c-67-186-255-54.hsd1.ut.comcast.net] has quit [Ping timeout:
248 seconds]
20:01 < xyproto> how can I manipulate the colors of an image.Color, say,
remove all colors except red?
20:01 -!- eikenberry [~jae@ivanova.zhar.net] has quit [Quit: End of line.]
20:01 < xyproto> I've tried converting with the colormodel .Convert()
functions, but I can't figure it out
20:02 -!- tncardoso [~thiago@150.164.2.20] has quit [Quit: bye]
20:05 -!- vzx [~ryan@74-129-201-27.dhcp.insightbb.com] has quit [Ping timeout: 240
seconds]
20:05 < xyproto> I have a color "c", that is a image.RGBAColor, but if I try
to fmt.Println(c.R) I get:
20:06 < xyproto> c.R undefined (type image.Color has no field or method R)
20:06 -!- bugQ [~bug@c-67-186-255-54.hsd1.ut.comcast.net] has joined #go-nuts
20:06 < xyproto> Do I need to convert the image.RGBAColor somehow?
20:06 -!- alehorst [~alehorst@187.58.246.207] has quit [Quit: Leaving.]
20:06 < xyproto> The documentation is sparse on this topic
20:09 -!- vzx [~ryan@74-129-201-27.dhcp.insightbb.com] has joined #go-nuts
20:11 -!- markcol [~markcol@74.125.59.1] has quit [Quit: markcol]
20:11 -!- tobym [~tobym@cpe-72-229-2-6.nyc.res.rr.com] has joined #go-nuts
20:11 < skelterjohn> image.Color is an interface, right?
20:12 < chomp> it is
20:12 < skelterjohn> so it has no field R, no fields at all
20:12 -!- markcol [~markcol@74.125.59.1] has joined #go-nuts
20:12 < skelterjohn> so you can do theColor.(RGBAColor)
20:12 < Tonnerre> Now I only need to figure out how to unset a field :S
20:12 < chomp> RGBAColor doesn't implement Color does it?
20:12 < skelterjohn> and then modify its .R field
20:12 < chomp> oh it does
20:12 < skelterjohn> it does
20:12 < fvbommel> Tonnerre: My guess is that only one of the
*Exception/os.Error returns of that function is useful for any given call.  So
maybe you could rewrite/wrap it such that it just returns (value *Bla, err
os.Exception).
20:12 < chomp> you can also do theColor.RGBA() which returns r,g,b,a uint32
20:13 < skelterjohn> he wants to filter out the not-read
20:13 < skelterjohn> not-red
20:13 < chomp> ah right.
20:13 < Tonnerre> fvbommel: I didn't invent that API
20:13 < fvbommel> Tonnerre: If the caller wants to know what error/exception
was actually the problem, he can us a type switch on err.(type).
20:13 < fvbommel> Tonnerre: So wrapping it is then?
20:13 < Tonnerre> fvbommel: it's what Apache Thrift makes of Exceptions in
the .thrift IDL
20:14 < Tonnerre> fvbommel: yes, wrapping is the way
20:14 -!- wrtp [~rog@92.17.18.72] has quit [Quit: wrtp]
20:15 -!- Niedar [~bleh@ip68-99-166-222.hr.hr.cox.net] has quit [Ping timeout: 240
seconds]
20:15 -!- cafesofie [~cafesofie@ool-18b97779.dyn.optonline.net] has quit [Remote
host closed the connection]
20:16 -!- oal [~oal@5.79-160-122.customer.lyse.net] has quit [Remote host closed
the connection]
20:16 < xyproto> skelterjohn: ah, thank you, I will try
theColor.(RGBAColor).  That was the exact piece of syntax I was unsure of.
20:16 < skelterjohn> type assertion
20:17 < Tonnerre> What's the regular Go way of unsetting something?  Just
assigning nil, right?
20:17 < skelterjohn> well, theColor.(image.RGBAColor)
20:17 < skelterjohn> Tonnerre: what does "unset" mean?
20:17 < Tonnerre> skelterjohn: I'm trying to guess what I should do in a
Thrift interface to tell it to not submit a field
20:17 < skelterjohn> you'd have to take a look at the api
20:18 < Tonnerre> Well, what I have is a struct:
http://pastebin.com/Tz9G7Rhy
20:19 < Tonnerre> If I try
20:19 < Tonnerre> cp.SuperColumn = nil
20:19 < Tonnerre> then it tells me I cannot do that
20:19 < Tonnerre> Setting it to an empty string or leaving it uninitialized
doesn't work
20:21 < skelterjohn> the nil value for a string is ""
20:21 < Tonnerre> Yes but that doesn't work; it still transmits the field
and the other side believes I want a supercolumn
20:21 -!- dreadlorde [~dreadlord@c-24-11-39-160.hsd1.mi.comcast.net] has joined
#go-nuts
20:21 < skelterjohn> either there is a way to tell the API to ignore some
fields, or the API sucks
20:22 < Tonnerre> The latter is certainly true
20:22 < Tonnerre> At least in Go
20:22 < Tonnerre> The C++ API works somewhat
20:22 < chomp> how is the go interface generated"
20:22 < chomp> ?
20:22 < skelterjohn> which go thrift api are you using?
20:22 < chomp> because that's absolutely idiotic
20:23 < Tonnerre> skelterjohn: the one from thrift HEAD
20:23 < Tonnerre> I compiled the Cassandra client .thrift file with it
20:23 < skelterjohn> i have no idea how to use that information to find an
api.  maybe a link?
20:23 < skelterjohn> i see two thrift impls on cat-v
20:24 < Tonnerre> http://thrift.apache.org/ has the svn
20:24 < skelterjohn> is there a web interface to browse the source?
20:24 < Tonnerre> And I applied it to
http://svn.apache.org/repos/asf/cassandra/trunk/interface/cassandra.thrift
20:24 < skelterjohn> ah, i found ti
20:24 < skelterjohn> it
20:25 < skelterjohn> where in there is the go ibt?
20:25 < skelterjohn> bit
20:25 < Tonnerre>
http://git.ancient-solutions.com/cgi-bin/gitweb.cgi?p=golang/cassandra.git;a=summary
has the resulting Go code
20:25 < Tonnerre>
http://git.ancient-solutions.com/cgi-bin/gitweb.cgi?p=golang/cassandra.git;a=blob;f=ttypes.go;h=b301ea48b5c10a89166f96a124651a1ba2be9d60;hb=235e969c3c3b5b918822cd924d9c80a9f7307a8f
20:25 < Tonnerre> That's the file which contains the struct
20:26 < skelterjohn> what tool did you use to generate the .go code
20:27 -!- zozoR [~Morten@2906ds2-arno.0.fullrate.dk] has quit [Read error:
Operation timed out]
20:27 < Tonnerre> thrift
20:27 < skelterjohn> man, those files are thousands of lines long
20:27 < Tonnerre> thrift --gen go cassandra.thrift
20:27 -!- cafesofie [~cafesofie@ool-18b97779.dyn.optonline.net] has joined
#go-nuts
20:27 < skelterjohn> well, there's no way i can look at a file that is 15k
lines long and have any hope of analyzing it
20:28 -!- aweber [~done@dslb-084-056-093-055.pools.arcor-ip.net] has quit [Remote
host closed the connection]
20:28 < dlowe> if only there were some device capable of collating large
amounts of data
20:28 -!- boscop [~boscop@unaffiliated/boscop] has joined #go-nuts
20:28 -!- pothos [~pothos@111-240-166-48.dynamic.hinet.net] has quit [Read error:
Connection reset by peer]
20:28 -!- boscop_ [~boscop@g226239191.adsl.alicedsl.de] has quit [Ping timeout:
246 seconds]
20:30 < Tonnerre> It seems the answer is in thrift.TProtocol.WriteString
20:30 -!- bugQ [~bug@c-67-186-255-54.hsd1.ut.comcast.net] has quit [Ping timeout:
252 seconds]
20:30 -!- pothos [~pothos@111-240-168-61.dynamic.hinet.net] has joined #go-nuts
20:31 -!- werdan7 [~w7@freenode/staff/wikimedia.werdan7] has quit [Read error:
Operation timed out]
20:32 < Tonnerre> It seems that thing cannot unset a field
20:34 -!- GeertJohan [~Squarc@D978EC5D.cm-3-1d.dynamic.ziggo.nl] has joined
#go-nuts
20:36 < skelterjohn> it doesn't surprise me
20:36 < skelterjohn> is there a way to set only one field?
20:36 < skelterjohn> or are all transactions the entire object
20:36 < Tonnerre> You pass the object to the RPC function
20:36 < Tonnerre> So the whole struct
20:37 < Tonnerre> thrift4go seems to be exactly the thing that ended up in
the upstream libthrift
20:38 -!- nictuku [~nict@84-72-7-79.dclient.hispeed.ch] has joined #go-nuts
20:38 -!- nictuku [~nict@84-72-7-79.dclient.hispeed.ch] has quit [Changing host]
20:38 -!- nictuku [~nict@unaffiliated/nictuku] has joined #go-nuts
20:39 < Tonnerre> With small unrelated dffs
20:39 < Tonnerre> diffs
20:41 -!- markcol [~markcol@74.125.59.1] has quit [Quit: markcol]
20:45 -!- TheMue [~TheMue@p5DDF5CB6.dip.t-dialin.net] has quit [Quit: TheMue]
20:50 -!- virtualsue [~chatzilla@nat/cisco/x-jpmybldbwreezold] has quit [Ping
timeout: 276 seconds]
20:50 -!- kr [~Keith@204.14.152.118] has joined #go-nuts
20:50 -!- dlowe [~dlowe@ita4fw1.itasoftware.com] has quit [Quit: Leaving.]
20:55 -!- adlan [~adlan@175.138.44.64] has quit [Read error: Connection reset by
peer]
20:56 -!- virtualsue [~chatzilla@nat/cisco/x-ohijiqibblfmzlnh] has joined #go-nuts
20:59 -!- wallerdev [~wallerdev@c-68-60-43-43.hsd1.mi.comcast.net] has quit [Read
error: Connection reset by peer]
20:59 -!- wallerdev [~wallerdev@c-68-60-43-43.hsd1.mi.comcast.net] has joined
#go-nuts
20:59 -!- iant1 [~iant@nat/google/x-tiazkjwcbqxhnade] has joined #go-nuts
20:59 -!- ctimmerm [~ctimmerm@cs181050011.pp.htv.fi] has quit [Ping timeout: 258
seconds]
21:01 -!- iant [~iant@nat/google/x-hhbncnewihgxskwp] has quit [Ping timeout: 260
seconds]
21:03 -!- Fish [~Fish@9fans.fr] has quit [Quit: So Long, and Thanks for All the
Fish]
21:04 -!- Fish [~Fish@9fans.fr] has joined #go-nuts
21:06 -!- cafesofie [~cafesofie@ool-18b97779.dyn.optonline.net] has quit [Remote
host closed the connection]
21:08 -!- cafesofie [~cafesofie@ool-18b97779.dyn.optonline.net] has joined
#go-nuts
21:13 -!- Fish [~Fish@9fans.fr] has quit [Quit: So Long, and Thanks for All the
Fish]
21:16 -!- nictuku [~nict@unaffiliated/nictuku] has quit [Quit: Leaving]
21:16 -!- jstemmer [~cheetah@mrpwn.stemmertech.com] has quit [Quit: leaving]
21:17 < serverhorror_> hmmm how do I implement equality on my structs?  Or
should I just create an interface Equaler (I have a feeling something like that
already exists)
21:18 -!- mode/#go-nuts [+v iant] by ChanServ
21:18 < skelterjohn> make a method
21:18 < skelterjohn> if you want, have it take an interface{} parameter and
type assert
21:21 -!- ako [~nya@fuld-590c6783.pool.mediaWays.net] has joined #go-nuts
21:21 < serverhorror_> hmm ok.  I just thought there was a formal interface
since theres bytes.Equal but reading that I need type assertions it kinda makes
sense there isn't one...
21:21 -!- virtualsue [~chatzilla@nat/cisco/x-ohijiqibblfmzlnh] has quit [Ping
timeout: 240 seconds]
21:21 < skelterjohn> bytes is a package for operating on the []byte type
21:21 < exch> equality is not defined for struct types.  Hence why you can't
use them as map keys
21:22 -!- huin [~huin@91.85.171.238] has quit [Quit: leaving]
21:24 -!- aho [~nya@fuld-590c7374.pool.mediaWays.net] has quit [Ping timeout: 250
seconds]
21:25 -!- photron [~photron@port-92-201-72-43.dynamic.qsc.de] has quit [Ping
timeout: 260 seconds]
21:26 -!- piranha [~piranha@5ED43A0B.cm-7-5a.dynamic.ziggo.nl] has quit [Quit:
Computer has gone to sleep.]
21:27 -!- Nitro [~Nitro@unaffiliated/nitro] has quit [Ping timeout: 276 seconds]
21:30 -!- ExtraSpice [XtraSpice@78-57-204-104.static.zebra.lt] has quit [Read
error: Connection reset by peer]
21:41 -!- chomp [~chomp@dap-209-166-184-50.pri.tnt-3.pgh.pa.stargate.net] has quit
[Ping timeout: 246 seconds]
21:41 -!- tncardoso [~thiago@189.59.202.188] has joined #go-nuts
21:42 -!- firwen [~firwen@2a01:e34:eea3:7e10:4a5b:39ff:fe51:e8ae] has quit [Quit:
Geek insindeĀ®]
21:44 -!- rlab [~Miranda@91.200.158.34] has quit [Quit: Miranda IM! Smaller,
Faster, Easier.  http://miranda-im.org]
21:48 -!- Venom_X [~pjacobs@66.54.185.131] has quit [Quit: Venom_X]
21:52 -!- ExsysTech [~ExsysTech@50-46-213-60.evrt.wa.frontiernet.net] has quit
[Read error: Connection reset by peer]
21:52 -!- ExsysHost [~ExsysTech@50-46-213-60.evrt.wa.frontiernet.net] has joined
#go-nuts
21:55 < Tonnerre> skelterjohn: it seems that the thrift compiler doesn't
compile omitted fields right; I'm going to fix that
21:55 < skelterjohn> how are you going to specify that they're omitted?
21:55 < Tonnerre> skelterjohn: I'll have to add some "isset" fields to the
struct in place of the current _ nonsense
21:56 < Tonnerre> Just the way it is done in almost all the other languages
thrift supports
21:56 -!- a2800276 [~a2800276@xdsl-87-79-227-178.netcologne.de] has quit [Ping
timeout: 276 seconds]
21:56 < skelterjohn> i didn't understand the _ interface{} fields
21:57 < skelterjohn> i didn't know you could do that
21:57 -!- chomp [~chomp@c-67-186-35-69.hsd1.pa.comcast.net] has joined #go-nuts
21:57 < Tonnerre> skelterjohn: they seem to be generated because the guy who
wrote the thing didn't know or care what to put into the places which are supposed
to generate the isset fields
21:57 < skelterjohn> i see - and he wanted the correct struct size /
offsets?
22:02 -!- skelterjohn [~jasmuth@lawn-gw.rutgers.edu] has quit [Quit: skelterjohn]
22:03 < Tonnerre> (Nah, the code just gets generated anyway and apparently
he didn't want to leave it blank)
22:06 -!- awidegreen [~quassel@h-170-226.A212.priv.bahnhof.se] has quit [Remote
host closed the connection]
22:06 -!- quag [~quag@121-98-81-61.bitstream.orcon.net.nz] has quit [Ping timeout:
276 seconds]
22:08 -!- GilJ [~GilJ@zeus.ugent.be] has quit [Ping timeout: 255 seconds]
22:09 -!- cco3 [~conleyo@nat/google/x-wseknskhzajwsyny] has quit [Remote host
closed the connection]
22:15 -!- cco3 [~conleyo@nat/google/x-rdbylhtexknlcvla] has joined #go-nuts
22:16 -!- wallerdev [~wallerdev@c-68-60-43-43.hsd1.mi.comcast.net] has quit [Quit:
wallerdev]
22:26 -!- bugQ [~bug@c-67-186-255-54.hsd1.ut.comcast.net] has joined #go-nuts
22:28 -!- wallerdev [~wallerdev@c-68-60-43-43.hsd1.mi.comcast.net] has joined
#go-nuts
22:33 -!- wallerdev [~wallerdev@c-68-60-43-43.hsd1.mi.comcast.net] has quit
[Client Quit]
22:38 -!- Nitro [~Nitro@unaffiliated/nitro] has joined #go-nuts
22:39 -!- r_linux [~r_linux@smtp.mandique.com.br] has quit [Quit: Lost terminal]
22:43 -!- tobier_ [~tobier@c-1c9de055.712-1-64736c11.cust.bredbandsbolaget.se] has
joined #go-nuts
22:44 -!- tobier [~tobier@c-1c9de055.712-1-64736c11.cust.bredbandsbolaget.se] has
quit [Read error: Operation timed out]
22:45 -!- chomp_ [~chomp@c-67-186-35-69.hsd1.pa.comcast.net] has joined #go-nuts
22:46 -!- chomp [~chomp@c-67-186-35-69.hsd1.pa.comcast.net] has quit [Read error:
Connection reset by peer]
22:47 -!- |Craig| [~|Craig|@panda3d/entropy] has quit [Ping timeout: 246 seconds]
22:48 -!- tobier_ [~tobier@c-1c9de055.712-1-64736c11.cust.bredbandsbolaget.se] has
quit [Read error: Operation timed out]
22:48 -!- tobier [~tobier@c-1c9de055.712-1-64736c11.cust.bredbandsbolaget.se] has
joined #go-nuts
22:52 -!- wallerdev [~wallerdev@c-68-60-43-43.hsd1.mi.comcast.net] has joined
#go-nuts
22:57 -!- georgezhou [480ee599@gateway/web/freenode/ip.72.14.229.153] has joined
#go-nuts
22:57 -!- georgezhou [480ee599@gateway/web/freenode/ip.72.14.229.153] has quit
[Client Quit]
23:01 -!- zcram [~zcram@77-233-78-167.cdma.dyn.kou.ee] has quit [Quit: Leaving]
23:02 -!- kr [~Keith@204.14.152.118] has quit [Ping timeout: 246 seconds]
23:02 -!- wallerdev [~wallerdev@c-68-60-43-43.hsd1.mi.comcast.net] has quit [Quit:
wallerdev]
23:03 -!- skelterjohn [~jasmuth@ool-43552550.dyn.optonline.net] has joined
#go-nuts
23:05 -!- iant [~iant@nat/google/x-tiazkjwcbqxhnade] has quit [Read error:
Operation timed out]
23:06 -!- tobier_ [~tobier@c-1c9de055.712-1-64736c11.cust.bredbandsbolaget.se] has
joined #go-nuts
23:06 -!- tobier [~tobier@c-1c9de055.712-1-64736c11.cust.bredbandsbolaget.se] has
quit [Read error: Operation timed out]
23:06 -!- ShadowIce [~pyoro@unaffiliated/shadowice-x841044] has quit [Quit:
Verlassend]
23:12 -!- krutcha [~krutcha@remote.icron.com] has quit [Quit: Leaving]
23:15 -!- skelterjohn [~jasmuth@ool-43552550.dyn.optonline.net] has quit [Quit:
skelterjohn]
23:16 -!- mnoel [~mnoel@c-75-65-250-60.hsd1.la.comcast.net] has quit [Read error:
Connection reset by peer]
23:16 -!- mnoel [~mnoel@c-75-65-250-60.hsd1.la.comcast.net] has joined #go-nuts
23:21 -!- pharris [~Adium@rhgw.opentext.com] has quit [Quit: Leaving.]
23:22 -!- mnoel [~mnoel@c-75-65-250-60.hsd1.la.comcast.net] has quit [Read error:
Connection reset by peer]
23:25 -!- wallerdev [~wallerdev@c-68-60-43-43.hsd1.mi.comcast.net] has joined
#go-nuts
23:31 -!- jarsen [~jarsen@76.8.206.34] has joined #go-nuts
23:32 -!- wallerdev [~wallerdev@c-68-60-43-43.hsd1.mi.comcast.net] has quit [Quit:
wallerdev]
23:34 -!- iant [~iant@66.109.103.84] has joined #go-nuts
23:34 -!- mode/#go-nuts [+v iant] by ChanServ
23:36 -!- jarsen [~jarsen@76.8.206.34] has quit [Remote host closed the
connection]
23:43 -!- GeertJohan [~Squarc@D978EC5D.cm-3-1d.dynamic.ziggo.nl] has quit [Quit:
Leaving.]
23:45 < Tonnerre> Whoever owns http://go-lang.cat-v.org/packages should
please update my Fedora entry to reflect more recent versions, notably fc15
23:46 < str1ngs> Tonnerre: send uriel an email
23:47 < Tonnerre> Ok, because I don't really maintain my fc12 repository
anymore for the obvious reason
--- Log closed Wed May 25 00:00:51 2011