Re: [go-nuts] Reordering of reads and writes within a goroutine

2017-09-07 Thread Michael Jones
Is it fair to say that this question is a little bit like the fate of Schrödinger's cat? You can't tell when any variable has been set (or perhaps messed up) until you access the variable and that is just that act that causes its multiple possible "messed-up" states to collapse to the right value.

Re: [go-nuts] Re: Splitting CamelCaseWords in Go

2017-09-06 Thread Michael Jones
e: > > Almost, https://play.golang.org/p/6Zl_EKqFqT > But thanks a lot! It's significantly shorter/better than my initial > version. > > On Tue, Sep 5, 2017 at 6:18 PM, Michael Jones > wrote: > >> Like this? >> >> https://play.golang.org/p/OIE8jdWVGB >>

Re: [go-nuts] Re: error handling needs syntactical sugar

2017-09-05 Thread Michael Jones
...Go is not perfect. But there is subtle magic in this error business. Developers should look closely at errors. Imagine handling them as if you were a doctor and the error was a child's symptom or a test result. Choices: 1. Ask them how they feel, ignore it. Do a test, ignore it. Effectively you

Re: [go-nuts] Re: Splitting CamelCaseWords in Go

2017-09-05 Thread Michael Jones
Like this? https://play.golang.org/p/OIE8jdWVGB On Tue, Sep 5, 2017 at 12:33 PM, Tong Sun wrote: > > I'll be religiously avoiding "*unicode.IsUpper*()" as something mystery > happened in the past: > https://groups.google.com/d/msg/golang-nuts/714WQs85H3w/KEqKgmAqAAAJ > > BTW, *for my case*, I d

[go-nuts] Re: Bytconv where art thou

2017-09-01 Thread Michael Jones
you know when it' is avalable. > > Peter > > On Friday, September 1, 2017 at 3:50:29 AM UTC-4, Sebastien Binet wrote: >> >> Hi, >> >> I'd also be very interested in looking at 'bytconv'. And most probably >> should use it in ange

Re: [go-nuts] Why isn't golang input and output is buffered?

2017-08-31 Thread Michael Jones
By the way, if we're willing to do it all...we can take it down a little more: https://play.golang.org/p/DNxQT01vy9 read 100 26.174853ms sort 100 180.17782ms On Thu, Aug 31, 2017 at 11:28 AM, Michael Jones wrote: > Nice! Is "bytconv" shared somewhere? > > On Th

Re: [go-nuts] Why isn't golang input and output is buffered?

2017-08-31 Thread Michael Jones
bytconv instead of strconv. >> >> bytconv: >> read 100 98.517584ms >> sort 100 481.994354ms >> >> strconv: >> read 100 174.720883ms >> sort 100 479.437831ms >> >> bytconv is the missing Go standard library package. bytconv i

Re: [go-nuts] Why isn't golang input and output is buffered?

2017-08-30 Thread Michael Jones
olang.org/p/tMyipz6sYU > 954.543351ms > 166.710399ms > > So this is about 6 times slower. My guess is this is due to the use of > reflection in fmt.Fscanf. But that is just a guess; I don't really have any > evidence to back it up. > > On Wed, Aug 30, 2017 at 1:33 P

Re: [go-nuts] Why isn't golang input and output is buffered?

2017-08-30 Thread Michael Jones
This can be much simpler... https://play.golang.org/p/tMyipz6sYU On Wed, Aug 30, 2017 at 7:55 AM, Nilsocket wrote: > > Can you provide example code for how you read the input? >> > > Both of them were given same input size is:100, (i.e., 1 million) > > https://play.golang.org/p/grB-muK7hw >

Re: [go-nuts] math/big

2017-08-28 Thread Michael Jones
oops! that's actually a**1024 ...was rushing and typed the Printf legend too quickly. On Mon, Aug 28, 2017 at 5:14 PM, Michael Jones wrote: > I use it frequently / constantly / 24/7 :-) > > it's purpose is to enable integer, rational, and real arithmetic at chosen > preci

Re: [go-nuts] math/big

2017-08-28 Thread Michael Jones
I use it frequently / constantly / 24/7 :-) it's purpose is to enable integer, rational, and real arithmetic at chosen precisions greater than the hardware's native CPU arithmetic. One property of such thousand or million digit numbers is that they cannot be moved around the way '5' and '3' are i

Re: [go-nuts] Gathering Ideas for Go 2.

2017-08-21 Thread Michael Jones
I don't think it's about language. I got downvotes immediately for my comments over the weekend. https://github.com/golang/go/issues/19623 Whatever the circumstances, any proposal will often have its detractors as the most immediate and vocal responders. Support may come later. Agree that openmin

Re: [go-nuts] multiply and divide

2017-08-19 Thread Michael Jones
Jimmy, thank you for the tip! i went there and added my modest suggestions to the proposal. https://github.com/golang/go/issues/19623 Tamás, you make a very important point. It is one that GRI did a very good job of in big.Float. The question of how to specify precision for variable-precision floa

