Re: [go-nuts] Bitmasks on signed types

2016-06-14 Thread Michael Jones
I have fought this many times. What I almost always do is cast all variables involved as unsigned so that I can express the logical operations as desired. The exception is right shift which must be signed if the expected outcome for signed values is to happen. On Tue, Jun 14, 2016 at 1:08 PM,

Re: [go-nuts] feature request: allow literal digit underscore grouping

2016-06-22 Thread Michael Jones
> https://github.com/golang/go/issues/42 Michael Jones michael.jo...@gmail.com > On Jun 22, 2016, at 7:29 AM, Roger Pack <rogerpack2...@gmail.com> wrote: > > Could you drop me a link to the discussion by chance? Seems this > feature is actually a reasonably common request

Re: [go-nuts] feature request: allow literal digit underscore grouping

2016-06-22 Thread Michael Jones
that is already there for input values in hex. Michael Jones michael.jo...@gmail.com > On Jun 22, 2016, at 8:14 AM, Michael Jones <michael.jo...@gmail.com> wrote: > >> https://github.com/golang/go/issues/42 > > Michael Jones > michael.jo...@gmail.com > >> On Jun 22, 2016

Re: [go-nuts] feature request: allow literal digit underscore grouping

2016-06-21 Thread Michael Jones
I asked for this a while back ("drop underscore between digits as in Ada") and the answer was no. I try to ask just once. This was shut down without much discussion at https://github.com/golang/go/issues/42. I agree that it's a nice feature. By the way, though, one nice aspect of Go is that

Re: [go-nuts] Multi Variable Linear Regression (with r squared and p values)

2016-07-23 Thread Michael Jones
Surely this calculation is part of that regression module or a dependent module. On Jul 23, 2016 11:50 AM, wrote: > I'm trying to port over some code using linear regression (statsmodule > package) in python to golang. I need the library to give me r square and p > values

Re: [go-nuts] Re: What lead to the versionning debate?

2016-07-29 Thread Michael Jones
Go is strongly opinionated about strategies (reduce errors, simplify structure, rapid builds, memory safety, etc.) but is agnostic about most everything else. Even if the Go team uses CPU X, OS Y, VCS Z, that’s just an example from a multiplicity of present and future choices. The design of Go

Re: [go-nuts] Re: Generation of Strings - generation

2016-07-14 Thread Michael Jones
The first time this came up I wrote code to generate general alphabet combinations as quickly as I could. The approach I used was a generator object that one calls to set the length and alphabet size, and a Next() function that is called repeatedly until it signals that all values have been

Re: [go-nuts] Understanding HTTP server latencies

2016-07-18 Thread Michael Jones
When you move the rate up by 5x, from 1k => 5k, your wait time moves up by 2846x. That is suspicious in any system, language, etc. ;-) From: on behalf of Rayland Date: Monday, July 18, 2016 at 6:03 AM To: golang-nuts

Re: [go-nuts] Re: problems receiving data from a GPS

2016-07-19 Thread Michael Jones
Detective mode here: family: http://www.castelecom.com/obd-gps-tracker details: http://www.castelecom.com/idd-213gl “DD-213GL is an intelligent on-board diagnostic device compatible with passenger and commercial vehicles, it features plug-and-play technology, could read diagnostic

Re: [go-nuts] Re: problems receiving data from a GPS

2016-07-19 Thread Michael Jones
In response to the call to help at every level of developer background, here an expository solution line by line. Don’t click if this is your homework. https://play.golang.org/p/UOf38Uh-MT All that is left is to understand the data payload formats. Michael -- You received this

Re: [go-nuts] Re: problems receiving data from a GPS

2016-07-20 Thread Michael Jones
.@gmail.com> Subject: Re: [go-nuts] Re: problems receiving data from a GPS thanks guys I was converting the data to hex incorrectly https://play.golang.org/p/35Wgkrh4Rq now its equal to python On Tuesday, July 19, 2016 at 6:41:42 PM UTC-5, Michael Jones wrote: In response to the

Re: [go-nuts] Re: problems receiving data from a GPS

