[go-nuts] How to do for inserting input data(http request post method) into postgresql database

2019-01-30 Thread Robert Hsiung
Hi all: I used net/http package to build up the http server with golang. Also,I make the simple Html page for front end . But I don't know how to do for inserting input data(http request post method) into postgresql database ? Any one could provide the sample code ? Thanks so much. BR

[go-nuts] Re: Memory usages

2019-01-30 Thread 伊藤和也
OK, I want to make it clearer. Whether constants are untyped or typed, constants are treated at compile time and originary there is no idea of how much memory constants take but there is the idea of how much memory variables take so I should just focus on how much memory variables take at

[go-nuts] liteide x35.4 released

2019-01-30 Thread visualfc
Hi, all. LiteIDE X35.4 released! The new version enhances code navigation and code completion, and can also use text information to implement navigation in the wrong source code. Enhanced code completion for Golang import lines, support for fuzzy completion. For the Go Module project,  display

[go-nuts] database/sql: NextResultSet API always return false

2019-01-30 Thread sagar puneria
I just want to know in which case NextResultSet return true? I tried all the cases it is always returning false. If so then what is use case of implementing NextResultSet ?

Re: [go-nuts] Memory usages

2019-01-30 Thread Bakul Shah
I think computing memory use of any *constant* is not straightforward and probably not worth it. Even a typed constant may only exist in an instruction stream. For instance "var x int64 = 42" may compile down to a single instruction (or more, depending on the underlying architecture). Or there

Re: [go-nuts] Re: Memory usages

2019-01-30 Thread Ian Denhardt
Quoting Michael Jones (2019-01-30 23:15:51) >very close. One more idea: typed constants only exist during >compilation. I assume you meant "untyped constants" here. But yes, exactly. -Ian -- You received this message because you are subscribed to the Google Groups "golang-nuts"

Re: [go-nuts] Re: Memory usages

2019-01-30 Thread Michael Jones
very close. One more idea: typed constants only exist during compilation. In the generated executable they are all typed because they have been used somewhere and that defined their size and type (int, float, ...) On Wed, Jan 30, 2019 at 6:55 PM 伊藤和也 wrote: > OK, I understand it somehow but I

[go-nuts] Re: Memory usages

2019-01-30 Thread 伊藤和也
OK, I understand it somehow but I want to make sure my understanding is correct. There are two types of constant "untyped constant" and "typed constant". 1. An untyped constant has a size but it's not specific which means an untyped constant takes some memory. > fmt.Println(100) 2. A typed

Re: [go-nuts] Re: Memory usages

2019-01-30 Thread Ian Lance Taylor
On Wed, Jan 30, 2019 at 4:40 PM 伊藤和也 wrote: > > I thought "100" has a specific size then "num" has the copy of "100". In a compiled language like Go it's not very useful to think about the size of numeric constants. Think about the sizes of variables. Numeric constants exist only in the

[go-nuts] Re: Memory usages

2019-01-30 Thread 伊藤和也
I thought "100" has a specific size then "num" has the copy of "100". var num int32 = 100 So in this case below, "100" is passed to the function "f" is also "4" bytes in total? func main() { >f(100) > } > > func f(num int32) { // num is "4" bytes > > } 2019年1月31日木曜日

Re: [go-nuts] Memory usages

2019-01-30 Thread Michael Jones
On Wed, Jan 30, 2019 at 4:05 PM 伊藤和也 wrote: > : > So in this case below, Is the memory usage "12" bytes in total? (Question > 1) > > var num int32 = 100 >> | | >> 4 bytes + 8 bytes = 12 bytes > > no. the literal "100" has no specific size and is conformed to the

Re: [go-nuts] Re: Existing code for order-preserving concurrent work queue?

2019-01-30 Thread Michael Jones
note that my code sidesteps this problem generally On Wed, Jan 30, 2019 at 3:48 PM roger peppe wrote: > On Wed, 30 Jan 2019 at 20:07, 'Bryan Mills' via golang-nuts < > golang-nuts@googlegroups.com> wrote: > >> The code to sequence the results using a channel is not much more verbose. >> >> That

[go-nuts] Memory usages

2019-01-30 Thread 伊藤和也
An interger constant is "int" type and takes "8" bytes memory on 64-bit system. fmt.Println(unsafe.Sizeof(100)) // 8 > fmt.Println(reflect.TypeOf(100)) // int and an "int32" type value takes "4" bytes. var num int32 > fmt.Println(unsafe.Sizeof(num)) // 4 So in this case below, Is the memory

Fwd: [go-nuts] Re: Existing code for order-preserving concurrent work queue?

2019-01-30 Thread roger peppe
On Wed, 30 Jan 2019 at 20:07, 'Bryan Mills' via golang-nuts < golang-nuts@googlegroups.com> wrote: > The code to sequence the results using a channel is not much more verbose. > > That not only avoids the library dependency, but also makes the peak > memory consumption for the results

Re: [go-nuts] What does a deadlock mean in golang?

2019-01-30 Thread Michael Jones
fantastic read! On Wed, Jan 30, 2019 at 12:42 PM Bakul Shah wrote: > On Wed, 30 Jan 2019 12:21:46 -0800 Tom Mitchell > wrote: > > > > On Tue, Jan 29, 2019 at 12:55 AM =E4=BC=8A=E8=97=A4=E5=92=8C=E4=B9=9F > > a.ito.dr...@gmail.com> wrote: > > > > > I know the general meaning of a deadlock, but

Re: [go-nuts] What does a deadlock mean in golang?

2019-01-30 Thread Bakul Shah
On Wed, 30 Jan 2019 12:21:46 -0800 Tom Mitchell wrote: > > On Tue, Jan 29, 2019 at 12:55 AM =E4=BC=8A=E8=97=A4=E5=92=8C=E4=B9=9F a.ito.dr...@gmail.com> wrote: > > > I know the general meaning of a deadlock, but I don't know the meaning of > > a deadlock in golang. > > > > Good question... > A

Re: [go-nuts] What does a deadlock mean in golang?

2019-01-30 Thread Tom Mitchell
On Tue, Jan 29, 2019 at 12:55 AM 伊藤和也 wrote: > I know the general meaning of a deadlock, but I don't know the meaning of > a deadlock in golang. > Good question... A classic and now hard to find reference for a deadlock is "Operating System Principles (Prentice-Hall Series in Automatic

Re: [go-nuts] Re: Existing code for order-preserving concurrent work queue?

2019-01-30 Thread 'Bryan Mills' via golang-nuts
The code to sequence the results using a channel is not much more verbose. That not only avoids the library dependency, but also makes the peak memory consumption for the results O(runtime.NumCPU()), instead of O(N) with the number of tasks, and allows the output to be streamed instead of

[go-nuts] Maximizing source locality: [ANN] ftee

2019-01-30 Thread Michael Ellis
About 3 decades ago, one of my mentors offered the thought that a really practical metric for software maintainability is the percentage of fixes and enhancements that require editing only one region of one file. As he put it: "Visit your programmers' cubicles and find out how many files have

[go-nuts] Re: [ANN] goey - Declarative, cross-platform GUIs

2019-01-30 Thread Robert Johnstone
Hello, I'm glad that you are finding it useful, and I'm certainly taking bug reports. You could always submit a pull-request, but that would require an account with bitbucket. I have changed the settings for the issue tracker to accept anonymous users. If you try again, you should be able