Re: [protobuf] is it possible to compile protobuf 3.0 on windows? (protobuf)

2016-12-09 Thread 'Jisi Liu' via Protocol Buffers
Could you elaborate on the pthread issue? It should work for msvc 2015.

On Wed, Dec 7, 2016 at 2:52 PM lucidbee  wrote:

> I may be missing something obvious.
>
> I am trying to compile protobuf 3.0.0.2 on windows 10 using msvs 2015
> update 3.
>
> Using cmake.
>
> Seems like this should work but it insists on pthreads and fails.
>
> Is this not supported?
>
> If I have to make a single threaded version of protobuf on my own then it
> seems compiling on windows is not supported.
> Is that possible?
> Or is there a workaround?
>
> Thanks for your input.
> lucidbee
>
>
> --
> You received this message because you are subscribed to the Google Groups
> "Protocol Buffers" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to protobuf+unsubscr...@googlegroups.com.
> To post to this group, send email to protobuf@googlegroups.com.
> Visit this group at https://groups.google.com/group/protobuf.
> For more options, visit https://groups.google.com/d/optout.
>

-- 
You received this message because you are subscribed to the Google Groups 
"Protocol Buffers" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to protobuf+unsubscr...@googlegroups.com.
To post to this group, send email to protobuf@googlegroups.com.
Visit this group at https://groups.google.com/group/protobuf.
For more options, visit https://groups.google.com/d/optout.


Re: [protobuf] c++ singleton support

2016-12-09 Thread 梅骁
Thank you for your reply! I'll give it a try.

在 2016年12月10日星期六 UTC+8上午8:04:09,liujisi写道:
>
> Each message type has a default instance. You can specify the default 
> values for the fields in the message and use the default instance of that 
> message as the singleton.
>
> On Sat, Dec 3, 2016 at 9:13 PM 梅骁  wrote:
>
>> Hi,
>> Does protobuf has singleton support? I want to use it for global 
>> configurations of my program.
>> For example, if I have a message type "GlobalSetting", then I want to 
>> use the class like: GlobalSetting::Instance().get_someVarible.
>>   
>>   Thank you.
>>
>> -- 
>> You received this message because you are subscribed to the Google Groups 
>> "Protocol Buffers" group.
>> To unsubscribe from this group and stop receiving emails from it, send an 
>> email to protobuf+u...@googlegroups.com .
>> To post to this group, send email to prot...@googlegroups.com 
>> .
>> Visit this group at https://groups.google.com/group/protobuf.
>> For more options, visit https://groups.google.com/d/optout.
>>
>

-- 
You received this message because you are subscribed to the Google Groups 
"Protocol Buffers" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to protobuf+unsubscr...@googlegroups.com.
To post to this group, send email to protobuf@googlegroups.com.
Visit this group at https://groups.google.com/group/protobuf.
For more options, visit https://groups.google.com/d/optout.


Re: [protobuf] Protobuf / Java / ParseFrom inconsistent behavior

2016-12-09 Thread 'Jisi Liu' via Protocol Buffers
Parsing the bytes from a valid protobuf wireformat into a unmatched type
shouldn't cause parsing failures. Those unrecognized fields should be kept
in the unknown fields and should be able to serialize back. Java
implementation enforces roundtrip to be lossless.

I'm not familiar with the Go implementation. It seems to treat unrecognized
fields differently. The spec doesn't require that all the implementations
follow a defined behavior though.

On Thu, Dec 8, 2016 at 1:14 PM Konstantin Chukhlomin 
wrote:

