Re: [go-nuts] runtime.Caller ->

2016-08-16 Thread Chris Hines
There was some discussion about how to handle generated methods in stack 
traces in #11432, in particular I brought it up in this 
comment: https://github.com/golang/go/issues/11432#issuecomment-146269822. 
The discussion eventually led to the addition of the new 
runtime.CallersFrames API, but providing metadata about generated functions 
was considered orthogonal and left for possible followup work.

Chris

On Monday, August 15, 2016 at 3:13:46 PM UTC-4, Ian Lance Taylor wrote:
>
> On Mon, Aug 15, 2016 at 10:51 AM, Tim Hockin  > wrote: 
> > OK, is there ANY heuristic I can rely on find the "real" call frame? 
>
> I don't know.  Sorry.  As I said earlier, I don't have a good answer here. 
>
> You should open an issue for this.  For some reason it has not been a 
> problem, perhaps because most code doesn't use the wrapper methods 
> much.  One reliable approach you could take would be to not call 
> runtime.Callers(1) from a value method or from a method in a type that 
> you embed into another type.  But I understand that that is not a 
> satisfactory answer. 
>
> Ian 
>
>
> > On Mon, Aug 15, 2016 at 10:17 AM, Ian Lance Taylor  > wrote: 
> >> On Sun, Aug 14, 2016 at 10:07 PM, Tim Hockin  > wrote: 
> >>> Can I rely on "" not changing? 
> >> 
> >> I'm sorry, that's a hard question to answer, because other compilers 
> >> do not use that string. 
> >> 
> >> There are no plans to change that string for the gc toolchain. 
> >> 
> >> Ian 
> >> 
> >>> On Sun, Aug 14, 2016 at 9:55 PM, Ian Lance Taylor  > wrote: 
>  On Sun, Aug 14, 2016 at 9:41 PM, Tim Hockin  > wrote: 
> > On Sun, Aug 14, 2016 at 8:31 PM, Ian Lance Taylor  > wrote: 
> >> On Sun, Aug 14, 2016 at 3:33 PM, Tim Hockin  > wrote: 
> >>> Edit:  It looks like this has more to do with being an interface 
> >>> method than an embedded type. 
> >>> 
> >>> https://play.golang.org/p/I5XPdWR_O0 
> >> 
> >> Hmmm, you're right.  It only happens for a value method. 
> > 
> > Is this likely to change? I.e. can I hardcode "2" or should I 
> actually 
> > write the loop to climb frames?  Is there a limit to the number of 
> > frames I should inspect before I give up?  Is the string 
> > "" stable? 
>  
>  Well, unfortunately, it's different for different compilers.  I don't 
>  have a good answer here.  Except to say that you should never need 
>  more than 2 frames; it should never be the case that autogenerated 
>  code calls autogenerated code. 
>  
>  Ian 
>

-- 
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/optout.


Re: [go-nuts] Go 1.7 is released

2016-08-16 Thread Brad Fitzpatrick
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 test suite, it'll continue to break
> because it has never been proven to work.
>
> > On 17 Aug 2016, at 05:13, Michael Hudson-Doyle <
> michael.hud...@canonical.com> wrote:
> >
> >> On 17 August 2016 at 08:31, Dave Cheney  wrote:
> >> Stripping go binaries is not tested and known to produce broken
> binaries.
> >
> > Stripping should be fine, and any problems produced by it should be
> > reported as bugs. Please.
> >
> >> I recommend not doing this until strip/upx/whatever are tested as part
> of the unit tests which are run before each commit lands.
> >
> > upx, on the other hand, I have no idea about.
> >
> > Cheers,
> > mwh
>
> --
> 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/optout.
>

-- 
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/optout.


[go-nuts] [ANN] Golang Bindings for Vulkan API with demos

2016-08-16 Thread Maxim Kupriianov
Hi everyone!

I'd start from a little story. On 3rd March a Reddit user itsmontoya, a 
friend of mine, besides an ex-coworker, challenged me to do Go bindings for 
the Vulkan API that has been released officially that day. It was a fun 
idea since vulkan.h is a big chunk of a typical header code and I decided 
to accept it. In a couple of hours I got ~17KLOC of binding code for that 
header. Well, I had no idea where to get the implementation..

