Currently if we use timer or something, runtime will start a new goroutine
to do timerproc works. Why can't we check timer heap in each iteration of
sysmon if any timer exists? This may reduce some context switchs, I think.
--
You received this message because you are subscribed to the Google
Thanks for the responses.
I will try a few options and see what fit best.
For a bit of context I’m making a script to check if the entire toolchain
needed to build a project is present on the machine. The script checks for
node/npm, Go, GCC and a few other tools (like go-bindata eg.). The real
Wow that appears to be exactly the answer I'm looking for! Thank you.
Just to make sure: When marshalling a struct, will fields of
type json.RawMessage be ignored (simply inserted into the JSON object
without further processing)?
On Thursday, August 10, 2017 at 7:27:17 PM UTC-7, Jakob Borg
I don't fully understand the problem, but if you need a quick and dirty way
to ensure a function is called exactly once, you can always use a global
variable, have the function checks the variable when the function is
called. If the function is called the first time, it will set the variable.
On 10 Aug 2017, at 22:11, Dmitriy Cherchenko
> wrote:
What is the best way to send the stringified JSON object from the database as
JSON and not as a string-type value of a property in the bigger JSON object the
server is responding with?
Do
Hope you had a goo time on vacation.
No need for custom types, specially with csv files, all you get are
"string" type, but you know that some columns are actually float values, or
ints or plain text. So we have several functions that "clean, format, etc"
different kinds of data, and just call
Yeah, that doesn't work. Returning the value from the C.func does
though. The whole system is pretty queasy-making.
(Looking at the internal behaviour of SetSize, it should probably not
take a uint64, since it expects a -1 sentinel for variable length).
On Thu, 2017-08-10 at 12:00 +0100, roger
How can that get applied here (The Halting Problem)? We use functions
everywhere and this is the same as we already do (with same level of
probability for Halting Problem).
What I do currently:
1 - abstracting some parts of a long function in another function.
2 - the name of that second
Sorry for my confused responses before.
The thing was my hardware board lacked fpu, so that's why I could not
make it work a simple hello world compiled with: GOOS=linux GOARCH=mips go
build hello.go
because the go compiler did not emmit softfloat.
For other people who are facing the same
Yes, it makes sense that it would be impossible to really check at that
level. What surprised me was that this does not trigger vet:
for i := range slice {
go f(i)
_ = 1
}
Yet this does trigger vet:
for i := range slice {
_ = 1
go f(i)
}
Is there something special about the
If you have a loop like:
for i := range slice {
f()
}
There's no way to know whether f launches a goroutine that captures the
loop variable without also evaluating the body of f and potentially every
function directly or indirectly called by f. If i escapes into a global
variable, you also
But then if the JSON is sent as a string property of a bigger object, it'll
have to be parsed by JavaScript on the browser side. That is undesirable.
On Thursday, August 10, 2017 at 1:21:54 PM UTC-7, Shawn Milochik wrote:
>
> On Thu, Aug 10, 2017 at 4:20 PM, Dmitriy Cherchenko
On Thu, Aug 10, 2017 at 4:20 PM, Dmitriy Cherchenko
wrote:
> Hi Shawn,
>
> Thank you for your quick reply!
>
> I’m not having any issues retrieving data from the database. I’m only
> concerned that the unmarshalling and marshalling processes seem needless
> and a little
Hi Shawn,
Thank you for your quick reply!
I’m not having any issues retrieving data from the database. I’m only
concerned that the unmarshalling and marshalling processes seem needless
and a little risky especially on big JSON objects.
On Thursday, August 10, 2017 at 1:17:02 PM UTC-7, Shawn
Seems like something that should "just work." Are you having a problem with
this? If so, please show some code.
A string is a string -- if you insert a base64-encoded value (or JSON, or
YAML) into a database varchar or text field, you should get the identical
string back out, character for
On Thu, Aug 10, 2017 at 10:03 PM dc0d wrote:
> Is there a tool/linter to check if a private package function gets called
exactly once in the code?
Good luck with solving the halting problem ;-)
--
-j
--
You received this message because you are subscribed to the
I've noticed that cmd/vet's rangeloop check, which warns you about binding
to range loop variables in function literals which are launched with 'go'
or 'defer', is more limited than I thought:
Hi Medina,
Sorry I was on vacations.
So do you mean the way to do it is to hardcode most of functionality. No
need to use custom types, interfaces. Just plain text parsing?
In that case, how easy is it to evolve or refactor the code?
Thanks
On Wednesday, July 26, 2017 at 8:36:15 PM UTC+2,
The original question was how to determine if the result had rows. Well it
turns out that golang's sql packa wi; generate the exception"ErrNoRows" if
there are no rows, therefore, it is not necessary to test the rows.Next()
and consume the first row differently than the second and certainly not
On 10/08/17 09:09 AM, roger peppe wrote:
On 10 August 2017 at 13:39, David Collier-Brown wrote:
On 10/08/17 02:47 AM, Henrik Johansson wrote:
I beg to differ. Most Java apps I have seen over many years almost
unanimously suffer from over-modeling.
A former customer did
On 10 August 2017 at 13:39, David Collier-Brown wrote:
> On 10/08/17 02:47 AM, Henrik Johansson wrote:
>>
>> I beg to differ. Most Java apps I have seen over many years almost
>> unanimously suffer from over-modeling.
>
>
> A former customer did a deep, thoughtful, *thorough*
On 10/08/17 02:47 AM, Henrik Johansson wrote:
I beg to differ. Most Java apps I have seen over many years almost
unanimously suffer from over-modeling.
A former customer did a deep, thoughtful, *thorough* model of bracket
tournaments, without any attempt to abstract the salient features.
Can't you just define f5f_VARIABLE as uint64? The only place it's used
it's being converted to uint anyway (which seems slightly dubious in itself).
On 10 August 2017 at 09:03, Dan Kortschak wrote:
> I'm pretty sure this should never have worked, but it seemed to
Hi all,
Are there good SOAP libraries to generate structs given WSDL? Looking for
something that would generate idiomatic Go code.
Thanks,
Srinath G S
[image: --]
Srinath GS
[image: https://]about.me/srinathgs
> > Is Visual Studio Code a .Net app that takes up lots of memory and CPU?
> Worse, it's an Electron app :)
I use VSC on an old 2012 Mac Mini, and I cannot confirm that it consumes
lots of CPU or memory, even with about two dozen extension installed. It is
fast and responsive (some say it is
Sorry for creating confusion, my reading mistake.
I read the inner-loop as:
if err := bdb.Get(key, ); err == nil && val.Value() != nil {
totalFound++
} else if err != nil {
totalErrored++
} else {
totalNotFound++
}
Which it obviously is not... :/
This day doesn't seem promising after this
I'm pretty sure this should never have worked, but it seemed to
previously and now it doesn't.
In the gonum/hdf5 package there is a var declared against an HDF5
define like so, `var h5t_VARIABLE int64 = C.H5T_VARIABLE`[1].
`H5T_VARIABLE` is defined in H5Tpublic.h as `#define
H5T_VARIABLE
On Wed, Aug 09, 2017 at 03:11:48PM +0200, Michael Banzon wrote:
> Is there a way to have a (bash) script check if the version of the Go
> compiler installed is a specific minimum version?
In the light of [1], I think you could combine checking of the presense
of the `go` tool itself with build
Egon,
Obviously I ran the race detector. No races were detected. Therefore, since
it wasn't germane, I omitted it from the posted results.
Here's my results.
$ go test -run=! -bench=. -v -cpu=4 -race total_test.go
goos: linux
goarch: amd64
BenchmarkTotal/Count-4 5000
Note, you also have a race in your code.
Use `-race` to detect.
+ Egon
On Thursday, 10 August 2017 06:43:34 UTC+3, d...@dgraph.io wrote:
>
> Hi
>
> I am trying to benchmark a key-value store written in Go. I have the code
> as shown below. There are a few lines that are specific to the store
Package testing
https://golang.org/pkg/testing/
Benchmarks
The benchmark function must run the target code b.N times. During benchmark
execution, b.N is adjusted until the benchmark function lasts long enough
to be timed reliably.
The first thing to do is to reduce the program to the simplest
I beg to differ. Most Java apps I have seen over many years almost
unanimously suffer from over-modeling. That Go encourages another style of
modeling does not make it too simple. It only makes it different which may
be good or bad according to taste.
That said, I personally think that generics
32 matches
Mail list logo