> Hi everyone,
>
> I've found something which I think either wrong or feature.
>
> Say, I have a proto file with definitions:
>
> message Article {
>   message PrintData {
> int32 page = 1;
> bool is_published = 2;
> string section = 3;
> string column = 4;
>   }
>
>   string title = 1;
>   PrintData print_data = 2;
>   string kicker = 3;
> }
>
> message Image {
>   string caption = 1;
>   string author = 2;
>   int32 width = 3;
> }
>
>
> And then, using Java code I'm filling all the fields in Article,
> converting it to bytes array and trying to decode it to the Image.
> Expecting some error, but:
>
> Article article = Article.newBuilder()
> .setTitle("TITLE")
> .setPrintData(
> Article.PrintData.newBuilder()
> .setPage(1)
> .setIsPublished(true)
> .setSection("NEWS")
> .setColumn("Review")
> )
> .setKicker("BOOM")
> .build();
>
> byte[] bytes = article.toByteArray();
>
> try {
> Image image = Image.parseFrom(bytes);
>
> System.out.println("Caption: " + image.getCaption()); // TITLE
> System.out.println("Author: " + image.getAuthor()); // NEWS" Review
> System.out.println("Width: " + image.getWidth()); // 0
>
> } catch (InvalidProtocolBufferException e) {
> e.printStackTrace();
> }
>
>
> At the same time, same example failing in Go (which is expected): bad
> wiretype for field assets.Image.Width: got wiretype 2, want 0.
>
> I wonder if you know answers on these questions:
> 1) Should go and Java libraries behaviors be the same?
> 2) Should Java throw exception when Protobuf fields and not compatible?
> 3) Is it ok that image.author for all strings content from
> article.print_data?
>
> Code samples (try it yourself):
> https://github.com/chuhlomin/proto-java - Message definition and Java
> check
> https://github.com/chuhlomin/proto-go - Go
>
> Additional information:
> I've used znly/protoc  docker
> image to generate Go classes from Protobuf.
> $ java -version
>
>
>
> java version "1.8.0_101"
> Java(TM) SE Runtime Environment (build 1.8.0_101-b13)
> Java HotSpot(TM) 64-Bit Server VM (build 25.101-b13, mixed mode)
>
> $ go version
> go version go1.7.1 darwin/amd64
>
> Thanks.
>
> --
> You received this message because you are subscribed to the Google Groups
> "Protocol Buffers" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to protobuf+unsubscr...@googlegroups.com.
> To post to this group, send email to protobuf@googlegroups.com.
> Visit this group at https://groups.google.com/group/protobuf.
> For more options, visit https://groups.google.com/d/optout.
>

-- 
You received this message because you are subscribed to the Google Groups 
"Protocol Buffers" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to protobuf+unsubscr...@googlegroups.com.
To post to this group, send email to protobuf@googlegroups.com.
Visit this group at https://groups.google.com/group/protobuf.
For more options, visit https://groups.google.com/d/optout.


Re: [protobuf] Any script or tool to check forward/backward compatibility breaking changes to protobuf IDL?

2016-12-09 Thread 'Jisi Liu' via Protocol Buffers
I heard this feature requests several times, but I'm not aware if anyone
has implemented it yet. Please post it back if you end up implanting the
tool.

On Tue, Dec 6, 2016 at 10:26 PM Ajay  wrote:

> Hi,
>
>  Are you guys aware of any tool or script that can be used to check if
> changes to protobuf message definitions will break forward/backward
> compatibility? We can manually check this during review. But I'm wondering
> if someone has automated this.
>
> Thanks,
> Ajay
>
> --
> You received this message because you are subscribed to the Google Groups
> "Protocol Buffers" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to protobuf+unsubscr...@googlegroups.com.
> To post to this group, send email to protobuf@googlegroups.com.
> Visit this group at https://groups.google.com/group/protobuf.
> For more options, visit https://groups.google.com/d/optout.
>

-- 
You received this message because you are subscribed to the Google Groups 
"Protocol Buffers" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to protobuf+unsubscr...@googlegroups.com.
To post to this group, send email to protobuf@googlegroups.com.
Visit this group at https://groups.google.com/group/protobuf.
For more options, visit https://groups.google.com/d/optout.


Re: [protobuf] c++ singleton support

2016-12-09 Thread 'Jisi Liu' via Protocol Buffers
Each message type has a default instance. You can specify the default
values for the fields in the message and use the default instance of that
message as the singleton.