2016-07-20 Thread Michael Jones
Final version: https://play.golang.org/p/nb-KHcw9vS From: Michael Jones <michael.jo...@gmail.com> Date: Wednesday, July 20, 2016 at 1:50 AM To: EdgarAlejandro Vintimilla <eavi...@gmail.com>, golang-nuts <golang-nuts@googlegroups.com> Cc: <egonel...@gmail.com> S

Re: [go-nuts] Generation of Strings - generation

2016-07-15 Thread Michael Jones
aab >> > > aac >> > > bac >> > > bab >> > > baa >> > > caa >> > > cab >> > > cac >> > > >> > > and so on. Then the total cost is n^n-1 digit changes. Though I do not >> > > kn

Re: [go-nuts] Re: An efficient runtime expression evaluation

2016-07-18 Thread Michael Jones
Anything much faster than this needs vector operations in the interpreter so the “get to the OP function” overhead is once per time series rather than once per element in the series. From: on behalf of Egon Date: Monday, July 18, 2016 at

Re: [go-nuts] 'Vectorizing' array arithmetic using parallel for loops?

2016-06-28 Thread Michael Jones
likely want is a set of worker process (~ncpus or 2x that) doing the work and a way to know when the work is done. Michael Jones michael.jo...@gmail.com > On Jun 28, 2016, at 5:01 PM, guyz...@gmail.com wrote: > > Hi, > > I'm attempting to optimize pair-wise operations over arrays

Re: [go-nuts] Re: Hi, someone may help me converting this python code to GO

2016-07-10 Thread Michael Jones
I get “030a1x” as the result of my Go port. Is that what you expected? —— Michael Jones michael.jo...@gmail.com On Sun, Jul 10, 2016 at 6:10 AM, Kevin Powick <kpow...@gmail.com> wrote: Glad to see you put some effort into it yourself. -- You received this message because you are subs

Re: [go-nuts] Hi, someone may help me converting this python code to GO

2016-07-10 Thread Michael Jones
Dan, i was guessing that the code was specifying a 16 bit integer for the running crc. That's why i am curious. On Jul 10, 2016 2:42 PM, "Jesper Louis Andersen" < jesper.louis.ander...@gmail.com> wrote: > > On Sun, Jul 10, 2016 at 5:07 AM, wrote: > >> def

Re: [go-nuts] Why is reflect.ValueOf(nil map).Interface() != nil?

2016-08-09 Thread Michael Jones
The interface is like an envelope. You “open it” to see what’s inside. Sending nothing (no envelope arrives) is not the same as sending an empty envelope (i.e., interface is non-nil, pointer within is nil). It never confused me, beyond my general confusion from thinking in similes and

Re: [go-nuts] Re: go process memory limits and gurantees

2016-08-09 Thread Michael Jones
First, a related question—if an attempt to allocate is about to fail, or succeeds while crossing a threshold of “low memory remaining” (if this is even knowable), does/should the runtime change the GC policy to be very aggressive and exploit all possible avenues to remedy? A low water / high

Re: [go-nuts] Re: How to check that a Go package has not been modified?

2016-08-03 Thread Michael Jones
A few years ago, I uploaded a parallel “find duplicate files in a filesystem” utility to GitHub. It is called “dup” for “find duplicates.” https://github.com/MichaelTJones/dup/blob/master/dup.go In that program, which first groups files by size, then compares the first few bytes, then

Re: [go-nuts] Handling dynamic and unknown number of wait groups?

2016-06-30 Thread Michael Jones
.* Finally, I did not change the logic of the program to use a worker pool. It still spawns a goroutine for every URL visited. That is not bad, but neither is it necessary. Making this change would have made changes 1–5 less clear, and the goal here is clarity. Hope this helps, Michael Michael

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: 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

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

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 <michael.jo...@gmail.com> wrote: > Me too. What else could it be? > > On Tue, Feb 7, 2017 at 7:41 AM, Ian Davis <m...@i

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

2017-02-03 Thread Michael Jones
provement over time and newbies can have a correct expectation of the > cost. > > Chris > > > On Thu, Feb 2, 2017 at 3:26 PM, Michael Jones <michael.jo...@gmail.com> > wrote: > >> Insight here feels tenuous. >> >> It is rare that a well-written "re

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

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

