[go-nuts] Re: Realize - Go build system with file watchers and live reload. Run, build and watch file changes with custom paths

2016-08-19 Thread anatoly techtonik
On Saturday, August 20, 2016 at 3:28:10 AM UTC+3, Alessio Pracchia wrote: > > Hi, i created a small build system for Go (Realize > ). The basic idea is to have a system > for the live reload on file changes with an automatic build process system. > Any suggest

Re: [go-nuts] Understanding go routine heap

2016-08-19 Thread Jan Mercl
On Sat, Aug 20, 2016 at 8:29 AM Yulrizka wrote: > He argues that this is heap race condition. I don't know what is a heap race condition but the code is race free. -- -j -- You received this message because you are subscribed to the Google Groups "golang-nuts" group. To unsubscribe from th

[go-nuts] Understanding go routine heap

2016-08-19 Thread Yulrizka
Dear gophers I have discussion with my colleague about this code func process() *foo { var result *foo var wg sync.WaitGroup wg.Add(1) go func() { defer wg.Done() result = &foo{1} }() wg.Wait() return result } He argues that this is heap race condi

Re: [go-nuts] Unary +

2016-08-19 Thread Lucio
On Saturday, 20 August 2016 01:01:39 UTC+2, Michael Jones wrote: > > > > …instead it means “assign the value ⁻3 to x”, where negative 3 is a single > idea, not two as in (Negate 3). The raised minus sign is from Kenneth > Iverson, who used it in APL to make the point that the ‘⁻’ and ‘-‘ have

Re: [go-nuts] Unary +

2016-08-19 Thread Lucio
On Saturday, 20 August 2016 02:29:17 UTC+2, Thomas Bushnell, BSG wrote: > > With all due respected to the illustrious Dr. Iverson, he was in > loony-land with his two versions of minus. > > > I take exception to the "loony-land" qualification of Dr Iverson's raised minus. I think it was immense

Re: [go-nuts] Unary +

2016-08-19 Thread Val
Hello Ian Leading zeroes do affect the value : https://play.golang.org/p/h0iE_8_yYK I personally regard this as a gotcha, and this feeling gets stronger when an experienced gopher overlooks it. I put an entry in my go-traps list. Cheers Val On Saturday, Au

[go-nuts] Re: Unary +

2016-08-19 Thread Rick
This is why I love this group. > -- You received this message because you are subscribed to the Google Groups "golang-nuts" group. To unsubscribe from this group and stop receiving emails from it, send an email to golang-nuts+unsubscr...@googlegroups.com. For more options, visit https://group

[go-nuts] Re: import csv file

2016-08-19 Thread francis badasu
loud and clear -- You received this message because you are subscribed to the Google Groups "golang-nuts" group. To unsubscribe from this group and stop receiving emails from it, send an email to golang-nuts+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/d/optou

Re: [go-nuts] Unary +

2016-08-19 Thread Ian Lance Taylor
On Fri, Aug 19, 2016 at 12:54 PM, Rob Thornton wrote: > What is the purpose of the unary '+' operator? In both C and Go they are > syntactically correct but neither generate instructions to modify the > expression. This is not an entirely serious answer, but the unary plus operator permits colu

Re: [go-nuts] Unary +

2016-08-19 Thread Michael Jones
You sir, are one of the treasures of Google. I miss you. From: "Thomas Bushnell, BSG" Date: Friday, August 19, 2016 at 5:28 PM To: Michael Jones , Axel Wagner , Rob Thornton Cc: golang-nuts Subject: Re: [go-nuts] Unary + With all due respected to the illustrious Dr. Iverson, he was in l

Re: [go-nuts] Remove vs Delete

2016-08-19 Thread Ian Lance Taylor
On Fri, Aug 19, 2016 at 3:51 PM, bep wrote: > > I had this discussion with another Gopher about the difference between Delete > and Remove. > > I found this definition which I agree on: > > "Delete and remove are defined quite similarly, but the main difference > between them is that delete mean

Re: [go-nuts] Unary +

2016-08-19 Thread 'Thomas Bushnell, BSG' via golang-nuts
With all due respected to the illustrious Dr. Iverson, he was in loony-land with his two versions of minus. The notation "-3" does not mean "negative three", which, as my freshman math professor, a lover of English, pointed out, is a solecism, since "negative" is an adjective, and three is and alw

[go-nuts] Realize - Go build system with file watchers and live reload. Run, build and watch file changes with custom paths

2016-08-19 Thread Alessio Pracchia
Hi, i created a small build system for Go (Realize ). The basic idea is to have a system for the live reload on file changes with an automatic build process system. Any suggestion? This is my first go project, all suggestions are welcome :) . I'll write the u