So it turned out that the implementation is a vendor-specific thing, and 
the fastest way to get it is to buy an android tablet from Nvidia. So I did 
that and after a couple of months (the parcel has been lost twice, so I 
reordered) the table tablet was mine. In order to be able create apps for 
android using the Android NDK without any fancy stuff being done with 
ANativeWindow, I dedicated some time in May to create the well discussed 
freamework http://github.com/xlab/android-go. It works cool with 
EGL/GLES/GLES2 but of course that was a side-effect. What I really did was 
the first Vulkan run on a device that got me the surface properties.

Since May my binding generator improved a lot due to feedback and bugs I 
got while binding those two beasts,
so in August I found some time on a weekend to create examples. And now I'm 
glad to announce the release.

Package github.com/vulkan-go/vulkan [1] provides Go bindings for Vulkan [2] 
— a low-overhead, cross-platform 3D graphics and compute API. And some demo 
apps [3] for Android for those who have got the supported devices.

[1]: https://github.com/vulkan-go/vulkan
[2]: https://www.khronos.org/vulkan/
[3]: https://github.com/vulkan-go/demos

Cheers!
- Max

P.S. still no generator release, but I may assure it's 99.9% ready now, 
after all this :P

-- 
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/optout.


Re: [go-nuts] Go 1.7 is released

2016-08-16 Thread Dave Cheney
Until it's part of the ./all.bash test suite, it'll continue to break because 
it has never been proven to work.

> On 17 Aug 2016, at 05:13, Michael Hudson-Doyle  
> wrote:
> 
>> On 17 August 2016 at 08:31, Dave Cheney  wrote:
>> Stripping go binaries is not tested and known to produce broken binaries.
> 
> Stripping should be fine, and any problems produced by it should be
> reported as bugs. Please.
> 
>> I recommend not doing this until strip/upx/whatever are tested as part of 
>> the unit tests which are run before each commit lands.
> 
> upx, on the other hand, I have no idea about.
> 
> Cheers,
> mwh

-- 
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/optout.


Re: [go-nuts] Go 1.7 is released

2016-08-16 Thread Michael Hudson-Doyle
On 17 August 2016 at 08:31, Dave Cheney  wrote:
> Stripping go binaries is not tested and known to produce broken binaries.

Stripping should be fine, and any problems produced by it should be
reported as bugs. Please.

> I recommend not doing this until strip/upx/whatever are tested as part of the 
> unit tests which are run before each commit lands.

upx, on the other hand, I have no idea about.

Cheers,
mwh

-- 
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/optout.


Re: [go-nuts] Go 1.7 is released

2016-08-16 Thread Dave Cheney
Stripping go binaries is not tested and known to produce broken binaries. I 
recommend not doing this until strip/upx/whatever are tested as part of the 
unit tests which are run before each commit lands.

-- 
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/optout.


[go-nuts] Re: Biometric login (webauthn) in Go, need help in verifying signature

2016-08-16 Thread Tamás Gulácsi
Can you give some test data? Start from https://play.golang.org/p/fZM_vB2FFr