2017-02-19 Thread Michael Jones
good. On Sat, Feb 18, 2017 at 11:08 PM, <ngjun...@gmail.com> 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: >>

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

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

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] 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] Unexpected Behaviour of goroutine

2017-02-12 Thread Michael Jones
<m.srivath...@gmail.com> 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. &g

Re: [go-nuts] Unary +

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

Re: [go-nuts] Unary +

2016-08-20 Thread Michael Jones
Leadings zeroes signal the use of base 8. Have a look at this “base 10” calculator. https://play.golang.org/p/L0whPekuvG There was debate about this in early Go days. It is consistent with historical usage (C, and earlier, in Donald Knuth’s Art of Computer Programming.) Good summary at

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

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)) >

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

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

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

2017-02-26 Thread Michael Jones
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 <eric.jacob...@gmail.com> wrote: > > > Le dimanche 26 février 2017 19:05:38 UTC+1, Michael Jones a écrit : > > Back on the ground for a

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 <michael.jo...@gmail.com> wrote: > Maybe so. I'll look. The gain inside my v1 and v2 versions c

Re: [go-nuts] Re: In case you missed it: language benchmarks for Go 1.7, and language adoption

2016-08-30 Thread Michael Jones
I looked at that this morning and sped it up a little. From: 'Isaac Gouy' via golang-nuts Reply-To: Isaac Gouy Date: Tuesday, August 30, 2016 at 12:15 PM To: golang-nuts Subject: [go-nuts] Re: In case you missed

Re: [go-nuts] What was the rationale behind using braces for scoping?

2016-09-08 Thread Michael Jones
There is ample evidence that “typographic block structure” via indenting is fragile in terms of potential error in the reality of cut-and-paste. This is not a comment on like/dislike in abstract, just on dislike when designing for high programmer productivity. -- You received this message

Re: [go-nuts] Re: Assigning +Inf to a float32 ..

2016-09-12 Thread Michael Jones
Actually, you would also want a way to say “which type of NaN” as there are two classes and several subclasses. I wrote code for this a while back and posted it here (IIRC). From: on behalf of Date: Sunday, September 11, 2016 at 6:32 AM To:

Re: [go-nuts] Re: tidy way to write a repeat-until in golang

2016-10-07 Thread Michael Jones
It is a significant frustration for me, actually. What I do is to leave out the test completely at the top and put it at the bottom , Just as you show. Comes up often in linked-list traversal and math code. From: on behalf of Jonathan

Re: [go-nuts] truncate float32 to lesser precision (22 bit mantissa)

2016-09-21 Thread Michael Jones
Any kind of computational geometry code will have subtle issues in just this area. Broadly, the issue is classification of a point or line as IN, OUT, or ON. Of these, ‘ON’ is the difficult one because floating point prevents perfect calculation where real numbers would allow it. This is

Re: [go-nuts] truncate float32 to lesser precision (22 bit mantissa)

2016-09-21 Thread Michael Jones
Good point. I missed that. Also, I did not mean “unsolvabe” just not solvable using slightly a different precision. Common solutions: Remove the divides by multiplying them out. Then it just works (at least in FP where integer precision is not such an issue as in graphics hardware) Avoid the

Re: [go-nuts] Re: ANNOUNCE: renderview

2016-08-27 Thread Michael Jones
I tried to build but was deterred by build woes. From: on behalf of mura Date: Saturday, August 27, 2016 at 9:06 AM To: golang-nuts Cc: Subject: [go-nuts] Re: ANNOUNCE: renderview

Re: [go-nuts] image: algorithm to convert to grayscale

2016-09-28 Thread Michael Jones
Yes, certainly this is round to nearest for the luminance computation, and that is a good thing. As far as the equation itself, this is a color science topic with many types of answers—engineering answers that cite various specifications, scientific answers that study human perception, and

Re: [go-nuts] big.Rat anomalies

2016-10-10 Thread Michael Jones
Dave, try this version: https://play.golang.org/p/p5zyQF1Sdr From: on behalf of Jan Mercl <0xj...@gmail.com> Date: Monday, October 10, 2016 at 4:40 PM To: Dave Cohen , golang-nuts Subject: Re: [go-nuts]