Re: [go-nuts] multiply and divide

2017-08-19 Thread Michael Jones
I would REALLY like to see big types as normal declarations and syntax. The SSA framework seems suitable to automatically manage the temporaries. On Sat, Aug 19, 2017 at 7:14 AM, roger peppe wrote: > Constructive reals in Go, anyone? :-) > > On 18 Aug 2017 17:50, "Michael

Re: [go-nuts] multiply and divide

2017-08-18 Thread Michael Jones
John Souvestre - New Orleans LA > > > > *From:* golang-nuts@googlegroups.com [mailto:golang-nuts@googlegroups.com] > *On Behalf Of *Michael Jones > *Sent:* 2017 August 18, Fri 11:50 > *To:* golang-nuts > *Subject:* [go-nuts] multiply and divide > > > > Here is a minor musing f

[go-nuts] multiply and divide

2017-08-18 Thread Michael Jones
Here is a minor musing from something that came up yesterday. Sometimes we see a real number expression as simple as... x*y/z ...and knowing from basic algebra that... (x*y)/z == x*(y/z) ...we might not expect much difference between the two in our code. Alas, computer floating point does no

Re: [go-nuts] Go channels overused and hyped?

2017-08-18 Thread Michael Jones
yes... everything is good for what it is designed for and less-good for what it is not designed for. mutex-protected counters are good channels for data communication are good neither is a perfect stand in for the other. nothin wrong with channels. On Fri, Aug 18, 2017 at 4:38 AM, Tamás Gulácsi

Re: [go-nuts] Go ordered map

2017-08-15 Thread Michael Jones
As a curiosity, is an ordered map really a hashtable or is it a different kind of self-organizing search structure? I would look to LLRB trees if order is an issue... (do a Google search for "Sedgewick LLRB") or start here: https://www.cs.princeton.edu/~rs/talks/LLRB/RedBlack.pdf On Tue, Aug 15,

Re: [go-nuts] Go channels overused and hyped?

2017-08-12 Thread Michael Jones
snmed, My disappointment with that blog post is that it does not address the larger issue, which some people here have clarified, but to be clear on the larger issue and the various points raised about channels: SMALL BENCHMARKS ARE HARD Benchmarking is harder than it seems, because computers si

Re: [go-nuts] A humble request/challenge

2017-08-08 Thread Michael Jones
I remember a segmented wheel of Aitkin implementation. Maybe you can start with that. here are a few: https://golanglibs.com/top?q=sieve On Tue, Aug 8, 2017 at 3:31 PM, Pierpaolo Bernardi wrote: > Hello, > > > Here's a link to read and download the paper: > > > > https://www.scribd.com/doc/228

Re: [go-nuts] [ANN] Edit - Acme command language

2017-08-08 Thread Michael Jones
The Four Horsemen of the Apocalypse, surely! It would be tempting fate to shade them or step on their brand. On Tue, Aug 8, 2017 at 5:54 AM, wrote: > Thanks for suggesting the Reader(q0, q1 int64) io.RuneReader. I > accidentally replied off list. > > I wasn't aware of up to four horsemen being i

Re: [go-nuts] Repository of self-contained functions

2017-08-07 Thread Michael Jones
i have the same. Like HAKMEM, just not as smart. On Mon, Aug 7, 2017 at 8:22 AM, Shawn Milochik wrote: > I like *idea* of that idea, but I suspect that the implementation > wouldn't work out. > > As the Go Proverb says: "A little copying is better than a little > dependency." > > I have a simila

Re: [go-nuts] Re: How to optimize as with -O2 from Gcc? (50x speedup)