By the way, I'd make an EXACT translation of the PHP code first, then write 
tests (it's easy with go!), for EVERY step of the verification, to check 
when the deviation starts.

2016. augusztus 16., kedd 19:27:28 UTC+2 időpontban ayng...@gmail.com a 
következőt írta:
>
> Any tips at all would be helpful, I'd prefer not having to run a docker 
> instance with C# alongside my Go app on appengine just to be able to sign 
> people in.
>

-- 
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/optout.


Re: [go-nuts] Re: Shiny

2016-08-16 Thread howardcshaw
On Tuesday, August 16, 2016 at 12:19:13 PM UTC-5, Dave MacFarlane wrote:
>
> What do you mean "no actual text editors"? By my count of the 
> importers that GoDoc knows about 3 out of 8 of the projects that are 
> using it are text editor apps. 
>
> - Dave 
>

Go to exp/shiny/examples/textedit. 
go run main.go

Try to edit. Nothing happens. Click - no caret appears. Type, nothing 
happens. Try to select text, nothing happens. 

Look at the list of GoDoc projects:

go-vu: not clear what this is, but it looks like a GUI implementation of 
its own, resting on top of Cocoa, mobile, or Shiny, 
but https://github.com/achille-roussel/go-vu/blob/master/text.go looks like 
his custom implementation of a text edit.

view-fits: image viewer for specific file type.

de: programmer's text editor - uses the Shiny screen as an image window, 
renders text and line numbers into that on its own, does not use any Shiny 
widgets (hardly surprising - this is a VI style mode-based editor, so a 
traditional text edit would hardly be a viable basis). See 
https://github.com/driusan/de/blob/master/kbmap/insertmode.go for basic 
implementation of text editing

T: T text editor. https://github.com/eaburns/T/blob/master/ui/textbox.go - 
this is his own textbox implementation - presumably because Shiny does not 
have a usable one yet.

hplot: histogram and function plotter.

linedrawer: draws steps from 1-dimensional cellular automata

goapple2: apple II emulator, using Shiny as a framebuffer/eventloop, 
basically. Again, not using built-in text widgets, doing its own rendering 
and text handling.

graphics/cmd/edit: popping up a couple of levels, to graphics, here is a 
line from their readme: "editor provides a graphical, editable text area 
widget." Again, their own implementation of a text editor widget.

So, again, not one of these programs uses the Shiny text widget. 
"sigint.ca/graphics/editor" looks like an interesting implementation that I 
may try to use, as it appears on the face of it to have been designed as a 
drop-in usable widget with minimal dependency contamination.

But my basic point stands - the exp/shiny implementation lacks the basic 
widgets to implement the average desktop application, particularly of the 
data entry variety, but is suitable as a backing framebuffer/eventloop. 
Expanding your dependencies may gain you a text editor widget, but you 
would still be on your own for implementing buttons, radio-buttons, 
drop-down/lookup/choosers, list selectors, tree controls, grid controls. 
Unless it is your *goal* in the first place to write such a set of widgets, 
then currently you are probably better off implementing back-end logic in 
Go and front-end interfaces in something else, or looking into alternative 
more feature-complete GUI packages for Go.

The text widget itself was only added to Shiny on June 12, and there is 
still a comment in the file that reads "// TODO: cursors + editing (not 
just viewing) text, key + mouse events, // scrolling, load/save, 
clipboard." so I don't think I am making any claims the developers would 
not acquiesce to. Surely this will change over time, and the 
implementations above are evidence enough that Shiny is a viable platform 
on which to build complex widgets. I am not at all meaning to disparage the 
project, just trying to offer a bit of my own experience.

Howard

-- 
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/optout.


[go-nuts] Re: Go 1.7 is released

2016-08-16 Thread Henry
I just want to point out that after upgrading to Go 1.7, I experienced 
problem with go vet command as stated in issue 
https://github.com/golang/go/issues/15728 . I couldn't figure out which 
packages need rebuilding so I deleted all the files under GOPATH/pkg and 
everything works fine now. 

I hope this is helpful.

On Tuesday, August 16, 2016 at 6:28:23 AM UTC+7, Chris Broadfoot wrote:

> Hello gophers,
>
> We just released Go 1.7.
>
> You can read the announcement blog post here:
>   https://blog.golang.org/go1.7
>
> You can download binary and source distributions from our download page:
>   https://golang.org/dl/
>
> To compile from source using a Git checkout, update to the release with 
> "git checkout go1.7" and build as usual.
>
> To find out what has changed, read the release notes:
>   https://golang.org/doc/go1.7
>
> Thanks to everyone who contributed to the release.
>
> Chris
>

-- 
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/optout.


Re: [go-nuts] Re: Shiny

