Re: [go-nuts] Re: Give the zero time value a location, and it won't survive a roundtrip to JSON?

2020-11-29 Thread Michael Jones
Matt’s formatting example suggests interval arithmetic for time. That is a nice idea. On Sat, Nov 28, 2020 at 2:22 AM 'Axel Wagner' via golang-nuts < golang-nuts@googlegroups.com> wrote: > It would also be possible to implement `json.Marshaler` to use a different > time format. In particular, it

Re: [go-nuts] Evaluation order of return

2020-09-25 Thread Michael Jones
Another way to understand the general topic is by comparison to Lindenmayer systems. The compiler is an iterated rewrite framework and the exact code that you get can be a surprise the same way L-System graphics vary. On Thu, Sep 24, 2020 at 10:36 PM cs.ali...@gmail.com < cs.alikoyu...@gmail.com>

Re: [go-nuts] flag: bug with shared values?

2020-09-18 Thread Michael Jones
> 2. if other gophers has ideas of workaround? Use distinct values, but never access them directly. Write setter/getter functions that do the value sharing as you prefer and return the desired result. On Fri, Sep 18, 2020 at 11:30 AM Ian Lance Taylor wrote: > On Fri, Sep 18, 2020 at 12:50 AM

Re: [go-nuts] How to find repeated string?

2020-08-19 Thread Michael Jones
Maybe this way? https://play.golang.org/p/_OM4RvO83Cf On Wed, Aug 19, 2020 at 4:04 AM Ian Davis wrote: > On Wed, 19 Aug 2020, at 12:02 PM, Ian Davis wrote: > > > > On Wed, 19 Aug 2020, at 11:54 AM, Brian Candler wrote: > > Or another thought - perhaps you are looking for *adjacent* repeats

Re: [go-nuts] [ generics ] Added constraint type inference to the design draft

2020-08-13 Thread Michael Jones
Yes, thank you. In intellectual shame I must say that I somehow understood that the generics needed to be "leaf" functions. Thank you for demonstrating my oversight. Happier now. Michael On Thu, Aug 13, 2020 at 3:47 PM Bakul Shah wrote: > On Aug 13, 2020, at 3:29 PM, Michael J

Re: [go-nuts] [ generics ] Added constraint type inference to the design draft

2020-08-13 Thread Michael Jones
The all-or-none aspect would be sidestepped if it were allowed to define "partial generics": func A (T1, T2) (...){} func B(T)(...){ A(T,int)(...){...} } Allowing B to exist just means running the whole generic thing iteratively until no resolution is changed. If the fixed point still has

Re: [go-nuts] map without default values

2020-08-13 Thread Michael Jones
Joe, your question is perfectly answered by Axel. I'll just share a few (personal) Go "style" comments: Go likes you to test explicitly for failure where that is possible: did the open fail, did the pipe break, etc.Multiple return values make this clear by avoiding the need for a "reserved"

Re: [go-nuts] Newbie question about type-casts

2020-08-04 Thread Michael Jones
var cash, change, bet int64 : bet = cash/4 // change is 0,1,2,3 meaning 0/4, 1/4, 2/4, 3/4 dineros or zlottys or whatever change = cash - 4*bet // or, change = cash%4 // choose one of these if change>0{ bet++ // a: round up means 1/4 and 2/4 and 3/4 go to 1 } // ...or... if change>=2{ bet++

Re: [go-nuts] Generic symbol metaproposal

2020-07-26 Thread Michael Jones
his whatever symbol is chosen. On Fri, Jul 24, 2020 at 3:16 PM David Riley wrote: > On Jul 24, 2020, at 5:50 PM, Ian Lance Taylor wrote: > > > > On Fri, Jul 24, 2020 at 2:22 PM wrote: > > > > > > On 7/23/20, Michael Jones wrote: > > > ... > > &

[go-nuts] Generic symbol metaproposal

2020-07-22 Thread Michael Jones
One interesting fact of go is that semicolons are required at the end of statements. A fact forgotten perhaps because of the automatic ‘we’ll insert one for you’ process. This duality, required but auto-supplied in nearly every case is a delightful outcome. Another delight is the uppercase signal

Re: [go-nuts] Generics and parentheses

2020-07-22 Thread Michael Jones
So it seems! nothing substantive on the hard part. On Wed, Jul 22, 2020 at 5:02 PM Russ Cox wrote: > So it sounds like everyone is in favor of the entire generics proposal and > all the semantics, and all we have left to hammer out is the bracket > characters? Do I have that right? > > Best, >

Re: [go-nuts] Pointers to allocated memory objects?

2020-07-17 Thread Michael Jones
interior. https://blog.golang.org/ismmkeynote On Fri, Jul 17, 2020 at 7:57 PM joe mcguckin wrote: > Do pointers have to point to the beginning of a heap object or can they > point to the interior of the object? > > Thanks, > > Joe > > -- > You received this message because you are subscribed