On Sat, Dec 3, 2016 at 9:13 PM 梅骁  wrote:

> Hi,
> Does protobuf has singleton support? I want to use it for global
> configurations of my program.
> For example, if I have a message type "GlobalSetting", then I want to
> use the class like: GlobalSetting::Instance().get_someVarible.
>
>   Thank you.
>
> --
> You received this message because you are subscribed to the Google Groups
> "Protocol Buffers" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to protobuf+unsubscr...@googlegroups.com.
> To post to this group, send email to protobuf@googlegroups.com.
> Visit this group at https://groups.google.com/group/protobuf.
> For more options, visit https://groups.google.com/d/optout.
>

-- 
You received this message because you are subscribed to the Google Groups 
"Protocol Buffers" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to protobuf+unsubscr...@googlegroups.com.
To post to this group, send email to protobuf@googlegroups.com.
Visit this group at https://groups.google.com/group/protobuf.
For more options, visit https://groups.google.com/d/optout.


Re: [protobuf] Protocol Version 2.1.0 available for download...?

2016-12-09 Thread 'Jisi Liu' via Protocol Buffers
It's no longer available for download.  You probalby would have to checkout
the github ref:
https://github.com/google/protobuf/commit/1fb3d394e5bb4ded7a76dc8d44a701733aad3553
and
build from there.

On Fri, Dec 9, 2016 at 6:03 AM Srinivas DGS 
wrote:

> Hi All,
>
> Can anyone point me to download the Protocol Version 2.1.0...?
> Thanks in advance.
>
> Thanks,
> Srinivas DGS
>
> --
> You received this message because you are subscribed to the Google Groups
> "Protocol Buffers" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to protobuf+unsubscr...@googlegroups.com.
> To post to this group, send email to protobuf@googlegroups.com.
> Visit this group at https://groups.google.com/group/protobuf.
> For more options, visit https://groups.google.com/d/optout.
>

-- 
You received this message because you are subscribed to the Google Groups 
"Protocol Buffers" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to protobuf+unsubscr...@googlegroups.com.
To post to this group, send email to protobuf@googlegroups.com.
Visit this group at https://groups.google.com/group/protobuf.
For more options, visit https://groups.google.com/d/optout.


Re: [protobuf] Currency/Monetary amount in Protobuf

2016-12-09 Thread 'Jisi Liu' via Protocol Buffers
There's no native support for MonetaryAmount. However, you can define a
message to represent the type with the precision and write a custom tool to
convert the message to and from the native Java type.

On Sun, Dec 4, 2016 at 4:29 PM Luis Trigueiros 
wrote:

> Hi,
>
> I am new to protobuf and I am trying to get the understanding of how I can
> represent monetary amounts the equivalent of the java 8 MonetaryAmount ?
> Can anyone help me ?
>
> Many thanks,
>   Oscar
>
>
> --
> You received this message because you are subscribed to the Google Groups
> "Protocol Buffers" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to protobuf+unsubscr...@googlegroups.com.
> To post to this group, send email to protobuf@googlegroups.com.
> Visit this group at https://groups.google.com/group/protobuf.
> For more options, visit https://groups.google.com/d/optout.
>

-- 
You received this message because you are subscribed to the Google Groups 
"Protocol Buffers" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to protobuf+unsubscr...@googlegroups.com.
To post to this group, send email to protobuf@googlegroups.com.
Visit this group at https://groups.google.com/group/protobuf.
For more options, visit https://groups.google.com/d/optout.


[protobuf] Protocol Version 2.1.0 available for download...?

2016-12-09 Thread Srinivas DGS
Hi All,

Can anyone point me to download the Protocol Version 2.1.0...?
Thanks in advance.

Thanks,
Srinivas DGS

-- 
You received this message because you are subscribed to the Google Groups 
"Protocol Buffers" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to protobuf+unsubscr...@googlegroups.com.
To post to this group, send email to protobuf@googlegroups.com.
Visit this group at https://groups.google.com/group/protobuf.
For more options, visit https://groups.google.com/d/optout.