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

--- Log opened Thu Dec 09 00:00:37 2010
00:00 -!- DarthShrine [~angus@pdpc/supporter/student/DarthShrine] has quit [Quit:
DarthShrine]
00:03 -!- wrtp [~rog@92.17.77.11] has quit [Quit: wrtp]
00:09 -!- SRabbelier [~SRabbelie@188.142.63.148] has joined #go-nuts
00:09 -!- virtualsue [~chatzilla@nat/cisco/x-tbqhjlzttmcesixt] has quit [Ping
timeout: 240 seconds]
00:17 -!- antonkovalyov [~antonkova@75-101-56-240.dsl.static.sonic.net] has quit
[Remote host closed the connection]
00:17 -!- antonkovalyov [~antonkova@75-101-56-240.dsl.static.sonic.net] has joined
#go-nuts
00:23 -!- iant [~iant@nat/google/x-xhlzsswkddgorbtx] has quit [Quit: Leaving.]
00:26 < drd> any suggestions for debugging a segault in 6l ?
00:27 -!- scyth [~scyth@rots.in.rs] has quit [Ping timeout: 250 seconds]
00:28 < drd> it's crashing at ld/dwarf.c:1859
00:28 -!- scyth [~scyth@rots.in.rs] has joined #go-nuts
00:29 < drd> (on amd_64, ubuntu 10.10 running in parallels on a mac)
00:31 * drd tries an older revision
00:31 -!- iant [~iant@67.218.110.2] has joined #go-nuts
00:31 -!- mode/#go-nuts [+v iant] by ChanServ
00:34 -!- krutcha [~krutcha@remote.icron.com] has quit [Quit: Leaving]
00:34 -!- enherit [~enherit@cpe-98-149-170-48.socal.res.rr.com] has quit [Ping
timeout: 276 seconds]
00:38 -!- thomas_b [~thomasb@cm-84.215.47.51.getinternet.no] has quit [Ping
timeout: 272 seconds]
00:53 < uriel> rmmh: I guess it should be quite trivial to fix gofmt to do
that automatically
00:53 < uriel> rmmh: but I really wonder if there are that many instances of
it
01:06 -!- boscop [~boscop@f055199010.adsl.alicedsl.de] has quit [Ping timeout: 240
seconds]
01:06 -!- [noff] [~noff@145-152.78-83.cust.bluewin.ch] has joined #go-nuts
01:09 -!- watr_ [~watr@66.183.100.58] has quit [Ping timeout: 272 seconds]
01:09 -!- ExtraSpice [~XtraSpice@88.118.33.48] has quit [Ping timeout: 240
seconds]
01:10 -!- noff [~noff@88-190.78-83.cust.bluewin.ch] has quit [Ping timeout: 265
seconds]
01:10 -!- nighty__ [~nighty@210.188.173.245] has joined #go-nuts
01:18 -!- kanru [~kanru@61-30-10-70.static.tfn.net.tw] has joined #go-nuts
01:27 < nsf> I like it..  running all.bash for 20 minutes (still compiling
gc suite, it's qemu) and then it tells me I don't have 'ed' installed :D
01:38 -!- tvw [~tv@e176005135.adsl.alicedsl.de] has quit [Ping timeout: 245
seconds]
01:45 -!- raylu [raylu@c-24-131-193-106.hsd1.pa.comcast.net] has left #go-nuts []
01:48 -!- CodeWar [~CodeWar@c-24-23-206-137.hsd1.ca.comcast.net] has joined
#go-nuts
02:04 -!- noktoborus [debian-tor@gateway/tor-sasl/noktoborus] has quit [Quit:
noktoborus]
02:05 -!- iant [~iant@67.218.110.2] has quit [Quit: Leaving.]
02:11 -!- Project_2501 [~Marvin@82.84.79.101] has quit [Quit: E se abbasso questa
leva che succ...]
02:13 -!- krutcha [~krutcha@S010600045a27676a.vs.shawcable.net] has joined
#go-nuts
02:13 < uriel> wtf are you doing without ed installed?
02:14 < nsf> it's a fresh net installed arch x86_64 on qemu
02:14 < nsf> it has nothing here at all
02:14 < adg> yeah i've made that mistake too
02:14 < adg> i don't know why i _would_ have ed installed.  i never use it
02:14 < nsf> but I'm surprised that it doesn't have 'ed' in core
02:15 < adg> too big?  :P
02:15 < nsf> it's really small
02:15 < adg> it's 53kb
02:15 < nsf> exactly
02:15 < adg> (on my 64-bit freebsd system)
02:15 < nsf> pacman (package manager in archlinux) says 72kb
02:16 < adg> manpage probably
02:16 < nsf> but it's my x86 system
02:16 < uriel> adg: uhu?  any *nix-like system without ed should be shot,
burnt, and its ashes scatered into a black hole
02:16 < nsf> maybe a bit bigger on 64
02:16 < uriel> I use ed all the time, it is really handy for quick edits,
not to mention scriptiong
02:16 < nsf> oh wait
02:16 < nsf> it's vice versa
02:16 < nsf> anyways..  difference is irrelevant
02:16 < adg> uriel: i don't deny that ed is useful.  it's just that i've
never used it, so there's no point in me having it by default
02:17 < uriel> adg: so if you never used, say, grep, you would think there
is no sense in having it installed by default?
02:17 < adg> except, of course, when building go
02:17 < uriel> ed is as core to Unix as grep, cat, and sort
02:18 < uriel> plus, ed still puts vi and emacs to shame, but that is
another sad story
02:18 < adg> uriel: are you going to FOSDEM?
02:18 -!- skelterjohn [~jasmuth@c-68-45-238-234.hsd1.nj.comcast.net] has joined
#go-nuts
02:18 < uriel> adg: maybe, not sure, why?
02:19 < adg> I will be there, presenting on Go
02:19 < uriel> ah, awesome
02:19 < adg> yeah it's quite exciting
02:19 < uriel> i might be in the US at the time, but if you are going that
is a great encouragement for me to drop by if I can make it
02:19 -!- CodeWar [~CodeWar@c-24-23-206-137.hsd1.ca.comcast.net] has left #go-nuts
["Leaving"]
02:21 < uriel> well, like all conferences, most of the talks are shit, but
there is usually plenty of people, I think it is probably one of the least bad
open source conferences in Europe, specially because they don't take themselves
too seriously
02:21 < skelterjohn> all conferences?  maybe you just don't go to the right
ones :)
02:22 < uriel> skelterjohn: can you suggest any?
02:22 < adg> or, more likely, too critical :)
02:22 < skelterjohn> i like AAAI, ICML, UAI, ICAPS, NIPS
02:22 < skelterjohn> all of which are AI/machine learning conferences
02:23 < skelterjohn> and the talks are by and large quite good :)
02:23 < uriel> skelterjohn: ok, I should concede that more specialized
conferences are usually much better
02:23 < adg> i went to the Open Source Developers Conference in Melbourne a
couple of weeks ago - the talks there were mostly very good
02:23 < skelterjohn> i don't see much purpose in going to a "computer
science" conference, certainly
02:24 < adg> Google I/O typically has very good presentations
02:24 < adg> (we certainly put in plenty of effort)
02:24 < uriel> skelterjohn: it is more general
programming/software/opensource conferences where talks are mostly a waste of
time, but they are a great opportunity to 1) troll people 2) if you are lucky meet
a few cool interesting people
02:24 -!- foocraft [~dsc@89.211.184.236] has joined #go-nuts
02:25 < adg> uriel: i can't imagine you trolling anyone!
02:25 < uriel> adg: I'm not a huge fan of Google I/O, but it is admitedly
above-average, but then, I totally despisse many of the topics (GWT?  I still
can't believe such a thing could be for real and not a joke)
02:25 < uriel> adg: haha
02:25 < skelterjohn> what is GWT?
02:25 < skelterjohn> google window toolkit?
02:26 < adg> skelterjohn: Google Web Toolkit - write UI code in Java and
have it automagically translated to JavaScript
02:26 < foocraft> web toolkit?
02:26 < foocraft> isn't youtube using GWT?
02:26 < uriel> skelterjohn: Java-to-AJAX-compiler, basically, write Java
code, generate JS+html+...
02:26 < adg> I don't much like the idea, either, but it actually seems to be
quite good - with the (admittedly huge) proviso that you have to actually _want_
to write Java code to find it useful.
02:26 < foocraft> google docs, gmail too
02:27 < uriel> foocraft: AFAIK gmail does *not* use gwt
02:27 < adg> foocraft: not gmail
02:27 < uriel> foocraft: Wave used it, and sucked massively
02:27 < adg> Wave used GWT extensively, pushed it to its limits
02:27 < adg> If Wave sucked, it sucked for reasons unrelated to GWT.
02:28 < foocraft> so as a follow up to yesterday's merge sort parallel vs.
serial battle, my prof.  doesn't believe my parallel code is parallel haha
02:28 < foocraft> and he never even checked the code
02:28 < uriel> adg: I'm not so sure, the UI was capable of hoghing any
hardware you could throw at it, and I would expect GWT to at least be partially to
blame for that
02:29 < adg> foocraft: sounds like a lazy kinda guy?
02:29 < foocraft> very.
02:29 < foocraft> he did point it a cool idea though
02:29 < uriel> foocraft: nobody told you about profs magical telepathic
powers to just *know* what the code you wrote does?
02:29 < adg> uriel: the UI had issues, but I don't think they were endemic
to GWT
02:29 < foocraft> he told me that the way I should be parallizing merge sort
is to write a parallel merg
02:29 < foocraft> merge*
02:29 < adg> even with its slow UI I think wave could have succeeded, but
they didn't focus on the right things IMO
02:29 < uriel> adg: could be, I don't know of any other project that uses
GWT, so it is hard to know
02:30 -!- niemeyer [~niemeyer@189.73.142.213] has quit [Ping timeout: 245 seconds]
02:30 < uriel> wave's failure was due to more than the UI, on that I
certainly agree, but that is way offtopic
02:31 < uriel> sorry for the offtopic trolling, wasn't intentional, I should
be sleeping, 3am here :)
02:31 < adg> goodnight :)
02:31 < uriel> to bring things more on-topic, I hope for more Go talks at
next Google I/O ;)
02:31 < nsf> it's too late for me here
02:31 < nsf> 7:30 am
02:31 < nsf> :D
02:31 < uriel> hehehe
02:32 < uriel> maybe a combination of both introductory and more advanced
talks
02:32 < foocraft> I think we need a talk about style, or a style document in
place
02:32 < adg> there will be, and they will be a lot more advanced
02:33 < foocraft> and a unit testing framework?  :p (I have my own
assertBlah that panic on an error)
02:33 < uriel> a talk more focused on implementation details would be
interesting, and maybe help encourage people to get involved in hacking more on
the core bits
02:33 < uriel> adg: awesome
02:36 < nsf> goodnight, sweet dreams
02:36 -!- nsf [~nsf@jiss.convex.ru] has quit [Quit: WeeChat 0.3.3]
02:37 < foocraft> what allocator does go use?
02:37 < foocraft> is it DL?
02:46 < foocraft> http://gostyleguide.info/ :(
02:47 < foocraft> go is the most difficult language to google things about.
02:47 -!- adu [~ajr@pool-173-66-11-168.washdc.fios.verizon.net] has joined
#go-nuts
02:49 * TheSeeker always googles using golang instead
02:49 -!- skelterjohn [~jasmuth@c-68-45-238-234.hsd1.nj.comcast.net] has quit
[Quit: skelterjohn]
02:57 -!- skelterjohn [~jasmuth@c-68-45-238-234.hsd1.nj.comcast.net] has joined
#go-nuts
03:10 < adu> how do you google with golang?
03:10 < skelterjohn> foocraft: he suggested parallelizing the merge part?
how would that work, exactly?
03:12 < TheSeeker> instead of looking for the word 'go' I look for the word
'golang' ?
03:16 -!- skelterjohn [~jasmuth@c-68-45-238-234.hsd1.nj.comcast.net] has quit
[Quit: skelterjohn]
03:18 -!- antonkovalyov [~antonkova@75-101-56-240.dsl.static.sonic.net] has quit
[Remote host closed the connection]
03:20 < uriel> foocraft: http://go-lang.cat-v.org/go-search
03:21 < adu> TheSeeker: why not use "site:golang.org"
03:22 < TheSeeker> because not all go related stuff is hosted at golang.org?
03:24 < TheSeeker> eg: https://launchpad.net/nutbean
03:24 < adu> also, when I get my go parser written, it will probably be
hosted at hackage.haskell.org
03:26 < adu> I've never used Netbeans
03:27 < TheSeeker> nobody's perfect :)
03:27 < adu> I heard it was based on Eclipse
03:28 < rmmh> no, it's not based on eclipse
03:30 < foocraft> skelterjohn, he told me to look it up
03:30 < foocraft> but I'm looking at one of them, and it'a bit unclear
03:32 -!- mbohun [~user@ppp115-156.static.internode.on.net] has joined #go-nuts
03:50 -!- snearch_ [~snearch@f053010114.adsl.alicedsl.de] has joined #go-nuts
03:53 -!- snearch [~snearch@f053003059.adsl.alicedsl.de] has quit [Ping timeout:
245 seconds]
03:56 -!- araujo [~araujo@gentoo/developer/araujo] has quit [Quit: Leaving]
03:58 -!- vermi [959f7527@gateway/web/freenode/ip.149.159.117.39] has joined
#go-nuts
03:59 < vermi> o hai again #go-nuts
04:00 < vermi> so i'm trying to figure out if there's a way to add a timeout
to http.Get() ...  for instance, if I don't get a response within say 25 seconds,
return
04:02 < rmmh> (you should just use my bot)
04:04 < rmmh> vermi: more specifically, there's no timeout support in http
04:05 < vermi> fantastic.
04:05 < vermi> just as i had everything working and condensed down to some
elegant code, the search engine I was using went down D:
04:06 < vermi> so now when people try to use the functions, they take 60+
seconds to get an error
04:06 < vermi> maybe i should just disable them until the site is back up
04:07 -!- piyushmishra [~piyushmis@117.200.228.172] has joined #go-nuts
04:07 -!- vermi [959f7527@gateway/web/freenode/ip.149.159.117.39] has quit [Quit:
Page closed]
04:12 -!- Kashia [~Kashia@port-92-200-108-107.dynamic.qsc.de] has quit [Ping
timeout: 240 seconds]
04:18 < |Craig|> vegai: you can make a wrapper around the calls with a
timeout.  Not the cleanest approach, but doable
04:18 < |Craig|> oh, he left
04:19 -!- Eridius [~kevin@unaffiliated/eridius] has quit [Ping timeout: 240
seconds]
04:25 < foocraft> write a wrapper that contains a timeout for the function?
04:25 < foocraft> wait, for that, I need to know how to interact with a go
routine from another go routine
04:25 < foocraft> like...kill it
04:26 < |Craig|> foocraft: nah, you just ignore the result if it happens
after the timeout
04:26 < foocraft> so the wrapper would have a channel that accepts the
result?
04:26 < |Craig|> ya
04:27 < foocraft> and if the channel is empty in the wrapper after the time
out, then it timed out
04:27 < foocraft> but what if it didn't time out, wouldn't I be causing a
lag?
04:28 < |Craig|> so it would prabably use a little closure to call the
wrapped function, the closure would respond on a channel, and the main function
would have a select blocking on a timout and output
04:28 -!- rejb [~rejb@unaffiliated/rejb] has quit [Ping timeout: 276 seconds]
04:28 < |Craig|> foocraft: yes, there is an overhead, but the call in
question in this case did time out eventually, just after way too long
04:28 < |Craig|> so it wouldn't be a permeant leak
04:29 < foocraft> so you spawn a go routine that detects the time out,
basically?
04:29 < foocraft> so there wouldn't be a lag
04:29 < |Craig|> something like that
04:29 < foocraft> like the problem with waiting on the channel, exlusively,
is that you set a strict limit
04:31 -!- DarthShrine [~angus@pdpc/supporter/student/DarthShrine] has joined
#go-nuts
04:38 -!- rhencke [~rhencke@ppp-70-247-243-221.dsl.ltrkar.swbell.net] has joined
#go-nuts
04:38 < |Craig|> foocraft: here is a very rough version of it:
http://dpaste.com/284665/
04:39 < |Craig|> Its rather neat that doing such a thing is simple in go
04:39 < foocraft> I like how cooking things that are really complex is fast
in go
04:40 < foocraft> like, and they're not even complex
04:40 < |Craig|> it prabably should have a return value to signal timout
errors
04:40 < foocraft> yeah that clojure should prolly set something in its
parent's thread
04:41 < |Craig|> closure, clojure is a language
04:41 < foocraft> damn
04:41 < foocraft> haha :p
04:42 < |Craig|> foocraft: to do error reporting for the timout, just do the
return inside the select
04:42 < |Craig|> and add another return paramater
04:42 < |Craig|> no need to modify the closure
04:42 -!- krutcha [~krutcha@S010600045a27676a.vs.shawcable.net] has quit [Quit:
Leaving]
04:52 < rhencke> should go bugs only be filed against releases?
04:54 -!- antonkovalyov [~antonkova@adsl-75-18-220-88.dsl.pltn13.sbcglobal.net]
has joined #go-nuts
04:56 -!- devrim [~Adium@cpe-72-225-239-227.nyc.res.rr.com] has joined #go-nuts
04:56 -!- devrim1 [~Adium@cpe-72-225-239-227.nyc.res.rr.com] has quit [Read error:
Connection reset by peer]
05:02 -!- iant [~iant@adsl-71-133-8-30.dsl.pltn13.pacbell.net] has joined #go-nuts
05:02 -!- mode/#go-nuts [+v iant] by ChanServ
05:03 -!- zozoR [~zozoR@56344bf6.rev.stofanet.dk] has joined #go-nuts
05:04 -!- Gertm [~Gertm@d51A45118.access.telenet.be] has quit [Ping timeout: 265
seconds]
05:18 -!- krutcha [~krutcha@S010600045a27676a.vs.shawcable.net] has joined
#go-nuts
05:18 -!- Gertm [~Gertm@d51A45118.access.telenet.be] has joined #go-nuts
05:19 -!- lotrpy [~lotrpy@202.120.36.170] has joined #go-nuts
05:20 < lotrpy> hello, I'm reading go_tutorial, line 16 of helloword3.go:
file, err := file.Open("/does/not/exist", 0, 0)
05:20 < lotrpy> isn't there a naming conflict?
05:21 <+iant> the code is slightly dubious and should probably be changed,
but there is no naming conflict
05:22 <+iant> the variable file is only in scope after the declaration
05:22 <+iant> it shadows the package name file
05:23 < lotrpy> iant, sorry for my broken English, I copy "naming conflict"
from the tutorial too, I don't how to express "shadow package name" until ...now:)
05:24 < lotrpy> not a big deal, at leat to me, but I think file, _ =
file.foo is not a recommanded way to write code.
05:31 < rmmh> indeed
05:33 -!- iant [~iant@adsl-71-133-8-30.dsl.pltn13.pacbell.net] has quit [Ping
timeout: 245 seconds]
05:34 -!- iant [~iant@216.239.45.130] has joined #go-nuts
05:34 -!- mode/#go-nuts [+v iant] by ChanServ
05:40 -!- rbraley_ [~rbraley@ip72-204-243-89.ph.ph.cox.net] has joined #go-nuts
05:40 -!- rbraley_ [~rbraley@ip72-204-243-89.ph.ph.cox.net] has quit [Client Quit]
05:40 -!- rbraley [~rbraley@ip72-204-243-89.ph.ph.cox.net] has quit [Quit:
Ex-Chat]
05:41 < plexdev> http://is.gd/iqpM7 by [Ryan Hitchman] in 9 subdirs of go/
-- throughout: simplify two-variable ranges with unused second variable
05:41 -!- rbraley [~rbraley@ip72-204-243-89.ph.ph.cox.net] has joined #go-nuts
05:44 -!- rhencke [~rhencke@ppp-70-247-243-221.dsl.ltrkar.swbell.net] has quit
[Quit: rhencke]
05:47 -!- devrim [~Adium@cpe-72-225-239-227.nyc.res.rr.com] has quit [Quit:
Leaving.]
05:50 < foocraft> how can I get the byte max value?
05:53 -!- _nil [~aiden@c-24-147-65-44.hsd1.ma.comcast.net] has joined #go-nuts
05:53 < _nil> hey, can i put things like : "rsc, r" on the Reviewers line?
05:53 < _nil> i just fixed 1265 issue
05:53 < _nil> (probably should have s/r/adg/g)
05:53 < foocraft> I think it's 1<<17
05:57 < Rennex> foocraft: the max value of an unsigned byte is 255 :P
05:57 < foocraft> but isn't this UTF16?
05:58 < foocraft> like for chars that is
05:59 < foocraft> ((1<<17) -1)
06:00 < Rennex> hm, dunno about that, but unicode stuff in general can use 1
or more bytes/words/whatever to represent a character (i.e.  utf-16 needs more
than 16 bits for some characters)
06:00 < Rennex> not that i can guess what you need the maximum value for :)
06:00 < foocraft> just trying to write a randomized tester that spits out
legit chars :p
06:01 < foocraft> I want to implement a parallel Trie with Go
06:01 < foocraft> and I'm writing the tests for that
06:01 * foocraft is a fan of TDD
06:03 < Namegduf> Do me a favour
06:03 < Namegduf> Don't do what gotrie did
06:03 < Namegduf> And use a map in every node
06:03 < foocraft> yeah that's how a trie should be implemented
06:04 < foocraft> in java, I used a hashmap < Character, Trie >
06:04 < Namegduf> No, that's not how a trie should be implemented
06:04 < Namegduf> Hashmaps are BIG
06:04 < Namegduf> Your trie will be bloated as hell
06:05 < foocraft> well, I can prolly use an ArrayList of Tries and have a
character stored in every trie, indicating its root's head
06:05 < Namegduf> C implementations can use a linked list at each level and
compact multiple levels where there's only one child for reasonable performance
and memory usage
06:06 < foocraft> so actually, ArrayLists, when they're saved on disk, they
reduce their capacity to their size
06:06 < foocraft> so isn't a map in Go equivalent to a hashmap?
06:07 < Namegduf> Yes, it is.
06:07 < foocraft> hmm so why use a map in Go and not use a hashmap in java?
06:07 < Namegduf> I said "don't" do that
06:07 -!- zozoR [~zozoR@56344bf6.rev.stofanet.dk] has quit [Quit: Morten.  Desu~]
06:07 < Namegduf> Because maps are big
06:07 < foocraft> oh :) oops
06:08 < foocraft> yeah, I see how they can be big, but what's the quicker
alternative?  (slices of Tries?)
06:08 < |Craig|> Namegduf: thanks for providing yet another example of the
structual ambiguity of english syntax ;)
06:08 < foocraft> which would benefit from caching, when I'm searching for
the next trie node to traverse
06:08 < Namegduf> A stereotypical C implementation I found had a next
pointer in each node
06:08 < Namegduf> And a single child pointer
06:09 < Namegduf> And each level was implemented as a linked list
06:09 < Namegduf> There's probably cheaper ways to do it.
06:09 < foocraft> I think you prolly wanna switch how you represent it, as
you go down
06:09 < foocraft> because tries tend to be dense at a high level, and as you
go down, they're like 2 chars per node or less
06:09 < Namegduf> My implementation did that, but it also compacted.
06:10 < foocraft> the average hight of a trie of english words should be 7
06:10 < foocraft> height*
06:11 -!- mbohun [~user@ppp115-156.static.internode.on.net] has quit [Remote host
closed the connection]
06:11 < foocraft> although an array of the alphabet size, for unicode =
nightmare
06:12 < foocraft> so maybe an array that keeps doubling its size, for all
nodes, can be a good idea
06:12 < foocraft> but then the magic goes in how big the initial size is
06:12 < foocraft> to minimize waste
06:20 -!- rbraley [~rbraley@ip72-204-243-89.ph.ph.cox.net] has quit [Ping timeout:
265 seconds]
06:28 -!- keithcascio [~keithcasc@nat/google/x-kpczuhrtfljslfms] has quit [Quit:
Leaving]
06:29 -!- sl [~sl@68-179-130-17.bsr-c9-d1.evv.dhcp.sigecom.net] has quit [Read
error: Connection reset by peer]
06:44 -!- Tv [~tv@cpe-76-168-227-45.socal.res.rr.com] has quit [Ping timeout: 255
seconds]
07:06 < foocraft> does go have a foreach syntax?
07:09 < |Craig|> foocraft: see the language specification, specifically for
loops using range statements
07:09 < |Craig|> they work on slices maps and channels
07:09 < |Craig|> I think thats it though
07:11 < foocraft> when I do for i := range ( someArray ) { stuff } the i I
see is an index within someArray
07:11 < foocraft> it's not an element within someArray
07:12 < |Craig|> foocraft: note the optional second parameter
http://golang.org/doc/go_spec.html#RangeClause
07:13 < |Craig|> I mean second return value
07:14 < foocraft> okay got it
07:14 < foocraft> so if I ignore the index and have the element, I got a
typical foreach
07:14 < foocraft> for _, elem := range ( array ) { stuff ( elem ) }
07:17 -!- rbraley [~rbraley@ip72-204-243-89.ph.ph.cox.net] has joined #go-nuts
07:19 < foocraft> is there any preprocessing for Go? :p
07:19 < foocraft> I want to get how go determines go routine count and what
does it do when I reach the limit
07:20 -!- photron [~photron@port-92-201-249-34.dynamic.qsc.de] has joined #go-nuts
07:20 < foocraft> I mean, does it wait or does it run the go routine within
the same go routine it was spawned from?
07:31 < krutcha> you mean as like a child process..  or?
07:36 < krutcha> ack I think I painted myself into a corner with RWLock
07:36 < krutcha> my if condition takes a lock, then a function called in the
scope does also
07:45 -!- adu [~ajr@pool-173-66-11-168.washdc.fios.verizon.net] has quit [Quit:
adu]
07:48 -!- devrim [~Adium@cpe-72-225-239-227.nyc.res.rr.com] has joined #go-nuts
07:57 < krutcha> does string([]uint8) make a copy, or just do a wrapper cast
around the same array?
08:02 -!- tensorpudding [~user@99.148.202.191] has quit [Read error: Connection
reset by peer]
08:08 < |Craig|> krutcha: I think []uint8 is a mutable type and strings are
not, so it must copy, but I havent used strings in go much
08:09 < krutcha> roger roger
08:11 -!- bortzmeyer [~bortzmeye@batilda.nic.fr] has joined #go-nuts
08:11 < |Craig|> krutcha: I think they are both stored in memory the same
(length then data) so you might be able to skip the copy using unsafe, but thats
very, very messy
08:12 -!- rlab [~Miranda@91.200.158.34] has joined #go-nuts
08:14 < jesusaurus> will it cause an error if you close a closed channel?
08:14 < krutcha> nope
08:15 < jesusaurus> thanks
08:15 -!- fuzzybyte [~fuzzybyte@77.79.7.8] has quit [Ping timeout: 276 seconds]
08:16 < krutcha> I think once you call close once, closed(channel) will be
true when checked, and if the channel is read from it will produce zero values
08:16 < krutcha> so in a sense it's still active/there, just not yielding
data
08:17 < jesusaurus> what im worried about is calling close(channel) multiple
times
08:17 < krutcha> should be fine AFAIK
08:17 < jesusaurus> time to test then
08:18 < krutcha> easy to mock up on http://golang.org/ for some peace of
mind
08:20 < |Craig|> for loops over channels using close works really nicely
08:21 < jesusaurus> im being passed a channel and want to close it,
08:22 -!- piyushmishra [~piyushmis@117.200.228.172] has quit [Read error:
Connection reset by peer]
08:22 < jesusaurus> looks like calling close() will NOT panic if the channel
has already been closed
08:23 -!- napsy [~luka@88.200.96.18] has joined #go-nuts
08:28 -!- ronnyy [~quassel@drsd-4db3d4fc.pool.mediaWays.net] has joined #go-nuts
08:28 -!- |Craig| [~|Craig|@panda3d/entropy] has quit [Quit: |Craig|]
08:34 -!- raylu [raylu@c-24-131-193-106.hsd1.pa.comcast.net] has joined #go-nuts
08:35 < raylu> how do i handle non-utf-8 encoded strings?  in particular,
i'm downloading a webpage using the http package that is iso-8859-1 encoded
08:51 -!- ronnyy [~quassel@drsd-4db3d4fc.pool.mediaWays.net] has quit [Remote host
closed the connection]
08:51 -!- itrekkie [~itrekkie@ip72-200-115-40.tc.ph.cox.net] has joined #go-nuts
08:51 -!- ExtraSpice [~XtraSpice@88.118.33.48] has joined #go-nuts
08:51 -!- itrekkie [~itrekkie@ip72-200-115-40.tc.ph.cox.net] has quit [Client
Quit]
08:57 -!- araujo [~araujo@gentoo/developer/araujo] has joined #go-nuts
09:09 -!- enferex [~enferex@users.757.org] has quit [Ping timeout: 250 seconds]
09:09 -!- mcot [~mcot@pool-71-171-113-161.clppva.fios.verizon.net] has joined
#go-nuts
09:12 -!- mcot_ [~mcot@pool-71-171-113-161.clppva.fios.verizon.net] has quit [Ping
timeout: 265 seconds]
09:15 -!- ronnyy [~quassel@drsd-4db3d4fc.pool.mediaWays.net] has joined #go-nuts
09:17 -!- enferex [~enferex@users.757.org] has joined #go-nuts
09:17 -!- virtualsue [~chatzilla@nat/cisco/x-xzuqgwwgnrlyrltf] has joined #go-nuts
09:33 -!- wrtp [~rog@92.17.77.11] has joined #go-nuts
09:34 -!- snearch_ [~snearch@f053010114.adsl.alicedsl.de] has quit [Quit:
Verlassend]
09:35 -!- ronnyy [~quassel@drsd-4db3d4fc.pool.mediaWays.net] has quit [Remote host
closed the connection]
09:36 -!- nighty__ [~nighty@210.188.173.245] has quit [Remote host closed the
connection]
09:45 -!- noktoborus_ [debian-tor@gateway/tor-sasl/noktoborus] has joined #go-nuts
09:47 -!- napsy_ [~luka@88.200.96.18] has joined #go-nuts
09:49 -!- sahid [~sahid@LNeuilly-152-21-22-10.w193-253.abo.wanadoo.fr] has joined
#go-nuts
09:52 -!- krutcha [~krutcha@S010600045a27676a.vs.shawcable.net] has quit [Quit:
Leaving]
09:59 -!- Project_2501 [~Marvin@82.84.79.101] has joined #go-nuts
10:08 -!- noam [~noam@77.124.236.67] has quit [Ping timeout: 240 seconds]
10:19 -!- Guest18411 [~luka@88.200.96.18] has quit [Quit: leaving]
10:24 -!- noam [noam@77.124.236.67] has joined #go-nuts
10:27 -!- antonkovalyov [~antonkova@adsl-75-18-220-88.dsl.pltn13.sbcglobal.net]
has quit [Remote host closed the connection]
10:37 -!- tdc [~santegoed@host86-156-182-103.range86-156.btcentralplus.com] has
joined #go-nuts
10:40 -!- mcot_ [~mcot@pool-71-171-113-161.clppva.fios.verizon.net] has joined
#go-nuts
10:43 -!- mcot [~mcot@pool-71-171-113-161.clppva.fios.verizon.net] has quit [Ping
timeout: 240 seconds]
10:44 -!- virtualsue [~chatzilla@nat/cisco/x-xzuqgwwgnrlyrltf] has quit [Ping
timeout: 245 seconds]
10:47 < uriel> raylu: you handle them by converting them to utf-8
10:47 -!- Patabugen [4e2117f3@pdpc/supporter/active/patabugen] has joined #go-nuts
10:53 -!- Zerelda [Zerelda@76.91.53.83] has joined #go-nuts
10:54 < Zerelda> hi.  does Go have an ordered map?
10:55 < Zerelda> how do you do sparse data storage in Go
10:57 -!- kanru [~kanru@61-30-10-70.static.tfn.net.tw] has quit [Ping timeout: 245
seconds]
10:57 < Zerelda> all I see is Heap, List, Ring, Vector
10:57 -!- Patabugen [4e2117f3@pdpc/supporter/active/patabugen] has quit [Ping
timeout: 265 seconds]
10:59 < wrtp> Zerelda: a map gives you sparse data storage.  but it's not
ordered.
11:00 < Zerelda> it has to be ordered
11:00 < wrtp> what kind of thing are you wanting to use it for?
11:00 < Zerelda> thats the most basic requirement for sparse data storage
11:00 < wrtp> you mean like a sparse matrix?
11:01 -!- noktoborus_ [debian-tor@gateway/tor-sasl/noktoborus] has quit [Ping
timeout: 245 seconds]
11:01 < Zerelda> indexed data
11:01 < Zerelda> that you can iterate over
11:01 < Zerelda> like std::map in C++
11:01 -!- dreisner [~noclaf@ool-18bba97a.dyn.optonline.net] has joined #go-nuts
11:02 < Zerelda> theres std::map and std::unordered_map
11:02 < Zerelda> you use a map for sparse data storage
11:02 < wrtp> why do you need it to be ordered?
11:02 < Zerelda> what use is it if its not ordered?
11:02 < Zerelda> that accomplishes nothing
11:02 < wrtp> you can retrieve values by key
11:02 < Zerelda> lol
11:02 < wrtp> that's good enough for many applications
11:03 < Zerelda> no thats not
11:03 < Zerelda> you cant even implement basic stuff like that
11:03 < Zerelda> what are you gonna do, try querying every possible key?
11:03 < wrtp> you can iterate through it
11:03 < wrtp> although the order of iteration is undefined
11:03 < Zerelda> well thats not usable for sparse data storage
11:04 < Zerelda> thats why every language has ordered and unordered maps
11:04 < wrtp> surely that depends on what kind of sparse data you're storing
11:04 < Zerelda> Google Go really cant do this?
11:04 < exch> keep a separate slice of keys.  You can order that to your
heart's content
11:04 < Zerelda> now you want me to maintain 2 containers?
11:04 < Zerelda> this is dumb
11:04 < wrtp> what are you actually trying to do?
11:04 < Zerelda> basic stuff wrtp
11:04 < wrtp> like....
11:04 < exch> Personally, I've never had the need for an ordered map myself
11:05 < Zerelda> wrtp: the Key is 'time'
11:05 < Zerelda> iterate over events...
11:05 < wrtp> when i did something like that recently, i used a Heap.
11:05 < Zerelda> std::map<time_t, event_t>
11:05 < Zerelda> simple.
11:06 < Zerelda> sounds like doing basic things is more complicated in Go
11:06 < wrtp> do you need to extract arbitrary ranges of events from the
map?
11:06 < Zerelda> yes
11:06 < Zerelda> done all the time
11:07 < Zerelda> super common
11:07 < Zerelda> we query the map's upper_bound and lower_bound and it will
give all events in a range
11:07 < uriel> 11:03 < Zerelda> well thats not usable for sparse data
storage
11:08 < uriel> wtf do you mean by "sparse data storage"?
11:08 < wrtp> uriel: he's just explained
11:08 < uriel> and what is the problem with keeping a map and a slice?
11:08 < Zerelda> because that's a regression from C++
11:08 < uriel> C++ is a regression from C
11:08 < wrtp> uriel: the problem with that is that inserting a new element
is O(n)
11:08 < Zerelda> my app has has tons of time and audio code all over
11:08 < Zerelda> Imagine if I had to duplicate everything
11:09 < wrtp> Zerelda: go isn't very rich in algorithms currently
11:10 < wrtp> Zerelda: but it would not be hard to do.
11:10 < Zerelda> ok but this is one of the most basic things you could have
11:10 < wrtp> it's not really - there are many possible algorithms with
different tradeoffs.
11:10 < Zerelda> string ...  vector ...  list ...  ordered map ...
unordered map ...
11:10 < Zerelda> thats bread and butter
11:10 < wrtp> well, go has all of those except ordered map
11:11 < Zerelda> ok unusable language
11:11 < Zerelda> i do audio stuff
11:11 < Zerelda> thx for your help
11:11 < wrtp> it would be trivial to write
11:11 < uriel> 11:08 < wrtp> uriel: the problem with that is that
inserting a new element is O(n)
11:11 < uriel> wrtp: not really, not at all even
11:11 < Zerelda> a proper map isnt trivial
11:11 < uriel> wrtp: see how append() works
11:12 < uriel> Zerelda: Go has proper maps that have worked just fine for
everyone I know that has used Go
11:12 < wrtp> Zerelda: just because the language doesn't provide something
as a basic primitive doesn't mean that it's "unusable"
11:12 < wrtp> uriel: if you're keeping an ordered slice of keys, then
inserting a new element into the middle of that slice is O(n)
11:12 < uriel> maybe the language should offer as primitives every
datastructure ever dreamed up by anyone?
11:12 < vegai> Zerelda: are you a troll?  I don't know any language that has
ordered maps
11:12 < Zerelda> looking at my visual studio implementation of the map, its
about 3000 lines of code
11:12 < Zerelda> and has been perfected for many years
11:13 < wrtp> is that the C++ template library version?
11:13 < Zerelda> yes
11:13 -!- niemeyer [~niemeyer@189.73.142.213] has joined #go-nuts
11:13 -!- piyushmishra [~piyushmis@117.200.224.142] has joined #go-nuts
11:14 < uriel> the Flash codebase is many hundreds of thousands of lines of
code, perfected over many many years, and it is still useless shit
11:14 < uriel> so I don't see what kind of argument that is
11:14 < Zerelda> implementing a container is not a trivial thing you whip up
in a day
11:15 < wrtp> depends on the container
11:15 < uriel> exactly, and depends on what you need it for
11:15 < wrtp> a simple binary tree could be done in a few minutes
11:15 < Zerelda> i dont want simple hacked stuff
11:16 < uriel> the containers Go provides are more than enough for >90%
of projects, and Go makes it quite easy to build your own custom containers for
more specialized needs
11:16 < Zerelda> i want a professional working map which is a core part of
the language
11:16 < vegai> if you want a C++, why not just use C++?
11:16 < uriel> 'professional'?  ok, I think I got trolled far enough
11:16 < Zerelda> i do use C++
11:16 < vegai> well there you go
11:16 < Zerelda> i said already, Go isnt usable without a map
11:16 < vegai> ordered map.  It has map
11:17 < vegai> which by default is of course unordered
11:17 < wrtp> Zerelda: std::map is not in the "core" of the language - it's
part of C++'s standard library
11:17 < Zerelda> that's fine
11:17 -!- dreisner [~noclaf@ool-18bba97a.dyn.optonline.net] has left #go-nuts []
11:17 < wrtp> go is a new language - it has not had time for all the
standard library components to be written yet
11:17 < uriel> 11:16 < Zerelda> i said already, Go isnt usable without
a map
11:18 < uriel> Zerelda: I guess you consider C unusuable too?
11:18 < Zerelda> you're going to have problems with C++ folks if you take
away one of their basic containers
11:18 < Zerelda> bye
11:18 < uriel> Zerelda: so maybe Go should include every feature every other
language has ever implemented?
11:18 < vegai> Zerelda: is map ordered by default in these C++ libs?
11:18 < Zerelda> Yes
11:18 < exch> I do hope Go doesn't go the same route.  I would hate to end
with something as hidious as *shrug* boost
11:18 < Zerelda> std::map is ordered
11:18 < uriel> vegai: yes, C++ containers are quite broken by
11:18 < uriel> default
11:19 < wrtp> Zerelda: and, although i see that ordered maps are a central
feature for you, they're not that commonly used elsewhere.
11:19 < Zerelda> Everyone i know uses them all the time nonstop
11:19 < Zerelda> we're all audio guys
11:19 < wrtp> uriel: you're being needlessly inflammatory
11:19 < Zerelda> its like one of the most basic things you need
11:19 < wrtp> yeah, for audio i can see that
11:19 < vegai> ordered maps are useful in some cases certainly, but isn't it
a bit silly to make it ordered by default?
11:19 < wrtp> most people don't do audio
11:19 < Zerelda> not just audio though
11:19 < vegai> it makes people think that maps should be ordered by default
11:19 < Zerelda> theres so many similar things
11:19 < vegai> and then they get burned when they try other languages
11:19 < Zerelda> Imagine data points on a graph
11:20 < uriel> wrtp: sorry, you are right, but all this "without feature X
Go is completely useless" gets tyring about a while (given that Go clearly is
quite useful for tons of people without feature X)
11:20 < Zerelda> You store those ordered
11:20 < wrtp> a hash table can be more efficient than an ordered tree
11:20 < Zerelda> Storing data points on a graph is a universal thing
11:20 < Zerelda> audio happens to be one form of that
11:20 < uriel> every algorithm is 'universal' in some way
11:20 < Zerelda> well, not audio streams, those are non-sparse
11:20 < wrtp> associating values with keys is more universal (it's a
superset)
11:21 < Zerelda> but events in my case
11:21 < wrtp> Zerelda: out of interest, what algorithm does the standard C++
ordered map implementation use?
11:22 < Zerelda> red black
11:22 < wrtp> 3000 lines, woo
11:22 < wrtp> red black's not that hard.
11:22 < Zerelda> its optimized
11:23 < Zerelda> the length is from template optimizations to do stuff
static
11:23 < wrtp> of course
11:23 -!- TheSeeker [~n@99-153-250-110.lightspeed.irvnca.sbcglobal.net] has quit
[Ping timeout: 260 seconds]
11:24 < wrtp> the joys of C++ templates
11:25 < uriel> anyway, there is: http://github.com/runningwild/go-btree
11:25 < Zerelda> anyways, i am NOT asking about a specialized thing...
please
11:25 < Zerelda> i mean lets see
11:25 < Zerelda>
http://www.aanda.org/articles/aa/full_html/2009/27/aa12505-09/img20.png
11:25 < Zerelda> what is this?  who knows ...
11:25 < Zerelda> Orbital phase?
11:25 < Zerelda> ordered map ...
11:26 < Zerelda>
https://www.crops.org/images/publications/jeq/30/5/1720f5.jpeg
11:26 < Zerelda> ???
11:26 -!- TheSeeker [~n@99-153-250-110.lightspeed.irvnca.sbcglobal.net] has joined
#go-nuts
11:26 < Zerelda> ordered map
11:27 < wrtp> ordered vector of keys and values...  :-)
11:27 < Zerelda> nope
11:27 < Zerelda> Thats not sparse
11:27 < Zerelda> thats too expensive at insertion time
11:27 < Zerelda> horrible
11:27 < wrtp> that's an optimisation
11:28 < wrtp> not necessary when n is small like in those examples
11:28 < Zerelda> no its common sense.  you dont sit there inserting stuff
into the middle of a vector
11:28 < Zerelda> and moving all elements repeatedly
11:28 < Zerelda> the whole reason you use the map is to "not-fing-do-that"
11:28 < wrtp> if n is small, a more complex algorithm is quite possibly more
expensive
11:28 < Zerelda> N is not small
11:28 < Zerelda> if N was small, I'd use something other
11:28 < vegai> map for the items, array for the ordering?
11:29 < wrtp> vegai: same problem
11:29 < vegai> yeah, I suppose.
11:29 < vegai> meh, so just trees.
11:29 < wrtp> yup
11:29 -!- noktoborus_ [debian-tor@gateway/tor-sasl/noktoborus] has joined #go-nuts
11:30 < wrtp> uriel: the btree implementation you linked to doesn't have all
the required operations
11:30 < wrtp> and the iterator will be slow
11:30 -!- ucasano [~ucasano@host150-147-static.225-95-b.business.telecomitalia.it]
has joined #go-nuts
11:30 -!- Fish [~Fish@coss6.exosec.net] has quit [Quit: So Long, and Thanks for
All the Fish]
11:31 < vegai> then again, perhaps there's a case for including basic data
structures with go
11:31 < vegai> the C world is littered with implementations thereof
11:31 < vegai> some good, most bad
11:31 < wrtp> vegai: it will happen - it's just that it hasn't yet
11:31 < uriel> vegai: there is container/* already
11:32 < vegai> ok, cool.
11:32 -!- unofficialmvp [~dev@94-62-164-227.b.ipv4ilink.net] has joined #go-nuts
11:32 < uriel> vegai: no other stuff has been added to container/* because,
well, pretty much nobody needs other stuff
11:32 < exch> After all is said and done, Go is an opensource project.  If
you need something, you're welcome to roll your own and put it up for
review/approval.
11:32 < wrtp> Zerelda: you could probably use cgo to use the standard C++
map...
11:32 < Zerelda> heh
11:32 < uriel> already container/Vector is causing all kinds of problems,
because people use it when they should be using slices instead
11:32 < Zerelda> can you pass template parameters?
11:32 < Zerelda> for the type
11:33 * uriel votes to have container/Vector removed from go's stdlib, or at least
deprecated somehow
11:33 -!- tvw [~tv@212.79.9.150] has joined #go-nuts
11:33 < wrtp> uriel: container/Vector *is* a slice
11:33 < uriel> wrtp: sure, but it is a really retarded way of using a slice
11:33 < wrtp> Zerelda: no - go does not have generics (yet)
11:33 < uriel> wrtp: you are much better off just using a slice directly
11:33 < Zerelda> ok wrtp if you cant pass the type it would be pretty hard
to use
11:34 < wrtp> Zerelda: you'd always use the same type (an interface type, 64
bits)
11:34 < uriel> I can't think of any since code I have seen using Vector that
wouldn't be better off using slices directly
11:34 < Zerelda> if you use an interface type
11:34 < Zerelda> that means all the elements would be allocated on the heap,
no?
11:34 < wrtp> Zerelda: no
11:34 < Zerelda> well you cant store all objects in 8 bytes
11:35 < Zerelda> per element
11:35 < wrtp> Zerelda: if the element size is less than pointer size, then
it gets stored directly in the element
11:35 < wrtp> s/element$/interface/
11:35 < Zerelda> right thats what I mean
11:35 < wrtp> it's true that if you're storing larger objects, then they'll
get heap allocated
11:35 < Zerelda> lol that wont work
11:35 < Zerelda> too slow
11:36 < wrtp> how large are your event objects?
11:36 < Zerelda> pluginid, group, track, column, time, value, meta
11:36 < uriel> see also: https://github.com/petar/GoLLRB
11:36 < Zerelda> 28 bytes
11:38 < wrtp> i think if a heap allocation per event is too slow, then go is
going to be too slow for you - it does heap allocations for quite a few things.
11:38 < wrtp> e.g.  when taking the address of a local
11:38 < Zerelda> i never use the heap
11:38 < Zerelda> i hate the heap
11:38 -!- virtualsue [~chatzilla@nat/cisco/x-cjuqgkrpidgzgjfe] has joined #go-nuts
11:39 < wrtp> you must use the heap - that's where map objects get stored
11:39 < Zerelda> correct
11:39 < Zerelda> map, string, vector, etc
11:39 < wrtp> so you *do* use the heap :-)
11:39 < vegai> http://golang.org/doc/go_for_cpp_programmers.html ? :)
11:39 < Zerelda> wrtp, only if a container does it for me
11:40 -!- res99 [~anonymous@201.237.130.70] has joined #go-nuts
11:40 < Zerelda> and also in the other circumstances where you're forced to
use it and have no other solution
11:40 < vegai> that's how I worked in C as well
11:40 < vegai> but this ain't C
11:41 < Zerelda> as for storing events on the heap -- by "too slow" i meant
11:41 < wrtp> thing is, when you haven't got garbage collection, the heap is
awkward
11:41 < Zerelda> doing weird stuff with a virtual interface in between
11:41 < vegai> can I ask what you do?  I got 'audio stuff'
11:41 < Zerelda> the elements need to be the elements, no vtable
11:41 < vegai> apparently rather real-time requirements?
11:41 < Zerelda> yes realtime
11:42 < vegai> I don't think go is trying to combat in that arena
11:42 < wrtp> what's wrong with the vtable?
11:42 < Zerelda> wrtp: nothing, when you need it for structural classes
11:42 < vegai> (not entirely sure which arena it's trying to, but definitely
not real-time)
11:42 < Zerelda> but it's inappropriate for object elements
11:43 < uriel> 11:42 < vegai> I don't think go is trying to combat in
that arena
11:43 < uriel> vegai: yet, there is nothing in Go that makes inherently
unsuited to realtime stuff
11:43 < Zerelda> there's no reason at all why a language like Go cant do
realtime perfectly
11:43 < uriel> vegai: the implementation obviously needs more tunning, but
hey, the language is not even complete yet
11:43 < Zerelda> if you choose to start using a bunch of heap allocs, thats
your choice
11:43 < uriel> Zerelda: exactly, there we agree
11:44 < Zerelda> when you write realtime code in C++, you dont do some stuff
11:44 < uriel> (although I don't think the heap is really the issue)
11:44 < Zerelda> same thing
11:44 < wrtp> Zerelda: you can't avoid heap allocs if you're going to share
data between independent processes
11:44 -!- piyushmishra [~piyushmis@117.200.224.142] has quit [Quit: Leaving.]
11:44 < vegai> I forgot, can the GC be circumvented?
11:44 < wrtp> which is what go allows you to do
11:45 < wrtp> vegai: you can turn it off (i think)
11:45 < Zerelda> processes..  you talking about the channels system?
11:45 < Zerelda> or OS processes
11:45 < wrtp> Zerelda: yeah, "goroutines"
11:45 < wrtp> which get multiplexed onto os processes
11:45 < Zerelda> thats fine
11:45 < TheSeeker> Channels can be shared over networks though, yes?
11:46 < wrtp> TheSeeker: no
11:46 < Zerelda> you use realtime threads, and non-realtime threads
11:46 < Zerelda> elements can get marked for deletion
11:46 < Zerelda> the non-realtime thread handles them later
11:46 < wrtp> Zerelda: there's no concept of scheduling priority in go
11:46 < Zerelda> i dont mean in the language
11:46 < Zerelda> thats a programmer thing
11:46 < wrtp> although the GC is due for an update
11:46 < wrtp> i believe it should get quite a bit faster
11:46 < Zerelda> the programmer writes code for his realtime thread, and for
his non realtime thread
11:46 < uriel> TheSeeker: there are netchans, which 'proxy' chans over the
network
11:47 < Zerelda> non-realtime for example, being the gui code
11:47 < GilJ> adg: Oh, good to know :)
11:47 < GilJ> adg: About the FOSDEM Go talk :)
11:47 < vegai> wrtp: but that will just lead to never freeing any memory
11:48 < wrtp> Zerelda: sure.  and you can tie a goroutine to an os thread,
which presumably you can tell the OS to set realtime attributes on
11:48 -!- artefon [~thiago@187.114.48.78] has joined #go-nuts
11:48 < wrtp> vegai: yeah.  multithreaded GC is a difficult issue.  i'm
interested to see where they end up.
11:48 < Zerelda> well, language looks cool.  somebody call me up when its
got generics and unordered map :)
11:48 < Zerelda> *ordered map
11:48 < TheSeeker> uriel: so is that a yes or a no ?:P I'm thinking, a
plugin system that allows a main application to run somewhere, and a plugin to run
somewhere else...  could just use a client protocol, but being able to share
objects directly sounds interesting.  (somewhat like osgi?)
11:49 < uriel> TheSeeker: again, channels don't go over the network by
themselves, but the netchan lib allows you to do it
11:49 < wrtp> TheSeeker: you can't share objects directly - you can marshal
and unmarshal them over the network (see gob)
11:50 < wrtp> TheSeeker: netchans automate the process, although they're a
bit limited currenty
11:50 < wrtp> s/currenty/currently/
11:50 < wrtp> Zerelda: it'll happen
11:50 < TheSeeker> that's OK, I'm probably years away from even starting my
project at my current rate of progress :)
11:51 < Zerelda> do any core language devs come on this chan
11:51 < wrtp> Zerelda: yeah, iant is around sometimes
11:51 < wrtp> Zerelda: but your best bet is to mail to golang-nuts
11:51 < Zerelda> k
11:52 < wrtp> Zerelda: if you do, explain your problem domain before you
start ranting about go not having an ordered map :-)
11:52 < Zerelda> i'll try
11:53 -!- piyushmishra [~piyushmis@117.200.231.162] has joined #go-nuts
11:55 < wrtp> FWIW, i'd like to see Go as a viable platform for audio
processing stuff
11:56 < foocraft> the map::ordered_whatever is probably implementing it
using two containers
11:56 < uriel> wrtp: I don't think anyone disagrees with that
11:56 < Zerelda> foocraft: is not
11:57 < Zerelda> its an rbtree.  The tree is ordered.
11:58 < foocraft> well, I can imagine a sorted set of values, and a mapping
of keys to indices, so when you want to iterate over the values, I return an
iterator to the list of elements (or the tree of elements)
11:58 < foocraft> so that's still two containers
11:59 < Zerelda> sorry i explained before, but you dont want to store the
keys in a vector like that
11:59 < Zerelda> due to algorithmic complexity at insertion
11:59 < foocraft> the thing is, with unordered/ordered you have O(1)
retrieval, and your insertion is O(log n ) or something like that
12:00 < foocraft> the insertion costs more for sorted, as it should
12:00 < foocraft> and you "still" implemented it using two containers
12:00 -!- fuzzybyte [~fuzzybyte@77.79.7.8] has joined #go-nuts
12:00 < Zerelda> two containers?
12:00 < Zerelda> i dont understand
12:00 < foocraft> a tree and a map
12:01 < Zerelda> who did that?
12:01 < uriel> foocraft: er, no
12:01 < uriel> foocraft: the tree *is* the map
12:01 < foocraft> then how can I retrieve in O(1)?
12:01 < foocraft> oh I retrieve in log n time
12:02 < Zerelda> its not O(1)
12:02 < Zerelda> its not a vector
12:02 < Zerelda> bbl
12:03 < wrtp> Zerelda: i see that C++ map doesn't provide any way of
extracting arbitrary subranges in less than O(n) time
12:04 < Zerelda> http://www.cplusplus.com/reference/stl/map/lower_bound/
12:04 < Zerelda> Complexity Logarithmic in size.
12:05 < foocraft> I think with a red-black tree, you can implement that map
12:05 < foocraft> it'll take log n time for all ops
12:05 < wrtp> yeah, getting the lower bound is O(log(n)) but if i want to
iterate over all elements with keys in [x0, x1], i have to iterate through all the
elements in the map until x1
12:06 < Zerelda> lower_bound returns an iterator
12:06 < wrtp> foocraft: yeah, the C++ standard algorithm uses rb trees
12:06 < Zerelda> you begin iterating at x0
12:06 -!- ucasano [~ucasano@host150-147-static.225-95-b.business.telecomitalia.it]
has quit [Ping timeout: 240 seconds]
12:06 < wrtp> oh yes, so it does
12:06 < wrtp> i see
12:07 < wrtp> i hadn't noticed its argument
12:07 < wrtp> serves me right for just looking at the wikipedia page :-)
12:07 < foocraft> I think implementing it with an axillary data structure
would give you the best of both worlds, but you have O(2n) space
12:07 < Zerelda> theyre all the same -- lower bound, upper, find, equal
range, etc
12:07 -!- Tuller [~tuller@c-69-143-52-174.hsd1.va.comcast.net] has joined #go-nuts
12:08 < Zerelda> log
12:08 < Zerelda> but you only have to do them once ;)
12:08 < wrtp> foocraft: O(2n) == O(n)
12:08 < foocraft> yeah :)
12:08 < foocraft> but if his data is tooooo big, then the 2 matters sorta
12:09 < Zerelda> the 2 is a matter of implementation details
12:09 < wrtp> exactly.
12:09 < wrtp> which can be important.
12:09 < wrtp> but it's wrong to use O notation that way
12:10 < wrtp> foocraft: "the best of both worlds" comes down to caching
behaviour often
12:11 < foocraft> hmm well I would say that for iterating through the
elements in sorted order, having a slice would be awesome
12:11 < foocraft> or, better yet, an amortized array-based dictionary :)
12:12 < foocraft> which is basically a linked lists of arrays, such that
each array size is in the form of 2^k.  you keep the arrays in sorted order
12:12 < wrtp> foocraft: how can you avoid O(n) insertion time if you're
keeping elements or keys in sorted order in a slice?
12:12 < foocraft> okay so the AAD structure is a bit different than O(n)
12:13 -!- piyushmishra [~piyushmis@117.200.231.162] has quit [Ping timeout: 272
seconds]
12:13 < foocraft> it has amortized constant time insertion and is sorted
12:13 < Zerelda> wrtp: cant
12:13 < wrtp> i think you're basically talking about a btree with a large
key array in each node
12:13 < foocraft> no this is not a btree
12:14 < Zerelda> skip list?
12:14 < wrtp> ok, so how do you structure the arrays?
12:14 < Zerelda> http://www.codeproject.com/KB/cpp/stree.aspx
12:14 -!- piyushmishra [~piyushmis@117.200.231.162] has joined #go-nuts
12:15 < foocraft> insertion = { insert an array of size 1 containing the
element to the list, in order of the size of arrays; while there's an array of the
same size, merge both arrays }
12:15 < Zerelda> oh and the first statement of that article.  true, thats
how a lot of ppl would feel
12:15 < Zerelda> having sorted map being one of the most useful containers
12:15 < Zerelda> but anyways
12:15 < wrtp> foocraft: i.e.  if you've got 1e9 elements, and each array
stores 1e3 elements, how do you store the arrays such that you don't have to
potentially search 1e6 arrays?
12:15 < Zerelda> it uses a skip list implementation
12:15 < Zerelda> which sounds a little like what foocraft is speaking of
12:16 < Zerelda> See the pictures below
12:16 < foocraft> and the nasty compile errors is why you would use Go :p
12:16 < wrtp> Zerelda: i've used (and implemented) skip lists before now
12:16 < Zerelda> cool
12:17 < wrtp> but i don't think 1-2-3 top-down skip lists were invented then
12:18 < wrtp> no i'm wrong, they were invented in '92
12:19 < Zerelda> if the whole world exploded, and only a few people were
left alive, and they invented things that were already invented, they'd be
genuinely inventing something
12:20 < TheSeeker> is the concept of 'inventing an algorithm' different than
'inventing laws of physics' ?
12:20 < Zerelda> discovering laws of physics
12:20 < foocraft> OF COURSE IT IS :)
12:20 < TheSeeker> The algorithm always existed, we just hadn't discovered
it yet?
12:20 < Zerelda> if you can invent laws of physics...
12:20 < Zerelda> youd be god :P
12:21 < foocraft> actually, inventing laws of physics isn't about being a
god, because these laws show a relationship between the real "axioms" of physics
12:21 < Zerelda> well its true, an algorithm is a discovery
12:21 < Zerelda> if its the most optimized way scientifically to make
something
12:21 < Zerelda> if I make an algorithm that generates algorithmic artwork,
thats not a discovery
12:21 < Zerelda> but an invention only
12:22 < wrtp> Zerelda: then most algorithms are inventions, because you
can't prove they're the most optimised way to do something :-)
12:22 < Zerelda> some maybe provable
12:23 < Zerelda> thread safety is provable :O
12:23 < wrtp> as is type safety
12:24 < foocraft> fibonnaci heaps are magical
12:25 -!- ucasano [~ucasano@host150-147-static.225-95-b.business.telecomitalia.it]
has joined #go-nuts
12:25 < TheSeeker> allocate f(n+1) more memory when the current heap of size
f(n) is exhausted ?
12:26 * wrtp wasn't previously aware of fibonacci heaps
12:27 < wrtp> doesn't help the ordered map discussion though
12:28 < wrtp> i think i'd probably have used a fib heap the last time i
implemented A* if i'd known about it
12:29 -!- Tuller [~tuller@c-69-143-52-174.hsd1.va.comcast.net] has quit [Remote
host closed the connection]
12:31 -!- noff_ [~noff@pub1.heig-vd.ch] has joined #go-nuts
12:32 -!- kanru [~kanru@218-161-121-189.dynamic.hinet.net] has joined #go-nuts
12:34 -!- DerHorst [~Horst@e176099183.adsl.alicedsl.de] has joined #go-nuts
12:34 -!- [noff] [~noff@145-152.78-83.cust.bluewin.ch] has quit [Ping timeout: 240
seconds]
12:36 < TheSeeker> hmmm, wikipedia seems to suggest that a Brodal Queue is
equally magical to a Fibonacci Heap...
12:37 -!- gilles_ [~gilles@zeus.ugent.be] has joined #go-nuts
12:38 -!- Pauwl [~gilles@zeus.ugent.be] has left #go-nuts []
12:39 < foocraft> actually, it suggests that it's better
12:39 < foocraft> well, it's not amortized that is
12:41 -!- ucasano [~ucasano@host150-147-static.225-95-b.business.telecomitalia.it]
has quit [Ping timeout: 276 seconds]
12:46 -!- noam [noam@77.124.236.67] has quit [Read error: Connection reset by
peer]
12:46 -!- noam [noam@77.124.236.67] has joined #go-nuts
12:48 -!- soapy_illusions [~alex@207.96.182.162] has joined #go-nuts
12:48 -!- tdc [~santegoed@host86-156-182-103.range86-156.btcentralplus.com] has
quit [Quit: tdc]
12:51 -!- ucasano [~ucasano@151.12.47.139] has joined #go-nuts
12:55 -!- nsf [~nsf@jiss.convex.ru] has joined #go-nuts
12:56 -!- Fish [~Fish@coss6.exosec.net] has joined #go-nuts
12:56 < TheSeeker> http://imada.sdu.dk/~rolf/publicationlist.html
13:00 -!- skejoe [~skejoe@188.114.142.162] has joined #go-nuts
13:00 -!- noff_ [~noff@pub1.heig-vd.ch] has quit [Quit: Quitte]
13:09 * nsf is finally testing gocode on x86_64
13:11 -!- noam [noam@77.124.236.67] has quit [Read error: Connection reset by
peer]
13:11 -!- noam [noam@77.124.236.67] has joined #go-nuts
13:14 -!- tdc [~santegoed@host86-156-182-103.range86-156.btcentralplus.com] has
joined #go-nuts
13:15 -!- tdc [~santegoed@host86-156-182-103.range86-156.btcentralplus.com] has
quit [Read error: Connection reset by peer]
13:15 -!- tdc_ [~santegoed@host86-156-182-103.range86-156.btcentralplus.com] has
joined #go-nuts
13:17 -!- plainhao [~plainhao@208.75.85.237] has joined #go-nuts
13:18 -!- Project_2501 [~Marvin@82.84.79.101] has quit [Read error: Connection
reset by peer]
13:18 < nsf> nope, it wasn't an x86 bug
13:18 < nsf> the same happens on x86_64
13:18 < nsf> eats memory
13:20 -!- Project_2501 [~Marvin@82.84.96.52] has joined #go-nuts
13:21 -!- nsf [~nsf@jiss.convex.ru] has quit [Quit: WeeChat 0.3.3]
13:22 < wrtp> live memory or dead memory?
13:32 < mpl> carcass!
13:33 < wrtp> does it wriggle when you chew on it?
13:34 < mpl> nope.  it's long dead and already smelling real bad, kinda like
unix ;)
13:35 < wrtp> does it keep growing or does it reach steady state?
13:37 -!- boscop [~boscop@f055255024.adsl.alicedsl.de] has joined #go-nuts
13:38 < unofficialmvp> HI, any ppa for gccgo on ubuntu ?
13:43 < TheSeeker> ppa?
13:44 < unofficialmvp> https://launchpad.net/ubuntu/+ppas
13:46 -!- artefon [~thiago@187.114.48.78] has quit [Quit: bye]
14:02 -!- skelterjohn [~jasmuth@c-68-45-238-234.hsd1.nj.comcast.net] has joined
#go-nuts
14:07 -!- captn [~root@pD9FE2921.dip.t-dialin.net] has joined #go-nuts
14:08 -!- skelterjohn [~jasmuth@c-68-45-238-234.hsd1.nj.comcast.net] has quit
[Quit: skelterjohn]
14:09 -!- sauerbraten [~sauerbrat@p508CAD94.dip.t-dialin.net] has joined #go-nuts
14:21 -!- zozoR [~zozoR@56344bf6.rev.stofanet.dk] has joined #go-nuts
14:21 -!- fhs [~fhs@pool-74-101-63-115.nycmny.east.verizon.net] has quit [Quit:
leaving]
14:25 -!- bjarneh [~bjarneh@1x-193-157-193-214.uio.no] has joined #go-nuts
14:31 -!- alc [~arx@222.128.155.132] has quit [Ping timeout: 250 seconds]
14:38 -!- tav [~tav@92.7.119.86] has quit [Ping timeout: 245 seconds]
14:39 -!- kanru [~kanru@218-161-121-189.dynamic.hinet.net] has quit [Ping timeout:
265 seconds]
14:44 -!- tav [~tav@92.7.142.214] has joined #go-nuts
14:51 -!- unofficialmvp [~dev@94-62-164-227.b.ipv4ilink.net] has left #go-nuts []
14:53 < soapy_illusions> Is there any better way to put a comment in JSON
other than "_comment":"Test Comment", as I am using a JSON file as my config file
14:54 -!- skelterjohn [~jasmuth@lawn-gw.rutgers.edu] has joined #go-nuts
15:00 -!- nsf [~nsf@jiss.convex.ru] has joined #go-nuts
15:04 < uriel> soapy_illusions: no, json doesn't accept comments
15:04 < bortzmeyer> soapy_illusions: No.
http://stackoverflow.com/questions/244777/can-i-comment-a-json-file
15:04 < bortzmeyer> soapy_illusions: use XML
15:05 < soapy_illusions> but using JSON unmarshal is just soooo easy
15:05 < soapy_illusions> but I guess I will need to get it working in XML
15:05 < bortzmeyer> but JSON is more limited than XML
15:14 < vegai> better not use XML if the commenting is your only reason
15:14 < wrtp> http://blog.getify.com/2010/06/json-comments/
15:15 < wrtp> so the json encoder *could* parse comments
15:16 -!- artefon [~thiago@dhcp16.usuarios.dcc.ufmg.br] has joined #go-nuts
15:18 < uriel> 15:04 < bortzmeyer> soapy_illusions: use XML
15:18 < uriel> I hope this is sarcasm
15:18 < uriel> 15:05 < bortzmeyer> but JSON is more limited than XML
15:18 < uriel> wrong, json is way more useful than XML
15:18 < soapy_illusions> well I saw that, we could very well allow comments
in JSON
15:18 < soapy_illusions> it's just not in the official JSON spec
15:19 < uriel> no comments keeps json simpler, that is good, the
__comment__: "fooooo" trick works nicely too
15:19 < uriel> the official JSON spec, unlike the XML spec, is readable and
sane
15:21 < soapy_illusions> ok I'll implement them like that
15:21 < soapy_illusions> thanks
15:21 -!- rejb [~rejb@unaffiliated/rejb] has joined #go-nuts
15:27 -!- noam [noam@77.124.236.67] has quit [Read error: Connection reset by
peer]
15:27 -!- noam [noam@77.124.236.67] has joined #go-nuts
15:28 -!- femtoo [~femto@95-89-197-196-dynip.superkabel.de] has joined #go-nuts
15:31 -!- Project_2501 [~Marvin@82.84.96.52] has quit [Ping timeout: 260 seconds]
15:36 < bortzmeyer> uriel: I was serious
15:36 * uriel sighs
15:36 < bortzmeyer> vegai: yes, the comments issue is not important enough,
just by itself.
15:42 -!- tdc_ [~santegoed@host86-156-182-103.range86-156.btcentralplus.com] has
quit [Quit: tdc_]
15:49 -!- awidegreen [~quassel@c-eacae555.08-2-73746f39.cust.bredbandsbolaget.se]
has joined #go-nuts
15:53 -!- soapy_illusions [~alex@207.96.182.162] has quit [Quit: Leaving]
15:54 -!- ucasano [~ucasano@151.12.47.139] has quit [Quit: ucasano]
15:56 -!- kanru [~kanru@118-168-234-157.dynamic.hinet.net] has joined #go-nuts
16:02 < plexdev> http://is.gd/irKzq by [Rob Pike] in go/src/pkg/gob/ -- gob:
fix bug sending zero-length top-level slices and maps
16:10 -!- Tv [~tv@cpe-76-168-227-45.socal.res.rr.com] has joined #go-nuts
16:12 -!- enherit [~enherit@cpe-98-149-170-48.socal.res.rr.com] has joined
#go-nuts
16:15 -!- bortzmeyer [~bortzmeye@batilda.nic.fr] has quit [Quit: Leaving.]
16:18 < mpl> uriel: I keep that one handy for quoting about xml usually:
http://9fans.net/archive/2010/06/237 :)
16:22 < d_m> being simpler/well-defined/limited is what makes json better
16:24 < mpl> yeah because it follows that it is used only where/when
suitable.
16:25 < exch> jason is mostly used to just transfer data chunks to-from a
server.  it's hardly ever intended to be read by anyone directly.  So comments are
a bit pointless
16:25 < exch> Good documentation with the API spitting it out is all you
need
16:25 < _nil> i don't see my CL as having hit the mailing list
16:25 < _nil> can someone help me with that?
16:26 < _nil> 3536041
16:26 < _nil> i received an email that looks like this :
http://pastebin.com/spqY0b3e
16:27 < exch> Doesn't it usually take a while for CL's to show up on the ML?
Spam filter related I believe
16:28 < _nil> i did this last night
16:28 < exch> hmm It should be there by now then
16:28 < exch> Mind you, I've never submitted anything, so I can't really
help you there
16:28 < wrtp> it usually takes only a minute or so when i do it
16:29 < _nil> :(
16:29 < _nil> suggestions?  i don't want to piss russ or r off
16:29 < wrtp> _nil: you've done hg mail, right?
16:29 < _nil> yeah
16:29 < _nil> if i click their names it shows up in their list of to be
reviewed
16:30 < wrtp> looking at the CL, it looks as if it should have worked
16:30 -!- ExtraSpice [~XtraSpice@88.118.33.48] has quit [Max SendQ exceeded]
16:32 < _nil> i know, it's weird
16:32 < wrtp> i thought maybe it got marked as spam, but that doesn't seem
to be the case
16:32 < _nil> bug?
16:32 < _nil> what happens if i hgmail again
16:32 < wrtp> try it
16:32 < _nil> one thing i did do is explicitly put
golang-dev@googlegroups.com on the cc line
16:32 -!- ExtraSpice [~XtraSpice@88.118.33.48] has joined #go-nuts
16:32 < _nil> doesn't it do that by default too?
16:32 < _nil> if cc isn't specified
16:34 < wrtp> that shouldn't make any difference
16:34 < _nil> k, sry, jw
16:35 < _nil> wrtp: i'm just going to forward this one
16:35 < _nil> to the list
16:35 < _nil> does that make sens?
16:35 < wrtp> seems ok to me
16:36 < wrtp> you could add a note about what happened
16:37 -!- ExtraSpice [~XtraSpice@88.118.33.48] has quit [Max SendQ exceeded]
16:38 -!- ExtraSpice [~XtraSpice@88.118.33.48] has joined #go-nuts
16:39 < wrtp> _nil: seen it now
16:39 < _nil> wrtp: thanks for all the help!
16:39 < mpl> _nil: I had that happen to me once
16:39 < _nil> oh?
16:39 < _nil> how'd you fix it
16:40 < mpl> _nil: because somehow hg-login didn't work properly, so the CL
was submitted but not really got into the golang "domain"
16:40 < mpl> I never fixed it.  by the time I realized I was teh only one
able to access it, someone had beaten me to the issue with another CL, so I just
deleted it.
16:41 -!- skejoe [~skejoe@188.114.142.162] has quit [Quit: leaving]
16:41 < mpl> I think it's because I had messed up with the hg cookies
16:41 < mpl> maybe deleted them, can't remember.
16:41 -!- ExtraSpice [~XtraSpice@88.118.33.48] has quit [Excess Flood]
16:49 -!- cco3 [~conley@c-69-181-138-209.hsd1.ca.comcast.net] has quit [Ping
timeout: 245 seconds]
16:50 < _nil> mpl: but you can access the one i posted?
16:50 < _nil> 3536041
16:51 -!- Venom_X [~pjacobs@66.54.185.131] has joined #go-nuts
16:56 -!- noam [noam@77.124.236.67] has quit [Ping timeout: 240 seconds]
16:56 -!- noam [noam@77.124.236.67] has joined #go-nuts
16:58 < mpl> _nil: yes.
16:58 < mpl> "Add checkout concept to better a...  "
17:00 -!- kanru [~kanru@118-168-234-157.dynamic.hinet.net] has quit [Ping timeout:
255 seconds]
17:04 < _nil> thanks!
17:04 * _nil waves
17:04 -!- MaksimBurnin [~max@44.188-224-87.telenet.ru] has quit [Ping timeout: 245
seconds]
17:06 -!- aconran-office_ [~aconran-o@adsl-76-199-140-78.dsl.pltn13.sbcglobal.net]
has quit [Remote host closed the connection]
17:06 -!- MaksimBurnin [~max@44.188-224-87.telenet.ru] has joined #go-nuts
17:06 -!- aconran-office_ [~aconran-o@adsl-76-199-140-78.dsl.pltn13.sbcglobal.net]
has joined #go-nuts
17:10 -!- ShadowIce [~pyoro@unaffiliated/shadowice-x841044] has joined #go-nuts
17:13 -!- aconran-office__
[~aconran-o@adsl-76-199-140-78.dsl.pltn13.sbcglobal.net] has joined #go-nuts
17:14 -!- piyushmishra [~piyushmis@117.200.231.162] has quit [Quit: Leaving.]
17:15 -!- saschpe [~quassel@opensuse/member/saschpe] has joined #go-nuts
17:16 -!- nigelkerr [~nigelkerr@jstormichfw.jstor.org] has joined #go-nuts
17:16 -!- aconran-office_ [~aconran-o@adsl-76-199-140-78.dsl.pltn13.sbcglobal.net]
has quit [Ping timeout: 265 seconds]
17:28 -!- bjarneh [~bjarneh@1x-193-157-193-214.uio.no] has quit [Quit: leaving]
17:30 -!- Fish [~Fish@coss6.exosec.net] has quit [Quit: So Long, and Thanks for
All the Fish]
17:31 -!- mnoel [~mnoel@c-75-65-250-60.hsd1.la.comcast.net] has joined #go-nuts
17:33 < foocraft> lets solve TSP!
17:34 < skelterjohn> it's solved
17:34 < skelterjohn> just takes a while
17:39 < wrtp> TSP?
17:40 < uriel> mpl: I will add that to
http://harmful.cat-v.org/software/xml/ ;)
17:40 -!- alexis [~alexis@lolnet.org] has joined #go-nuts
17:41 < skelterjohn> traveling sales person
17:41 < mpl> uriel: well, russ didn't actually call it harmful, so it's not
really fair ;)
17:47 < alexis> if I do var links = [string]{}, do I create a 0-sized array
?
17:47 < alexis> because link[0] = "mystring" just say I'm out of range
17:48 < exch> var links []string; <- 0-size slice
17:48 < exch> indexing it at 0 will naturally result in an error
17:48 < exch> links := make([]string, 1); links[0] = "foo";
17:49 < alexis> hmm, okay, I'll read again about this "make" :)
17:49 < exch> var links []string; links = append(links, "foo"); will also
work
17:50 < exch> or links := []string{ "foo" }
17:50 < alexis> okay, I was looking for something like append actually
17:50 < plexdev> http://is.gd/is1M2 by [Rob Pike] in 2 subdirs of go/src/ --
govet: a new static checker for Go programs.
17:51 < exch> append() is a builtin function which lets you add stuff to any
type of slice
17:52 < exch> can take multiple arguments, or a list..  s = append(s, 1, 2,
3, 4); or: var a, b []int; a = []int{1,2,3}; b = append(b, a...);
17:53 < alexis> nice
17:54 < alexis> if I make s = append(s, "foobar"), will it return me the
same element, s, modified, or a new one?
17:54 < exch> That depends if s is large enuogh to contain "foobar"
17:54 < exch> if s is full, a new slice will be allocated, big enough to
hgold whatever you pass to append()
17:55 -!- ExtraSpice [~XtraSpice@88.118.33.48] has joined #go-nuts
17:55 < alexis> okay nice :)
17:56 < alexis> I do have a question about regexp.  How can I make some that
are "ungreedy" ?
17:57 < exch> The current regexp package doesn't support ungreedy matches.
it's a relatively simple package.  If you need more power, check out this RE2
implementation in Go: http://code.google.com/p/sre2/
17:57 -!- devrim [~Adium@cpe-72-225-239-227.nyc.res.rr.com] has quit [Quit:
Leaving.]
17:57 < exch> That one should be replacing the current regexp in the
standard lib at some point
17:57 -!- devrim [~Adium@cpe-72-225-239-227.nyc.res.rr.com] has joined #go-nuts
17:57 -!- ExtraSpice [~XtraSpice@88.118.33.48] has quit [Max SendQ exceeded]
17:58 < alexis> okay, thanks for the pointer
17:58 -!- keithcascio [~keithcasc@nat/google/x-vfdhnnglismyyjmd] has joined
#go-nuts
18:04 -!- DerHorst [~Horst@e176099183.adsl.alicedsl.de] has quit [Remote host
closed the connection]
18:05 -!- sl [~sl@68-179-130-17.bsr-c9-d1.evv.dhcp.sigecom.net] has joined
#go-nuts
18:06 -!- mnoel [~mnoel@c-75-65-250-60.hsd1.la.comcast.net] has quit [Quit: mnoel]
18:07 < plexdev> http://is.gd/is4jc by [Robert Griesemer] in 2 subdirs of
go/src/pkg/go/ -- go/token,scanner: fix comments so godoc aligns properly
18:11 < alexis> exch: to you know if there is a way to use the regexp
methods FindString* with sre2 ?
18:13 -!- tvw [~tv@212.79.9.150] has quit [Remote host closed the connection]
18:13 < exch> alexis: not sure.  I haven't used sre2 myself yet
18:13 -!- artefon [~thiago@dhcp16.usuarios.dcc.ufmg.br] has quit [Quit: bye]
18:14 < alexis> okay, will see then
18:14 < alexis> or, try to see :)
18:17 < Venom_X> what are we doing instead of bytes.Add?
18:18 < exch> Venom_X: append()
18:18 < alexis> the famous append ;)
18:20 -!- deso [~deso@x0561a.wh30.tu-dresden.de] has joined #go-nuts
18:21 -!- noam [noam@77.124.236.67] has quit [Read error: Connection reset by
peer]
18:21 -!- gmilleramilar [~gmiller@184-106-207-119.static.cloud-ips.com] has joined
#go-nuts
18:21 < Venom_X> exch: is that in the bytes package?  I'm not seeing it
18:21 -!- noam [noam@77.124.236.67] has joined #go-nuts
18:21 < exch> Venom_X: it's a builtin global funciton
18:21 < Venom_X> oh
18:22 < exch> works for all slice types
18:22 < gmilleramilar> shouldn'
18:23 < gmilleramilar> shouldn't heap have a Peek method?
18:24 < plexdev> http://is.gd/is6xE by [Balazs Lecz] in 2 subdirs of
go/src/pkg/ -- os/inotify: new package
18:24 < plexdev> http://is.gd/is6xM by [Robert Griesemer] in
go/src/cmd/gofmt/ -- gofmt: simplify "x, _ = range y" to "x = range y"
18:24 < plexdev> http://is.gd/is6yu by [Robert Griesemer] in 5 subdirs of
go/src/ -- go/ast: fix ast.Walk
18:28 < Venom_X> exch: I get the following: "cannot use buf (type
*bytes.Buffer) as type uint8 in append"
18:30 < exch> try buf.Bytes()
18:32 < uriel> 18:24 < plexdev> http://is.gd/is6xM by [Robert
Griesemer] in go/src/cmd/gofmt/ -- gofmt: simplify "x, _ = range y" to "x = range
y"
18:32 < Venom_X> cannot use buf.Bytes() (type []uint8) as type uint8 in
append
18:32 < uriel> wasn't somebody asking for this yesterday?  that was fast!
18:32 -!- ExtraSpice [~XtraSpice@88.118.33.48] has joined #go-nuts
18:33 < exch> Venom_X: you are appending a slice of bytes to another slice?
In that case, use the elipsis operator to 'unpack' the src slice into separate
arguments: targ = append(targ, buf.Bytes()...)
18:33 < alexis> hmm I have a string containing two links, is
FindAllStringSubmatch supposed to return me all the occurences of the matches ?
18:34 < exch> alexis: it should
18:34 < exch> "FindAllStringSubmatch is the 'All' version of
FindStringSubmatch; it returns a slice of all successive matches of the
expression, as defined by the 'All' description in the package comment.  A return
value of nil indicates no match." <- docs
18:35 < alexis> okay, so maybe my regexp is wrong
18:37 < alexis> it's here, maybe am I missing something.
http://friendpaste.com/7myP4SJVLYok2wJ05PnTna
18:37 < Venom_X> exch: thanks!  That worked.
18:38 -!- TheMue [~TheMue@p5DDF4C76.dip.t-dialin.net] has joined #go-nuts
18:38 < alexis> it does match the first link, but not the next one.
18:41 < plexdev> http://is.gd/is8X5 by [Ryan Hitchman] in 2 subdirs of go/
-- gc: syntax error for incomplete chan type
18:41 < exch> alexis: You are passing 1 to the Find..() function.  it stops
after 1 match
18:41 < exch> make that -1
18:42 < alexis> ah yes
18:51 -!- wrtp [~rog@92.17.77.11] has quit [Quit: wrtp]
18:52 -!- wrtp [~rog@92.17.77.11] has joined #go-nuts
18:54 -!- wrtp [~rog@92.17.77.11] has quit [Client Quit]
18:57 < plexdev> http://is.gd/isbnC by [Mikio Hara] in go/src/pkg/syscall/
-- syscall: add network interface constants for linux/386, linux/amd64
18:58 -!- tvw [~tv@e176001208.adsl.alicedsl.de] has joined #go-nuts
19:04 -!- skelterjohn [~jasmuth@lawn-gw.rutgers.edu] has quit [Quit: skelterjohn]
19:10 -!- tensorpudding [~user@99.148.202.191] has joined #go-nuts
19:11 -!- piyushmishra [~piyushmis@117.200.231.162] has joined #go-nuts
19:24 -!- fabled [~fabled@mail.fi.jw.org] has quit [Quit: Ex-Chat]
19:24 -!- tvw [~tv@e176001208.adsl.alicedsl.de] has quit [Remote host closed the
connection]
19:24 -!- xash [~xash@d003180.adsl.hansenet.de] has joined #go-nuts
19:31 -!- xash [~xash@d003180.adsl.hansenet.de] has quit [Remote host closed the
connection]
19:33 -!- DarthShrine [~angus@pdpc/supporter/student/DarthShrine] has quit [Quit:
DarthShrine]
19:33 -!- virtualsue [~chatzilla@nat/cisco/x-cjuqgkrpidgzgjfe] has quit [Ping
timeout: 260 seconds]
19:57 -!- femtooo [~femto@95-89-197-196-dynip.superkabel.de] has joined #go-nuts
19:58 -!- Tv [~tv@cpe-76-168-227-45.socal.res.rr.com] has quit [Ping timeout: 245
seconds]
20:00 < plexdev> http://is.gd/ismcg by [Russ Cox] in go/src/pkg/os/ -- os:
fix test of RemoveAll
20:00 < plexdev> http://is.gd/ismcs by [Russ Cox] in go/ -- A+C: Lorenzo
Stoakes, Nigel Kerr (both individual CLA)
20:00 < plexdev> http://is.gd/ismcW by [Nigel Kerr] in go/src/pkg/xml/ --
xml: disallow invalid Unicode code points
20:00 -!- femtoo [~femto@95-89-197-196-dynip.superkabel.de] has quit [Ping
timeout: 245 seconds]
20:13 -!- Project_2501 [~Marvin@82.84.95.106] has joined #go-nuts
20:20 -!- femtooo [~femto@95-89-197-196-dynip.superkabel.de] has quit [Read error:
Connection reset by peer]
20:21 -!- Venom_X [~pjacobs@66.54.185.131] has quit [Ping timeout: 255 seconds]
20:22 < _nil> hey guys, whats the best way to use Fstatfs to get the
blocksize of the FS?
20:23 -!- Venom_X [~pjacobs@66.54.185.130] has joined #go-nuts
20:24 -!- skejoe [~skejoe@188.114.142.162] has joined #go-nuts
20:31 -!- saschpe [~quassel@opensuse/member/saschpe] has quit [Remote host closed
the connection]
20:32 -!- d_m [d6@192.94.73.15] has quit [Ping timeout: 240 seconds]
20:33 -!- |Craig| [~|Craig|@panda3d/entropy] has joined #go-nuts
20:33 -!- scyth [~scyth@rots.in.rs] has quit [Quit: Leaving]
20:36 -!- DarthShrine [~angus@60-242-109-62.tpgi.com.au] has joined #go-nuts
20:36 -!- DarthShrine [~angus@60-242-109-62.tpgi.com.au] has quit [Changing host]
20:36 -!- DarthShrine [~angus@pdpc/supporter/student/DarthShrine] has joined
#go-nuts
20:39 < raylu> uriel: and how do i do that?
20:41 -!- rodpar07 [~rodpar07@host-9-57.a9.cmm.com.py] has joined #go-nuts
20:51 < uriel> raylu: do what?
20:51 < raylu> 03:40:40 raylu> how do i handle non-utf-8 encoded strings?
in particular, i'm downloading a webpage using the http package that is iso-8859-1
encoded
20:52 < raylu> 05:52:59 uriel> raylu: you handle them by converting them
to utf-8
20:53 -!- Chopinn [~Chopin@ti0018a380-dhcp1590.bb.online.no] has joined #go-nuts
20:53 < uriel> good question
20:55 < uriel> people not using utf-8 in this day and age need to be hunted
down and shot
20:57 -!- pothos [~pothos@111-240-212-92.dynamic.hinet.net] has quit [Read error:
Connection reset by peer]
20:58 < raylu> ok, but that's illegal here, so what hsould i do instead?
20:58 < raylu> *should
20:59 -!- antonkovalyov [~antonkova@75-101-56-240.dsl.static.sonic.net] has joined
#go-nuts
20:59 < mpl> have a law passed that makes it legal
20:59 -!- pothos [~pothos@111-240-212-190.dynamic.hinet.net] has joined #go-nuts
20:59 < jesusaurus> its illegal to use utf8?
20:59 < jesusaurus> where?
20:59 < mpl> in "latin"-america
21:00 * mpl hides
21:00 < uriel> mpl: hahaha
21:00 < uriel> mpl: you win lamest pun of the day :)
21:00 < mpl> yep, probably
21:00 < mpl> :D
21:00 < uriel> well, it was funny, so who cares ;P
21:01 < uriel> and I'm really surprised there is no lib to convert to/from
latin1
21:01 < uriel> or at least I can't fin dit
21:01 -!- pothos [~pothos@111-240-212-190.dynamic.hinet.net] has quit [Read error:
Connection reset by peer]
21:02 < exch> The motivation is 'If you dont have UTF8, you just don't
count."
21:02 -!- pothos [~pothos@111-240-212-190.dynamic.hinet.net] has joined #go-nuts
21:02 -!- piyushmishra [~piyushmis@117.200.231.162] has quit [Quit: Leaving.]
21:02 < KirkMcDonald> That would include anything using Windows, innit?  :-)
21:02 -!- piyushmishra [~piyushmis@117.200.231.162] has joined #go-nuts
21:03 < exch> I see no problem with that assertion.  I therefor move that we
henceforthwith all point and laugh at Windows.
21:03 < exch> If you're not already doing so.
21:04 * uriel has enough to point and laugh elsewhere
21:05 -!- plainhao [~plainhao@208.75.85.237] has quit [Quit: plainhao]
21:09 < _nil> dir_linux.go:33: invalid indirect of fstatBuf.Bsize (type
int32)
21:09 < _nil> thoughts?  ^
21:10 -!- rodpar07 [~rodpar07@host-9-57.a9.cmm.com.py] has left #go-nuts
["Saliendo"]
21:10 -!- xash [~xash@d003180.adsl.hansenet.de] has joined #go-nuts
21:10 -!- zozoR [~zozoR@56344bf6.rev.stofanet.dk] has quit [Quit: Morten.  Desu~]
21:10 -!- Eridius [~kevin@unaffiliated/eridius] has joined #go-nuts
21:10 < GilJ> Is there some sort of set container in go?  I can't seem to
find it
21:12 -!- xash_ [~xash@d003180.adsl.hansenet.de] has joined #go-nuts
21:12 -!- xash [~xash@d003180.adsl.hansenet.de] has quit [Client Quit]
21:14 < uriel> GilJ: there are maps
21:15 < _nil> fixed it
21:15 < uriel> if you need something fancier see the containers section of:
http://go-lang.cat-v.org/pure-go-libs
21:16 -!- piyushmishra [~piyushmis@117.200.231.162] has quit [Quit: Leaving.]
21:17 < plexdev> http://is.gd/isxht by [Rob Pike] in 2 subdirs of go/doc/ --
tutorial: a couple of minor fixes.
21:19 -!- enherit [~enherit@cpe-98-149-170-48.socal.res.rr.com] has quit [Quit:
leaving]
21:20 < enferex> iant: Since gocc is in the upcoming 4.6 release is it still
relavant to do all my hacking on the googlecode repo?
21:20 <+iant> enferex: yes
21:20 < enferex> er gccgo, sorry wrong mental-endian
21:20 <+iant> enferex: that is the master code
21:20 < enferex> wholy-cow your fast!
21:20 <+iant> enferex: it is mirrored into the gcc repository
21:20 <+iant> ha
21:20 < enferex> me thinks your not human ;-)
21:21 < enferex> and have passed the turing test
21:22 < enferex> setting up a repo here so I can submit all my hacks to
21:23 <+iant> if you realize that I'm not human then I guess I haven't
passed the Turing Test
21:24 -!- krutcha [~krutcha@remote.icron.com] has joined #go-nuts
21:24 < enferex> well I can only hypothesize, thus far you are passing good
and well
21:25 < enferex> but anyways, I am working on rbmm, and after doing some
hackin within your front end I am rather impressed
21:34 -!- skejoe [~skejoe@188.114.142.162] has quit [Quit: Lost terminal]
21:34 -!- Scorchin [~Scorchin@host86-147-115-164.range86-147.btcentralplus.com]
has joined #go-nuts
21:34 < plexdev> http://is.gd/iszE8 by [Andrew Gerrand] in
go/misc/dashboard/godashboard/ -- dashboard: fix project tag filter
21:35 -!- virtualsue [~chatzilla@93-97-62-8.zone5.bethere.co.uk] has joined
#go-nuts
21:35 -!- gmilleramilar [~gmiller@184-106-207-119.static.cloud-ips.com] has quit
[Remote host closed the connection]
21:49 -!- virtualsue [~chatzilla@93-97-62-8.zone5.bethere.co.uk] has quit [Ping
timeout: 240 seconds]
21:49 -!- TheMue [~TheMue@p5DDF4C76.dip.t-dialin.net] has quit [Quit: TheMue]
21:50 -!- virtualsue [~chatzilla@nat/cisco/x-kbfxcgylvmbaphcn] has joined #go-nuts
21:51 < plexdev> http://is.gd/isCe3 by [Andrew Gerrand] in 2 subdirs of
go/src/pkg/http/ -- http: ServeFile to handle Range header for partial requests
21:55 -!- photron [~photron@port-92-201-249-34.dynamic.qsc.de] has quit [Ping
timeout: 265 seconds]
21:55 < uriel> raylu: I forgot that apparently there is a go-iconv
21:55 < uriel> raylu: that should take care of latin1
21:56 -!- Venom_X [~pjacobs@66.54.185.130] has quit [Quit: Venom_X]
21:58 < GilJ> uriel: Thanks :)
21:59 -!- sauerbraten [~sauerbrat@p508CAD94.dip.t-dialin.net] has quit [Remote
host closed the connection]
22:04 -!- skelterjohn [~jasmuth@c-68-45-238-234.hsd1.nj.comcast.net] has joined
#go-nuts
22:15 -!- gnuvince [~vince@220.252-ppp.3menatwork.com] has joined #go-nuts
22:15 -!- ShadowIce [~pyoro@unaffiliated/shadowice-x841044] has quit [Quit:
Verlassend]
22:26 -!- belkiss [~kvirc@feu30-1-82-242-58-196.fbx.proxad.net] has joined
#go-nuts
22:28 -!- nigelkerr [~nigelkerr@jstormichfw.jstor.org] has quit [Quit: nigelkerr]
22:30 -!- napsy [~luka@88.200.96.18] has quit [Quit: Lost terminal]
22:38 -!- awidegreen [~quassel@c-eacae555.08-2-73746f39.cust.bredbandsbolaget.se]
has quit [Remote host closed the connection]
22:43 -!- Kashia [~Kashia@port-92-200-108-107.dynamic.qsc.de] has joined #go-nuts
22:44 -!- deso [~deso@x0561a.wh30.tu-dresden.de] has quit [Remote host closed the
connection]
22:45 -!- belkiss [~kvirc@feu30-1-82-242-58-196.fbx.proxad.net] has quit [Quit:
KVIrc 4.0.2 Insomnia http://www.kvirc.net/]
22:49 -!- noam [noam@77.124.236.67] has quit [Read error: Connection reset by
peer]
22:49 -!- noam [noam@77.124.236.67] has joined #go-nuts
22:50 < foocraft> is there anyone I can talk to about possible a possible
GSOC?
22:51 -!- wrtp [~rog@92.17.77.11] has joined #go-nuts
22:52 < foocraft> I think I was writing my question in parallel and wasn't
syncing :p
22:52 -!- virtualsue [~chatzilla@nat/cisco/x-kbfxcgylvmbaphcn] has quit [Ping
timeout: 265 seconds]
22:53 < plexdev> http://is.gd/isKy0 by [Ken Thompson] in 3 subdirs of
go/src/ -- arm floating point simulation
22:54 -!- noam [noam@77.124.236.67] has quit [Ping timeout: 272 seconds]
22:56 -!- wrtp [~rog@92.17.77.11] has quit [Quit: wrtp]
22:57 -!- Tv [~tv@cpe-76-168-227-45.socal.res.rr.com] has joined #go-nuts
23:03 -!- Project_2501 [~Marvin@82.84.95.106] has quit [Quit: E se abbasso questa
leva che succ...]
23:06 -!- alexis [~alexis@lolnet.org] has quit [Ping timeout: 240 seconds]
23:16 -!- virtualsue [~chatzilla@nat/cisco/x-khsqklangkoeckot] has joined #go-nuts
23:17 < uriel> interesting: http://code.google.com/p/tinygo/
23:18 < uriel> foocraft: probably adg is the one to talk to about gsoc
23:18 < adg> foocraft: email adg@golang.org re: soc
23:19 -!- jhawk28 [~jhawk28@user-387c58d.cable.mindspring.com] has joined #go-nuts
23:19 < foocraft> thanks guys
23:22 -!- alexis [~alexis@lolnet.org] has joined #go-nuts
23:40 < plexdev> http://is.gd/isQv3 by [Ryan Hitchman] in go/src/pkg/os/ --
os: make MkdirAll work with symlinks
23:44 < foocraft> I find it weird that some systems courses that could very
easily switch to Go land are still using C
23:45 < foocraft> computer networks(undergrad) projects: IRC server,
distributed IRC server, Bittorrent tracker
23:45 -!- rlab [~Miranda@91.200.158.34] has quit [Quit: Miranda IM! Smaller,
Faster, Easier.  http://miranda-im.org]
23:47 < adg> it's not that surprising.  Go has only been public for a year.
23:47 < GilJ> foocraft: I think that is because Go is still in early
development
23:47 < adg> C has been around for, what, 40 years?
23:47 < adg> and you certainly learn a lot about the internals of things
when you write systems in C
23:48 < rmmh> academia usually lags by around a decade
23:48 < dho_> depends on perspective
23:48 < dho_> academia also produces cutting edge research
23:48 < rmmh> I mean, undergrad courses
23:48 < foocraft> but c'mon, IRC server, distributed IRC server and
bittorrent tracker...the only help C provides is make their lives miserable here
23:48 < adg> that's true
23:49 < adg> i would expect C to be used in operating systems courses and
the like
23:49 < foocraft> yeah that makes sense
23:49 < dho> I dunno
23:49 < dho> There's benefit to learning systems / network programming in C
23:50 < foocraft> like do I IO multiplex, or do I do threads or do I just
fork a couple of processes(because I started late :p j/k)?
23:50 < dho> our primary products are written in C and it's not really that
easy to find someone who can come in with real knowledge of network protocols,
clustering, systems programming, and can do this in C
23:53 < adg> on the one hand, i think Go would make a fine teaching
language, but on the other hand I kinda feel like everyone should be made to start
with assembly and work their way up
23:53 < foocraft> hmm
23:53 < MaybeSo> bring back the paper punch card!
23:53 < adg> otherwise how will you truly understand anything?  to write
efficient code you need to understand the performance characteristics of
everything
23:54 < adg> MaybeSo: i'm not of that extreme viewpoint :)
23:54 < foocraft> where I study, we work down to hell, then stay a bit in
hell and then graduate (because before we graduate, towards the end usually, we do
systems electives and the like)
23:54 < adg> but there's a very cool course online called "From NAND to
Tetris in 12 Steps"
23:54 < adg> http://www.cs.rpi.edu/news/colloquia/December8_2005.html
23:54 < foocraft> setjmp
23:55 < foocraft> but isn't Go advertising itself as a systems language?
23:55 < MaybeSo> somewhere in the go source there's a virtual machine for
handling assembler, in order to support a game...
23:55 < adg> MaybeSo: the spacewar code?
23:55 < adg> foocraft: sure
23:56 < MaybeSo> that sounds like it
23:56 < foocraft> and it's actually not bad at that
23:57 < foocraft> if you can spawn something lighter than a thread and more
manageable than a thread, why wouldn't it be a good sys language?  :p
23:58 < exch> many people have tripped over that 'systems programming'
definition.  Pike's definition of that is different than what one might expect it
seems
23:59 < foocraft> I think a systems language is something that will allow
you to understand, and affect, what's really going on under the hood
23:59 < exch> He means webservers, databases and other assorted backend
stuff.  I got the impression that many people thought it was super lowlevel stuff
like C/asm
23:59 < foocraft> now, I don't see any "magical" statements in Go,
everything gives me a good feeling about how it's actually implemented, as I'm
writing code
--- Log closed Fri Dec 10 00:00:36 2010