Re: [go-nuts] the go archive size must be smaller?

2020-07-17 Thread Michael Jones
What are you asking for? 1. GZip to compress more completely? 2. Use of different compression tools? (Zstd?) 3. Go to output binaries that are more compression friendly? 4. The Go binaries to just be smaller? : If you are specific, you will get specific answers. On Fri, Jul 17, 2020 at 2:33 PM

Re: [go-nuts] Re: Generics and parentheses

2020-07-17 Thread Michael Jones
Jon, this is a special case where a "tr '«»' '[]'' is enough. On Fri, Jul 17, 2020 at 8:56 AM Jon Conradt wrote: > In the spirit of “show me, don’t tell me” and experience reports. How hard > would it be to release a beta which supports both [] and guillamets? We try > them. We see where we

Re: [go-nuts] Generics and parentheses

2020-07-15 Thread Michael Jones
nice. "gen" here is akin to the existing forward declaration of recursive inner functions. it says, "you are about to see something special and you need to know *this* about it." On Tue, Jul 14, 2020 at 11:06 PM Bakul Shah wrote: > I don't much like square brackets or angle brackets or

Re: [go-nuts] pure function on golang

2020-07-07 Thread Michael Jones
The standard math library is a natural, easy gateway; a simple preprocessor could do it. maybe i'll prototype it. On Tue, Jul 7, 2020 at 4:43 AM Brian Candler wrote: > On Tuesday, 7 July 2020 01:46:48 UTC+1, Kurniagusta Dwinto wrote: >> >> > i would value "pure" if it were a contract for early

Re: [go-nuts] pure function on golang

2020-07-06 Thread Michael Jones
i would value "pure" if it were a contract for early evaluation. in my post on this from 2018 (linked above), the reasoning was so that "x := math.Sin(0.23)" would be a compile-time event. On Mon, Jul 6, 2020 at 5:11 PM Kurniagusta Dwinto wrote: > > It's not obvious to me that "pure" is a

Re: [go-nuts] pure function on golang

2020-07-06 Thread Michael Jones
prior discussion: https://groups.google.com/forum/#!searchin/Golang-Nuts/pure$20functions/golang-nuts/ZVeMxBBVpa4/slidZL9KBAAJ On Mon, Jul 6, 2020 at 3:11 PM bugpowder wrote: > I'd guess the compiler could then enforce it (see if any non-pure marked > function is called from a pure one), it

Re: [go-nuts] Worker Pool vs. New Goroutine For Each Task

2020-07-03 Thread Michael Jones
If you change then will anything limit the peak degree of parallelism? The worker pool size is such a limiting factor. May be important for you. If so, plan another throttling mechanism. On Fri, Jul 3, 2020 at 7:03 AM Atakan Çolak wrote: > Hiya everyone, > > I have a simple processor function

Re: [go-nuts] Re: Speed up png.Decode

2020-06-27 Thread Michael Jones
An easy "comfort" exercise: save 1000 images to a directory in png form. decode with go and with several tools such as imagemagick compare times for format in jpeg, tiff, ... convert all images to that format; do the test above anew the result will be a comparison chart of Go existing image

Re: [go-nuts] Re: Why not use F in generic?

2020-06-24 Thread Michael Jones
Many (nearly all?) computer languages cater to English readers who have experience with certain noun/verb and noun/modifier ordering. Globally, “bird blue” and “pizza pepperoni” may be more common in other natural languages than blue bird and pepperoni pizza. The proposed order, “the T type

Re: [go-nuts] How I can translate this shell command to golang code?

2020-06-22 Thread Michael Jones
...@gmail.com> wrote: > Ciao, > > I had read this tutorial, but my mistake was not having called the shell > command > > Il giorno lunedì 22 giugno 2020 18:01:04 UTC+2, Michael Jones ha scritto: >> >> https://tutorialedge.net/golang/executing-system-commands-with

Re: [go-nuts] How I can translate this shell command to golang code?

2020-06-22 Thread Michael Jones
https://tutorialedge.net/golang/executing-system-commands-with-golang/ On Mon, Jun 22, 2020 at 8:54 AM Franco Marchesini < franco.marches...@gmail.com> wrote: > Help, > > how I can translate this shell command : > > echo -n 123456 | dmtxwrite -s 16x48 -o image.png > > to golang > >

Re: [go-nuts] [generics] Infer types on return

2020-06-19 Thread Michael Jones
> > > I'm wondering what fundamentally separates inference of arguments from > inference of returns, FWIW. Why is it a problem if we try to infer the > return-type when assigning to an interface, but not when we try to infer > the parameter-type when passing one? > The difference is the

Re: [go-nuts] Go has confusing pointers

2020-06-19 Thread Michael Jones
this says "increment the data c points at" not "increment the pointer" the function is returning an int instead of a Count On Fri, Jun 19, 2020 at 10:23 AM wrote: > Hi, > Please help me understand the below: > I got this from "The Zoo of Go Functions" > > type Count int > > func (c *Count)

