* Axel Wagner:
> One way to fix this is to change the signatures to
>
> func Contains[I Iterator[T], T comparable](c I, value T) bool
> func Contains2[I Iterator[T], T comparable](value T, c I) bool
I had not realized that, thanks. The opposite order is perhaps more
useful, [T comparable, I Itera
I've tried this example, related to the collections example in the
proposal.
package main
type Iterator[T any] interface{
Next() (T, bool)
}
func Contains[T comparable](c Iterator[T], value T) bool {
for {
v, ok := c.Next()
if ok {
Hi all,
When Using the golang.org/x/crypto/ssh module to connect to a lshd SSH
server this error gets thrown:
panic: ssh: handshake failed: ssh: exponent too large
goroutine 1 [running]:
main.main()
C:/Users/user/Documents/project/sample.go:33 +0x685 EOF
It's defined in /ssh/k
Do I have to tell the runtime that a system call is blocking? For
example, I use this code snippet to perform a blocking ioctl:
conn, err := file.SyscallConn()
if err != nil {
return
}
err1 := conn.Control(func(fd uintptr) {
_, _, er
I've opened an issue: https://github.com/golang/go/issues/27180
--
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
On Tuesday, August 21, 2018 at 7:31:28 AM UTC+2, Keith Randall wrote:
>
> There is no conservativeness to unsafe.Pointer. The type information for
> any object in the heap is recorded at allocation time, and is unrelated to
> the type of the reference currently held to it (be it unsafe.Pointer,
>
> Another question: Why does the nil check take two instructions. Can't it
> be done using MOVQ?
>
Scratch that. That was nonsense.
--
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
Forgot the ssa.html
--
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/
or further
analysis.
Another question: Why does the nil check take two instructions. Can't it be
done using MOVQ?
Best regards,
Florian
--
You received this message because you are subscribed to the Google Groups
"golang-nuts" group.
To unsubscribe from this group and stop receivin
>
> From the GC POV, the only interesting thing about an unsafe.Pointer is if
> its value falls anywhere into a GC managed memory block for liveness
> analysis, AFAIK.
>
And then it will check that memory block for stuff that looks like a
pointer (not caring what the actual type being pointed t
>
> The garbage collector does not care about the values of items of a []T
> when T is not a pointer type nor a type containing transitively any
> pointers.
>
Just to make sure I understand you correctly. Are you saying I could hold
an unsafe.Pointer to an array of uint64 and the GC will still
Thanks Axel.
Good to know the first part. I have a couple of comments regarding your
answer to the second part.
In regards to your second question: That would require having an array type
> for every possible size, which isn't really tenable.
>
The idea was to use the same array type (`[(^uint
Mistake in the second struct. The data field should have the type:
*[(^uint(0)) >> 17]uint64
--
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
m favoring that at
the moment.
Best regards,
Florian
--
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.
>
> x := T{}.F
Thanks. Good idea. That doesn't work in most cases though (function
arguments/returns or type definitions for example).
--
You received this message because you are subscribed to the Google Groups
"golang-nuts" group.
To unsubscribe from this group and stop receiving emails fro
that this has been
discussed previously, but I couldn't find it. It would be great if someone
could provide a link.
Best regards,
Florian
--
You received this message because you are subscribed to the Google Groups
"golang-nuts" group.
To unsubscribe from this group and stop r
form
>
> On 4 September 2017 at 08:54, Florian Florensen > wrote:
>
>> Hello,
>>
>> I'd like to rotate, scale, ... images by moving pixels using affine
>> transformations. For example, the get a points x, y position after a
>> translating it by
I
didn't write tests. Sorry for that!
I still would use Seths version, since it correctly splits uppercase-words
like CAMELCase to ["C" "A" "M" "E" "L" "Case"].
Am Dienstag, 5. September 2017 03:43:22 UTC+2 schrieb Tong Sun:
>
Hi, two approaches would be:
func camelAppend(str string) string {
w := []rune(str)
for i := len(w) - 1; i > 1; i-- {
if unicode.IsUpper(w[i]) {
w = append(w[:i], append([]rune{' '}, w[i:]...)...)
}
}
return string(w)
}
func camelRegexp(str string) string {
re := regexp.Mu
Hello,
I'd like to rotate, scale, ... images by moving pixels using affine
transformations. For example, the get a points x, y position after a
translating it by m, n pixels, you can just add m resp n to x and y:
x' = x + m
y' = y + n
So the task is basically just to iterate over the images p
fail to see the problem. Could you elaborate if I misunderstood you?
Best regards,
Florian
--
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-nut
ide a way to update
dependencies of packages that are not go get-able. Inside or outside GOPATH
has nothing to do with it.
Thanks,
Florian
--
You received this message because you are subscribed to the Google Groups
"golang-nuts" group.
To unsubscribe from this group and stop receiving
I always forget that there is no edit button... sorry for not proofreading
thoroughly before posting.
--
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
ot;go build". Then
"go get -d && go build -u -i" would work great.
I know that none of these exactly fit the original idea of the "get" or
"build" command perfectly, but this is a real world problem in need of a
solution.
tldr: Please let me update depe
e environment in a script is no solution, as the point of the
whole change is not to use a script. go generate doesn't provide any way to
set environment variables.
Best regards,
Florian
--
You received this message because you are subscribed to the Google Groups
"golang-nuts" g
Hi Go nuts,
I have a (server) function that gets a context.Context and *listens* on a
net.UDPConn. I would like this function to receive and handle network
packets, but close the socket and return as soon as the context is
cancelled.
Ideally, I'd like to do something along these lines:
for {
code, since providing "" as a pattern results in a panic at the
moment.
What did I miss?
Best regards,
Florian
--
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.
de this in some garbage collected languages, so I decided to close
the issue.
On Sunday, December 18, 2016 at 8:13:39 PM UTC+1, Florian Uekermann wrote:
>
> Well, I am pretty sure I was wrong about something. Turning of the garbage
> collector results in no error. Any smart ideas for debug
Well, I am pretty sure I was wrong about something. Turning of the garbage
collector results in no error. Any smart ideas for debugging this?
On Sunday, December 18, 2016 at 4:20:25 PM UTC+1, Florian Uekermann wrote:
>
> I may be misdiagnosing the problem, but I think go is doing a probl
I forgot to ask another question.
If solving this is not practical in go, should I bring this up with the
Vulkan people?
I don't really understand why they don't use uint64_t regardless of
architecture.
--
You received this message because you are subscribed to the Google Groups
"golang-nuts"
I may be misdiagnosing the problem, but I think go is doing a problematic
check of the value of C pointer types pointers.
The following runtime error is reproducible, but does not always happen in
a program:
runtime: writebarrierptr *0xc420326a90 = 0x12
fatal error: bad pointer in write barrie
>
> You wrote `*X.Y`; I'm going to assume you meant to write `*X = Y`.
>
*X.Y = value
, where the Y field is a pointer to the C heap. But I suppose that is
pretty much the same.
> This error message is telling you that in the assignment `*X = Y` Y
> has a pointer type, but has the value 1.
ersion of Go are you using (`go version`)?
$ go version
go version go1.7.3 linux/amd64
### What operating system and processor architecture are you using (`go
env`)?
$ go env
GOARCH="amd64"
GOBIN=""
GOEXE=""
GOHOSTARCH="amd64"
GOHOSTOS="linux"
GO
* Dave Cheney:
> On Fri, Nov 25, 2016 at 4:24 PM, Florian Weimer wrote:
>> * Brad Fitzpatrick:
>>
>>> In light of the CEO of Reddit admitting to editing user comments (see
>>> dozen news stories today), I propose we delete the /r/golang subreddit.
>>>
&g
On /r/fantasy and /r/books I've gotten the chance to interact with some of my
favorite authors...not just on special occasions but because they're core
members of the community.
On /r/woodworking people were endlessly helpful when I tried to pick up
woodworking as a hobby.
When school starts red
* Brad Fitzpatrick:
> In light of the CEO of Reddit admitting to editing user comments (see
> dozen news stories today), I propose we delete the /r/golang subreddit.
>
> That is so beyond unethical and immature,
Was it immature because they didn't make any money out of it, at least
not directly?
* audrius butkevicius:
> I am looking for advice how this could be implemented in a more robust way
> without leaking resources.
You can't with just an io.Writer. If a write operation cannot be
canceled (and io.Writer does not provide this capability), a timeout
will always result in a resource
* Tong Sun:
> The dark voodoo regexp as described here works for many cases.
> http://www.perlmonks.org/?node_id=261292
In general, whitespace is significant in XML, so you need a DTD or
schema to make sure that you can make such edits without changing the
meaning of the document.
--
You receiv
* Elazar Leibovich:
> Hi,
>
> I'm the author of the goproxy project.
>
> Recently I received a complaint from a user about goproxy being categorized
> as a virus.
>
> https://www.reasoncoresecurity.com/sysnetwk.exe-fbcc41dafc7bd8cf9b373e0d6b74808b11a9ba3c.aspx
>
> From a cursory look, it looks li
* Pietro Gagliardi:
> Just pass the null-terminated string and use C.int(len(goString)) as
> the length. The length of a Go string is already in bytes and does not
> include the terminating null (since Go has none), and I assume
> C.CString() produces the same byte sequence without encoding
> conv
* Chris Kastorff:
> If your program is spending that much time in GC, then you're likely
> spending a lot of time with the pointer write barriers on, which slow
> execution (for the benefit of having your code run at all during GC.)
Well, it's creating a lot of garbage, so I can't really complain
* John Morrice:
> Thought I'd be kind and illustrate your bug vs my solution with code. I
> use WaitGroups in both examples to keep things clearer.
>
> Your bug:
> https://play.golang.org/p/yoNPmbXnlW
>
> I.e.
>
> Ringo wrote Yellow Submarine
> Ringo wrote I am the Walrus
> Ringo wrote Eleanor R
* Clark Wierda:
> I don't have specific answers, but I do have some thoughts.
>
> First, the externally parallel has no overhead related to coordination. I
> would expect you to get the result you have of full core utilization and
> nearly perfect scaling.
GNU parallel saves intermediate outpu
I'm trying to parse OpenPGP key server dumps. Throughput is not too
bad so far, but I'd like to speed things up by introducing
parallelism.
The dumps are split into several files (each about 40 MB large, with a
few thousand keys). The toy version I have so far does not need any
coordination betw
PublicKey.parseRSA() has this check:
if len(pk.e.bytes) > 3 {
err = errors.UnsupportedError("large public exponent")
return
}
I get that it is valuable to limit the exponent size, but this limit
is too low: quite a few RSA keys in a dump from the pu
45 matches
Mail list logo