Re: [go-nuts] why "iota"?

2016-11-09 Thread Michael Jones
Iota is indeed a Greek letter, the one from which western alphabets inherited the letter ‘i’ (⍳). If you read Comparative Grammar of Greek and Latin (Darling, 1933) or the New Comparative Grammar of Greek and Latin (Sihler), you’ll discover that iota and its friend upsilon share quite a bit of

Re: [go-nuts] Noob question: Pointers to interfaces

2016-11-07 Thread Michael Jones
eans turning Go into a dynamic language. Le mardi 8 novembre 2016 01:09:10 UTC+1, Michael Jones a écrit : Not precisely so…Interfaces, and type switches, and related mechanisms are safe. Their type indeterminism is protected from the program and their concretization is much like Schrodinger’s box…the in

Re: [go-nuts] Noob question: Pointers to interfaces

2016-11-07 Thread Michael Jones
Not precisely so…Interfaces, and type switches, and related mechanisms are safe. Their type indeterminism is protected from the program and their concretization is much like Schrodinger’s box…the interface is any type until you look at it through a type switch or type dereferencing…then it is a

Re: [go-nuts] why "iota"?

2016-11-10 Thread Michael Jones
functions as ably as people in the other Olympics can throw a stick or kick a ball.) поздравления -Original Message- From: Konstantin Khomoutov <flatw...@users.sourceforge.net> Date: Thursday, November 10, 2016 at 7:28 AM To: Michael Jones <michael.jo...@gmail.com> Cc: Konstant

Re: [go-nuts] Slow 64 bit integer division on amd64

2016-11-10 Thread Michael Jones
A=2^62 B=13 A/B = 4611686018427387904/13 A/B = quotient 354745078340568300 with remainder 4 A/B = (82595524*2^32 + 3964585196) with remainder 4 Consider the quotient: H = Upper 32 bits of 354745078340568300 = 82595524 L = Lower 32 bits of 354745078340568300 = 3964585196

Re: [go-nuts] why "iota"?

2016-11-10 Thread Michael Jones
“…on our math high school courses.” Which I imagine are like my college math courses! -Original Message- From: on behalf of Konstantin Khomoutov Date: Thursday, November 10, 2016 at 4:09 AM To: Dan Kortschak

Re: [go-nuts] Are short variable declarations necessary?

2016-10-19 Thread Michael Jones
949) -Original Message- From: <golang-nuts@googlegroups.com> on behalf of Ian Lance Taylor <i...@golang.org> Date: Wednesday, October 19, 2016 at 12:25 PM To: Michael Jones <michael.jo...@gmail.com> Cc: T L <tapir@gmail.com>, golang-nuts <golang-nuts@googlegro

Re: [go-nuts] Are short variable declarations necessary?

2016-10-19 Thread Michael Jones
Interesting. I have never used var this way. I am the student here. (as in everything else!) From: Axel Wagner <axel.wagner...@googlemail.com> Date: Wednesday, October 19, 2016 at 2:39 PM To: Michael Jones <michael.jo...@gmail.com> Cc: Ian Lance Taylor <i...@golang.o

Re: [go-nuts] Need help building Go

2016-10-14 Thread Michael Jones
Awesome! Thanks! From: Pietro Gagliardi <andl...@lostsig.net> Date: Friday, October 14, 2016 at 10:12 PM To: Michael Jones <michael.jo...@gmail.com> Cc: <golang-nuts@googlegroups.com> Subject: Re: [go-nuts] Need help building Go src/cmd/dist/deps.go -- You received th

Re: [go-nuts] Are short variable declarations necessary?

2016-10-19 Thread Michael Jones
As in a number of previous questions, this one was asked poorly and the answers dance all around the intention. I had decided never to enter the fray of these oddly-put assertion/half questions, but since this is lingering, may I suggest that this is his real question: “can we have var-style

Re: [go-nuts] Is it a compiler bug?