[go-nuts] [generics] Thank you Go team

2020-06-18 Thread Michael Jones
I doubt this will help, but I have to try... Really smart and accomplished people have worked for a year to refine the generics approach--as the impressive updated design draft and the scholarly FeatherweightGo paper both demonstrate. The design is accompanied with tools to allow development and

Re: [go-nuts] function multiple returned values signature, compiler optimisation/feature question

2020-06-10 Thread Michael Jones
This is beyond most translation systems. Interestingly, the exceptions are themselves old in origin. The LISP compiler, emerging after interpretation was the universal environment for LISP, was able to “execute” the program being compiled to discover what could be evaluated to a static

Re: [go-nuts] Re: gzip.Reader.Read does not fill the given buffer

2020-06-10 Thread Michael Jones
Philosophically On Wed, Jun 10, 2020 at 11:26 AM Michael Jones wrote: > Philosophy, this is one of the Go library’s most beautiful designs. It > allows the one in charge—the program you write—to say what should happen, > while allowing everything subordinate to be guided on how it shou

Re: [go-nuts] Re: gzip.Reader.Read does not fill the given buffer

2020-06-10 Thread Michael Jones
Philosophy, this is one of the Go library’s most beautiful designs. It allows the one in charge—the program you write—to say what should happen, while allowing everything subordinate to be guided on how it should happen. This allows code to be adaptive to device optimal read sizes, network

Re: [go-nuts] Re: what is the complexity of regexp.MustCompile()?

2020-06-08 Thread Michael Jones
Ray, only the discussion is exponential. On Mon, Jun 8, 2020 at 4:23 PM 'Axel Wagner' via golang-nuts < golang-nuts@googlegroups.com> wrote: > On Tue, Jun 9, 2020 at 12:48 AM Kurtis Rader wrote: > >> You're talking past each other. Robert is talking about limiting the >> length of the regex,

Re: [go-nuts] Re: Preventing SIGBUS errors when memmove-ing an unsafe.Pointer to multiple destinations

2020-06-07 Thread Michael Jones
; function that calls typedmemmove, and its lifetime is more or less static. > So while the destination pointers go out of scope, the source one never > does. > > > On Sunday, June 7, 2020 at 4:45:40 PM UTC+3, Michael Jones wrote: >> >> Do you mean that you have a problem w

Re: [go-nuts] Re: Preventing SIGBUS errors when memmove-ing an unsafe.Pointer to multiple destinations

2020-06-07 Thread Michael Jones
Do you mean that you have a problem with the value of the pointer? That is "copying the pointer." This seems impossible. Attempting to access through a pointer copied via unsafe is (generally) inviting doom, and seems highly possible. The instant the last pointer to that data goes out of scope

Re: [go-nuts] What Go devs think about issues described by Daniel Lemire in article "The Go compiler needs to be smarter"?