Re: [go-nuts] Re: import csv file

2016-08-19 Thread asit dhal
+1 Warm Regards, Asit Dhal http://bit.ly/193ASIT On 8/20/2016 2:14:47 AM, Shawn Milochik wrote: To everyone participating in this thread: Google "help vampire" To OP: don't be one. To everyone else: Don't feed them. -- You received this message because you are subscribed to the Google Groups

[go-nuts] Re: import csv file

2016-08-19 Thread Shawn Milochik
To everyone participating in this thread: Google "help vampire" To OP: don't be one. To everyone else: Don't feed them. -- You received this message because you are subscribed to the Google Groups "golang-nuts" group. To unsubscribe from this group and stop receiving emails from it, send an e

[go-nuts] Re: import csv file

2016-08-19 Thread francis badasu
Yh, thanks so much. but still getting this error when i run it. undefined: sql in sql.Open > > -- You received this message because you are subscribed to the Google Groups "golang-nuts" group. To unsubscribe from this group and stop receiving emails from it, send an email to golang-nuts+unsu

Re: [go-nuts] Unary +

2016-08-19 Thread 'Axel Wagner' via golang-nuts
> > x := -3 // does NOT mean get the value 3, negate that, and assign to the > location known as x. Correction: Number literals in go don't include a sign in their definition: https://golang.org/ref/spec#Integer_literals So, yes, it does mean exactly that :) Your explanation, however, does make

[go-nuts] Remove vs Delete

2016-08-19 Thread Joel Eric
I have always considered add/remove to be a pair of keywords and insert/delete a pair of keywords so you could look at the method name used to place the item in storage originally I will admit that I have very little rationale to back this premise up - it's more of a personal practice. Overall

Re: [go-nuts] Remove vs Delete

2016-08-19 Thread asit dhal
In computer programming, remove means to remove some elements out of many elements. So, here you assume, there are many files in a container and when you you remove a file, one file disappears and others remain. The whole container remains the same. delete/erase means to wipe out something comp

Re: [go-nuts] Unary +

2016-08-19 Thread Michael Jones
My answer is philosophical, and possibly not what is wanted, but it is informed. Here goes: Backstory: Unary Minus, as taught in computer science and implemented in languages and instruction sets and so forth is slightly confusing and often confusingly described. x := -y // means get the

[go-nuts] Remove vs Delete

2016-08-19 Thread bep
I had this discussion with another Gopher about the difference between Delete and Remove. I found this definition which I agree on: *"Delete * and *remove * are defined quite similarly, but the main d

[go-nuts] Re: import csv file