2016-08-16 Thread Dave MacFarlane
On Tue, Aug 16, 2016 at 12:56 PM,   wrote:
> No buttons (though they aren't hard to implement from a label), no radio
> boxes, no built-in scrollbars that I could find, no actual text editors, no
> lookups/drop-downs/choosers, no listboxes. And certainly nothing akin to a
> grid/spreadsheet control with embeddable widgets.
>

What do you mean "no actual text editors"? By my count of the
importers that GoDoc knows about 3 out of 8 of the projects that are
using it are text editor apps.

- Dave

-- 
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/optout.


[go-nuts] Re: Shiny

2016-08-16 Thread howardcshaw
I've been working with it lately. I got fairly far in writing a drop-in 
visualizer for my algorithms, but I ran into a snag when I went to add 
dynamically generated editing for parameter values. The widget.NewText(), 
in spite of being used in an Example called TextEdit, does not appear to 
actually have any GUI support for editing yet.

It is also slightly unclear what version of the language it is built for. I 
think they have been advancing with Go, and have not made efforts towards 
backwards compatibility, and I had to make several hand-edits after 
updating, to get it to compile under Go 1.5.

So, from my examination, the event handling/mainloop is fine (at least on 
Linux using X11 driver), painting is fine, widget layout is acceptable-ish, 
but widget depth is exceedingly poor. Basically has image rendering 
widgets, labels, and text widgets with automatic text layout, and that is 
it.

No buttons (though they aren't hard to implement from a label), no radio 
boxes, no built-in scrollbars that I could find, no actual text editors, no 
lookups/drop-downs/choosers, no listboxes. And certainly nothing akin to a 
grid/spreadsheet control with embeddable widgets.

So, right now, as Dave MacFarlane's suggestion also shows, it is viable for 
creating renderers/viewers.

Howard

On Tuesday, August 16, 2016 at 6:35:55 AM UTC-5, Joe Blue wrote:
>
> Shiny looks OK for building desktop apps.
>
> A tone built anything useful with it ?
>

-- 
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/optout.


[go-nuts] [RELEASE] Jet 2.0 - Fastest and Easy to use template engine for Go

2016-08-16 Thread Henrique santos


Hi everyone, passing by to announce the release of Jet v2.0.


Lot's of enhancements, documentation, tests, and new features.

Please take a look in https://github.com/CloudyKit/jet


Jet is stable and ready for production.


Feedback is welcome.

Regards

-- 
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/optout.


Re: [go-nuts] Go 1.7 is released

2016-08-16 Thread robfig
PSA: If anyone uses upx to shrink linux binaries, beware that it will now 
produce a binary that segfaults immediately.


On Tuesday, August 16, 2016 at 7:50:22 AM UTC-4, bep wrote:
>
> Congrats! Good stuff!
>
> I wrote the benchmark below to compare two branches in Hugo, but ran a set 
> after 1.7 upgrade:
>
> 4 random but fairly big Hugo sites, each built 6 times, rendered to memory:
>
>- go1.6.2 0.17-DEV 24.479727984s - All OK
>- go1.6.2 0.17-MULTILINGUAL 26.49965009s - All OK
>- go1.7 0.17-DEV 21.830323612s - All OK 
>- go1.7 0.17-MULTILINGUAL 23.164846844s - All OK
>
> That should be a great 10%+ speedup, and that in an application I would 
> already consider pretty fast.
>
>
> https://github.com/bep/hugo-benchmark
>
>
>
>
>
>
> tirsdag 16. august 2016 02.04.08 UTC+2 skrev chai2010 følgende:
>>
>> go1.7.windows-amd64.zip missing.
>>
>> 2016-08-16 7:28 GMT+08:00 Chris Broadfoot :
>>
>>> Hello gophers,
>>>
>>> We just released Go 1.7.
>>>
>>> You can read the announcement blog post here:
>>>   https://blog.golang.org/go1.7
>>>
>>> You can download binary and source distributions from our download page:
>>>   https://golang.org/dl/
>>>
>>> To compile from source using a Git checkout, update to the release with 
>>> "git checkout go1.7" and build as usual.
>>>
>>> To find out what has changed, read the release notes:
>>>   https://golang.org/doc/go1.7
>>>
>>> Thanks to everyone who contributed to the release.
>>>
>>> Chris
>>>
>>> -- 
>>> 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...@googlegroups.com.
>>>
>>> For more options, visit https://groups.google.com/d/optout.
>>>
>>
>>
>>
>> -- 
>> https://github.com/golang-china/gopl-zh
>> https://github.com/golang-china
>> https://github.com/chai2010
>>
>

-- 
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/optout.


Re: [go-nuts] Cron job (2nd monday of every month/ 3rd tuesday of every month)

2016-08-16 Thread Tamás Gulácsi
TL;DR cron works like this (see the man page): 
https://github.com/robfig/cron/blob/v2/spec.go#L164
It means that the dow and dom restrictions are ORed, not ANDed together.

I'd say to your original problem, that choose one restriction (say, dow), 
and restrict in the called function: https://play.golang.org/p/aVWj_HAPX9


2016. augusztus 16., kedd 9:58:56 UTC+2 időpontban kumargv a következőt 
írta:
>
> I tested but it is not working .
>
> https://play.golang.org/p/vN1q7kNcRF
>
> OUTPUT
>
> C:\Users\vijay\Desktop>go run cron.go
> EVERY ONE MINUTE
> second monday of every month
> 3rd tuesday of every month
> ++
> EVERY ONE MINUTE
>
> On Thu, Aug 11, 2016 at 7:32 PM, Tamás Gulácsi  > wrote:
>
>> // The first monday can be 1-7th, the second 8-14th day of the month.
>> c.AddFunc("0 30 * 8-14 * 1", func() { fmt.Println("second monday of every 
>> month") })
>>
>> // The first tuesday can be 1-7th, the second 8-14th, the third 15-22th.
>> c.AddFunc("0 30 * 15-22 * 2", func() { fmt.Println("3rd tuesday of every 
>> month") })
>>
>> --
>> You received this message because you are subscribed to a topic in the 
>> Google Groups "golang-nuts" group.
>> To unsubscribe from this topic, visit 
>> https://groups.google.com/d/topic/golang-nuts/XT0QD4hwkVM/unsubscribe.
>> To unsubscribe from this group and all its topics, send an email to 
>> golang-nuts...@googlegroups.com .
>> For more options, visit https://groups.google.com/d/optout.
>>
>
>

-- 
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/optout.


[go-nuts] Re: Fast ConcurrentCounter without memory sharing

2016-08-16 Thread anupam . kapoor

,
| It would be interesting to know what the potential speedup is.  It
| should be easy enough to write a C program to measure that.  But when
| writing such a program, remember that no real program will simply
| increment a concurrent counter.  The question is not just how much
| speedup you can get from a concurrent counter, but how much it will
| matter to a real program.
`
normally, atomic-increment for uint64_t on x86 are very expensive. so a
simple thing which works is to amortize that cost.

this basically translates to using a per-core uint16_t, and when that
wraps around, just push the values via atomic update to a uint64_t,
which is a global counter.

when this scheme is compared with vanilla atomic-increment of uint64_t,
it turns out to be quite fast (approx. 4-5 times better)

where would you use this : well, if you are mantaining rx/tx stats for a
10g interface, it becomes significant :)

i have tried this with vanilla C not go, so ymmv.

--
kind regards
anupam

-- 
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/optout.


Re: [go-nuts] Go 1.7 is released

2016-08-16 Thread bep
Congrats! Good stuff!

I wrote the benchmark below to compare two branches in Hugo, but ran a set 
after 1.7 upgrade:

4 random but fairly big Hugo sites, each built 6 times, rendered to memory:

   - go1.6.2 0.17-DEV 24.479727984s - All OK
   - go1.6.2 0.17-MULTILINGUAL 26.49965009s - All OK
   - go1.7 0.17-DEV 21.830323612s - All OK 
   - go1.7 0.17-MULTILINGUAL 23.164846844s - All OK

That should be a great 10%+ speedup, and that in an application I would 
already consider pretty fast.


https://github.com/bep/hugo-benchmark






tirsdag 16. august 2016 02.04.08 UTC+2 skrev chai2010 følgende:
>
> go1.7.windows-amd64.zip missing.
>
> 2016-08-16 7:28 GMT+08:00 Chris Broadfoot 
> :
>
>> Hello gophers,
>>
>> We just released Go 1.7.
>>
>> You can read the announcement blog post here:
>>   https://blog.golang.org/go1.7
>>
>> You can download binary and source distributions from our download page:
>>   https://golang.org/dl/
>>
>> To compile from source using a Git checkout, update to the release with 
>> "git checkout go1.7" and build as usual.
>>
>> To find out what has changed, read the release notes:
>>   https://golang.org/doc/go1.7
>>
>> Thanks to everyone who contributed to the release.
>>
>> Chris
>>
>> -- 
>> 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...@googlegroups.com .
>>
>> For more options, visit https://groups.google.com/d/optout.
>>
>
>
>
> -- 
> https://github.com/golang-china/gopl-zh
> https://github.com/golang-china
> https://github.com/chai2010
>

-- 
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/optout.


[go-nuts] Re: Regexp question

2016-08-16 Thread Damian Gryski


On Tuesday, August 16, 2016 at 1:00:15 PM UTC+2, Jan Mercl wrote:
>
> This code (A)
>
> package main
> 
> import (
> "fmt"
> "regexp"
> )
> 
> func main() {
> fmt.Printf("%v", 
> regexp.MustCompile(`a*`).FindAllStringIndex(`baaab`, -1))
> }
>
> (https://play.golang.org/p/WeyStT0Gbn)
>
> Produces
>
> [[0 0] [1 4] [5 5]]
>
> Why there is no match at [4 4]? That's at the (start of the) second letter 
> b in the text, analogically to the first match [0, 0]. Am I missing 
> something or is it a bug?
>


Seems like these sentences from the regexps docs match your case:

"If 'All' is present, the routine matches successive non-overlapping 
matches of the entire expression. Empty matches abutting a preceding match 
are ignored. "


The match at [4 4] would be an empty match abutting a preceding match.

Damian

>

-- 
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/optout.


[go-nuts] Regexp question

2016-08-16 Thread Jan Mercl
This code (A)

package main

import (
"fmt"
"regexp"
)

func main() {
fmt.Printf("%v",
regexp.MustCompile(`a*`).FindAllStringIndex(`baaab`, -1))
}

(https://play.golang.org/p/WeyStT0Gbn)

Produces

[[0 0] [1 4] [5 5]]

Why there is no match at [4 4]? That's at the (start of the) second letter
b in the text, analogically to the first match [0, 0]. Am I missing
something or is it a bug?

In a similar program, the symmetry is present (B)

package main

import (
"fmt"
"regexp"
)

func main() {
fmt.Println(regexp.MustCompile(`a*`).FindAllStringIndex(``,
-1))

fmt.Println(regexp.MustCompile(`a*`).FindAllStringIndex(`b`, -1))

fmt.Println(regexp.MustCompile(`a*`).FindAllStringIndex(`bb`, -1))

fmt.Println(regexp.MustCompile(`a*`).FindAllStringIndex(`bbb`, -1))
}

(https://play.golang.org/p/m0kbrNQp21)

Output

[[0 0]]
[[0 0] [1 1]]
[[0 0] [1 1] [2 2]]
[[0 0] [1 1] [2 2] [3 3]]

Thanks in advance to anyone enlightening me.

FTR: The regular expression and the test text in (A) is part of the regexp
package tests at [0].

  [0]:
https://github.com/golang/go/blob/0d818588685976407c81c60d2fda289361cbc8ec/src/regexp/find_test.go#L44

-- 

-j

-- 
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/optout.


[go-nuts] Re: Go 1.7 is released

2016-08-16 Thread Scott Cotton
Hello all,

Great work go team, thanks! 

We got a speedup with 1.7 v 1.6 using the SSA backend

Scott

Le mardi 16 août 2016 01:28:23 UTC+2, Chris Broadfoot a écrit :
>
> Hello gophers,
>
> We just released Go 1.7.
>
> You can read the announcement blog post here:
>   https://blog.golang.org/go1.7
>
> You can download binary and source distributions from our download page:
>   https://golang.org/dl/
>
> To compile from source using a Git checkout, update to the release with 
> "git checkout go1.7" and build as usual.
>
> To find out what has changed, read the release notes:
>   https://golang.org/doc/go1.7
>
> Thanks to everyone who contributed to the release.
>
> Chris
>

-- 
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/optout.


[go-nuts] Trivial file server responds with "Moved Permanently"?

2016-08-16 Thread Dave Cheney
Where does the 301 point?

-- 
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/optout.


Re: [go-nuts] Cron job (2nd monday of every month/ 3rd tuesday of every month)

2016-08-16 Thread vijay giri
I tested but it is not working .

https://play.golang.org/p/vN1q7kNcRF

OUTPUT

C:\Users\vijay\Desktop>go run cron.go
EVERY ONE MINUTE
second monday of every month
3rd tuesday of every month
++
EVERY ONE MINUTE

On Thu, Aug 11, 2016 at 7:32 PM, Tamás Gulácsi  wrote:

> // The first monday can be 1-7th, the second 8-14th day of the month.
> c.AddFunc("0 30 * 8-14 * 1", func() { fmt.Println("second monday of every
> month") })
>
> // The first tuesday can be 1-7th, the second 8-14th, the third 15-22th.
> c.AddFunc("0 30 * 15-22 * 2", func() { fmt.Println("3rd tuesday of every
> month") })
>
> --
> You received this message because you are subscribed to a topic in the
> Google Groups "golang-nuts" group.
> To unsubscribe from this topic, visit https://groups.google.com/d/
> topic/golang-nuts/XT0QD4hwkVM/unsubscribe.
> To unsubscribe from this group and all its topics, send an email to
> golang-nuts+unsubscr...@googlegroups.com.
> For more options, visit https://groups.google.com/d/optout.
>

-- 
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/optout.