2020-06-04 Thread Michael Jones
When he writes "you expect a good, optimizing compiler to..." he is implicitly stating that he wants more than good optimizing compilation, he wants (understandably, but let's be explicit) iterated compile-time evaluation -- he wants fun() to be an integer value of 60. It is true that the gc Go

Re: [go-nuts] x, err = some_func(); if err != nil { } seems awkward

2020-06-04 Thread Michael Jones
Before you get an avalanche of emails about "that is an old question, discussed in design documentation, mailing lists, and extension discussions over a decade", let me ask you to consider a concept that your comment implies. For that to work, it means that a function call either succeeds or

Re: [go-nuts] Re: what is the complexity of regexp.MustCompile()?

2020-06-03 Thread Michael Jones
If you have thousands of fixed strings, a map is your friend. Remarkably so. On Wed, Jun 3, 2020 at 2:43 PM Ray Pereda wrote: > Typo fix, regexp#MatchString and > related Match functions are linear. That is an amazing guarantee and makes > regular >

Re: [go-nuts] Re: Incorrect arithmetic answers

2020-06-01 Thread Michael Jones
fixed, in light of the prior crucial comment... https://play.golang.org/p/d-AwGEwj_YB On Mon, Jun 1, 2020 at 12:20 PM wrote: > Floating point calculations are imprecise. > > https://0.30004.com/ > >

Re: [go-nuts] Re: Is there a way to create a global variable inside go routine stack? so that i can access any time, without passing around between methods/functions. Crazy thought !!!..

2020-05-25 Thread Michael Jones
Variables are names associated with values, values that can *vary*, that is, can be changed. (Unlike constants, which are *constant* values.) In the beginning, all variables were global, and this was not good. Then came local variables, ones *local* to a function, which came and went as

Re: [go-nuts] Re: help understanding weird Benchmark results

2020-05-19 Thread Michael Jones
as was explained, the loop needs to be "for i:=0; i < b.N; i++" as was mentioned, the compiler's dead code elimination efforts can frustrate benchmarking. they way to make sure the test code survives is to not let it be dead code. for example // external var dummy func for i:=0; i < b.N; i++ {

Re: [go-nuts] Image Resize and Crop

2020-05-10 Thread Michael Jones
I have an extremely elaborate resizing library, but it is so complex it would not make sense as a standard tool for common uses. (Many convolution kernels, separate windows, forward and backward mapping, separable convolutions, upsampling first for Nyquist issues, strategy phase and then

Re: [go-nuts] Why I fear Go

2020-05-09 Thread Michael Jones
I have hired many people over the years, run companies, bought companies, and make VC investment decisions now, which are almost the same task. In every case there is the minimum qualification and the personal magic you bring above or outside that. The desire for "senior" means "skills and

Re: [go-nuts] getting values from memory addresses within another process...

2020-04-30 Thread Michael Jones
The general dangerous ability to do this is why protected mode went into the i368 and is the first and most essential promise to prevent of every OS other than MS DOS, original MacOS, and practically the threads in shared memory model of Smalltalk & MP Mathematica. On Thu, Apr 30, 2020 at 7:13 PM

Re: [go-nuts] Safe ways to call C with less overhead

2020-04-30 Thread Michael Jones
Function call intensity seems directly addressed by a tree or DAG like chain of command buffers, not necessarily a full scene graph (with logic and selection) but a call at the top and traverse tool to let you make just a few cgo transitions to c per frame. I’ve done this several ways myself

Re: [go-nuts] Why isn't there "number plus" postfix syntax for more than or equal?

2020-04-24 Thread Michael Jones
Hi “Anon”, A more serious answer (though just personal opinion) is that your idea lacks the “grammar” that it implies. Value Relationship Value “a >= 99” is a “sentence” or fragment in most computer languages. It is a logical assertion that is either true or false and can be composed into

Re: [go-nuts] Why isn't there "number plus" postfix syntax for more than or equal?

2020-04-23 Thread Michael Jones
You could extend the notation: If r 13+- { // if r is close to 13, in a handwavy sense : } On Thu, Apr 23, 2020 at 9:43 AM Ian Lance Taylor wrote: > On Thu, Apr 23, 2020 at 8:48 AM anon notmyfault64 > wrote: > > > > Many times outside programming we use "number plus" postfix syntax to >

Re: [go-nuts] Re: [ANN] Unik, a Go unikernel capable of running Gio GUI programs

2020-04-13 Thread Michael Jones
IBM VM/370 and much that followed is exactly this “VM is a hardware abstraction” line of reasoning. Logging into a user session was to “IPL a machine.” (Initial Program Load, imagine an IBM PC bios screen rushing by) On Mon, Apr 13, 2020 at 2:06 PM Brian Candler wrote: > On Monday, 13 April

Re: [go-nuts] Re: go run requires internet connection?

2020-04-09 Thread Michael Jones
Unable to reproduce the issue on MacOS Mojave 10.14.6, though I tried with gusto. On Thu, Apr 9, 2020 at 4:32 AM Tanmay Das wrote: > Thanks, everyone for your valuable comments. I think Brain is right. It > might be an OS-related issue. I really like how active this group is. I > look forward

Re: [go-nuts] Bencharking issue with b.StartTimer and b.StopTimer. Was: Benchmark using b.StopTimer and b.StartTimer has unexpected behaviour - to me at least

2020-03-24 Thread Michael Jones
yes On Tue, Mar 24, 2020 at 11:48 AM Orson Cart wrote: > On Tuesday, 24 March 2020 18:31:29 UTC, Michael Jones wrote: >> >> You use them to stop the time charged against your benchmark. >> >> For example: >> >> bench: >> stop timer >>

Re: [go-nuts] Bencharking issue with b.StartTimer and b.StopTimer. Was: Benchmark using b.StopTimer and b.StartTimer has unexpected behaviour - to me at least

2020-03-24 Thread Michael Jones
You use them to stop the time charged against your benchmark. For example: bench: stop timer generate initial data start timer do test On Tue, Mar 24, 2020 at 10:47 AM Orson Cart wrote: > > On Tuesday, 24 March 2020 16:49:55 UTC, Robert Engels wrote: >> >> Can you please succinctly

Re: [go-nuts] Re: Mem-Leak in Go method

2020-03-13 Thread Michael Jones
if the allocation feels small to th GC the urgency to > free it will be low. You need to loop in allocating and see if the memory > grows and grows. > > >> Yes, got it.I will try using the latest version of Go and check the > behavior. > > Thanks, > Nitish > &g

Re: [go-nuts] Re: Mem-Leak in Go method

2020-03-12 Thread Michael Jones
That code looks wrong. I see the end but not the start. Look here and copy carefully: https://golang.org/pkg/runtime/pprof/ Call at end, on way out. Also, as shared by others above, there are no promises about how soon the dead allocations go away, The speed gets faster and faster version to

Re: [go-nuts] Re: An important proposal will fail without your support

2020-03-10 Thread Michael Jones
I wrote some very efficient math software in Go. To accomplish my goals, I used make and awk programs that generate assembly code tuned to the exact demands of command line make configuration. Then it builds in go, then runs. This is not mainstream, but has worked well since Go 1.0. It never

Re: [go-nuts] How to handle EINTR from syscall.Dup2

2020-03-01 Thread Michael Jones
...and if true, this notion of “it’s atomic unless it’s not” deserves a name: the “subatomic operation.” On Sun, Mar 1, 2020 at 6:56 AM Ian Lance Taylor wrote: > On Sat, Feb 29, 2020 at 9:45 PM Philip Boampong > wrote: > > > > > And dup2 is not documented to return EINTR > > > > Yes, it is. In

Re: [go-nuts] Re: Lot's of test errors in package zmq4 with Go version 1.14, no errors with earlier versions

2020-02-26 Thread Michael Jones
gt; “unix” os an interrupt is a very rare condition and so they treat it as an > error. If you issue interrupts continually you are creating an unexpected > context. > > > On Feb 26, 2020, at 8:39 PM, Ian Lance Taylor wrote: > > > > On Wed, Feb 26, 2020 at 5:51 PM Michael

Re: [go-nuts] Re: Lot's of test errors in package zmq4 with Go version 1.14, no errors with earlier versions

2020-02-26 Thread Michael Jones
Sorry...I meant the go system signal interface could loop if desired. (Not recommending, just saying that panicky people could be coddled if desired) On Wed, Feb 26, 2020 at 5:48 PM Ian Lance Taylor wrote: > On Wed, Feb 26, 2020 at 5:42 PM Michael Jones > wrote: > > > > There

Re: [go-nuts] Re: Lot's of test errors in package zmq4 with Go version 1.14, no errors with earlier versions

2020-02-26 Thread Michael Jones
There is the BSD notion of sa_restart, a convenience to loop for the caller as appropriate. https://www.freebsd.org/cgi/man.cgi?query=sigaction Go could adopt such a notion if desired. On Wed, Feb 26, 2020 at 5:14 PM Ian Lance Taylor wrote: > On Wed, Feb 26, 2020 at 9:11 AM Manlio Perillo >

Re: [go-nuts] Fuchsia Programming Language Policy

2020-02-25 Thread Michael Jones
Actually, you should read the whole note -- it's fun. Half of the languages are bad because of memory leaks, the other half are bad because of having GC; half are bad because of difficult asynchronism, the other half are bad because of having a runtime. etc. It reads like an imperiously-worded

Re: [go-nuts] Go without garbage collector

2020-02-12 Thread Michael Jones
To me it seems the issue of concurrency and dynamic ownership of memory are so deeply connected to Go’s programming methodology that the “no GC” comparison is biased. In particular, coding to do it yourself but as perfectly as the GC across many concurrent routines is hard. Doing it better than

Re: [go-nuts] Re: keep just 2 decimal places in a float64

2020-02-01 Thread Michael Jones
forgot the code...final test is what generates the report above. float128.go: https://play.golang.org/p/2MzjllLC3qT float128_test.go: https://play.golang.org/p/ZQwsFh0_Apt On Sat, Feb 1, 2020 at 7:32 PM Michael Jones wrote: > As promised, some careful results from one of the tests in

Re: [go-nuts] Re: keep just 2 decimal places in a float64

2020-02-01 Thread Michael Jones
As promised, some careful results from one of the tests in my doubled-precision library. Rows are iteration's of Jean-Michel Muller's roundoff-intolerant Œ() function: http://perso.ens-lyon.fr/jean-michel.muller/ Columns are 32-bit floating point,64-bit floating point, my fast 128-bit library,

Re: [go-nuts] Re: keep just 2 decimal places in a float64

2020-02-01 Thread Michael Jones
/ > > On Sunday, January 26, 2020 at 8:46:16 AM UTC-8, Robert Engels wrote: >> >> Which is exactly what github.com/robaho/fixed and many others do! >> >> On Jan 26, 2020, at 10:34 AM, Michael Jones wrote: >> >> ...thus the virtue of scaled integers. scaling

Re: [go-nuts] Go Tool to convert svg to png/jpg

2020-01-31 Thread Michael Jones
Just to be clear: PNG is a description of pixel values comprising an image (RGBa, RGBa, RGBa, ...), SVG is a program for creating an image (set color to blue, draw a circle, change to red, draw a line, ...). Going from SVG (scalable vector graphics) to pixels is to render an image by executing the

Re: [go-nuts] Why is go too slow?

2020-01-29 Thread Michael Jones
Following up on this, consider how long it actually takes to compute F(40) in the normal iterative way, single threaded -- this is the natural amount of work under discussion. iterative: BenchmarkFibonacci40-36 5197482821.9 ns/op 0 B/op 0 allocs/op 22 nanoseconds, about a

Re: [go-nuts] Re: Go mindshare is low & ~flat, per Google Trends

2020-01-27 Thread Michael Jones
Python, to its credit, has the nice inclusive property of extensible interpreters of being friendly to "hang things" onto just like ornaments on trees. By linking with C/C++-libraries and adding glue/shim code, anything can be used from Python. This facility and interpretive execution (as Eric

Re: [go-nuts] Re: keep just 2 decimal places in a float64

2020-01-26 Thread Michael Jones
...thus the virtue of scaled integers. scaling by 100 makes cents whole, scaling by 1*100 gives four decimal places beyond that. There is nothing bad about floating point despite the reputation, it's just not the number system from algebra; nor is binary floating point the same as decimal

Re: [go-nuts] Re: How to convert time interval in days to human readable form?

2020-01-24 Thread Michael Jones
well, if you have the start and end dates (sy/sm/sd, ey/em/ed), then you can do it directly. the number of complete years is ey-sy+1 if em>sm or em==sm && ed>=sd, one less otherwise (i think this captures the edge conditions correctly) same for months (irrespective of the number of days in

Re: [go-nuts] Re: Go mindshare is low & ~flat, per Google Trends

2020-01-16 Thread Michael Jones
How global mindshare develops is something that I know quite a bit about through leadership and engineering experience in multiple billion user projects. One key lesson for me was that you reach a point where the audience you originally wanted to serve (or refocused to serve) has been served.

Re: [go-nuts] Quantum mechanics mindshare is low & ~flat, per Google Trends

2020-01-15 Thread Michael Jones
 On Wed, Jan 15, 2020 at 1:49 PM Dan Kortschak wrote: > Google Trends graph showing past 5y of Mechanic, Quantum mechanics > > > https://trends.google.com/trends/explore?date=today%205-y=%2Fm%2F03f_s3,%2Fm%2F069dx > > -- > You received this message because you are subscribed to the Google

Re: [go-nuts] distributed runtime

2020-01-03 Thread Michael Jones
Go is a shared memory system. Your challenge would be to understand a pointer that came to you from a different machine (i.e., remotely, the R in RPC). On Fri, Jan 3, 2020 at 2:31 PM wrote: > Hi all and Happy New Year, > > I was daydreaming the other day and I was wondering if it was possible

Re: [go-nuts] Simple worker pool in golnag

2019-12-28 Thread Michael Jones
I often choose worker pools when there is working storage to be allocated as part of the work to be done. This way means that such data and processing structures are naturally built and torn down right there before and after the work-channel loop in the worker, with no repeated allocations during

Re: [go-nuts] cgo & long jump

2019-12-09 Thread Michael Jones
The longjmp() facility is a wild, dangerous, improper, and popular mechanism. It's premise is that the app can go back in time, like you waking up last week with no knowledge of what happened since then. If you can follow that analogy, then imagine your surprise when external things you did last

Re: [go-nuts] Re: Why Iran is banned by Google?

2019-12-09 Thread Michael Jones
Hello parisaparvizi1994, Your frustration feels natural and understandable to me. Jan just answered you clearly, but since my words did not help, I'm thinking to try again. Maybe I can do better this time. First though, I must be clear that *I no longer speak for Google*--well, at least not

Re: [go-nuts] Re: Where is the middle of Brazil?

2019-12-07 Thread Michael Jones
...now *this* is something that I know a great deal about (resulting in label placement in Google Maps and Google Earth, discussions with colleagues in USGS, the US Census Bureau, DoD, the United Nations GGIM experts group, UK Ordnance Survey, Survey of India, etc.) Indeed most of the issues

Re: [go-nuts] Inconsistent rounding with float printf ?

2019-12-06 Thread Michael Jones
Agree with Ian. Solutions are: change expectations, use decimal floating point, or use a base-independent decimal representation. The latter implies scaled integers. Quick, ugly, and typed on one hand from bed, but here it is: https://play.golang.org/p/fBztRY6qHP0 999000/1000 = 999.0

Re: [go-nuts] CGO - Passing pointer to C

2019-12-04 Thread Michael Jones
Speaking for the Rick Hudson Fan Club, thank you for your wonderful, amazing work on the Go GC... https://blog.golang.org/ismmkeynote ...and for this reminder that we don't want programming practice to preclude continuing innovations. On Wed, Dec 4, 2019 at 9:52 AM Rick Hudson wrote: >

Re: [go-nuts] atomic.Add*() doesn't produce unique values

2019-12-01 Thread Michael Jones
not that it could > happen - but for completeness of the robust test) > > On Dec 1, 2019, at 10:44 PM, Michael Jones > wrote: > > not necessary as the testing and updating is only done in one place by one > the main goroutine. > > On Sun, Dec 1, 2019 at 7:46 PM Robert Engels > w

Re: [go-nuts] atomic.Add*() doesn't produce unique values

2019-12-01 Thread Michael Jones
"Oh you've allocated a bit array for every value in the test range, then checked for gaps in it?" Yes. What I should have said. (Though the test looks not for gaps but for two pigeons in one hole, but the same idea.) On Sun, Dec 1, 2019 at 8:44 PM Michael Jones wrote: >

Re: [go-nuts] atomic.Add*() doesn't produce unique values

2019-12-01 Thread Michael Jones
Liam wrote: > >  > Oh you've allocated a bit array for every value in the test range, then > checked for gaps in it? > > On Sunday, December 1, 2019 at 2:21:55 PM UTC-8, Michael Jones wrote: >> >> Oh! That's just a bit per integer in the test range 0..total-1. Since Go &g

Re: [go-nuts] atomic.Add*() doesn't produce unique values

2019-12-01 Thread Michael Jones
> > On Dec 1, 2019, at 4:21 PM, Michael Jones wrote: > > Oh! That's just a bit per integer in the test range 0..total-1. Since Go > (and everything else) lacks a bit type, I just type such code > automatically. Bytes hold 8 bits. Array size must be rounded up, so > > a := m

Re: [go-nuts] atomic.Add*() doesn't produce unique values

2019-12-01 Thread Michael Jones
e to > understand your collision detector. Could you explain this bit? > > for _, v := range a { > mask := byte(1 << (v & (8 - 1))) > index := v >> 3 > > if tally[index] != 0 { ... } > ... > } > > On Saturday, November 30, 2019 at 5:33:50 PM UTC-

Re: [go-nuts] Where is the middle of Brazil?

2019-11-30 Thread Michael Jones
at 5:48 PM andrey mirtchovski wrote: > i think JuciÊ wants us to crack the md5. i'm fresh off a CTF > competition so i don't have any more resources to throw at warming the > universe and increasing entropy, unfortunately... > > On Sat, Nov 30, 2019 at 6:43 PM Michael Jones >

Re: [go-nuts] Where is the middle of Brazil?

2019-11-30 Thread Michael Jones
My answer is this place . 14°35'03.5"S 53°03'51.3"W -14.584305, -53.064239 Not an official national answer, just my own. (That

Re: [go-nuts] atomic.Add*() doesn't produce unique values

2019-11-30 Thread Michael Jones
ingers cycles is fantastic progress! On Sat, Nov 30, 2019 at 3:38 PM Michael Jones wrote: > Liam, > > I just wrote a little stress test program for you. Maybe it will make you > less stressed. ;-) > https://play.golang.org/p/5_7Geyczd1V > > 4 CPU 2016 MacBook Pro: > > *celes

Re: [go-nuts] C variadic macro equivalent in Golang?

2019-11-30 Thread Michael Jones
You might refer to... https://blog.learngoprogramming.com/golang-variadic-funcs-how-to-patterns-369408f19085 ...to better appreciate Robert's advice. As he suggested, a variadic Go function accepting a slice of the special, magic "empty interface" type ("interface{}") can indeed do anything. The

Re: [go-nuts] atomic.Add*() doesn't produce unique values

2019-11-30 Thread Michael Jones
Liam, I just wrote a little stress test program for you. Maybe it will make you less stressed. ;-) https://play.golang.org/p/5_7Geyczd1V 4 CPU 2016 MacBook Pro: *celeste:atom mtj$ go run main.go* *32 concurrent workers* *128 batches of 1048576 atomic increments, 134217728 total increments*

Re: [go-nuts] Change slice type

2019-11-27 Thread Michael Jones
The general rule -- if there can be a general rule for risk behavior -- is that CPUs like having addresses aligned on an integer multiple of the data element size. So: access-as-byte data may be on any address (address&(1-1)==0), access as 2-byte data on a multiple of two address

Re: [go-nuts] golang multiple go routines reading from a channel and performance implications

2019-11-21 Thread Michael Jones
Agree. Essentially I'm saying the "channel aspect" is not an issue. On Thu, Nov 21, 2019 at 12:12 PM Robert Engels wrote: > He stated "each request takes 2 secs to process" - what's involved in that > is the important aspect imo. > > -----Original Message- &

Re: [go-nuts] golang multiple go routines reading from a channel and performance implications

2019-11-21 Thread Michael Jones
In my (past) benchmarking, I got ~3M channel send/receive operations per second on my MacBook Pro. It is faster on faster computers. 2k requests/src is much less than 3M, clearly, and the 1/1000 duty cycle suggests that you'll have 99.9% non-overhead to do your processing. This is back of the

Re: [go-nuts] pprof cpu profile doesn't write sample to file

2019-11-14 Thread Michael Jones
If your program is endless, then you'll need to have a timer that says "it's been long enough, write the profile now" On Thu, Nov 14, 2019 at 9:35 AM bln prasad wrote: > My applications main starts few go routines and runs indefinitely. its > like pprof.StopCPUProfile() may never get called. >

Re: [go-nuts] strict type assignability to prevent arbitrary values

2019-11-08 Thread Michael Jones
...job for a getter function. On Fri, Nov 8, 2019 at 9:31 AM Jake Montgomery wrote: > The inability to have a type safe enum in Go has bothered me as well. > > While using a struct, as Peter suggests, does prevent accidental use of > literals, it also prevents you from making your enum items

Re: [go-nuts] Preprocessing "go" statements with preserved semantics

2019-11-08 Thread Michael Jones
e of 1 the variable will get a > concrete type of int, while fn may accept a float32, or even a private type > that cannot be named in the current package. > > On Friday, November 8, 2019 at 5:51:10 PM UTC+1, Michael Jones wrote: >> >> If expr was evaluable in the original code

Re: [go-nuts] Preprocessing "go" statements with preserved semantics

2019-11-08 Thread Michael Jones
If expr was evaluable in the original code then why not rewrite in place after assigning temporaries? go fn(e1,e2) { t1,t2 := e1,e2 go func() { defer instrument() fn(t1,t2) } On Fri, Nov 8, 2019 at 8:38 AM André Eriksson wrote: > I am working on a type of Go preprocessor that rewrites

Re: [go-nuts] Channels may not be the best solution in Go

2019-10-04 Thread Michael Jones
Travis, glad to hear that you are exploring Harshad Numbers. It is an area where I have done more than a decade of work and I did not know that anyone else even cared about them. If you ever want to know how many thousand digit (or whatever) base 10 (or whatever) numbers have the Harshad property,

Re: [go-nuts] Code for Phi = arctan(y/x) + psi, psi = 0 or pi

2019-09-13 Thread Michael Jones
https://golang.org/pkg/math/#Atan2 On Fri, Sep 13, 2019 at 5:40 AM SATEESH KANDUKURI < p20170...@hyderabad.bits-pilani.ac.in> wrote: > Can anyone help me to write the code for Phi = arctan(y/x) + psi, psi = 0 > or pi and (x, y) are the spatial coordinates in the film plane with the > origin at

Re: [go-nuts] By passing go type check when performing bitwise operator

2019-09-01 Thread Michael Jones
Int(uint(a) >> uint(b)) Is always ok, costs nothing, not a type safety issue. On Sun, Sep 1, 2019 at 11:56 AM Steven Hartland wrote: > This has been changed in the upcoming 1.13 release, so you might want to > try the latest release candidate. > > > On 01/09/2019 19:03, Albert Tedja wrote: > >

Re: [go-nuts] sync.Mutex encounter large performance drop when goroutine contention more than 3400

2019-08-26 Thread Michael Jones
This is a perennial issue. We all want to know and understand; it is the sign of true intellect to feel a need to own the details. It is also true that measuring “out of context” is literally to measure something different and often that difference is bigger than the measurement. It can be very

[go-nuts] Re: [Go tool capable of hiding any file within an image.

2019-08-04 Thread Michael Jones
Thank you for sharing this. On Fri, Aug 2, 2019 at 11:45 AM Dimitar Petrov wrote: > Okay, thanks for clarification! > > петък, 2 август 2019 г., 21:42:23 UTC+3, Bryan C. Mills написа: >> >> This list is for discussion of the development of the Go project. >> >> For announcements of third-party

Re: [go-nuts] prevent alteration of binaries once distributed in the wild?

2019-07-23 Thread Michael Jones
One more thought ... just to expand your thinking beyond the excellent responses already given, is to rephrase the goal as "how do I prevent a modified binary (executable) from causing problems?" This is a weaker goal but can in some contexts be more manageable. I can't share full details, but

Re: [go-nuts] P-local/M-local storage for goroutines?

2019-07-23 Thread Michael Jones
The simple, common way--if I understand you need correctly--is to launch a method goroutine. type CacheManager struct { // things a worker needs to know, such as the global cache, the specific worker's local cache, etc. } func master() { for i := 0; i < workers; i++ { m := new(CacheManager)

Re: [go-nuts] Windows vs Linux ReadString

2019-07-20 Thread Michael Jones
show some code. On Sat, Jul 20, 2019 at 6:15 PM Allan Edwards wrote: > Wow, thanks for responding guys. So I ran my exe on linux without goland > and bam the readstring blocked as needed. For some reason the ReadString > call is not blocking inside of goland. It seems like a great IDE but I

Re: [go-nuts] Does reducing capacity of a slice return memory?

2019-07-19 Thread Michael Jones
e in a doggy > bag, sorry. > > A. > > On Friday, July 19, 2019 at 1:08:51 PM UTC-6, Michael Jones wrote: >> >> There is a difference in the meanings of terms in this discussion, maybe >> that’s confusing to some. (That is, Ian went right to the heart of the >> matter but maybe

  1   2   3   4   5   6   >