2017-08-05 Thread Michael Jones
Great. Hope it helps. I had a typo in power 0 (which is never called. Change the return to 1.0. On Sat, Aug 5, 2017 at 6:50 PM wrote: > Thanks, Michael. > > I've created a tiny project with those files here: > https://github.com/cpmech/go-fast-math-experiments > > The output of go test -run=XXX

Re: [go-nuts] Re: How to optimize as with -O2 from Gcc? (50x speedup)

2017-08-04 Thread Michael Jones
Dorival, There is a great deal to learn from this issue. Some interesting issues: Exponentiation by arbitrary real or complex powers is a little complicated to evaluate quickly with accuracy. Other than special cases, you're forced toward x**y ==> Exp(y*Log(x)), where each of Exp() and Log() are

Re: [go-nuts] Computations with complex numbers may be slow if care is not taken

2017-08-03 Thread Michael Jones
the complex power function is a difficult (time consuming) general computation. are you saying that you actually have a program that uses boolean gaussian integers and needs to do lots of power operations? if so, i highly recommend that you special case this for your own use. if this is common t

Re: [go-nuts] Re: GO Vs D

2017-08-02 Thread Michael Jones
t;right" I mean the simplest tool which gets you the right result. > > Fortunately, that doesn't happen all the time, but sometimes Go doesn't > give gou that simplest tool, and in that case I severely regret I wasn't > trusted enough so that they let me choose tha

Re: [go-nuts] Re: GO Vs D

2017-08-02 Thread Michael Jones
I've often found it helpful to consider extreme limit cases. In solo/school/hobby programming, you code and test more than you debug and you understand intent implicitly because you are coding it as you go. As a professional at work, as part of a team, in a code review regime, using third-party li

Re: [go-nuts] Re: No Allman-Style, No go!

2017-07-29 Thread Michael Jones
I understand you now. On Sat, Jul 29, 2017 at 10:36 AM wrote: > Sorry to repeat myself, but I think I wasn't clear enough, as many people > on this forum still don't understand my point at all. > > Google, as ANY company, MUST force its employees to use exactly the same > standards. > > I've don

Re: [go-nuts] Re: No Allman-Style, No go!

2017-07-27 Thread Michael Jones
Ecstatic, based on what you said here (*"some people will never be forced to change"* and *"because Google engineers have decided"*), I believe there are a few ideas you may profitably consider about the formatting topic--ideas that you probably have not yet considered and which may ease your conce

Re: [go-nuts] Math on Huge (2GB) numbers in GoLang

2017-07-25 Thread Michael Jones
The nat->string code allows any base -- or at least it did -- but it was not exposed in the Int APIs. Maybe you'll want to access the sources. On Sun, Jul 23, 2017 at 8:34 PM, me wrote: > > > On Saturday, July 22, 2017 at 9:37:16 AM UTC-6, Rémy Oudompheng wrote: >> >> >> The most annoying issue

Re: [go-nuts] Re: Bitwise operators applications

2017-07-22 Thread Michael Jones
...and...because that is how computers work so the understanding will itself be interesting and useful. It can be nice to see how things work "under the hood." On Sat, Jul 22, 2017 at 9:40 PM, Egon wrote: > Generally when you ask that question you probably won't need to use them. > > The main re

Re: [go-nuts] Math on Huge (2GB) numbers in GoLang

2017-07-22 Thread Michael Jones
Oh no! I wrote some of that code. Maybe I should revisit. On Sat, Jul 22, 2017 at 10:54 AM Hugh S. Myers wrote: > Ah! Excellent solution. I wrote one of the early multiple precision > packages for the C users group in the 80's and I typically wrote in C > first, then disassembled and reduced the

Re: [go-nuts] Re: Going places

2017-07-21 Thread Michael Jones
, July 21, 2017 at 12:03:03 PM UTC-4, Michael Jones wrote: >> >> Maybe not news, and certainly not big news, but I just filed a patent >> that uses Go source code to illustrate logical methods claimed in the >> invention. So if it was not already the case, Go has now been u

[go-nuts] Going places

2017-07-21 Thread Michael Jones
Maybe not news, and certainly not big news, but I just filed a patent that uses Go source code to illustrate logical methods claimed in the invention. So if it was not already the case, Go has now been used in patent filings. -- Michael T. Jones michael.jo...@gmail.com -- You received this mess

Re: [go-nuts] Re: Can't explain Golang benchmarks

2017-07-17 Thread Michael Jones
I get about 3 million channel send/receive pairs per second. If you actually do work inbeteeen (database access, computation, etc.) the limit is difficult to reach. On Mon, Jul 17, 2017 at 10:22 AM Jesper Louis Andersen < jesper.louis.ander...@gmail.com> wrote: > Your benchmarks are not really *d

Re: [go-nuts] Re: gofmt question

2017-06-30 Thread Michael Jones
Find a way to use comments for your ""big space" On Fri, Jun 30, 2017 at 8:12 PM wrote: > I have a few such bug bears, so, my trick is to 'fix' fmt's helpful > services when I check a file out, and only run fmt automatically when the > file is committed to the repository. > > This keeps my fugly

Re: [go-nuts] Writing an ethernet frame into the OS

2017-06-17 Thread Michael Jones
using the io.ReadWriter (Read() would take all > the time) , so the problem is, this library > cannot be used for duplex communications: if you use the Read() method, > then you will not be able to do Write(), because the read will not allow > the frame > to go into the interface normal

Re: [go-nuts] Writing an ethernet frame into the OS

2017-06-17 Thread Michael Jones
FYI: https://godoc.org/github.com/google/gopacket On Sat, Jun 17, 2017 at 9:00 AM, Michael Jones wrote: > Sorry to say that I don't have a direct answer for you. > > However, I happen to be doing some packet analysis at the moment--focused > first in the analysis part--and have

Re: [go-nuts] Writing an ethernet frame into the OS

2017-06-17 Thread Michael Jones
Sorry to say that I don't have a direct answer for you. However, I happen to be doing some packet analysis at the moment--focused first in the analysis part--and have recently started looking for helpful frameworks/libraries into which my code can be embedded. What I found so far is: https://gith

[go-nuts] interesting potential go event talk

2017-06-11 Thread Michael Jones
Atom: Horizontally Scaling Strong Anonymity "To evaluate Atom, *we implemented an Atom prototype* *in Go*, and tested it on a network of 1,024 Amazon EC2 machines. Our result shows that Atom can support more than one million users sending microblogging messages with 28 minutes of latency. using 1,

Re: [go-nuts] Re: Guidance on exposing functionality

2017-06-06 Thread Michael Jones
sometimes you can write the simple one in terms of the advanced one. when you can do that, it makes them better and also educational. On Tue, Jun 6, 2017 at 7:09 PM, peterGo wrote: > M2, > > The Go strconv package (https://golang.org/pkg/strconv/) contains the > simple forms Atoi and Itoa and th

Re: [go-nuts] negative unsigned value?

2017-05-22 Thread Michael Jones
...as always, a pragmatic and informed response. Thanks. On Mon, May 22, 2017 at 5:59 PM, Ian Lance Taylor wrote: > On Mon, May 22, 2017 at 5:49 PM, Michael Jones > wrote: > > > > On Mon, May 22, 2017 at 5:19 PM, Ian Lance Taylor > wrote: > >> > >> Rej

Re: [go-nuts] negative unsigned value?

2017-05-22 Thread Michael Jones
On Mon, May 22, 2017 at 5:19 PM, Ian Lance Taylor wrote: > Rejecting an unsigned comparison with zero would be a > language change. > yes, but it is not just a comparison with zero, it is a "is it less than zero, which it cannot possibly be since it is unsigned" so therefore it would be enforcin

Re: [go-nuts] Reading stdlib for education about go?

2017-05-12 Thread Michael Jones
The file IO routines are good examples of go factoring/structuring. In particular, the blend of real and direct actions and the abstracted/indirect use of readers/writers makes for a good IO feature set with high reuse, efficiency, natural extensibility, and testability. On the downside, it grew wi

Re: [go-nuts] Why float64 variable with value 0.0 as divisor produce +Inf?

2017-05-08 Thread Michael Jones
must not be zero: > > 3.14 / 0.0 // illegal: division by zero > > > > On Tuesday, May 9, 2017 at 9:48:53 AM UTC+8, Michael Jones wrote: > >> This is the definition of that division. >> >> What result would you prefer? >> > On Mon, May 8,

Re: [go-nuts] Why float64 variable with value 0.0 as divisor produce +Inf?

2017-05-08 Thread Michael Jones
This is the definition of that division. What result would you prefer? On Mon, May 8, 2017 at 6:45 PM Van Hu wrote: > Hi, my colleague found this strange behavior in Go today, seems like a bug? > > package main > > import ( > "fmt" > ) > > func main() { > var a float64 = 0.0 > fmt.Println(1.0 /

Re: [go-nuts] Missing binary operator shortcuts &&= and ||=

2017-05-08 Thread Michael Jones
gt; >> On 5 May 2017 at 14:11, Michael Jones wrote: > >>> Just so. One cannot do boolean arithmetic with boolean variables. > >>> > >>> We have: > >>> EQUIVALENCE ("==") > >>> XOR ("!=") > >>> NOT (&

Re: [go-nuts] Missing binary operator shortcuts &&= and ||=

2017-05-05 Thread Michael Jones
openness to including them. Michael * Understand the reason...allowing future implementation of packed boolean arrays. On Fri, May 5, 2017 at 5:35 AM, Ian Lance Taylor wrote: > On Fri, May 5, 2017 at 12:51 AM, roger peppe wrote: > > On 4 May 2017 at 20:48, Michael Jones wrote: > >

Re: [go-nuts] Missing binary operator shortcuts &&= and ||=

2017-05-04 Thread Michael Jones
What is *actually* missing is boolean operators for boolean types. On Thu, May 4, 2017 at 12:43 PM, Ian Lance Taylor wrote: > On Thu, May 4, 2017 at 9:42 AM, wrote: > > > > One apparently random omission in C, which was fixed in Perl, is &&= and > > ||=: > > > > a &&= b > > a = a && b > >

Re: [go-nuts] Re: Sorting an array of time.Duration

2017-05-03 Thread Michael Jones
Ram, Here is another example, a slightly modified version of ojucie's program: https://play.golang.org/p/uLsyW6oxz7 The difference here is to show the idea of making a custom type this is simply for the purpose of defining extra behaviors, such as those needed by Sort. On Tue, May 2, 2017 at 1

Re: [go-nuts] Re: // go:generate won t work, //go:generate will

2017-04-30 Thread Michael Jones
On Sun, Apr 30, 2017 at 7:14 AM, wrote: > A satisfying solution, imho, involves a more in depth change, > which won t happen for reasons cited previously. > Don't be too sure about that. No reason why "generate" could not be changed/made redundant/more real/keyworded/etc. as part of the open and

Re: [go-nuts] // go:generate won t work, //go:generate will

2017-04-29 Thread Michael Jones
[NOTE: an unofficial answer on Rob Pike's behalf] ...no, not organic growth, not oversight, not antique JCL inflexibility, rather, a design choice. Use of the "//tag:stuff" structure comes as a benefit vs cost optimization: The benefit is that it hides within the existing comment structure and ad

Re: [go-nuts] Re: Find a string in a file and delete all occurences in the file

2017-04-28 Thread Michael Jones
Great! On Fri, Apr 28, 2017 at 6:14 PM, Vikas Kumar wrote: > Thanks again Michael and Ishan. My git-hook is completed now, running > perfectly :) > > -- > You received this message because you are subscribed to the Google Groups > "golang-nuts" group. > To unsubscribe from this group and stop re

Re: [go-nuts] Re: Find a string in a file and delete all occurences in the file

2017-04-25 Thread Michael Jones
Sure. Here's a slightly expanded example. https://play.golang.org/p/bfKFrATI0q On Tue, Apr 25, 2017 at 5:20 AM, Vikas Kumar wrote: > Thanks a ton Michael and Ishan. Let me understand the code and use this in > my program. > > Cheers, > Vikas > > -- > You received this message because you are sub

Re: [go-nuts] Re: Find a string in a file and delete all occurences in the file

2017-04-23 Thread Michael Jones
...or if you copy the strings.Contains() comparison to the test, it echoes the program with six and each of the patterns removed. On Sun, Apr 23, 2017 at 7:57 AM, Michael Jones wrote: > Another example: > https://play.golang.org/p/hDKQtwHo6M > > In this case, just copy the pro

Re: [go-nuts] Re: Find a string in a file and delete all occurences in the file

2017-04-23 Thread Michael Jones
Another example: https://play.golang.org/p/hDKQtwHo6M In this case, just copy the program to your machine and build it. i called it lines.go when i run it as: lines < lines.go it echos the program with the line "six" removed On Sun, Apr 23, 2017 at 12:47 AM, Ishan Jain wrote: > You can do it

Re: [go-nuts] Change imaginary part of a complex

2017-04-20 Thread Michael Jones
It would be natural if real(c) and imag(c) were lvalues On Thu, Apr 20, 2017 at 1:21 PM 'Thomas Bushnell, BSG' via golang-nuts < golang-nuts@googlegroups.com> wrote: > The other way is to add the c to its conjugate and then add the imaginary > part, using cmplx.Conj. But that really amounts to wh

Re: [go-nuts] Re: Semicolons in Go

2017-04-20 Thread Michael Jones
On Thu, Apr 20, 2017 at 8:27 AM, wrote: > If I can't format my programs the way I want, and I much prefer putting > operators at the beginning of continuation lines for reasons mentioned on > this page, and "Perl Best Practices", I simply won't use the language - at > least not without implementi

Re: [go-nuts] Re: Building with "go install" vs "go build"

2017-04-18 Thread Michael Jones
The good news is that Dave Cheney moves at that same rapid clip. :-) On Tue, Apr 18, 2017 at 6:57 AM, Dave Cheney wrote: > > Apparently Dave Cheney says to prefer "go install" over "go build"[3], > except when cross-compiling [4]. However, many of these posts are older, > and Golang moves at suc

Re: [go-nuts] Can the bit representation of a float64 silently change?

2017-04-10 Thread Michael Jones
It is not crazy in any way to use the special NaN payload--it was designed just for you. Dr. Kahan and others provided the broad set of NaNs in '754 for just this purpose, for example, to encode missing data values and N/A data values separately for statistical processing, or to allow great freedom

Re: [go-nuts] Writing a non-blocking thread-safe buffer

2017-04-07 Thread Michael Jones
I get about 3 million channel transfers per second on my computer. If each transfer is a single byte, that's 3 MB/sec. If transfers are pointers to buffers of a kilobyte, then that's 3 GB/sec...which is about as many bytes/sec as a CPU could possibly touch. If those buffers are 25kb then you're at

Re: [go-nuts] Re: Algorithm Club

2017-04-06 Thread Michael Jones
Thank you for this thoughtful response. It helpful and inspires new thoughts. When I was a boy learning C (1976 or 1977, UNIX 6th Edition at Bell Labs via "learn") the definition of qsort() was a new idea for me. The exposure of base and stride so nakedly (after BASIC and FORTRAN and LISP and SAIL

Re: [go-nuts] Re: Last Gasp Call for Native Decimal Support

2017-04-05 Thread Michael Jones
In one of the many threads about this (five years ago!) I mentioned Mike Colinshaw's excellent work: http://speleotrove.com/decimal/ This is an excellent and correct library. I can be inspiration for a native Go implementation. On Wed, Apr 5, 2017 at 4:51 PM, Mandolyte wrote: > Doesn't help wi

Re: [go-nuts] Re: Algorithm Club

2017-03-31 Thread Michael Jones
yes On Fri, Mar 31, 2017 at 12:30 PM, Ian Davis wrote: > On Fri, 31 Mar 2017, at 05:19 PM, Michael Jones wrote: > > There is part of the topic that has always been slightly beyond my grasp. > (Maybe I do understand...but just lack absolute certainty.) Maybe others > know the ans

Re: [go-nuts] Re: Algorithm Club

2017-03-31 Thread Michael Jones
There is part of the topic that has always been slightly beyond my grasp. (Maybe I do understand...but just lack absolute certainty.) Maybe others know the answer... In a template system (which is what I prefer but that's not the point of this email) we have the notion of the TYPE(s) being a forma

Re: [go-nuts] New Smallcaps Go Fonts; other Go Fonts updated

2017-03-30 Thread Michael Jones
Good advice for Go as well. Maybe that should be the last line of a panic crash: [image: Inline image 1] On Thu, Mar 30, 2017 at 7:56 PM, Rob Pike wrote: > With the new "Smallcaps" font you can feel nostalgic by pretending you're > working on a TI Silent 700. > > -rob > > > On Wed, Mar 29, 201

Re: [go-nuts] Re: [ANN] Go geospatial libraries: geometries, GeoJSON, WKB, KML, PostGIS, GPX, polyline

2017-03-30 Thread Michael Jones
Hard to do better than KML. :-) On Thu, Mar 30, 2017 at 11:41 AM, Constantine Vassilev wrote: > Hi Tom, > > It worked perfectly. Thank you! > > --Constantine > > On Monday, March 27, 2017 at 11:14:48 AM UTC-7, Tom Payne wrote: >> >> Here's an example: >> >> 8< >> package main >> >> impor

Re: [go-nuts] Re: Algorithm Club

2017-03-27 Thread Michael Jones
Another dimension is "intellectual complexity." Where that is smaller, everything else is better for coding, documenting, debugging, testing, reading, using, and maintaining. It is a critical measure for maintaining the 'Go' of Go. On Sun, Mar 26, 2017 at 11:40 PM Egon wrote: > On Monday, 27 Ma

Re: [go-nuts] Algorithm Club

2017-03-25 Thread Michael Jones
This is just what I dream of. (Well, not dream really as I do it already with a macro processor, but I dream of it being integrated and robust.) On Sat, Mar 25, 2017 at 8:30 PM Will Faught wrote: > Generics is polymorphism, though; actually, it's a kind of polymorphism > called parametric polymo

Re: [go-nuts] Re: Algorithm Club

2017-03-24 Thread Michael Jones
I think I was saying that what I seem to want personally is the "simple, weak, slight" thing that you likely see as failure. The opposite end of that--where everything is a list and can be composed without special regard (lisp) or everything is an object that can receive any message (smalltalk) ar

Re: [go-nuts] Algorithm Club

2017-03-24 Thread Michael Jones
Type-based generally is all that I ever seem to want...making a macro-like LLRB heap concrete to handle objects of my own type and with my own comparison function. I believe this is what Rob speaks of. I've personally never needed to sort or order a bunch of unknown "things" On Fri, Mar 24, 2017

Re: [go-nuts] Re: atomic bugs

2017-03-19 Thread Michael Jones
In general is not not so much "will crash" but "will not run" On Sun, Mar 19, 2017 at 12:52 AM, T L wrote: > > > On Sunday, March 19, 2017 at 3:03:21 AM UTC+8, T L wrote: >> >> At the end of sync/atomic package docs, it says >> >> On x86-32, the 64-bit functions use instructions unavailable befo

Re: [go-nuts] uint type safety in go

2017-03-16 Thread Michael Jones
Yes, there are cases for integer domain wraparound just as there are cases for exception at the limits. The argument FOR is that "computers work that way." Since ENIAC, there have been overflow condition flags, but there have rarely been overflow/underflow panic traps. (Either no support, or suppo

Re: [go-nuts] Re: How do I test an func which depends on (pseudo)-random numbers, e.g. rand.Intn()?

2017-03-16 Thread Michael Jones
You could also capture a (p)random stream as a test data vector and use it in lieu of the PRNG during tests. This is the same as seeding iff and only iff the PRNG is never changed, Should that change, then so will the tests unless you capture a test vector now. (For example, if you have a timing be

Re: [go-nuts] how to use go generate to generate generic code .

2017-03-11 Thread Michael Jones
Very nice! Just the kind of use that comes up for me. The one complexity I had when I did this for the standard sort was dealing with the float32 and float64 types, where comparison was more complicated and elaborate in the presence of NaN values. Still, this kind of compile-time type templating i

Re: [go-nuts] Re: how to use go generate to generate generic code .

2017-03-10 Thread Michael Jones
Nothing wrong with it, and nothing wrong with doing it for min and max either. (Though it was a delight to see that animated editing sequence, so for entertainment value that's the way!) I did code generation for my version of Sort and it is 3x-5x faster. It takes intel more than 10 years to make

Re: [go-nuts] Re: No Allman-Style, No go!

2017-03-09 Thread Michael Jones
This is a popular point of view in general (programming tools serve programmers) and the natural and most free spirit of free-form programming languages. It turns out that there is a good argument--an evidence-based theory of software development--that you might want to think about as you form you

Re: [go-nuts] Re: do {} for x, why or why not?

2017-03-04 Thread Michael Jones
2 AM, Axel Wagner wrote: > There would be a way to add them without adding a new keyword: > > { >// stuff > } for condition > > I'm not saying I want it, or that it's a good idea, just that "we can't > add a new keyword" doesn't seem a good argum

Re: [go-nuts] Re: do {} for x, why or why not?

2017-03-03 Thread Michael Jones
I asked for this early...long before it was too late. (Existing valid programs ma have variables named 'do' so it is a non starter in that form. Rob's objection was wise and thoughtful. He wanted Go to be friendly to program transformation and he felt that a single uniform iteration construct woul

Re: [go-nuts] SOLID Design Patterns in GO

2017-03-03 Thread Michael Jones
Indeed... the pattern language book is excellent and its topic being different is helpful to teach deep ideas away from language/programming context. On Wed, Mar 30, 2016 at 10:46 AM Egon wrote: > On Wednesday, 30 March 2016 00:49:59 UTC+3, Staven wrote: > > On Tue, Mar 29, 2016 at 08:26:31AM -0

Re: [go-nuts] Bots on the mailing list

2017-03-02 Thread Michael Jones
I get them too. Cruelly, I just presumed that Yahoo! was broken in some as yet undiagnosed way. On Thu, Mar 2, 2017 at 11:56 PM, Ian Lance Taylor wrote: > On Thu, Mar 2, 2017 at 12:32 PM, Nyah Check wrote: > > > > Has anyone noticed there might be some bots subscribed to this mailing > list > >

Re: [go-nuts] Re: why the second memory allocation is blocked?

2017-03-02 Thread Michael Jones
Go deserves a keyword to "make love objects." On Thu, Mar 2, 2017 at 9:47 AM Dave Cheney wrote: > Your spinning goroutine is block the garbage collector which needs to > stop, temporarily, all the running goroutines to make love objects. > > -- > You received this message because you are subscri

Re: [go-nuts] Re: [Newbie] Why this code is so slow?

2017-02-26 Thread Michael Jones
Functionally similar...i use a time/memory tradeoff that makes factoring much faster but uses more memory. Other than that, very similar. On Sun, Feb 26, 2017 at 10:34 PM, Michael Jones wrote: > Maybe so. I'll look. The gain inside my v1 and v2 versions comes from > avoidable allocat

Re: [go-nuts] Re: [Newbie] Why this code is so slow?

2017-02-26 Thread Michael Jones
milar our approaches happen to be. I think there is still room for significant improvement in mine. On Sun, Feb 26, 2017 at 10:11 PM Éric Jacoboni wrote: > > > Le dimanche 26 février 2017 19:05:38 UTC+1, Michael Jones a écrit : > > Back on the ground for a bit with speedup news. My fi

Re: [go-nuts] Re: [Newbie] Why this code is so slow?

2017-02-26 Thread Michael Jones
Back on the ground for a bit with speedup news. My first ever performance tuning over Iran turned out well, the 100 case formerly... real 0m1.282s user 0m1.324s sys 0m0.027s ...is now down to real 0m0.868s user 0m0.858s sys 0m0.006s on the same MacBook Pro. I also changed the code to take a

Re: [go-nuts] Re: [Newbie] Why this code is so slow?

2017-02-26 Thread Michael Jones
I just coded up a quick amicable/perfect finder (using an expensive inner mechanism) and still it runs in 1.3 seconds in single processor mode. The times are not comparable because the techniques may not be the same, but I don't think it is fair to judge Go as slow. babar:amicable mtj$ time amicab

Re: [go-nuts] Is uint(v) when v is minus because a huge number supposed behavior?

2017-02-25 Thread Michael Jones
yes. https://en.wikipedia.org/wiki/Two's_complement On Sat, Feb 25, 2017 at 10:21 PM, Felix Sun wrote: > https://play.golang.org/p/TmxMmltHGH > > package main > > import ( > "fmt" > ) > > func main() { > var f int = -1 > fmt.Println("become huge number:", uint(f)) > fmt.Println("this panic", uin

Re: [go-nuts] Re: is it a waste of time to study old synchronization algorithms?

2017-02-25 Thread Michael Jones
...and it is also always the question of your intent--do you want to be good in a computer programming job or do you want to be a good computer scientist? If the latter, then every step of the way from Babylonian computation through Egyptian knot-tying ("trigonometry") the EDVAC and Konrad Zuse to

Re: [go-nuts] is this race condition normal?

2017-02-20 Thread Michael Jones
no. not only is there no guarantee, there is in fact a promise that you are mistaken to count on any order between the two. also, in an extreme case where func1 and func2 did not produce output (like a channel) consumed by someone who waits for them...in which case neither of them may run at all!

Re: [go-nuts] Re: int16 and float64 Multiplication

2017-02-19 Thread Michael Jones
good. On Sat, Feb 18, 2017 at 11:08 PM, wrote: > After some testing I just decided to instead round the numbers to 2 > decimals instead. Thank you for the heads up though. > > On Sunday, February 19, 2017 at 5:42:15 PM UTC+11, Michael Jones wrote: >> >> This feels unlike

Re: [go-nuts] Re: int16 and float64 Multiplication

2017-02-18 Thread Michael Jones
This feels unlikely. You might want to verify that the calculation matches your expectations exactly at many values. Ian's representation argument applies at every word size it may be that you just hit a "lucky" happenstance. On Sat, Feb 18, 2017 at 11:59 PM wrote: > Thank you for your help. I

Re: [go-nuts] Unexpected Behaviour of goroutine

2017-02-12 Thread Michael Jones
wrote: > Thanks to all who answered; I got explanation I needed. > > @"Michael Jones": yes, your solution also works - "i := i" overshadows the > i defined as part of the for-loop and that was also explained in one of the > Go-blogs. > > Anyways, as I have

Re: [go-nuts] Unexpected Behaviour of goroutine

2017-02-12 Thread Michael Jones
These answers are all correct. Here is another way to see the problem and address it. Not as clear to the next reader perhaps so not the recommendation, but a good example to contemplate. "Precisely what does this extra statement do?" package main import "fmt" import "log" func main() { for i :

Re: [go-nuts] A Tour of Go: 45

2017-02-07 Thread Michael Jones
Me too. What else could it be? On Tue, Feb 7, 2017 at 7:41 AM, Ian Davis wrote: > On Tue, 7 Feb 2017, at 03:36 PM, Tomi Häsä wrote: > > Is it normal to get 45 in the Flow Control example? > > https://tour.golang.org/flowcontrol/1 > > package main > > import "fmt" > > func main() { > sum := 0 > f

Re: [go-nuts] A Tour of Go: 45

2017-02-07 Thread Michael Jones
...and there is a nice story on this one. http://mathcentral.uregina.ca/qq/database/qq.02.06/jo1.html On Tue, Feb 7, 2017 at 9:21 AM, Michael Jones wrote: > Me too. What else could it be? > > On Tue, Feb 7, 2017 at 7:41 AM, Ian Davis wrote: > >> On Tue, 7 Feb 2017, at 0

Re: [go-nuts] Re: is it possible to speed up type assertion?

2017-02-03 Thread Michael Jones
ver time and newbies can have a correct expectation of the > cost. > > Chris > > > On Thu, Feb 2, 2017 at 3:26 PM, Michael Jones > wrote: > >> Insight here feels tenuous. >> >> It is rare that a well-written "real" program would be measurably >>

Re: [go-nuts] Re: is it possible to speed up type assertion?

2017-02-02 Thread Michael Jones
Insight here feels tenuous. It is rare that a well-written "real" program would be measurably influenced by something this small. As it happens, I often write such rare programs (where a 2x faster math.Log() really might make the whole program run 1.9x faster). Even as a poster child for it, I thi

Re: [go-nuts] about sorting array

2017-02-01 Thread Michael Jones
array contents are not immutable, just their size. On Wed, Feb 1, 2017 at 4:13 PM, Néstor Flórez wrote: > The below code sorts an array but it does it an by creating a slice, > correct? > What happened to the original array? > Arrays are inmutable > > ---

Re: [go-nuts] Re: I know finalizers are not promised to be called, but is it too not promised?

2017-01-29 Thread Michael Jones
"endeavor to" "anticipate" "allow for" "prepare for" "encourage" "facilitate" ...good "ensure" / "force" / "guarantee" (not in your control) "reclaim" / "recycle" / "release" (too absolute) ...bad On Sun, Jan 29, 2017 at 4:51 PM, Val wrote: > Hello Jesper > if I understand this thread cor

Re: [go-nuts] [ANN] template-compiler: compile go templates to go code

2017-01-21 Thread Michael Jones
Wow! On Sat, Jan 21, 2017 at 9:58 AM, wrote: > Hi, > > I have been working on a package to compile go templates to regular go > code. > Today i can announce an early release of it. > > Find it here > https://github.com/mh-cbon/template-compiler > > There is still have a lot to test and comment,

<    1   2   3   4   5   6   >