2016-11-12 Thread Michael Jones
The closest thing to a “super comment” is shown in my edit to your example: https://play.golang.org/p/nkDcMCzhkf It is legitimate, but it too has limitations. For me at least, those are rare. -Original Message- From: 'chris dollin' via golang-nuts Reply-To:

Re: [go-nuts] Is it a compiler bug?

2016-11-12 Thread Michael Jones
…which is what I usually do too… Command-/ in Sublime3 From: Jan Mercl <0xj...@gmail.com> Date: Saturday, November 12, 2016 at 9:31 AM To: Michael Jones <michael.jo...@gmail.com>, chris dollin <ehog.he...@googlemail.com>, imd3c <vvv.poc...@gmail.com> Cc:

Re: [go-nuts] Stressing the system using

2016-11-14 Thread Michael Jones
This is funny in the sense that my programs are great at stressing the CPU even though I don’t want to! :-) I looked at your hogcpu() function and saw an issue: you busy loop repeats a select statement and a square root. Almost any simple implementation of this will spend all of its time

Re: [go-nuts] Stressing the system using

2016-11-14 Thread Michael Jones
-nuts] Stressing the system using Why would a select statement take up most of the execution time? Is there another way to implement a non blocking channel? On Monday, November 14, 2016 at 6:01:24 PM UTC+5:30, Michael Jones wrote: This is funny in the sense that my programs are great at

Re: [go-nuts] CFG for a Go program

2016-11-26 Thread Michael Jones
I had the same reaction. More of a riddle than a question. If CFG means Context Free Grammar, then how could it be something of a program rather than of the language? if CFG means Configuration File, then the programming language would have nothing to do with the quest for the file, which would

Re: [go-nuts] Why doens't function type support comparision but channel type does?

2016-11-24 Thread Michael Jones
. On the other line of development, Rob Pike's coverage analyzer would be handy that way too. On Thu, Nov 24, 2016 at 9:13 PM, Jesper Louis Andersen < jesper.louis.ander...@gmail.com> wrote: > > > On Thu, Nov 24, 2016 at 8:23 PM Michael Jones <michael.jo...@gmail.com> > wr

Re: [go-nuts] Why doens't function type support comparision but channel type does?