2016-08-19 Thread Tamás Gulácsi
sth. like records, err := reader.ReadAll() if err != nil { log.Fatal(err) } db, err := sql.Open("sqlite", "memory") if err != nil { log.Fatal(err) } defer db.Close() tx, err := db.Begin() if err != nil { log.Fatal(err) } stmt, err := tx.Prep("INSERT INTO my_table (a, b, c) VALUES (?,

Re: [go-nuts] Unary +

2016-08-19 Thread 'Thomas Bushnell, BSG' via golang-nuts
In C, the type is promoted. But this ain't C. No clue what the point is in Go. It would function as a compile-time type-check for "numeric" I guess, but what would be the point? On Fri, Aug 19, 2016 at 1:32 PM 'Axel Wagner' via golang-nuts < golang-nuts@googlegroups.com> wrote: > x would already

[go-nuts] Re: SSA back-translation / destruction

2016-08-19 Thread adonovan via golang-nuts
On Wednesday, 17 August 2016 12:00:46 UTC-4, HWJ wrote: > > TL;DR: what's the best way to do SSA back-translation when using > x/tools/go/ssa? > > I'm thinking about a Go compiler which accepts a subset of Go and emits > assembly for a microcontroller. Instead of going all the way from > lexing

Re: [go-nuts] Unary +

2016-08-19 Thread 'Axel Wagner' via golang-nuts
x would already be signed during implicit type inference. The inferred type is either the one specified in an argument or declaration, or it's the default type (which is int, thus signed). I don't know the answer to your question though. I didn't even know this existed… On Fri, Aug 19, 2016 at 9:

Re: [go-nuts] Define method on scope-local type

2016-08-19 Thread 'Axel Wagner' via golang-nuts
It would probably be useful, but to be fair, I rarely had this problem aside from sort. I think this mechanism is better suited for the occasional edge-case (as it doesn't require a language change): https://github.com/golang/go/issues/4146 On Fri, Aug 19, 2016 at 8:49 PM, Joshua Liebow-Feeser wr

[go-nuts] Unary +

2016-08-19 Thread Rob Thornton
What is the purpose of the unary '+' operator? In both C and Go they are syntactically correct but neither generate instructions to modify the expression. The '-' operator obviously generates a neg or sub from 0 instruction to negate the result by inverting the expression with an add with carr

Re: [go-nuts] Define method on scope-local type

2016-08-19 Thread Joshua Liebow-Feeser
Does it really make sense to create an internal package just to define a single small, one-off type? Also, I don't imagine that any of the optimizations would need to be reconsidered; the scope is strictly a subset of the scope at which the optimizations operated before, so there shouldn't be any *

Re: [go-nuts] Define method on scope-local type

2016-08-19 Thread Paul Jolly
I did indeed mean to reply to all (done that this time)! Sure, I understand that it's "cleaner", but I'm advocating the internal package approach because: - it solves the problem today - it benefits from being able to take advantage of existing compile time optimisations without needing

Re: [go-nuts] Define method on scope-local type

2016-08-19 Thread Joshua Liebow-Feeser
Hey Paul, I think those are interesting ideas, but my concern about scope-local methods extends beyond just the methods of the sort.Interface interface; I was just using that as an example. The same complaint applies for any type used only within a given scope that needs to implement any interf

Re: [go-nuts] Re: Database design pattern

2016-08-19 Thread asit dhal
Hi Paraiso, I just did some research about database access and found this reddit link  https://www.reddit.com/r/golang/comments/2t52u7/how_do_you_write_functions_that_access_database/ I thought, there might be some well known pattern to access database and widely popular in go community. Anyway,

[go-nuts] Re: Database design pattern

2016-08-19 Thread paraiso . marc
I find your question strange because, unless you have a specific architectural problem , which you don't, AFAIK, you shouldn't try to force patterns in your code. Write code that is testable then refactor if needed. Don't try to force a specific pattern just because "patterns". Now if you are

Re: [go-nuts] Weired or not?

2016-08-19 Thread asit dhal
After struct embedding of S1 in S2, all methods of S1 will be available in S2. So, this is ok !! Warm Regards, Asit Dhal http://bit.ly/193ASIT On 8/19/2016 5:13:09 PM, Ian Lance Taylor wrote: On Thu, Aug 18, 2016 at 10:16 PM, T L wrote: > > package main > > type S1 struct { } > > func (*S1) f() {

Re: [go-nuts] Weired or not?

2016-08-19 Thread Ian Lance Taylor
On Thu, Aug 18, 2016 at 10:16 PM, T L wrote: > > package main > > type S1 struct { } > > func (*S1) f() {} > > type S2 struct { S1 } > > // var _ = S1.f // S1.f undefined (type S1 has no method f) > // var _ = S2.f // S2.f undefined (type S2 has no method f) > var _ = (*S2).f // ok! Not weird. S

Re: [go-nuts] runtime: split stack overflow

2016-08-19 Thread Ian Lance Taylor
On Fri, Aug 19, 2016 at 2:33 AM, wrote: >> It appears as though the signal handler is somehow not running on the >> alternate signal stack. I don't know why that would be, though. I >> have no other explanation. You'll have to debug it. >> > I can see by the stack pointers, that the alt stack is

[go-nuts] Re: gophercon 2016 videos

2016-08-19 Thread Rajanikanth Jammalamadaka
Awesome, thanks! On Friday, August 19, 2016 at 8:20:23 AM UTC-4, Josh Kamau wrote: > > For those who have been waiting, like me, GopherCon 2016 videos are now > on youtube. e.g https://www.youtube.com/watch?v=KINIAgRpkDA > -- You received this message because you are subscribed to the Google

[go-nuts] Database design pattern

2016-08-19 Thread asit dhal
Hi All, I need to build an application that accesses a small database(sqlite or may be mysql in production). My database operations are very small, like 1. Insert 2. Read 3. Search Insert is one time, and most of the time new records will be added in a batch.  Can someone suggest me some appli

Re: [go-nuts] How to initialize two dimension array

2016-08-19 Thread asit dhal
Here is a link to initialize a static array http://www.dotnetperls.com/2d-go And at runtime, https://rosettacode.org/wiki/Create_a_two-dimensional_array_at_runtime#Go Warm Regards, Asit Dhal http://bit.ly/193ASIT On 8/18/2016 6:19:57 PM, Seb Binet wrote: On Thu, Aug 18, 2016 at 9:32 AM, mailt

Re: [go-nuts] Go 1.7 is released

2016-08-19 Thread Daniel Skinner
yardstick or it doesn't work On Tue, Aug 16, 2016 at 6:17 PM Brad Fitzpatrick wrote: > We a phrase as catchy as "Pics or it didn't happen" for this. "Test or > it's not trustworthy"? Needs work. > > > On Tue, Aug 16, 2016 at 2:16 PM, Dave Cheney wrote: > >> Until it's part of the ./all.bash tes

Re: [go-nuts] Shiny

2016-08-19 Thread Daniel Skinner
Its definitely interesting but I was pursuing a technique to work with rasterized images instead of bezier curves or vector data, the results just weren't consistent enough to my taste. If I were to use it, It'd likely be more productive for use to link in the current work via cgo since the researc

[go-nuts] Re: import csv file

2016-08-19 Thread francis badasu
This is a snippets of the first part of my code package main import ( "encoding/csv" "fmt" "os" ) func main() { file, err := os.Open("Account_balances.csv") if err != nil { fmt.Println("Error", err) return } defer file.Close() reader := csv.NewReader(file) record, err := reader.Rea

Re: [go-nuts] Shiny

2016-08-19 Thread Joe Blue
Danial, Piano is really impressive. The Material touch effects are very snappy too !! Boxes too. With both Piano and Boxes running Android they are still snappy in GenyMotion and on real Android device. Its allot of fun playing around with different aspects of the code. Thanks for the update abou

[go-nuts] gophercon 2016 videos

2016-08-19 Thread Josh Kamau
For those who have been waiting, like me, GopherCon 2016 videos are now on youtube. e.g https://www.youtube.com/watch?v=KINIAgRpkDA -- You received this message because you are subscribed to the Google Groups "golang-nuts" group. To unsubscribe from this group and stop receiving emails from it

Re: [go-nuts] Shiny

2016-08-19 Thread Daniel Skinner
> > There is also some very impressive work by Skinner over at: > https://github.com/dskinner/material > > The branch called mediansdf has impressive font improvements. > Thanks for the shout out, though I'm already looking at dropping that branch. I'm interested in shiny as well but waiting for

[go-nuts] Re: cmdline--improve Golang std.flag based on Go src v1.7

2016-08-19 Thread Ally Dale
[root@localhost ~]# rm --help Usage: rm [OPTION]... FILE... Remove (unlink) the FILE(s). -f, --force ignore nonexistent files, never prompt -r, -R, --recursive remove directories and their contents recursively -v, --verbose explain what is being done ... By default, rm d

Re: [go-nuts] Define method on scope-local type

2016-08-19 Thread Paul Jolly
I've been following the same Github issue. > ... but the particularly annoying part is having to clutter the global > namespace by adding a global type which implements the interface > As part of an extension to sortGen I've also been th

[go-nuts] Re: cmdline--improve Golang std.flag based on Go src v1.7

2016-08-19 Thread Ally Dale
[root@localhost ~]# rm --help Usage: rm [OPTION]... FILE... Remove (unlink) the FILE(s). -f, --force ignore nonexistent files, never prompt -r, -R, --recursive remove directories and their contents recursively -v, --verbose explain what is being done ... By default, rm d

[go-nuts] Re: cmdline--improve Golang std.flag based on Go src v1.7

2016-08-19 Thread Ally Dale
[root@localhost ~]# rm --help Usage: rm [OPTION]... FILE... Remove (unlink) the FILE(s). -f, --force ignore nonexistent files, never prompt -r, -R, --recursive remove directories and their contents recursively -v, --verbose explain what is being done ... By default, rm d

Re: [go-nuts] runtime: split stack overflow

2016-08-19 Thread martin . strenge
> > It appears as though the signal handler is somehow not running on the > alternate signal stack. I don't know why that would be, though. I > have no other explanation. You'll have to debug it. > > I can see by the stack pointers, that the alt stack is used on both, Linux and Darwin. But I'm

Re: [go-nuts] cmd/go: make c/objective-c in cgo support golang package better.

2016-08-19 Thread Seb Binet
hi, On Thu, Aug 18, 2016 at 8:21 AM, bronze man wrote: > I think golang package is a great stuff for encapsulation.It may be better > if I can use that in cgo. > * c/objective-c function can include any .h file in the GOPATH with "the > full path way" like golang import. > * c/objective-c functi

Re: [go-nuts] Shiny

2016-08-19 Thread Joe Blue
fair enough :) On Fri, Aug 19, 2016 at 2:46 AM Nigel Tao wrote: > On Thu, Aug 18, 2016 at 6:12 PM, Joe Blue wrote: > > Do you want anyone to help on the material design "widgets" yet ? > > It's great that there's community interest in Shiny, but as I said, > it's not ready yet. I'll let y'all k