2016-11-24 Thread Michael Jones
As you imply, the third idea in the form of “probabilistic equality” is generally unworkable. The computer risks forum is literally full of examples of failures here. A contrived example: func a(x int) (int y) {     If x != 0 {    Y = 1/x     }     return } func a(x int) (int

Re: [go-nuts] Do Go Routines use continuations to allow yelding?

2016-11-27 Thread Michael Jones
Wait… “If any of these fails to produce a correct result…” Really? I believe that we want the correct result under any valid schedule, including the most perverse, and that anything less means a failure of the design of the underlying system. Perhaps I misunderstand what you imply. From:

Re: [go-nuts] CFG for a Go program

2016-11-27 Thread Michael Jones
Details of this would make a great Go Blog post… From: adonovan via golang-nuts Reply-To: Date: Sunday, November 27, 2016 at 6:07 PM To: golang-nuts Cc: Subject: Re: [go-nuts] CFG for a

Re: [go-nuts] Reaching infinity

2016-11-16 Thread Michael Jones
Oh, and you could defer something at the start of main…that will wait forever to execute since the for loop never returns. From: Pietro Gagliardi <andl...@lostsig.net> Date: Wednesday, November 16, 2016 at 2:21 PM To: Michael Jones <michael.jo...@gmail.com> Cc: Nikita L

Re: [go-nuts] Reaching infinity

2016-11-16 Thread Michael Jones
After your for loop, you could add: fmt.Println(math.Inf(0)) From: on behalf of Nikita Loskutov Date: Wednesday, November 16, 2016 at 1:58 PM To: golang-nuts Subject: [go-nuts] Reaching infinity Hello!

Re: [go-nuts] Reaching infinity

2016-11-17 Thread Michael Jones
: Re: [go-nuts] Reaching infinity @Michael Jones I think nothing will changed in case of fmt.Println(math.Inf(0)) or defer, because it never triggered. -- You received this message because you are subscribed to the Google Groups "golang-nuts" group. To unsubscribe from this group and s

Re: [go-nuts] Re: Is it a compiler bug?

2016-11-13 Thread Michael Jones
I think I see the confusion here… When you have a line comment symbol “//” in go, “c” in FORTRAN, “;” in assembler, etc. you are safe. There is never confusion. When you have a block comment symbol though, “/*” and “*/” in C/C++/…/Go, “{“ and “}” in PASCAL, etc., then you have the

Re: [go-nuts] Multiple-reader single-writer map access is safe ?

2016-11-04 Thread Michael Jones
刘桂祥, To be successful sharing changing data between multiple processes, threads, cores, or “goroutines” you must write programs that honor the physical reality of computing hardware. That reality is very subtle and unexpected when it comes to what is and is observed by memory readers and

Re: [go-nuts] Re: Duplicate File Checker Performance

2016-10-16 Thread Michael Jones
Sri G, How does this time compare to my “Dup” program? I can’t test for you…since it is your filesystem…but I thought I had it going about as fast as possible a few years ago when I wrote that one. https://github.com/MichaelTJones/dup Michael From:

Re: [go-nuts] Re: Duplicate File Checker Performance

2016-10-16 Thread Michael Jones
0.04s user 0.04s system 68% cpu 0.117 total Not so much when you're doing a full sequential read. Because I use the md5 for other purposes, the entire file must be hashed, so sadly I cant use these optimizations. On Sunday, October 16, 2016 at 1:26:24 PM UTC-4, Michael Jones wrot

Re: [go-nuts] Re: Large 2D slice performance question

2016-12-09 Thread Michael Jones
Glad to hear this worked for you. The general conclusion that goroutines do not help with in-memory processing is inaccurate. I often do large-scale numeric computations, spread across every physical and virtual core in my computers, and find that the scaling is excellent and beneficial.

Re: [go-nuts] Re: Idiomatic way to remove duplicates in a slice

2016-12-14 Thread Michael Jones
Do we know anything about the structure of the slice? It is inherent in the general notion that there must be a comparison of a new item with existing ones to establish uniqueness. Even so, knowledge about the structure of the input can make this comparison easier. If the input is

Re: [go-nuts] Re: memclr optimazation does worse?

2016-12-15 Thread Michael Jones
go version go1.7.4 linux/amd64 BenchmarkMemclr_100-36 531.5 ns/op BenchmarkLoop_100-36 271.7 ns/op BenchmarkMemclr_1000-36 5000 257 ns/op BenchmarkLoop_1000-36 2000 612 ns/op BenchmarkMemclr_1-36 500

Re: [go-nuts] Re: How to speed up execution time for a set of regular expressions

2016-12-13 Thread Michael Jones
I like regular expressions, but I always think of them as a last resort, sort of like finding your way through a labyrinth by feel. When you know more about the structure of the mystery -- "keep your left hand on the wall" or "spaces separate tokens"-- then other tools and approaches can help

Re: [go-nuts] float32 vs float64 precision lost when casting to int

2016-12-14 Thread Michael Jones
Yes. 80917.65 => 32-bit IEE 754 is 0x479e0ad3 == 80917.6484375 1 .000101011010011 80917.65 => 64-bit IEE 754 is 0x40F3C15A == 80917.6500 1 .000101011010011 00110011001100110011001100110 The last part, the “…00110011001100110011001100110,” is not

Re: [go-nuts] Re: Idiomatic way to remove duplicates in a slice

2016-12-14 Thread Michael Jones
ber 14, 2016 at 9:35 AM To: <golang-nuts@googlegroups.com> Subject: Re: [go-nuts] Re: Idiomatic way to remove duplicates in a slice On 12/14/2016 12:14 PM, Michael Jones wrote: > Do we know anything about the structure of the slice? > > Just FYI -- this thre

Re: [go-nuts] Re: Inlining local functions

2016-12-02 Thread Michael Jones
go build –gcflags=-m will show you what is and is not inlined. This is not the structural answer you seek, but it is the factual result of it. From: on behalf of Date: Friday, December 2, 2016 at 2:58 AM To: golang-nuts

Re: [go-nuts] Re: Large 2D slice performance question

2016-11-30 Thread Michael Jones
Yes…the more that you can share the better our help will be. If you have a small, even synthetic example of before and after we can do our best. From: adonovan via golang-nuts Reply-To: Date: Wednesday, November 30, 2016 at 6:31 AM To:

Re: [go-nuts] synchronise read from two channels

2016-11-30 Thread Michael Jones
It seems that you are fighting the helpful infrastructure, but I can’t be sure from what you’ve said. You can (presumably) just do this: For u := range streamOfUrls { For w := range availableWorkers {   w.url = u   activeWorkers <- w } } …but that is strange to me. Why not

Re: [go-nuts] Help me beat Erlang, SkynetBenchmark challenge

2016-12-01 Thread Michael Jones
is helpful in this regard, but what is really helpful is if the “model” of the test is legitimate. In this case, have your actors do whatever the real actors would do so that you are measuring “parallel actors doing.” From: Michael Jones <michael.jo...@gmail.com> Date: Thursday, December 1, 201

Re: [go-nuts] Help me beat Erlang, SkynetBenchmark challenge

2016-12-01 Thread Michael Jones
Here is an idea for you. 35% faster on my macbook pro: https://play.golang.org/p/3Mb5pR0V0J Michael From: on behalf of Roger Alsing Date: Thursday, December 1, 2016 at 12:52 AM To: golang-nuts

Re: [go-nuts] Unexpected type switch case listing & equality behaviour for float64

2016-12-30 Thread Michael Jones
ernheim <u...@dauernheim.net> wrote: > Apologies for not being more specific with a distilled exampled, the > reason is that I don't understand if this is a bug or expected. Agreed I > should have left the first lines out. > > I think Michael Jones summarised it quite

Re: [go-nuts] Re: Unexpected type switch case listing & equality behaviour for float64

2016-12-30 Thread Michael Jones
I think the problem is the unexpected type of g. In the "spread out" switch clauses it is int/float/... but in the "all as one" case it is still a generic interface. On Fri, Dec 30, 2016 at 8:49 AM, Matt Harden wrote: > Values of different types cannot be compared in Go.

Re: [go-nuts] Re: Thread safety programatic definition for Go

2017-01-01 Thread Michael Jones
Josvazg, Your notion of "globals safe" should allow init() functions as safe writers. They are always invoked serially. On Sun, Jan 1, 2017 at 7:29 AM wrote: > > On Sunday, January 1, 2017 at 4:43:32 AM UTC-7, josvazg wrote: > > I am trying to come up with a detailed

Re: [go-nuts] Re: ANN: rosarygen 1.0

2017-01-03 Thread Michael Jones
Fantastic! Sadly rare are examples of technologists using technology to serve people's inner desires and expressed needs. Also far too rare are opportunities to have parents comprehend and enjoy our work. You scored on both points. Bravo. On Tue, Jan 3, 2017 at 5:47 PM Rick

Re: [go-nuts] Which is a best practice, long run goroutine or short term one?

2017-01-06 Thread Michael Jones
It is difficult imagine "pthread_create failed" as the result of too many goroutines. On Fri, Jan 6, 2017 at 8:11 PM, Hoping White wrote: > Hi, all > > I’m writing a chat server like program, and I must make a decision now. > My business includes two kind of things: > 1.

Re: [go-nuts] why does runtime.GOMAXPROCS act like getter and setter?

2016-12-23 Thread Michael Jones
If it was to be changed, it might be good to add the pair: Gomaxprocs() SetGomaxprocs() I remember at the time it was suggested that it was "temporary API" that would go away someday. I have learned that there is rarely a temporary API, temporary utility, etc. On Fri, Dec 23, 2016 at 8:26

Re: [go-nuts] Re: [ANN] Gomail v2: sending emails faster

2016-12-27 Thread Michael Jones
*post hoc, ergo propter hoc* On Tue, Dec 27, 2016 at 12:21 AM, wrote: > ALERT - After implementing Gomail v2 started getting lots of SPAM > messages that ever received in Inbox. > > > On Wednesday, September 2, 2015 at 5:25:26 PM UTC+5:30, Alexandre Cesaro > wrote: >>

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)

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: [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< >>

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

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 >

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

  1   2   3   4   5   6   >